vxe-table 4.13.33 → 4.13.35
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.
- package/es/grid/src/grid.js +1 -1
- package/es/index.css +1 -1
- package/es/index.min.css +1 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/src/body.js +20 -3
- package/es/table/src/cell.js +55 -39
- package/es/table/src/column.js +2 -0
- package/es/table/src/columnInfo.js +2 -0
- package/es/table/src/props.js +3 -1
- package/es/table/src/table.js +130 -74
- package/es/table/src/util.js +7 -4
- package/es/table/style.css +9 -3
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +4 -4
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +9 -3
- package/es/vxe-table/style.min.css +1 -1
- package/lib/grid/src/grid.js +1 -1
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.css +1 -1
- package/lib/index.min.css +1 -1
- package/lib/index.umd.js +117 -76
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/src/body.js +19 -2
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/cell.js +47 -32
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/column.js +2 -0
- package/lib/table/src/column.min.js +1 -1
- package/lib/table/src/columnInfo.js +2 -0
- package/lib/table/src/columnInfo.min.js +1 -1
- package/lib/table/src/props.js +3 -1
- package/lib/table/src/props.min.js +1 -1
- package/lib/table/src/table.js +31 -31
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +10 -7
- package/lib/table/src/util.min.js +1 -1
- package/lib/table/style/style.css +9 -3
- package/lib/table/style/style.min.css +1 -1
- package/lib/ui/index.js +4 -4
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/lib/vxe-table/style/style.css +9 -3
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +1 -1
- package/packages/grid/src/grid.ts +1 -1
- package/packages/table/src/body.ts +20 -3
- package/packages/table/src/cell.ts +55 -39
- package/packages/table/src/column.ts +2 -0
- package/packages/table/src/columnInfo.ts +3 -0
- package/packages/table/src/props.ts +3 -1
- package/packages/table/src/table.ts +132 -73
- package/packages/table/src/util.ts +7 -3
- package/packages/ui/index.ts +1 -1
- package/styles/components/table.scss +13 -9
- package/styles/theme/base.scss +0 -2
- package/styles/theme/dark.scss +4 -1
- package/styles/theme/light.scss +3 -0
- package/styles/variable.scss +4 -1
- /package/es/{iconfont.1749019395589.ttf → iconfont.1749202972772.ttf} +0 -0
- /package/es/{iconfont.1749019395589.woff → iconfont.1749202972772.woff} +0 -0
- /package/es/{iconfont.1749019395589.woff2 → iconfont.1749202972772.woff2} +0 -0
- /package/lib/{iconfont.1749019395589.ttf → iconfont.1749202972772.ttf} +0 -0
- /package/lib/{iconfont.1749019395589.woff → iconfont.1749202972772.woff} +0 -0
- /package/lib/{iconfont.1749019395589.woff2 → iconfont.1749202972772.woff2} +0 -0
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.13.
|
|
3141
|
+
const version = "4.13.35";
|
|
3142
3142
|
core_.VxeUI.version = version;
|
|
3143
3143
|
core_.VxeUI.tableVersion = version;
|
|
3144
3144
|
core_.VxeUI.setConfig({
|
|
@@ -3264,7 +3264,7 @@ core_.VxeUI.setConfig({
|
|
|
3264
3264
|
// isEvery: false,
|
|
3265
3265
|
showIcon: true
|
|
3266
3266
|
},
|
|
3267
|
-
|
|
3267
|
+
aggregateConfig: {
|
|
3268
3268
|
padding: true,
|
|
3269
3269
|
rowField: 'id',
|
|
3270
3270
|
parentField: '_X_ROW_PARENT_KEY',
|
|
@@ -3338,13 +3338,13 @@ core_.VxeUI.setConfig({
|
|
|
3338
3338
|
isReplace: true
|
|
3339
3339
|
},
|
|
3340
3340
|
virtualXConfig: {
|
|
3341
|
-
enabled:
|
|
3341
|
+
// enabled: false,
|
|
3342
3342
|
gt: 24,
|
|
3343
3343
|
preSize: 1,
|
|
3344
3344
|
oSize: 0
|
|
3345
3345
|
},
|
|
3346
3346
|
virtualYConfig: {
|
|
3347
|
-
enabled:
|
|
3347
|
+
// enabled: false,
|
|
3348
3348
|
gt: 100,
|
|
3349
3349
|
preSize: 1,
|
|
3350
3350
|
oSize: 0
|
|
@@ -3599,7 +3599,7 @@ var esnext_iterator_some = __webpack_require__(7550);
|
|
|
3599
3599
|
const {
|
|
3600
3600
|
log: log_log
|
|
3601
3601
|
} = core_.VxeUI;
|
|
3602
|
-
const log_version = `table v${"4.13.
|
|
3602
|
+
const log_version = `table v${"4.13.35"}`;
|
|
3603
3603
|
const warnLog = log_log.create('warn', log_version);
|
|
3604
3604
|
const errLog = log_log.create('error', log_version);
|
|
3605
3605
|
;// ./packages/table/src/columnInfo.ts
|
|
@@ -3706,6 +3706,7 @@ class ColumnInfo {
|
|
|
3706
3706
|
titleHelp: _vm.titleHelp,
|
|
3707
3707
|
titlePrefix: _vm.titlePrefix,
|
|
3708
3708
|
titleSuffix: _vm.titleSuffix,
|
|
3709
|
+
aggFunc: _vm.aggFunc,
|
|
3709
3710
|
// 自定义参数
|
|
3710
3711
|
params: _vm.params,
|
|
3711
3712
|
// 渲染属性
|
|
@@ -3731,6 +3732,7 @@ class ColumnInfo {
|
|
|
3731
3732
|
// 列排序
|
|
3732
3733
|
sortNumber: 0,
|
|
3733
3734
|
renderSortNumber: 0,
|
|
3735
|
+
renderAggFn: '',
|
|
3734
3736
|
renderFixed: '',
|
|
3735
3737
|
renderVisible: false,
|
|
3736
3738
|
renderWidth: 0,
|
|
@@ -4131,19 +4133,22 @@ function updateFastRowKey(row, rowKey) {
|
|
|
4131
4133
|
}
|
|
4132
4134
|
return rowid;
|
|
4133
4135
|
}
|
|
4134
|
-
|
|
4136
|
+
function handleFieldOrColumn($xeTable, fieldOrColumn) {
|
|
4135
4137
|
if (fieldOrColumn) {
|
|
4136
4138
|
return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(fieldOrColumn) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(fieldOrColumn) ? $xeTable.getColumnByField(`${fieldOrColumn}`) : fieldOrColumn;
|
|
4137
4139
|
}
|
|
4138
4140
|
return null;
|
|
4139
|
-
}
|
|
4140
|
-
|
|
4141
|
+
}
|
|
4142
|
+
function handleRowidOrRow($xeTable, rowidOrRow) {
|
|
4141
4143
|
if (rowidOrRow) {
|
|
4142
4144
|
const rowid = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(rowidOrRow) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(rowidOrRow) ? rowidOrRow : getRowid($xeTable, rowidOrRow);
|
|
4143
4145
|
return $xeTable.getRowById(rowid);
|
|
4144
4146
|
}
|
|
4145
4147
|
return null;
|
|
4146
|
-
}
|
|
4148
|
+
}
|
|
4149
|
+
function getCellRestHeight(rowRest, cellOpts, rowOpts, defaultRowHeight) {
|
|
4150
|
+
return rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight;
|
|
4151
|
+
}
|
|
4147
4152
|
function getPaddingLeftRightSize(elem) {
|
|
4148
4153
|
if (elem) {
|
|
4149
4154
|
const computedStyle = getComputedStyle(elem);
|
|
@@ -5013,15 +5018,15 @@ function renderCellHandle(params) {
|
|
|
5013
5018
|
const {
|
|
5014
5019
|
computeEditOpts,
|
|
5015
5020
|
computeCheckboxOpts,
|
|
5016
|
-
|
|
5021
|
+
computeAggregateOpts
|
|
5017
5022
|
} = $table.getComputeMaps();
|
|
5018
|
-
const
|
|
5023
|
+
const aggregateOpts = computeAggregateOpts.value;
|
|
5019
5024
|
const {
|
|
5020
5025
|
mode
|
|
5021
|
-
} =
|
|
5026
|
+
} = aggregateOpts;
|
|
5022
5027
|
const checkboxOpts = computeCheckboxOpts.value;
|
|
5023
5028
|
const editOpts = computeEditOpts.value;
|
|
5024
|
-
const isDeepCell = treeNode || isRowGroupStatus &&
|
|
5029
|
+
const isDeepCell = treeNode || isRowGroupStatus && (mode === 'column' ? column.field === row.groupField : rowGroupNode);
|
|
5025
5030
|
switch (type) {
|
|
5026
5031
|
case 'seq':
|
|
5027
5032
|
return isDeepCell ? Cell.renderDeepIndexCell(params) : Cell.renderSeqCell(params);
|
|
@@ -5148,7 +5153,8 @@ const Cell = {
|
|
|
5148
5153
|
slots,
|
|
5149
5154
|
editRender,
|
|
5150
5155
|
cellRender,
|
|
5151
|
-
rowGroupNode
|
|
5156
|
+
rowGroupNode,
|
|
5157
|
+
aggFunc
|
|
5152
5158
|
} = column;
|
|
5153
5159
|
const renderOpts = editRender || cellRender;
|
|
5154
5160
|
const defaultSlot = slots ? slots.default : null;
|
|
@@ -5169,51 +5175,61 @@ const Cell = {
|
|
|
5169
5175
|
}
|
|
5170
5176
|
}
|
|
5171
5177
|
let cellValue = '';
|
|
5172
|
-
if (isRowGroupStatus && row.isAggregate) {
|
|
5178
|
+
if (isRowGroupStatus && field && row.isAggregate) {
|
|
5179
|
+
const aggRow = row;
|
|
5173
5180
|
const {
|
|
5174
5181
|
fullColumnFieldData
|
|
5175
5182
|
} = tableInternalData;
|
|
5176
5183
|
const {
|
|
5177
|
-
|
|
5184
|
+
computeAggregateOpts
|
|
5178
5185
|
} = $table.getComputeMaps();
|
|
5179
|
-
const
|
|
5186
|
+
const aggregateOpts = computeAggregateOpts.value;
|
|
5180
5187
|
const {
|
|
5181
5188
|
mode,
|
|
5182
5189
|
showTotal,
|
|
5183
5190
|
totalMethod,
|
|
5184
5191
|
countFields,
|
|
5185
|
-
countMethod,
|
|
5186
5192
|
contentMethod,
|
|
5187
5193
|
mapChildrenField
|
|
5188
|
-
} =
|
|
5189
|
-
const
|
|
5190
|
-
const
|
|
5191
|
-
const
|
|
5192
|
-
const
|
|
5194
|
+
} = aggregateOpts;
|
|
5195
|
+
const aggMethod = aggregateOpts.aggregateMethod || aggregateOpts.countMethod;
|
|
5196
|
+
const groupField = aggRow.groupField;
|
|
5197
|
+
const groupContent = aggRow.groupContent;
|
|
5198
|
+
const childList = mapChildrenField ? aggRow[mapChildrenField] || [] : [];
|
|
5199
|
+
const childCount = aggRow.childCount;
|
|
5193
5200
|
const colRest = fullColumnFieldData[groupField] || {};
|
|
5194
|
-
const
|
|
5201
|
+
const ctParams = {
|
|
5195
5202
|
$table,
|
|
5196
5203
|
groupField,
|
|
5197
5204
|
groupColumn: colRest ? colRest.column : null,
|
|
5198
5205
|
column,
|
|
5199
5206
|
groupValue: groupContent,
|
|
5200
5207
|
children: childList,
|
|
5201
|
-
|
|
5208
|
+
childCount,
|
|
5209
|
+
aggValue: null,
|
|
5210
|
+
/**
|
|
5211
|
+
* 已废弃
|
|
5212
|
+
* @deprecated
|
|
5213
|
+
*/
|
|
5214
|
+
totalValue: childCount
|
|
5202
5215
|
};
|
|
5203
|
-
if (mode === 'column' ?
|
|
5216
|
+
if (mode === 'column' ? field === aggRow.groupField : rowGroupNode) {
|
|
5204
5217
|
cellValue = groupContent;
|
|
5205
5218
|
if (contentMethod) {
|
|
5206
|
-
cellValue = `${contentMethod(
|
|
5219
|
+
cellValue = `${contentMethod(ctParams)}`;
|
|
5207
5220
|
}
|
|
5208
5221
|
if (showTotal) {
|
|
5209
|
-
cellValue = cell_getI18n('vxe.table.rowGroupContentTotal', [cellValue, totalMethod ? totalMethod(
|
|
5222
|
+
cellValue = cell_getI18n('vxe.table.rowGroupContentTotal', [cellValue, totalMethod ? totalMethod(ctParams) : childCount, childCount]);
|
|
5210
5223
|
}
|
|
5211
|
-
} else if (
|
|
5212
|
-
|
|
5213
|
-
|
|
5224
|
+
} else if ($table.getPivotTableAggregateCellAggValue) {
|
|
5225
|
+
cellValue = $table.getPivotTableAggregateCellAggValue(params);
|
|
5226
|
+
} else if (aggFunc === true || countFields && countFields.includes(field)) {
|
|
5227
|
+
if (aggMethod) {
|
|
5228
|
+
ctParams.aggValue = childCount;
|
|
5229
|
+
cellValue = `${aggMethod(ctParams)}`;
|
|
5214
5230
|
}
|
|
5215
5231
|
}
|
|
5216
|
-
} else
|
|
5232
|
+
} else {
|
|
5217
5233
|
cellValue = $table.getCellLabel(row, column);
|
|
5218
5234
|
}
|
|
5219
5235
|
const cellPlaceholder = editRender ? editRender.placeholder : '';
|
|
@@ -5245,7 +5261,7 @@ const Cell = {
|
|
|
5245
5261
|
level
|
|
5246
5262
|
} = params;
|
|
5247
5263
|
const {
|
|
5248
|
-
|
|
5264
|
+
computeAggregateOpts
|
|
5249
5265
|
} = $table.getComputeMaps();
|
|
5250
5266
|
const {
|
|
5251
5267
|
rowGroupExpandedFlag
|
|
@@ -5253,11 +5269,11 @@ const Cell = {
|
|
|
5253
5269
|
const {
|
|
5254
5270
|
rowGroupExpandedMaps
|
|
5255
5271
|
} = tableInternalData;
|
|
5256
|
-
const
|
|
5272
|
+
const aggregateOpts = computeAggregateOpts.value;
|
|
5257
5273
|
const {
|
|
5258
5274
|
padding,
|
|
5259
5275
|
indent
|
|
5260
|
-
} =
|
|
5276
|
+
} = aggregateOpts;
|
|
5261
5277
|
const rowid = getRowid($table, row);
|
|
5262
5278
|
const isExpand = !!rowGroupExpandedFlag && !!rowGroupExpandedMaps[rowid];
|
|
5263
5279
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
@@ -5267,14 +5283,14 @@ const Cell = {
|
|
|
5267
5283
|
style: padding && indent ? {
|
|
5268
5284
|
paddingLeft: `${level * indent}px`
|
|
5269
5285
|
} : undefined
|
|
5270
|
-
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
|
|
5286
|
+
}, [row.isAggregate ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
|
|
5271
5287
|
class: 'vxe-row-group--node-btn',
|
|
5272
5288
|
onClick(evnt) {
|
|
5273
5289
|
$table.triggerRowGroupExpandEvent(evnt, params);
|
|
5274
5290
|
}
|
|
5275
5291
|
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('i', {
|
|
5276
5292
|
class: isExpand ? cell_getIcon().TABLE_ROW_GROUP_OPEN : cell_getIcon().TABLE_ROW_GROUP_CLOSE
|
|
5277
|
-
})]), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
5293
|
+
})]) : renderEmptyElement($table), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
5278
5294
|
class: 'vxe-row-group-cell'
|
|
5279
5295
|
}, cellVNodes)]);
|
|
5280
5296
|
},
|
|
@@ -5375,14 +5391,18 @@ const Cell = {
|
|
|
5375
5391
|
const {
|
|
5376
5392
|
rowGroupNode
|
|
5377
5393
|
} = column;
|
|
5378
|
-
|
|
5394
|
+
const tableReactData = $table.reactData;
|
|
5395
|
+
const {
|
|
5396
|
+
rowGroupList
|
|
5397
|
+
} = tableReactData;
|
|
5398
|
+
if (rowGroupList.length) {
|
|
5379
5399
|
const {
|
|
5380
|
-
|
|
5400
|
+
computeAggregateOpts
|
|
5381
5401
|
} = $table.getComputeMaps();
|
|
5382
|
-
const
|
|
5402
|
+
const aggregateOpts = computeAggregateOpts.value;
|
|
5383
5403
|
const {
|
|
5384
5404
|
mode
|
|
5385
|
-
} =
|
|
5405
|
+
} = aggregateOpts;
|
|
5386
5406
|
if (mode === 'column' ? column.field === row.groupField : rowGroupNode) {
|
|
5387
5407
|
return [Cell.renderRowGroupBtn(params, cellVNodes)];
|
|
5388
5408
|
}
|
|
@@ -6251,6 +6271,8 @@ const columnProps = {
|
|
|
6251
6271
|
editRender: Object,
|
|
6252
6272
|
// 内容渲染配置项
|
|
6253
6273
|
contentRender: Object,
|
|
6274
|
+
// 聚合函数
|
|
6275
|
+
aggFunc: [String, Boolean],
|
|
6254
6276
|
// 额外的参数
|
|
6255
6277
|
params: Object
|
|
6256
6278
|
};
|
|
@@ -6711,6 +6733,7 @@ const renderType = 'body';
|
|
|
6711
6733
|
$xeTable.triggerCellDblclickEvent(evnt, cellParams);
|
|
6712
6734
|
};
|
|
6713
6735
|
let isMergeCell = false;
|
|
6736
|
+
let mergeRowspan = 1;
|
|
6714
6737
|
// 合并行或列
|
|
6715
6738
|
if (mergeBodyFlag && mergeBodyList.length) {
|
|
6716
6739
|
const spanRest = mergeBodyCellMaps[`${_rowIndex}:${_columnIndex}`];
|
|
@@ -6724,6 +6747,7 @@ const renderType = 'body';
|
|
|
6724
6747
|
}
|
|
6725
6748
|
if (rowspan > 1) {
|
|
6726
6749
|
isMergeCell = true;
|
|
6750
|
+
mergeRowspan = rowspan;
|
|
6727
6751
|
tdAttrs.rowspan = rowspan;
|
|
6728
6752
|
}
|
|
6729
6753
|
if (colspan > 1) {
|
|
@@ -6741,9 +6765,12 @@ const renderType = 'body';
|
|
|
6741
6765
|
return null;
|
|
6742
6766
|
}
|
|
6743
6767
|
if (rowspan > 1) {
|
|
6768
|
+
isMergeCell = true;
|
|
6769
|
+
mergeRowspan = rowspan;
|
|
6744
6770
|
tdAttrs.rowspan = rowspan;
|
|
6745
6771
|
}
|
|
6746
6772
|
if (colspan > 1) {
|
|
6773
|
+
isMergeCell = true;
|
|
6747
6774
|
tdAttrs.colspan = colspan;
|
|
6748
6775
|
}
|
|
6749
6776
|
}
|
|
@@ -6758,7 +6785,7 @@ const renderType = 'body';
|
|
|
6758
6785
|
isDirty = $xeTable.isUpdateByRow(row, column.field);
|
|
6759
6786
|
}
|
|
6760
6787
|
const isVNAutoHeight = scrollYLoad && !hasEllipsis;
|
|
6761
|
-
|
|
6788
|
+
let cellHeight = getCellRestHeight(rowRest, cellOpts, rowOpts, defaultRowHeight);
|
|
6762
6789
|
const isLastColumn = $columnIndex === columns.length - 1;
|
|
6763
6790
|
const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto');
|
|
6764
6791
|
let isVNPreEmptyStatus = false;
|
|
@@ -6771,6 +6798,15 @@ const renderType = 'body';
|
|
|
6771
6798
|
}
|
|
6772
6799
|
}
|
|
6773
6800
|
}
|
|
6801
|
+
if (mergeRowspan > 1) {
|
|
6802
|
+
const mEndRow = afterFullData[_rowIndex + mergeRowspan - 1];
|
|
6803
|
+
if (mEndRow) {
|
|
6804
|
+
const meRowRest = fullAllDataRowIdData[getRowid($xeTable, mEndRow)];
|
|
6805
|
+
if (meRowRest) {
|
|
6806
|
+
cellHeight += meRowRest.oTop - rowRest.oTop + getCellRestHeight(meRowRest, cellOpts, rowOpts, defaultRowHeight);
|
|
6807
|
+
}
|
|
6808
|
+
}
|
|
6809
|
+
}
|
|
6774
6810
|
const tcStyle = {};
|
|
6775
6811
|
if (hasEllipsis && resizeWidthFlag) {
|
|
6776
6812
|
let tsColspan = tdAttrs.colspan || 0;
|
|
@@ -6802,7 +6838,10 @@ const renderType = 'body';
|
|
|
6802
6838
|
}));
|
|
6803
6839
|
} else {
|
|
6804
6840
|
// 渲染单元格
|
|
6805
|
-
|
|
6841
|
+
if (treeConfig) {
|
|
6842
|
+
tdVNs.push(...renderLine(rowid, cellParams, cellHeight));
|
|
6843
|
+
}
|
|
6844
|
+
tdVNs.push((0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
6806
6845
|
key: 'tc',
|
|
6807
6846
|
class: ['vxe-cell', {
|
|
6808
6847
|
'c--title': showTitle,
|
|
@@ -8459,7 +8498,9 @@ const {
|
|
|
8459
8498
|
footerCellConfig: Object,
|
|
8460
8499
|
// 行配置项
|
|
8461
8500
|
rowConfig: Object,
|
|
8462
|
-
//
|
|
8501
|
+
// 数据聚合配置项
|
|
8502
|
+
aggregateConfig: Object,
|
|
8503
|
+
// 已废弃,被 aggregateConfig 替换
|
|
8463
8504
|
rowGroupConfig: Object,
|
|
8464
8505
|
// 当前行配置项
|
|
8465
8506
|
currentRowConfig: Object,
|
|
@@ -10732,10 +10773,10 @@ removeRowMaps:{},cvCacheMaps:{},inited:false,tooltipTimeout:null,initStatus:fals
|
|
|
10732
10773
|
* @deprecated
|
|
10733
10774
|
*/const computeSXOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const virtualXOpts=computeVirtualXOpts.value;return virtualXOpts;});const computeScrollXThreshold=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const virtualXOpts=computeVirtualXOpts.value;const{threshold}=virtualXOpts;if(threshold){return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(threshold);}return 0;});/**
|
|
10734
10775
|
* @deprecated
|
|
10735
|
-
*/const computeSYOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const virtualYOpts=computeVirtualYOpts.value;return virtualYOpts;});const computeVirtualXOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.scrollX,table_getConfig().table.virtualXConfig,props.scrollX,props.virtualXConfig);});const computeVirtualYOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.scrollY,table_getConfig().table.virtualYConfig,props.scrollY,props.virtualYConfig);});const computeScrollbarOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.scrollbarConfig,props.scrollbarConfig);});const computeScrollbarXToTop=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const scrollbarOpts=computeScrollbarOpts.value;return!!(scrollbarOpts.x&&scrollbarOpts.x.position==='top');});const computeScrollbarYToLeft=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const scrollbarOpts=computeScrollbarOpts.value;return!!(scrollbarOpts.y&&scrollbarOpts.y.position==='left');});const computeScrollYThreshold=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const virtualYOpts=computeVirtualYOpts.value;const{threshold}=virtualYOpts;if(threshold){return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(threshold);}return 0;});const computeRowHeightMaps=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return reactData.rowHeightStore;});const computeDefaultRowHeight=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const vSize=computeSize.value;const rowHeightMaps=computeRowHeightMaps.value;return rowHeightMaps[vSize||'default']||18;});const computeColumnOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.columnConfig,props.columnConfig);});const computeCurrentColumnOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.currentColumnConfig,props.currentColumnConfig);});const computeCellOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const cellOpts=Object.assign({},table_getConfig().table.cellConfig,props.cellConfig);if(cellOpts.height){cellOpts.height=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellOpts.height);}return cellOpts;});const computeHeaderCellOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const headerCellOpts=Object.assign({},table_getConfig().table.headerCellConfig,props.headerCellConfig);const cellOpts=computeCellOpts.value;headerCellOpts.height=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(getCellHeight(headerCellOpts.height||cellOpts.height));return headerCellOpts;});const computeFooterCellOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const footerCellOpts=Object.assign({},table_getConfig().table.footerCellConfig,props.footerCellConfig);const cellOpts=computeCellOpts.value;footerCellOpts.height=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(getCellHeight(footerCellOpts.height||cellOpts.height));return footerCellOpts;});const computeRowOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.rowConfig,props.rowConfig);});const computeRowGroupOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.rowGroupConfig,props.rowGroupConfig);});const computeCurrentRowOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.currentRowConfig,props.currentRowConfig);});const computeRowDragOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.rowDragConfig,props.rowDragConfig);});const computeColumnDragOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.columnDragConfig,props.columnDragConfig);});const computeResizeOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.resizeConfig,props.resizeConfig);});const computeResizableOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.resizableConfig,props.resizableConfig);});const computeSeqOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({startIndex:0},table_getConfig().table.seqConfig,props.seqConfig);});const computeRadioOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.radioConfig,props.radioConfig);});const computeCheckboxOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.checkboxConfig,props.checkboxConfig);});const computeTooltipOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().tooltip,table_getConfig().table.tooltipConfig,props.tooltipConfig);});const computeTableTipConfig=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const{tooltipStore}=reactData;const tooltipOpts=computeTooltipOpts.value;return Object.assign({},tooltipOpts,tooltipStore.currOpts);});const computeValidTipConfig=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const tooltipOpts=computeTooltipOpts.value;return Object.assign({},tooltipOpts);});const computeEditOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.editConfig,props.editConfig);});const computeSortOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({orders:['asc','desc',null]},table_getConfig().table.sortConfig,props.sortConfig);});const computeFilterOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.filterConfig,props.filterConfig);});const computeMouseOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.mouseConfig,props.mouseConfig);});const computeAreaOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.areaConfig,props.areaConfig);});const computeKeyboardOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.keyboardConfig,props.keyboardConfig);});const computeClipOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.clipConfig,props.clipConfig);});const computeFNROpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.fnrConfig,props.fnrConfig);});const computeMenuOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.menuConfig,props.menuConfig);});const computeLeftFixedWidth=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const{columnStore}=reactData;const{leftList}=columnStore;let leftWidth=0;for(let i=0;i<leftList.length;i++){const column=leftList[i];leftWidth+=column.renderWidth;}return leftWidth;});const computeRightFixedWidth=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const{columnStore}=reactData;const{rightList}=columnStore;let leftWidth=0;for(let i=0;i<rightList.length;i++){const column=rightList[i];leftWidth+=column.renderWidth;}return leftWidth;});const computeHeaderMenu=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const menuOpts=computeMenuOpts.value;const headerOpts=menuOpts.header;return headerOpts&&headerOpts.options?headerOpts.options:[];});const computeBodyMenu=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const menuOpts=computeMenuOpts.value;const bodyOpts=menuOpts.body;return bodyOpts&&bodyOpts.options?bodyOpts.options:[];});const computeFooterMenu=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const menuOpts=computeMenuOpts.value;const footerOpts=menuOpts.footer;return footerOpts&&footerOpts.options?footerOpts.options:[];});const computeIsMenu=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const menuOpts=computeMenuOpts.value;const headerMenu=computeHeaderMenu.value;const bodyMenu=computeBodyMenu.value;const footerMenu=computeFooterMenu.value;return!!(props.menuConfig&&isEnableConf(menuOpts)&&(headerMenu.length||bodyMenu.length||footerMenu.length));});const computeMenuList=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const{ctxMenuStore}=reactData;const rest=[];ctxMenuStore.list.forEach(list=>{list.forEach(item=>{rest.push(item);});});return rest;});const computeExportOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.exportConfig,props.exportConfig);});const computeImportOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.importConfig,props.importConfig);});const computePrintOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.printConfig,props.printConfig);});const computeExpandOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.expandConfig,props.expandConfig);});const computeTreeOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.treeConfig,props.treeConfig);});const computeEmptyOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.emptyRender,props.emptyRender);});const computeLoadingOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.loadingConfig,props.loadingConfig);});const computeCellOffsetWidth=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return props.border?Math.max(2,Math.ceil(reactData.scrollbarWidth/reactData.tableColumn.length)):1;});const computeCustomOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.customConfig,props.customConfig);});const computeTableRowExpandedList=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const{treeConfig}=props;const{rowExpandedFlag,expandColumn,rowGroupExpandedFlag,treeExpandedFlag,isRowGroupStatus}=reactData;const{visibleDataRowIdData,rowExpandedMaps}=internalData;const treeOpts=computeTreeOpts.value;const{transform}=treeOpts;const expandList=[];if(expandColumn&&rowExpandedFlag&&rowGroupExpandedFlag&&treeExpandedFlag){if(isRowGroupStatus||treeConfig&&transform){external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(rowExpandedMaps,(row,rowid)=>{if(visibleDataRowIdData[rowid]){expandList.push(row);}});}else{return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().values(rowExpandedMaps);}}return expandList;});const computeAutoWidthColumnList=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const{visibleColumn}=internalData;const{tableColumn}=reactData;return tableColumn.length||visibleColumn.length?visibleColumn.filter(column=>column.width==='auto'||column.minWidth==='auto'):[];});const computeFixedColumnSize=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const{tableColumn}=reactData;const{collectColumn}=internalData;let fixedSize=0;// 只判断第一层
|
|
10776
|
+
*/const computeSYOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const virtualYOpts=computeVirtualYOpts.value;return virtualYOpts;});const computeVirtualXOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.virtualXConfig||table_getConfig().table.scrollX,props.virtualXConfig||props.scrollX);});const computeVirtualYOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.virtualYConfig||table_getConfig().table.scrollY,props.virtualYConfig||props.scrollY);});const computeScrollbarOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.scrollbarConfig,props.scrollbarConfig);});const computeScrollbarXToTop=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const scrollbarOpts=computeScrollbarOpts.value;return!!(scrollbarOpts.x&&scrollbarOpts.x.position==='top');});const computeScrollbarYToLeft=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const scrollbarOpts=computeScrollbarOpts.value;return!!(scrollbarOpts.y&&scrollbarOpts.y.position==='left');});const computeScrollYThreshold=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const virtualYOpts=computeVirtualYOpts.value;const{threshold}=virtualYOpts;if(threshold){return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(threshold);}return 0;});const computeRowHeightMaps=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return reactData.rowHeightStore;});const computeDefaultRowHeight=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const vSize=computeSize.value;const rowHeightMaps=computeRowHeightMaps.value;return rowHeightMaps[vSize||'default']||18;});const computeColumnOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.columnConfig,props.columnConfig);});const computeCurrentColumnOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.currentColumnConfig,props.currentColumnConfig);});const computeCellOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const cellOpts=Object.assign({},table_getConfig().table.cellConfig,props.cellConfig);if(cellOpts.height){cellOpts.height=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellOpts.height);}return cellOpts;});const computeHeaderCellOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const headerCellOpts=Object.assign({},table_getConfig().table.headerCellConfig,props.headerCellConfig);const cellOpts=computeCellOpts.value;headerCellOpts.height=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(getCellHeight(headerCellOpts.height||cellOpts.height));return headerCellOpts;});const computeFooterCellOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const footerCellOpts=Object.assign({},table_getConfig().table.footerCellConfig,props.footerCellConfig);const cellOpts=computeCellOpts.value;footerCellOpts.height=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(getCellHeight(footerCellOpts.height||cellOpts.height));return footerCellOpts;});const computeRowOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.rowConfig,props.rowConfig);});const computeAggregateOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.aggregateConfig||table_getConfig().table.rowGroupConfig,props.aggregateConfig||props.rowGroupConfig);});const computeRowGroupOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return computeAggregateOpts.value;});const computeCurrentRowOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.currentRowConfig,props.currentRowConfig);});const computeRowDragOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.rowDragConfig,props.rowDragConfig);});const computeColumnDragOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.columnDragConfig,props.columnDragConfig);});const computeResizeOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.resizeConfig,props.resizeConfig);});const computeResizableOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.resizableConfig,props.resizableConfig);});const computeSeqOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({startIndex:0},table_getConfig().table.seqConfig,props.seqConfig);});const computeRadioOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.radioConfig,props.radioConfig);});const computeCheckboxOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.checkboxConfig,props.checkboxConfig);});const computeTooltipOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().tooltip,table_getConfig().table.tooltipConfig,props.tooltipConfig);});const computeTableTipConfig=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const{tooltipStore}=reactData;const tooltipOpts=computeTooltipOpts.value;return Object.assign({},tooltipOpts,tooltipStore.currOpts);});const computeValidTipConfig=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const tooltipOpts=computeTooltipOpts.value;return Object.assign({},tooltipOpts);});const computeEditOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.editConfig,props.editConfig);});const computeSortOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({orders:['asc','desc',null]},table_getConfig().table.sortConfig,props.sortConfig);});const computeFilterOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.filterConfig,props.filterConfig);});const computeMouseOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.mouseConfig,props.mouseConfig);});const computeAreaOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.areaConfig,props.areaConfig);});const computeKeyboardOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.keyboardConfig,props.keyboardConfig);});const computeClipOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.clipConfig,props.clipConfig);});const computeFNROpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.fnrConfig,props.fnrConfig);});const computeMenuOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.menuConfig,props.menuConfig);});const computeLeftFixedWidth=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const{columnStore}=reactData;const{leftList}=columnStore;let leftWidth=0;for(let i=0;i<leftList.length;i++){const column=leftList[i];leftWidth+=column.renderWidth;}return leftWidth;});const computeRightFixedWidth=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const{columnStore}=reactData;const{rightList}=columnStore;let leftWidth=0;for(let i=0;i<rightList.length;i++){const column=rightList[i];leftWidth+=column.renderWidth;}return leftWidth;});const computeHeaderMenu=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const menuOpts=computeMenuOpts.value;const headerOpts=menuOpts.header;return headerOpts&&headerOpts.options?headerOpts.options:[];});const computeBodyMenu=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const menuOpts=computeMenuOpts.value;const bodyOpts=menuOpts.body;return bodyOpts&&bodyOpts.options?bodyOpts.options:[];});const computeFooterMenu=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const menuOpts=computeMenuOpts.value;const footerOpts=menuOpts.footer;return footerOpts&&footerOpts.options?footerOpts.options:[];});const computeIsMenu=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const menuOpts=computeMenuOpts.value;const headerMenu=computeHeaderMenu.value;const bodyMenu=computeBodyMenu.value;const footerMenu=computeFooterMenu.value;return!!(props.menuConfig&&isEnableConf(menuOpts)&&(headerMenu.length||bodyMenu.length||footerMenu.length));});const computeMenuList=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const{ctxMenuStore}=reactData;const rest=[];ctxMenuStore.list.forEach(list=>{list.forEach(item=>{rest.push(item);});});return rest;});const computeExportOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.exportConfig,props.exportConfig);});const computeImportOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.importConfig,props.importConfig);});const computePrintOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.printConfig,props.printConfig);});const computeExpandOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.expandConfig,props.expandConfig);});const computeTreeOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.treeConfig,props.treeConfig);});const computeEmptyOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.emptyRender,props.emptyRender);});const computeLoadingOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.loadingConfig,props.loadingConfig);});const computeCellOffsetWidth=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return props.border?Math.max(2,Math.ceil(reactData.scrollbarWidth/reactData.tableColumn.length)):1;});const computeCustomOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.customConfig,props.customConfig);});const computeTableRowExpandedList=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const{treeConfig}=props;const{rowExpandedFlag,expandColumn,rowGroupExpandedFlag,treeExpandedFlag,isRowGroupStatus}=reactData;const{visibleDataRowIdData,rowExpandedMaps}=internalData;const treeOpts=computeTreeOpts.value;const{transform}=treeOpts;const expandList=[];if(expandColumn&&rowExpandedFlag&&rowGroupExpandedFlag&&treeExpandedFlag){if(isRowGroupStatus||treeConfig&&transform){external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(rowExpandedMaps,(row,rowid)=>{if(visibleDataRowIdData[rowid]){expandList.push(row);}});}else{return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().values(rowExpandedMaps);}}return expandList;});const computeAutoWidthColumnList=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const{visibleColumn}=internalData;const{tableColumn}=reactData;return tableColumn.length||visibleColumn.length?visibleColumn.filter(column=>column.width==='auto'||column.minWidth==='auto'):[];});const computeFixedColumnSize=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const{tableColumn}=reactData;const{collectColumn}=internalData;let fixedSize=0;// 只判断第一层
|
|
10736
10777
|
if(tableColumn.length&&collectColumn.length){collectColumn.forEach(column=>{if(column.renderFixed){fixedSize++;}});}return fixedSize;});const computeIsMaxFixedColumn=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const fixedColumnSize=computeFixedColumnSize.value;const columnOpts=computeColumnOpts.value;const{maxFixedSize}=columnOpts;if(maxFixedSize){return fixedColumnSize>=maxFixedSize;}return false;});const computeTableBorder=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const{border}=props;if(border===true){return'full';}if(border){return border;}return'default';});const computeIsAllCheckboxDisabled=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const{treeConfig}=props;const{tableData}=reactData;const{tableFullData}=internalData;const checkboxOpts=computeCheckboxOpts.value;const{strict,checkMethod}=checkboxOpts;if(strict){if(tableData.length||tableFullData.length){if(checkMethod){if(treeConfig){// 暂时不支持树形结构
|
|
10737
10778
|
}// 如果所有行都被禁用
|
|
10738
|
-
return tableFullData.every(row=>!checkMethod({$table:$xeTable,row}));}return false;}return true;}return false;});const computeVirtualScrollBars=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const{overflowX,scrollXLoad,overflowY,scrollYLoad}=reactData;return{x:overflowX&&scrollXLoad,y:overflowY&&scrollYLoad};});const computeRowGroupFields=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const rowGroupOpts=computeRowGroupOpts.value;return rowGroupOpts.groupFields;});const refMaps={refElem,refTooltip,refValidTooltip,refTableFilter,refTableCustom,refTableMenu,refTableHeader,refTableBody,refTableFooter,refTableLeftHeader,refTableLeftBody,refTableLeftFooter,refTableRightHeader,refTableRightBody,refTableRightFooter,refLeftContainer,refRightContainer,refColResizeBar,refRowResizeBar,refScrollXVirtualElem,refScrollYVirtualElem,refScrollXHandleElem,refScrollYHandleElem,refScrollXSpaceElem,refScrollYSpaceElem};const computeMaps={computeSize,computeTableId,computeValidOpts,computeRowField,computeVirtualXOpts,computeVirtualYOpts,computeScrollbarOpts,computeScrollbarXToTop,computeScrollbarYToLeft,computeColumnOpts,computeCurrentColumnOpts,computeScrollXThreshold,computeScrollYThreshold,computeRowHeightMaps,computeDefaultRowHeight,computeCellOpts,computeHeaderCellOpts,computeFooterCellOpts,computeRowOpts,computeRowGroupOpts,computeCurrentRowOpts,computeRowDragOpts,computeColumnDragOpts,computeResizeOpts,computeResizableOpts,computeSeqOpts,computeRadioOpts,computeCheckboxOpts,computeTooltipOpts,computeEditOpts,computeSortOpts,computeFilterOpts,computeMouseOpts,computeAreaOpts,computeKeyboardOpts,computeClipOpts,computeFNROpts,computeHeaderMenu,computeBodyMenu,computeFooterMenu,computeIsMenu,computeMenuList,computeMenuOpts,computeExportOpts,computeImportOpts,computePrintOpts,computeExpandOpts,computeTreeOpts,computeEmptyOpts,computeLoadingOpts,computeCellOffsetWidth,computeCustomOpts,computeLeftFixedWidth,computeRightFixedWidth,computeFixedColumnSize,computeIsMaxFixedColumn,computeIsAllCheckboxDisabled,computeVirtualScrollBars,computeSXOpts,computeSYOpts};const $xeTable={xID,props:props,context,reactData,internalData,getRefMaps:()=>refMaps,getComputeMaps:()=>computeMaps,xeGrid:$xeGrid,xegrid:$xeGrid};const eqCellValue=(row1,row2,field)=>{const val1=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row1,field);const val2=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row2,field);if(eqEmptyValue(val1)&&eqEmptyValue(val2)){return true;}if(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(val1)||external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(val1)){return''+val1===''+val2;}return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isEqual(val1,val2);};const handleKeyField=()=>{const keyField=computeRowField.value;internalData.currKeyField=keyField;internalData.isCurrDeepKey=hasDeepKey(keyField);};const getNextSortOrder=column=>{const sortOpts=computeSortOpts.value;const{orders=[]}=sortOpts;const currOrder=column.order||null;const oIndex=orders.indexOf(currOrder)+1;return orders[oIndex<orders.length?oIndex:0];};const getCustomStorageMap=id=>{const version=table_getConfig().version;const rest=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toStringJSON(localStorage.getItem(customStorageKey)||'');const maps=rest&&rest._v===version?rest:{_v:version};return(id?maps[id]:maps)||{};};const setCustomStorageMap=(id,data)=>{const version=table_getConfig().version;const maps=getCustomStorageMap();maps[id]=data||undefined;maps._v=version;localStorage.setItem(customStorageKey,external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toJSONString(maps));};const getRecoverRowMaps=keyMaps=>{const{fullAllDataRowIdData}=internalData;const restKeys={};external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(keyMaps,(row,rowid)=>{if(fullAllDataRowIdData[rowid]){restKeys[rowid]=row;}});return restKeys;};const handleReserveRow=reserveRowMap=>{const{fullDataRowIdData}=internalData;const reserveList=[];external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(reserveRowMap,(item,rowid)=>{if(fullDataRowIdData[rowid]&&$xeTable.findRowIndexOf(reserveList,fullDataRowIdData[rowid].row)===-1){reserveList.push(fullDataRowIdData[rowid].row);}});return reserveList;};const handleVirtualXVisible=()=>{const{isScrollXBig,scrollXWidth}=reactData;const{elemStore,visibleColumn,fullColumnIdData}=internalData;const leftFixedWidth=computeLeftFixedWidth.value;const rightFixedWidth=computeRightFixedWidth.value;const bodyScrollElem=getRefElem(elemStore['main-body-scroll']);if(bodyScrollElem){const clientWidth=bodyScrollElem.clientWidth;let scrollLeft=bodyScrollElem.scrollLeft;if(isScrollXBig){scrollLeft=Math.ceil((scrollXWidth-clientWidth)*Math.min(1,scrollLeft/(maxXWidth-clientWidth)));}const startLeft=scrollLeft+leftFixedWidth;const endLeft=scrollLeft+clientWidth-rightFixedWidth;let leftIndex=0;let rightIndex=visibleColumn.length;while(leftIndex<rightIndex){const cIndex=Math.floor((leftIndex+rightIndex)/2);const column=visibleColumn[cIndex];const colid=column.id;const colRest=fullColumnIdData[colid]||{};if(colRest.oLeft<=startLeft){leftIndex=cIndex+1;}else{rightIndex=cIndex;}}let visibleSize=0;const toVisibleIndex=leftIndex===visibleColumn.length?leftIndex:Math.max(0,leftIndex<visibleColumn.length?leftIndex-2:0);for(let cIndex=toVisibleIndex,cLen=visibleColumn.length;cIndex<cLen;cIndex++){const column=visibleColumn[cIndex];const colid=column.id;const colRest=fullColumnIdData[colid]||{};visibleSize++;if(colRest.oLeft>endLeft||visibleSize>=60){break;}}return{toVisibleIndex:Math.max(0,toVisibleIndex),visibleSize:Math.max(1,visibleSize)};}return{toVisibleIndex:0,visibleSize:6};};const calcVarRowHeightConfig=(sizeKey,sizeEl)=>{const{rowHeightStore}=reactData;if(sizeEl&&sizeEl.clientHeight){rowHeightStore[sizeKey]=sizeEl.clientHeight;}};const computeRowHeight=()=>{const{isAllOverflow}=reactData;const tableHeader=refTableHeader.value;const tableBody=refTableBody.value;const tableBodyElem=tableBody?tableBody.$el:null;const defaultRowHeight=computeDefaultRowHeight.value;let rowHeight=0;if(isAllOverflow){if(tableBodyElem){const tableHeaderElem=tableHeader?tableHeader.$el:null;let firstTrElem;firstTrElem=tableBodyElem.querySelector('tr');if(!firstTrElem&&tableHeaderElem){firstTrElem=tableHeaderElem.querySelector('tr');}if(firstTrElem){rowHeight=firstTrElem.clientHeight;}}if(!rowHeight){rowHeight=defaultRowHeight;}}else{rowHeight=defaultRowHeight;}// 最低支持 18px 行高
|
|
10779
|
+
return tableFullData.every(row=>!checkMethod({$table:$xeTable,row}));}return false;}return true;}return false;});const computeVirtualScrollBars=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const{overflowX,scrollXLoad,overflowY,scrollYLoad}=reactData;return{x:overflowX&&scrollXLoad,y:overflowY&&scrollYLoad};});const computeRowGroupFields=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const rowGroupOpts=computeRowGroupOpts.value;return rowGroupOpts.groupFields;});const refMaps={refElem,refTooltip,refValidTooltip,refTableFilter,refTableCustom,refTableMenu,refTableHeader,refTableBody,refTableFooter,refTableLeftHeader,refTableLeftBody,refTableLeftFooter,refTableRightHeader,refTableRightBody,refTableRightFooter,refLeftContainer,refRightContainer,refColResizeBar,refRowResizeBar,refScrollXVirtualElem,refScrollYVirtualElem,refScrollXHandleElem,refScrollYHandleElem,refScrollXSpaceElem,refScrollYSpaceElem};const computeMaps={computeSize,computeTableId,computeValidOpts,computeRowField,computeVirtualXOpts,computeVirtualYOpts,computeScrollbarOpts,computeScrollbarXToTop,computeScrollbarYToLeft,computeColumnOpts,computeCurrentColumnOpts,computeScrollXThreshold,computeScrollYThreshold,computeRowHeightMaps,computeDefaultRowHeight,computeCellOpts,computeHeaderCellOpts,computeFooterCellOpts,computeRowOpts,computeAggregateOpts,computeRowGroupOpts,computeCurrentRowOpts,computeRowDragOpts,computeColumnDragOpts,computeResizeOpts,computeResizableOpts,computeSeqOpts,computeRadioOpts,computeCheckboxOpts,computeTooltipOpts,computeEditOpts,computeSortOpts,computeFilterOpts,computeMouseOpts,computeAreaOpts,computeKeyboardOpts,computeClipOpts,computeFNROpts,computeHeaderMenu,computeBodyMenu,computeFooterMenu,computeIsMenu,computeMenuList,computeMenuOpts,computeExportOpts,computeImportOpts,computePrintOpts,computeExpandOpts,computeTreeOpts,computeEmptyOpts,computeLoadingOpts,computeCellOffsetWidth,computeCustomOpts,computeLeftFixedWidth,computeRightFixedWidth,computeFixedColumnSize,computeIsMaxFixedColumn,computeIsAllCheckboxDisabled,computeVirtualScrollBars,computeSXOpts,computeSYOpts};const $xeTable={xID,props:props,context,reactData,internalData,getRefMaps:()=>refMaps,getComputeMaps:()=>computeMaps,xeGrid:$xeGrid,xegrid:$xeGrid};const eqCellValue=(row1,row2,field)=>{const val1=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row1,field);const val2=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row2,field);if(eqEmptyValue(val1)&&eqEmptyValue(val2)){return true;}if(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(val1)||external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(val1)){return''+val1===''+val2;}return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isEqual(val1,val2);};const handleKeyField=()=>{const keyField=computeRowField.value;internalData.currKeyField=keyField;internalData.isCurrDeepKey=hasDeepKey(keyField);};const getNextSortOrder=column=>{const sortOpts=computeSortOpts.value;const{orders=[]}=sortOpts;const currOrder=column.order||null;const oIndex=orders.indexOf(currOrder)+1;return orders[oIndex<orders.length?oIndex:0];};const getCustomStorageMap=id=>{const version=table_getConfig().version;const rest=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toStringJSON(localStorage.getItem(customStorageKey)||'');const maps=rest&&rest._v===version?rest:{_v:version};return(id?maps[id]:maps)||{};};const setCustomStorageMap=(id,data)=>{const version=table_getConfig().version;const maps=getCustomStorageMap();maps[id]=data||undefined;maps._v=version;localStorage.setItem(customStorageKey,external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toJSONString(maps));};const getRecoverRowMaps=keyMaps=>{const{fullAllDataRowIdData}=internalData;const restKeys={};external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(keyMaps,(row,rowid)=>{if(fullAllDataRowIdData[rowid]){restKeys[rowid]=row;}});return restKeys;};const handleReserveRow=reserveRowMap=>{const{fullDataRowIdData}=internalData;const reserveList=[];external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(reserveRowMap,(item,rowid)=>{if(fullDataRowIdData[rowid]&&$xeTable.findRowIndexOf(reserveList,fullDataRowIdData[rowid].row)===-1){reserveList.push(fullDataRowIdData[rowid].row);}});return reserveList;};const handleVirtualXVisible=()=>{const{isScrollXBig,scrollXWidth}=reactData;const{elemStore,visibleColumn,fullColumnIdData}=internalData;const leftFixedWidth=computeLeftFixedWidth.value;const rightFixedWidth=computeRightFixedWidth.value;const bodyScrollElem=getRefElem(elemStore['main-body-scroll']);if(bodyScrollElem){const clientWidth=bodyScrollElem.clientWidth;let scrollLeft=bodyScrollElem.scrollLeft;if(isScrollXBig){scrollLeft=Math.ceil((scrollXWidth-clientWidth)*Math.min(1,scrollLeft/(maxXWidth-clientWidth)));}const startLeft=scrollLeft+leftFixedWidth;const endLeft=scrollLeft+clientWidth-rightFixedWidth;let leftIndex=0;let rightIndex=visibleColumn.length;while(leftIndex<rightIndex){const cIndex=Math.floor((leftIndex+rightIndex)/2);const column=visibleColumn[cIndex];const colid=column.id;const colRest=fullColumnIdData[colid]||{};if(colRest.oLeft<=startLeft){leftIndex=cIndex+1;}else{rightIndex=cIndex;}}let visibleSize=0;const toVisibleIndex=leftIndex===visibleColumn.length?leftIndex:Math.max(0,leftIndex<visibleColumn.length?leftIndex-2:0);for(let cIndex=toVisibleIndex,cLen=visibleColumn.length;cIndex<cLen;cIndex++){const column=visibleColumn[cIndex];const colid=column.id;const colRest=fullColumnIdData[colid]||{};visibleSize++;if(colRest.oLeft>endLeft||visibleSize>=60){break;}}return{toVisibleIndex:Math.max(0,toVisibleIndex),visibleSize:Math.max(1,visibleSize)};}return{toVisibleIndex:0,visibleSize:6};};const calcVarRowHeightConfig=(sizeKey,sizeEl)=>{const{rowHeightStore}=reactData;if(sizeEl&&sizeEl.clientHeight){rowHeightStore[sizeKey]=sizeEl.clientHeight;}};const computeRowHeight=()=>{const{isAllOverflow}=reactData;const tableHeader=refTableHeader.value;const tableBody=refTableBody.value;const tableBodyElem=tableBody?tableBody.$el:null;const defaultRowHeight=computeDefaultRowHeight.value;let rowHeight=0;if(isAllOverflow){if(tableBodyElem){const tableHeaderElem=tableHeader?tableHeader.$el:null;let firstTrElem;firstTrElem=tableBodyElem.querySelector('tr');if(!firstTrElem&&tableHeaderElem){firstTrElem=tableHeaderElem.querySelector('tr');}if(firstTrElem){rowHeight=firstTrElem.clientHeight;}}if(!rowHeight){rowHeight=defaultRowHeight;}}else{rowHeight=defaultRowHeight;}// 最低支持 18px 行高
|
|
10739
10780
|
return Math.max(18,rowHeight);};const handleVirtualYVisible=()=>{const{isAllOverflow,expandColumn,isScrollYBig,scrollYHeight}=reactData;const{elemStore,isResizeCellHeight,afterFullData,fullAllDataRowIdData}=internalData;const rowOpts=computeRowOpts.value;const cellOpts=computeCellOpts.value;const defaultRowHeight=computeDefaultRowHeight.value;const bodyScrollElem=getRefElem(elemStore['main-body-scroll']);if(bodyScrollElem){const clientHeight=bodyScrollElem.clientHeight;let scrollTop=bodyScrollElem.scrollTop;if(isScrollYBig){scrollTop=Math.ceil((scrollYHeight-clientHeight)*Math.min(1,scrollTop/(maxYHeight-clientHeight)));}const startTop=scrollTop;const endTop=scrollTop+clientHeight;let toVisibleIndex=-1;let visibleSize=0;const isCustomCellHeight=isResizeCellHeight||cellOpts.height||rowOpts.height;if(!isCustomCellHeight&&!expandColumn&&isAllOverflow){toVisibleIndex=Math.floor(startTop/defaultRowHeight)-1;visibleSize=Math.ceil(clientHeight/defaultRowHeight)+1;}else{const{handleGetRowId}=createHandleGetRowId($xeTable);let leftIndex=0;let rightIndex=afterFullData.length;while(leftIndex<rightIndex){const rIndex=Math.floor((leftIndex+rightIndex)/2);const row=afterFullData[rIndex];const rowid=handleGetRowId(row);const rowRest=fullAllDataRowIdData[rowid]||{};if(rowRest.oTop<=startTop){leftIndex=rIndex+1;}else{rightIndex=rIndex;}}toVisibleIndex=leftIndex===afterFullData.length?leftIndex:Math.max(0,leftIndex<afterFullData.length?leftIndex-2:0);for(let rIndex=toVisibleIndex,rLen=afterFullData.length;rIndex<rLen;rIndex++){const row=afterFullData[rIndex];const rowid=handleGetRowId(row);const rowRest=fullAllDataRowIdData[rowid]||{};visibleSize++;if(rowRest.oTop>endTop||visibleSize>=100){break;}}}return{toVisibleIndex:Math.max(0,toVisibleIndex),visibleSize:Math.max(6,visibleSize)};}return{toVisibleIndex:0,visibleSize:6};};const calculateMergerOffsetIndex=(list,offsetItem,type)=>{for(let mcIndex=0,len=list.length;mcIndex<len;mcIndex++){const mergeItem=list[mcIndex];const{startIndex,endIndex}=offsetItem;const mergeStartIndex=mergeItem[type];const mergeSpanNumber=mergeItem[type+'span'];const mergeEndIndex=mergeStartIndex+mergeSpanNumber;if(mergeStartIndex<startIndex&&startIndex<mergeEndIndex){offsetItem.startIndex=mergeStartIndex;}if(mergeStartIndex<endIndex&&endIndex<mergeEndIndex){offsetItem.endIndex=mergeEndIndex;}if(offsetItem.startIndex!==startIndex||offsetItem.endIndex!==endIndex){mcIndex=-1;}}};function buildMergeData(mergeConfigs){const mergeMaps={};if(mergeConfigs&&mergeConfigs.length){for(let mIndex=0;mIndex<mergeConfigs.length;mIndex++){const{row:_rowIndex,col:_columnIndex,rowspan:mergeRowspan,colspan:mergeColspan}=mergeConfigs[mIndex];for(let i=0;i<mergeRowspan;i++){for(let j=0;j<mergeColspan;j++){mergeMaps[`${_rowIndex+i}:${_columnIndex+j}`]=!i&&!j?{rowspan:mergeRowspan,colspan:mergeColspan}:{rowspan:0,colspan:0};}}}}return mergeMaps;}const handleBodyMerge=merges=>{const{fullAllDataRowIdData,fullColumnIdData,visibleColumn,afterFullData,mergeBodyList,mergeBodyMaps}=internalData;if(merges){const{handleGetRowId}=createHandleGetRowId($xeTable);if(!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(merges)){merges=[merges];}merges.forEach(item=>{let{row:margeRow,col:margeCol,rowspan,colspan}=item;let mergeRowIndex=-1;let mergeColumnIndex=-1;if(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(margeRow)){mergeRowIndex=margeRow;}else{const rowid=margeRow?handleGetRowId(margeRow):null;const rowRest=rowid?fullAllDataRowIdData[rowid]:null;if(rowRest){mergeRowIndex=rowRest._index;}}if(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(margeCol)){mergeColumnIndex=margeCol;}else{const colid=margeCol?margeCol.id:null;const colRest=colid?fullColumnIdData[colid]:null;if(colRest){mergeColumnIndex=colRest._index;}}if(mergeRowIndex>-1&&mergeColumnIndex>-1&&(rowspan||colspan)){rowspan=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(rowspan)||1;colspan=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(colspan)||1;if(rowspan>1||colspan>1){const row=afterFullData[mergeRowIndex];const column=visibleColumn[mergeColumnIndex];let mergeItem=mergeBodyMaps[`${mergeRowIndex}:${mergeColumnIndex}`];if(mergeItem){mergeItem.rowspan=rowspan;mergeItem.colspan=colspan;mergeItem._rowspan=rowspan;mergeItem._colspan=colspan;}else{mergeItem={row:mergeRowIndex,col:mergeColumnIndex,rowspan,colspan,_row:row,_col:column,_rowspan:rowspan,_colspan:colspan};mergeBodyMaps[`${mergeRowIndex}:${mergeColumnIndex}`]=mergeItem;mergeBodyList.push(mergeItem);}}}});}};const handleFooterMerge=merges=>{const{footerTableData}=reactData;const{mergeFooterList,mergeFooterMaps,fullColumnIdData}=internalData;if(merges){const{visibleColumn}=internalData;if(!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(merges)){merges=[merges];}merges.forEach(item=>{let{row:margeRow,col:margeCol,rowspan,colspan}=item;const mergeRowIndex=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(margeRow)?margeRow:-1;let mergeColumnIndex=-1;if(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(margeCol)){mergeColumnIndex=margeCol;}else{const colid=margeCol?margeCol.id:null;const colRest=colid?fullColumnIdData[colid]:null;if(colRest){mergeColumnIndex=colRest._index;}}if(mergeRowIndex>-1&&mergeColumnIndex>-1&&(rowspan||colspan)){rowspan=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(rowspan)||1;colspan=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(colspan)||1;if(rowspan>1||colspan>1){const row=footerTableData[mergeRowIndex];const column=visibleColumn[mergeColumnIndex];let mergeItem=mergeFooterMaps[`${mergeRowIndex}:${mergeColumnIndex}`];if(mergeItem){mergeItem.rowspan=rowspan;mergeItem.colspan=colspan;mergeItem._rowspan=rowspan;mergeItem._colspan=colspan;}else{mergeItem={row:mergeRowIndex,col:mergeColumnIndex,rowspan,colspan,_row:row,_col:column,_rowspan:rowspan,_colspan:colspan};mergeFooterMaps[`${mergeRowIndex}:${mergeColumnIndex}`]=mergeItem;mergeFooterList.push(mergeItem);}}}});}};const removeBodyMerges=merges=>{const{mergeBodyList,fullColumnIdData,fullAllDataRowIdData,mergeBodyMaps}=internalData;const rest=[];if(merges){const{handleGetRowId}=createHandleGetRowId($xeTable);if(!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(merges)){merges=[merges];}merges.forEach(item=>{const{row:margeRow,col:margeCol}=item;let mergeRowIndex=-1;let mergeColumnIndex=-1;if(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(margeRow)){mergeRowIndex=margeRow;}else{const rowid=margeRow?handleGetRowId(margeRow):null;const rowRest=rowid?fullAllDataRowIdData[rowid]:null;if(rowRest){mergeRowIndex=rowRest._index;}}if(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(margeCol)){mergeColumnIndex=margeCol;}else{const colid=margeCol?margeCol.id:null;const colRest=colid?fullColumnIdData[colid]:null;if(colRest){mergeColumnIndex=colRest._index;}}const mcIndex=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findIndexOf(mergeBodyList,item=>item.row===mergeRowIndex&&item.col===mergeColumnIndex);if(mcIndex>-1){const rItems=mergeBodyList.splice(mcIndex,1);const item=rItems[0];if(item){rest.push(rItems[0]);if(mergeBodyMaps[`${mergeRowIndex}:${mergeColumnIndex}`]){delete mergeBodyMaps[`${mergeRowIndex}:${mergeColumnIndex}`];}}}});}return rest;};const removeFooterMerges=merges=>{const{mergeFooterList,fullColumnIdData,mergeFooterMaps}=internalData;const rest=[];if(merges){if(!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(merges)){merges=[merges];}merges.forEach(item=>{const{row:margeRow,col:margeCol}=item;const mergeRowIndex=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(margeRow)?margeRow:-1;let mergeColumnIndex=-1;if(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(margeCol)){mergeColumnIndex=margeCol;}else{const colid=margeCol?margeCol.id:null;const colRest=colid?fullColumnIdData[colid]:null;if(colRest){mergeColumnIndex=colRest._index;}}const mcIndex=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findIndexOf(mergeFooterList,item=>item.row===mergeRowIndex&&item.col===mergeColumnIndex);if(mcIndex>-1){const rItems=mergeFooterList.splice(mcIndex,1);const item=rItems[0];if(item){rest.push(item);if(mergeFooterMaps[`${mergeRowIndex}:${mergeColumnIndex}`]){delete mergeFooterMaps[`${mergeRowIndex}:${mergeColumnIndex}`];}}}});}return rest;};const handleSortEvent=(evnt,sortConfs,isUpdate)=>{const sortOpts=computeSortOpts.value;const{multiple,remote,orders}=sortOpts;if(!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(sortConfs)){sortConfs=[sortConfs];}if(sortConfs&&sortConfs.length){if(!multiple){sortConfs=[sortConfs[0]];clearAllSort();}let firstColumn=null;sortConfs.forEach((confs,index)=>{let{field,order}=confs;let column=field;if(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(field)){column=$xeTable.getColumnByField(field);}if(!firstColumn){firstColumn=column;}if(column&&column.sortable){if(orders&&orders.indexOf(order)===-1){order=getNextSortOrder(column);}if(column.order!==order){column.order=order;}column.sortTime=Date.now()+index;}});if(isUpdate){if(!remote){$xeTable.handleTableData(true);}}if(evnt){$xeTable.handleColumnSortEvent(evnt,firstColumn);}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(()=>{updateRowOffsetTop();$xeTable.updateCellAreas();return updateStyle();});}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();};const clearAllSort=()=>{const{tableFullColumn}=internalData;tableFullColumn.forEach(column=>{column.order=null;});};const calcTableHeight=key=>{const{parentHeight}=reactData;const val=props[key];let num=0;if(val){if(val==='100%'||val==='auto'){num=parentHeight;}else{const excludeHeight=$xeTable.getExcludeHeight();if(isScale(val)){num=Math.floor((external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toInteger(val)||1)/100*parentHeight);}else{num=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(val);}num=Math.max(40,num-excludeHeight);}}return num;};const handleCustomRestore=storeData=>{let{collectColumn}=internalData;const{resizableData,sortData,visibleData,fixedData}=storeData;let hasCustomSort=false;// 处理还原
|
|
10740
10781
|
if(resizableData||sortData||visibleData||fixedData){external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(collectColumn,(column,index,items,path,parentColumn)=>{const colKey=column.getKey();// 支持一级
|
|
10741
10782
|
if(!parentColumn){if(fixedData&&fixedData[colKey]!==undefined){column.fixed=fixedData[colKey];}if(sortData&&external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(sortData[colKey])){hasCustomSort=true;column.renderSortNumber=sortData[colKey];}}if(resizableData&&external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(resizableData[colKey])){column.resizeWidth=resizableData[colKey];}if(visibleData&&external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(visibleData[colKey])){column.visible=visibleData[colKey];}});// 如果自定义了顺序
|
|
@@ -10769,23 +10810,23 @@ remainList.forEach(column=>{const width=Math.max(meanWidth,minCellWidth);column.
|
|
|
10769
10810
|
*/const updateAfterDataIndex=()=>{const{treeConfig}=props;const{fullDataRowIdData,fullAllDataRowIdData,afterFullData,afterTreeFullData}=internalData;const treeOpts=computeTreeOpts.value;const{transform}=treeOpts;const childrenField=treeOpts.children||treeOpts.childrenField;const fullMaps={};if(treeConfig){const{handleGetRowId}=createHandleGetRowId($xeTable);external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(afterTreeFullData,(row,index,items,path)=>{const rowid=handleGetRowId(row);const rowRest=fullAllDataRowIdData[rowid];const seq=path.map((num,i)=>i%2===0?Number(num)+1:'.').join('');if(rowRest){rowRest.seq=seq;rowRest.treeIndex=index;}else{const rest={row,rowid,seq,index:-1,$index:-1,_index:-1,treeIndex:-1,items:[],parent:null,level:0,height:0,resizeHeight:0,oTop:0,expandHeight:0};fullAllDataRowIdData[rowid]=rest;fullDataRowIdData[rowid]=rest;}fullMaps[rowid]=row;},{children:transform?treeOpts.mapChildrenField:childrenField});if(transform){afterFullData.forEach((row,index)=>{const rowid=handleGetRowId(row);const rowRest=fullAllDataRowIdData[rowid];const seq=index+1;if(rowRest){if(!treeConfig){rowRest.seq=seq;}rowRest._index=index;}});}internalData.afterFullRowMaps=fullMaps;}else{updateAfterListIndex();}};/**
|
|
10770
10811
|
* 如果为虚拟树、行分组、则将树结构拍平
|
|
10771
10812
|
* @returns
|
|
10772
|
-
*/const handleVirtualTreeToList=()=>{const{treeConfig}=props;const{isRowGroupStatus}=reactData;const{fullAllDataRowIdData,treeExpandedMaps,rowGroupExpandedMaps}=internalData;const
|
|
10813
|
+
*/const handleVirtualTreeToList=()=>{const{treeConfig}=props;const{isRowGroupStatus}=reactData;const{fullAllDataRowIdData,treeExpandedMaps,rowGroupExpandedMaps}=internalData;const aggregateOpts=computeAggregateOpts.value;const treeOpts=computeTreeOpts.value;const{handleGetRowId}=createHandleGetRowId($xeTable);const fullData=[];const expandMaps={};if(treeConfig&&treeOpts.transform){const childrenField=treeOpts.children||treeOpts.childrenField;external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(internalData.afterTreeFullData,(row,index,items,path,parentRow)=>{const rowid=handleGetRowId(row);const parentRowid=handleGetRowId(parentRow);if(!parentRow||expandMaps[parentRowid]&&treeExpandedMaps[parentRowid]){const rowRest=fullAllDataRowIdData[rowid];if(rowRest){rowRest._index=fullData.length;}expandMaps[rowid]=1;fullData.push(row);}},{children:childrenField});internalData.afterFullData=fullData;updateScrollYStatus(fullData);return fullData;}else if(isRowGroupStatus){const{childrenField}=aggregateOpts;external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(internalData.afterGroupFullData,(row,index,items,path,parentRow)=>{const rowid=handleGetRowId(row);const parentRowid=handleGetRowId(parentRow);if(!parentRow||expandMaps[parentRowid]&&rowGroupExpandedMaps[parentRowid]){const rowRest=fullAllDataRowIdData[rowid];if(rowRest){rowRest._index=fullData.length;}expandMaps[rowid]=1;fullData.push(row);}},{children:childrenField});internalData.afterFullData=fullData;updateScrollYStatus(fullData);return fullData;}return internalData.afterFullData;};/**
|
|
10773
10814
|
* 编译处理后全量的表格数据
|
|
10774
10815
|
* 如果存在筛选条件,继续处理
|
|
10775
|
-
*/const updateAfterFullData=()=>{const{treeConfig}=props;const{isRowGroupStatus}=reactData;const{tableFullColumn,tableFullData,tableFullTreeData,tableFullGroupData}=internalData;const filterOpts=computeFilterOpts.value;const sortOpts=computeSortOpts.value;const
|
|
10816
|
+
*/const updateAfterFullData=()=>{const{treeConfig}=props;const{isRowGroupStatus}=reactData;const{tableFullColumn,tableFullData,tableFullTreeData,tableFullGroupData}=internalData;const filterOpts=computeFilterOpts.value;const sortOpts=computeSortOpts.value;const aggregateOpts=computeAggregateOpts.value;const treeOpts=computeTreeOpts.value;const childrenField=treeOpts.children||treeOpts.childrenField;const{transform,rowField,parentField,mapChildrenField}=treeOpts;const{isEvery,remote:allRemoteFilter,filterMethod:allFilterMethod}=filterOpts;const{remote:allRemoteSort,sortMethod:allSortMethod,multiple:sortMultiple,chronological}=sortOpts;let tableData=[];let tableTree=[];// 处理数据
|
|
10776
10817
|
if(!allRemoteFilter||!allRemoteSort){const filterColumns=[];let orderColumns=[];tableFullColumn.forEach(column=>{const{field,sortable,order,filters}=column;if(!allRemoteFilter&&filters&&filters.length){const valueList=[];const itemList=[];filters.forEach(item=>{if(item.checked){itemList.push(item);valueList.push(item.value);}});if(itemList.length){filterColumns.push({column,valueList,itemList});}}if(!allRemoteSort&&sortable&&order){orderColumns.push({column,field,property:field,order:order,sortTime:column.sortTime});}});if(sortMultiple&&chronological&&orderColumns.length>1){orderColumns=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().orderBy(orderColumns,'sortTime');}// 处理筛选
|
|
10777
10818
|
// 支持单列、多列、组合筛选
|
|
10778
10819
|
if(!allRemoteFilter&&filterColumns.length){const handleFilter=row=>{return filterColumns.every(({column,valueList,itemList})=>{const{filterMethod,filterRender}=column;const compConf=isEnableConf(filterRender)?table_renderer.get(filterRender.name):null;const compFilterMethod=compConf?compConf.tableFilterMethod||compConf.filterMethod:null;const tdFilterMethod=compConf?compConf.tableFilterDefaultMethod||compConf.defaultTableFilterMethod||compConf.defaultFilterMethod:null;const cellValue=getCellValue(row,column);if(filterMethod){return itemList.some(item=>filterMethod({value:item.value,option:item,cellValue,row,column,$table:$xeTable}));}else if(compFilterMethod){return itemList.some(item=>compFilterMethod({value:item.value,option:item,cellValue,row,column,$table:$xeTable}));}else if(allFilterMethod){return allFilterMethod({$table:$xeTable,options:itemList,values:valueList,cellValue,row,column});}else if(tdFilterMethod){return itemList.some(item=>tdFilterMethod({value:item.value,option:item,cellValue,row,column,$table:$xeTable}));}return valueList.indexOf(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row,column.field))>-1;});};if(isRowGroupStatus){// 行分组
|
|
10779
|
-
tableTree=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().searchTree(tableFullGroupData,handleFilter,{original:true,isEvery:true,children:
|
|
10820
|
+
tableTree=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().searchTree(tableFullGroupData,handleFilter,{original:true,isEvery:true,children:aggregateOpts.mapChildrenField,mapChildren:aggregateOpts.childrenField});tableData=tableTree;}else if(treeConfig&&transform){// 筛选虚拟树
|
|
10780
10821
|
tableTree=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().searchTree(tableFullTreeData,handleFilter,{original:true,isEvery,children:mapChildrenField,mapChildren:childrenField});tableData=tableTree;}else{tableData=treeConfig?tableFullTreeData.filter(handleFilter):tableFullData.filter(handleFilter);tableTree=tableData;}}else{if(isRowGroupStatus){// 还原行分组
|
|
10781
|
-
tableTree=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().searchTree(tableFullGroupData,()=>true,{original:true,isEvery:true,children:
|
|
10822
|
+
tableTree=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().searchTree(tableFullGroupData,()=>true,{original:true,isEvery:true,children:aggregateOpts.mapChildrenField,mapChildren:aggregateOpts.childrenField});tableData=tableTree;}else if(treeConfig&&transform){// 还原虚拟树
|
|
10782
10823
|
tableTree=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().searchTree(tableFullTreeData,()=>true,{original:true,isEvery,children:mapChildrenField,mapChildren:childrenField});tableData=tableTree;}else{tableData=treeConfig?tableFullTreeData.slice(0):tableFullData.slice(0);tableTree=tableData;}}// 处理排序
|
|
10783
10824
|
// 支持单列、多列、组合排序
|
|
10784
10825
|
if(!allRemoteSort&&orderColumns.length){if(isRowGroupStatus){// 行分组的排序
|
|
10785
|
-
if(allSortMethod){const sortRests=allSortMethod({data:tableTree,sortList:orderColumns,$table:$xeTable});tableTree=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(sortRests)?sortRests:tableTree;}else{const treeList=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toTreeArray(tableTree,{key:
|
|
10826
|
+
if(allSortMethod){const sortRests=allSortMethod({data:tableTree,sortList:orderColumns,$table:$xeTable});tableTree=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(sortRests)?sortRests:tableTree;}else{const treeList=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toTreeArray(tableTree,{key:aggregateOpts.rowField,parentKey:aggregateOpts.parentField,children:aggregateOpts.mapChildrenField});tableTree=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toArrayTree(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().orderBy(treeList,orderColumns.map(({column,order})=>[getOrderField(column),order])),{key:aggregateOpts.rowField,parentKey:aggregateOpts.parentField,children:aggregateOpts.childrenField,mapChildren:aggregateOpts.mapChildrenField});}tableData=tableTree;}else if(treeConfig&&transform){// 虚拟树的排序
|
|
10786
10827
|
if(allSortMethod){const sortRests=allSortMethod({data:tableTree,sortList:orderColumns,$table:$xeTable});tableTree=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(sortRests)?sortRests:tableTree;}else{const treeList=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toTreeArray(tableTree,{children:mapChildrenField});tableTree=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toArrayTree(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().orderBy(treeList,orderColumns.map(({column,order})=>[getOrderField(column),order])),{key:rowField,parentKey:parentField,children:childrenField,mapChildren:mapChildrenField});}tableData=tableTree;}else{if(allSortMethod){const sortRests=allSortMethod({data:tableData,sortList:orderColumns,$table:$xeTable});tableData=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(sortRests)?sortRests:tableData;}else{tableData=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().orderBy(tableData,orderColumns.map(({column,order})=>[getOrderField(column),order]));}tableTree=tableData;}}}else{if(isRowGroupStatus){// 还原行分组
|
|
10787
10828
|
// 还原虚拟树
|
|
10788
|
-
tableTree=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().searchTree(tableFullGroupData,()=>true,{original:true,isEvery:true,children:
|
|
10829
|
+
tableTree=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().searchTree(tableFullGroupData,()=>true,{original:true,isEvery:true,children:aggregateOpts.mapChildrenField,mapChildren:aggregateOpts.childrenField});tableData=tableTree;}else if(treeConfig&&transform){// 还原虚拟树
|
|
10789
10830
|
tableTree=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().searchTree(tableFullTreeData,()=>true,{original:true,isEvery,children:mapChildrenField,mapChildren:childrenField});tableData=tableTree;}else{tableData=treeConfig?tableFullTreeData.slice(0):tableFullData.slice(0);tableTree=tableData;}}internalData.afterFullData=tableData;internalData.afterTreeFullData=tableTree;internalData.afterGroupFullData=tableTree;updateAfterDataIndex();};const updateStyle=()=>{const{showHeaderOverflow:allColumnHeaderOverflow,showFooterOverflow:allColumnFooterOverflow,mouseConfig,spanMethod,footerSpanMethod}=props;const{isGroup,currentRow,tableColumn,scrollXLoad,scrollYLoad,overflowX,scrollbarWidth,overflowY,scrollbarHeight,scrollXWidth,columnStore,editStore,isAllOverflow,expandColumn,isColLoading}=reactData;const{visibleColumn,tableHeight,headerHeight,footerHeight,elemStore,customHeight,customMinHeight,customMaxHeight}=internalData;const el=refElem.value;if(!el){return;}const containerList=['main','left','right'];const osbWidth=overflowY?scrollbarWidth:0;const osbHeight=overflowX?scrollbarHeight:0;const emptyPlaceholderElem=refEmptyPlaceholder.value;const mouseOpts=computeMouseOpts.value;const expandOpts=computeExpandOpts.value;const bodyWrapperElem=getRefElem(elemStore['main-body-wrapper']);const bodyTableElem=getRefElem(elemStore['main-body-table']);if(emptyPlaceholderElem){emptyPlaceholderElem.style.top=`${headerHeight}px`;emptyPlaceholderElem.style.height=bodyWrapperElem?`${bodyWrapperElem.offsetHeight-osbHeight}px`:'';}let bodyHeight=0;let bodyMaxHeight=0;const bodyMinHeight=customMinHeight-headerHeight-footerHeight-osbHeight;if(customMaxHeight){bodyMaxHeight=Math.max(bodyMinHeight,customMaxHeight-headerHeight-footerHeight-osbHeight);}if(customHeight){bodyHeight=customHeight-headerHeight-footerHeight-osbHeight;}if(!bodyHeight){if(bodyTableElem){bodyHeight=bodyTableElem.clientHeight;}}if(bodyHeight){if(bodyMaxHeight){bodyHeight=Math.min(bodyMaxHeight,bodyHeight);}bodyHeight=Math.max(bodyMinHeight,bodyHeight);}const scrollbarXToTop=computeScrollbarXToTop.value;const xLeftCornerEl=refScrollXLeftCornerElem.value;const xRightCornerEl=refScrollXRightCornerElem.value;const scrollXVirtualEl=refScrollXVirtualElem.value;if(scrollXVirtualEl){scrollXVirtualEl.style.height=`${osbHeight}px`;scrollXVirtualEl.style.visibility=overflowX?'visible':'hidden';}const xWrapperEl=refScrollXWrapperElem.value;if(xWrapperEl){xWrapperEl.style.left=scrollbarXToTop?`${osbWidth}px`:'';xWrapperEl.style.width=`${el.clientWidth-osbWidth}px`;}if(xLeftCornerEl){xLeftCornerEl.style.width=scrollbarXToTop?`${osbWidth}px`:'';xLeftCornerEl.style.display=scrollbarXToTop?overflowX&&osbHeight?'block':'':'';}if(xRightCornerEl){xRightCornerEl.style.width=scrollbarXToTop?'':`${osbWidth}px`;xRightCornerEl.style.display=scrollbarXToTop?'':overflowX&&osbHeight?'block':'';}const scrollYVirtualEl=refScrollYVirtualElem.value;if(scrollYVirtualEl){scrollYVirtualEl.style.width=`${osbWidth}px`;scrollYVirtualEl.style.height=`${bodyHeight+headerHeight+footerHeight}px`;scrollYVirtualEl.style.visibility=overflowY?'visible':'hidden';}const yTopCornerEl=refScrollYTopCornerElem.value;if(yTopCornerEl){yTopCornerEl.style.height=`${headerHeight}px`;yTopCornerEl.style.display=overflowY&&headerHeight?'block':'';}const yWrapperEl=refScrollYWrapperElem.value;if(yWrapperEl){yWrapperEl.style.height=`${bodyHeight}px`;yWrapperEl.style.top=`${headerHeight}px`;}const yBottomCornerEl=refScrollYBottomCornerElem.value;if(yBottomCornerEl){yBottomCornerEl.style.height=`${footerHeight}px`;yBottomCornerEl.style.top=`${headerHeight+bodyHeight}px`;yBottomCornerEl.style.display=overflowY&&footerHeight?'block':'';}const rowExpandEl=refRowExpandElem.value;if(rowExpandEl){rowExpandEl.style.height=`${bodyHeight}px`;rowExpandEl.style.top=`${headerHeight}px`;}containerList.forEach((name,index)=>{const fixedType=index>0?name:'';const layoutList=['header','body','footer'];const isFixedLeft=fixedType==='left';let fixedColumn=[];let fixedWrapperElem;if(fixedType){fixedColumn=isFixedLeft?columnStore.leftList:columnStore.rightList;fixedWrapperElem=isFixedLeft?refLeftContainer.value:refRightContainer.value;}layoutList.forEach(layout=>{const wrapperElem=getRefElem(elemStore[`${name}-${layout}-wrapper`]);const currScrollElem=getRefElem(elemStore[`${name}-${layout}-scroll`]);const tableElem=getRefElem(elemStore[`${name}-${layout}-table`]);if(layout==='header'){// 表头体样式处理
|
|
10790
10831
|
// 横向滚动渲染
|
|
10791
10832
|
let renderColumnList=tableColumn;let isOptimizeMode=false;if(isGroup){renderColumnList=visibleColumn;}else{// 如果是使用优化模式
|
|
@@ -10807,7 +10848,7 @@ if(fixedWrapperElem){if(wrapperElem){wrapperElem.style.top=`${customHeight>0?cus
|
|
|
10807
10848
|
* 处理单选框默认勾选
|
|
10808
10849
|
*/const handleDefaultRadioChecked=()=>{const{radioConfig}=props;if(radioConfig){const{fullDataRowIdData}=internalData;const radioOpts=computeRadioOpts.value;const{checkRowKey:rowid,reserve}=radioOpts;if(rowid){if(fullDataRowIdData[rowid]){handleCheckedRadioRow(fullDataRowIdData[rowid].row,true);}if(reserve){const rowkey=getRowkey($xeTable);internalData.radioReserveRow={[rowkey]:rowid};}}}};/**
|
|
10809
10850
|
* 处理默认展开行
|
|
10810
|
-
*/const handleDefaultRowExpand=()=>{const{expandConfig}=props;if(expandConfig){const{fullDataRowIdData}=internalData;const expandOpts=computeExpandOpts.value;const{expandAll,expandRowKeys}=expandOpts;if(expandAll){$xeTable.setAllRowExpand(true);}else if(expandRowKeys){const defExpandeds=[];expandRowKeys.forEach(rowid=>{if(fullDataRowIdData[rowid]){defExpandeds.push(fullDataRowIdData[rowid].row);}});$xeTable.setRowExpand(defExpandeds,true);}}};const handleRadioReserveRow=row=>{const radioOpts=computeRadioOpts.value;if(radioOpts.reserve){internalData.radioReserveRow=row;}};const handleCheckboxReserveRow=(row,checked)=>{const{checkboxReserveRowMap}=internalData;const checkboxOpts=computeCheckboxOpts.value;if(checkboxOpts.reserve){const rowid=getRowid($xeTable,row);if(checked){checkboxReserveRowMap[rowid]=row;}else if(checkboxReserveRowMap[rowid]){delete checkboxReserveRowMap[rowid];}}};const handleCheckedRadioRow=(row,isForce)=>{const radioOpts=computeRadioOpts.value;const{checkMethod}=radioOpts;if(row&&(isForce||!checkMethod||checkMethod({$table:$xeTable,row}))){reactData.selectRadioRow=row;handleRadioReserveRow(row);}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();};const handleCheckedCheckboxRow=(rows,value,isForce)=>{if(rows&&!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(rows)){rows=[rows];}$xeTable.handleBatchSelectRows(rows,!!value,isForce);$xeTable.checkSelectionStatus();return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();};const handleCheckedAllCheckboxRow=(checked,isForce)=>{const{treeConfig}=props;const{isRowGroupStatus}=reactData;const{afterFullData,afterTreeFullData,afterGroupFullData,checkboxReserveRowMap,selectCheckboxMaps}=internalData;const treeOpts=computeTreeOpts.value;const
|
|
10851
|
+
*/const handleDefaultRowExpand=()=>{const{expandConfig}=props;if(expandConfig){const{fullDataRowIdData}=internalData;const expandOpts=computeExpandOpts.value;const{expandAll,expandRowKeys}=expandOpts;if(expandAll){$xeTable.setAllRowExpand(true);}else if(expandRowKeys){const defExpandeds=[];expandRowKeys.forEach(rowid=>{if(fullDataRowIdData[rowid]){defExpandeds.push(fullDataRowIdData[rowid].row);}});$xeTable.setRowExpand(defExpandeds,true);}}};const handleRadioReserveRow=row=>{const radioOpts=computeRadioOpts.value;if(radioOpts.reserve){internalData.radioReserveRow=row;}};const handleCheckboxReserveRow=(row,checked)=>{const{checkboxReserveRowMap}=internalData;const checkboxOpts=computeCheckboxOpts.value;if(checkboxOpts.reserve){const rowid=getRowid($xeTable,row);if(checked){checkboxReserveRowMap[rowid]=row;}else if(checkboxReserveRowMap[rowid]){delete checkboxReserveRowMap[rowid];}}};const handleCheckedRadioRow=(row,isForce)=>{const radioOpts=computeRadioOpts.value;const{checkMethod}=radioOpts;if(row&&(isForce||!checkMethod||checkMethod({$table:$xeTable,row}))){reactData.selectRadioRow=row;handleRadioReserveRow(row);}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();};const handleCheckedCheckboxRow=(rows,value,isForce)=>{if(rows&&!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(rows)){rows=[rows];}$xeTable.handleBatchSelectRows(rows,!!value,isForce);$xeTable.checkSelectionStatus();return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();};const handleCheckedAllCheckboxRow=(checked,isForce)=>{const{treeConfig}=props;const{isRowGroupStatus}=reactData;const{afterFullData,afterTreeFullData,afterGroupFullData,checkboxReserveRowMap,selectCheckboxMaps}=internalData;const treeOpts=computeTreeOpts.value;const aggregateOpts=computeAggregateOpts.value;const childrenField=treeOpts.children||treeOpts.childrenField;const checkboxOpts=computeCheckboxOpts.value;const{checkField,reserve,checkMethod}=checkboxOpts;const{handleGetRowId}=createHandleGetRowId($xeTable);// indeterminateField 仅支持读取
|
|
10811
10852
|
const indeterminateField=checkboxOpts.indeterminateField||checkboxOpts.halfField;const selectRowMaps={};/**
|
|
10812
10853
|
* 绑定属性方式(有污染)
|
|
10813
10854
|
* 必须在行数据存在对应的属性,否则将不响应
|
|
@@ -10819,10 +10860,10 @@ if(treeConfig||isRowGroupStatus){external_root_XEUtils_commonjs_xe_utils_commonj
|
|
|
10819
10860
|
*/if(isRowGroupStatus){if(checked){/**
|
|
10820
10861
|
* 如果是行分组勾选
|
|
10821
10862
|
* 如果方法成立,则添加到临时集合中
|
|
10822
|
-
*/external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(afterGroupFullData,row=>{if(isForce||!checkMethod||checkMethod({$table:$xeTable,row})){const rowid=handleGetRowId(row);selectRowMaps[rowid]=row;}},{children:
|
|
10863
|
+
*/external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(afterGroupFullData,row=>{if(isForce||!checkMethod||checkMethod({$table:$xeTable,row})){const rowid=handleGetRowId(row);selectRowMaps[rowid]=row;}},{children:aggregateOpts.mapChildrenField});}else{/**
|
|
10823
10864
|
* 如果是树取消
|
|
10824
10865
|
* 如果方法成立,则不添加到临时集合中
|
|
10825
|
-
*/if(!isForce&&checkMethod){external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(afterGroupFullData,row=>{const rowid=handleGetRowId(row);if(checkMethod({$table:$xeTable,row})?false:selectCheckboxMaps[rowid]){selectRowMaps[rowid]=row;}},{children:
|
|
10866
|
+
*/if(!isForce&&checkMethod){external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(afterGroupFullData,row=>{const rowid=handleGetRowId(row);if(checkMethod({$table:$xeTable,row})?false:selectCheckboxMaps[rowid]){selectRowMaps[rowid]=row;}},{children:aggregateOpts.mapChildrenField});}}}else if(treeConfig){if(checked){/**
|
|
10826
10867
|
* 如果是树勾选
|
|
10827
10868
|
* 如果方法成立,则添加到临时集合中
|
|
10828
10869
|
*/external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(afterTreeFullData,row=>{if(isForce||!checkMethod||checkMethod({$table:$xeTable,row})){const rowid=handleGetRowId(row);selectRowMaps[rowid]=row;}},{children:childrenField});}else{/**
|
|
@@ -10857,17 +10898,17 @@ const computeScrollLoad=()=>{return (0,external_commonjs_vue_commonjs2_vue_root_
|
|
|
10857
10898
|
if(scrollXLoad){const{toVisibleIndex:toXVisibleIndex,visibleSize:visibleXSize}=handleVirtualXVisible();const offsetXSize=Math.max(0,virtualXOpts.oSize?external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(virtualXOpts.oSize):0);scrollXStore.preloadSize=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(virtualXOpts.preSize);scrollXStore.offsetSize=offsetXSize;scrollXStore.visibleSize=visibleXSize;scrollXStore.endIndex=Math.max(scrollXStore.startIndex+scrollXStore.visibleSize+offsetXSize,scrollXStore.endIndex);scrollXStore.visibleStartIndex=Math.max(scrollXStore.startIndex,toXVisibleIndex);scrollXStore.visibleEndIndex=Math.min(scrollXStore.endIndex,toXVisibleIndex+visibleXSize);$xeTable.updateScrollXData().then(()=>{loadScrollXData();});}else{$xeTable.updateScrollXSpace();}// 计算 Y 逻辑
|
|
10858
10899
|
const rowHeight=computeRowHeight();scrollYStore.rowHeight=rowHeight;// 已废弃
|
|
10859
10900
|
reactData.rowHeight=rowHeight;const{toVisibleIndex:toYVisibleIndex,visibleSize:visibleYSize}=handleVirtualYVisible();if(scrollYLoad){const offsetYSize=Math.max(0,virtualYOpts.oSize?external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(virtualYOpts.oSize):0);scrollYStore.preloadSize=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(virtualYOpts.preSize);scrollYStore.offsetSize=offsetYSize;scrollYStore.visibleSize=visibleYSize;scrollYStore.endIndex=Math.max(scrollYStore.startIndex+visibleYSize+offsetYSize,scrollYStore.endIndex);scrollYStore.visibleStartIndex=Math.max(scrollYStore.startIndex,toYVisibleIndex);scrollYStore.visibleEndIndex=Math.min(scrollYStore.endIndex,toYVisibleIndex+visibleYSize);$xeTable.updateScrollYData().then(()=>{loadScrollYData();});}else{$xeTable.updateScrollYSpace();}});};const calcScrollbar=()=>{const{scrollXWidth,scrollYHeight}=reactData;const{elemStore}=internalData;const scrollbarOpts=computeScrollbarOpts.value;const bodyWrapperElem=getRefElem(elemStore['main-body-wrapper']);const headerTableElem=getRefElem(elemStore['main-header-table']);const footerTableElem=getRefElem(elemStore['main-footer-table']);const xHandleEl=refScrollXHandleElem.value;const yHandleEl=refScrollYHandleElem.value;let overflowY=false;let overflowX=false;if(bodyWrapperElem){overflowY=scrollYHeight>bodyWrapperElem.clientHeight;if(yHandleEl){reactData.scrollbarWidth=scrollbarOpts.width||yHandleEl.offsetWidth-yHandleEl.clientWidth||14;}reactData.overflowY=overflowY;overflowX=scrollXWidth>bodyWrapperElem.clientWidth;if(xHandleEl){reactData.scrollbarHeight=scrollbarOpts.height||xHandleEl.offsetHeight-xHandleEl.clientHeight||14;}const headerHeight=headerTableElem?headerTableElem.clientHeight:0;const footerHeight=footerTableElem?footerTableElem.clientHeight:0;internalData.tableHeight=bodyWrapperElem.offsetHeight;internalData.headerHeight=headerHeight;internalData.footerHeight=footerHeight;reactData.overflowX=overflowX;reactData.parentHeight=Math.max(internalData.headerHeight+footerHeight+20,$xeTable.getParentHeight());}if(overflowX){$xeTable.checkScrolling();}};const handleRecalculateLayout=reFull=>{const el=refElem.value;internalData.rceRunTime=Date.now();if(!el||!el.clientWidth){return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();}const varEl=refVarElem.value;if(varEl){const[defEl,mediumEl,smallEl,miniEl]=varEl.children;calcVarRowHeightConfig('default',defEl);calcVarRowHeightConfig('medium',mediumEl);calcVarRowHeightConfig('small',smallEl);calcVarRowHeightConfig('mini',miniEl);}calcCellWidth();autoCellWidth();calcScrollbar();updateStyle();updateRowExpandStyle();return computeScrollLoad().then(()=>{// 初始化时需要在列计算之后再执行优化运算,达到最优显示效果
|
|
10860
|
-
calcCellWidth();if(reFull){autoCellWidth();}calcScrollbar();updateStyle();if(reFull){updateRowOffsetTop();}updateRowExpandStyle();if(reFull){return computeScrollLoad();}});};const handleUpdateRowGroup=groupFields=>{reactData.rowGroupList=groupFields?(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(groupFields)?groupFields:[groupFields]).map(field=>{return{field};}):[];};const handleGroupData=(list,rowGroups)=>{let fullData=list;let treeData=list;if(rowGroups){const
|
|
10901
|
+
calcCellWidth();if(reFull){autoCellWidth();}calcScrollbar();updateStyle();if(reFull){updateRowOffsetTop();}updateRowExpandStyle();if(reFull){return computeScrollLoad();}});};const handleUpdateRowGroup=groupFields=>{reactData.rowGroupList=groupFields?(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(groupFields)?groupFields:[groupFields]).map(field=>{return{field};}):[];};const handleeGroupSummary=aggList=>{const aggregateOpts=computeAggregateOpts.value;const{mapChildrenField}=aggregateOpts;if(mapChildrenField){external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().lastEach(aggList,aggRow=>{let count=0;external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(aggRow[mapChildrenField],row=>{if(row.isAggregate){count+=row.childCount||0;}else{count++;}});aggRow.childCount=count;});if($xeTable.handlePivotTableAggregateData){$xeTable.handlePivotTableAggregateData(aggList);}}};const updateGroupData=()=>{const{aggregateConfig,rowGroupConfig}=props;const{isRowGroupStatus}=reactData;const{tableFullGroupData}=internalData;const aggregateOpts=computeAggregateOpts.value;const{mapChildrenField}=aggregateOpts;if((aggregateConfig||rowGroupConfig)&&isRowGroupStatus){const aggList=[];external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(tableFullGroupData,row=>{if(row.isAggregate){aggList.push(row);}},{children:mapChildrenField});handleeGroupSummary(aggList);}};const handleGroupData=(list,rowGroups)=>{let fullData=list;let treeData=list;if(rowGroups){const aggregateOpts=computeAggregateOpts.value;const{rowField,parentField,childrenField,mapChildrenField}=aggregateOpts;const checkboxOpts=computeCheckboxOpts.value;const{checkField}=checkboxOpts;const indeterminateField=checkboxOpts.indeterminateField||checkboxOpts.halfField;const rgItem=rowGroups[0];if(rgItem&&rowField&&parentField&&childrenField&&mapChildrenField){fullData=[];treeData=[];const groupField=rgItem.field;const groupColumn=$xeTable.getColumnByField(groupField);const groupMaps={};const aggList=[];const rowkey=getRowkey($xeTable);list.forEach(row=>{const cellValue=groupColumn?$xeTable.getCellLabel(row,groupColumn):external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row,groupField);const groupValue=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(cellValue)?'':cellValue;let childList=groupMaps[groupValue];if(!childList){childList=[];groupMaps[groupValue]=childList;}if(row.isAggregate){row.isAggregate=undefined;}childList.push(row);});external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().objectEach(groupMaps,(childList,groupValue)=>{const{fullData:childFullData,treeData:childTreeData}=handleGroupData(childList,rowGroups.slice(1));const aggRow={isAggregate:true,aggData:{},groupContent:groupValue,groupField,childCount:0,[rowField]:getRowUniqueId(),[parentField]:null,[rowkey]:getRowUniqueId(),[childrenField]:childTreeData,[mapChildrenField]:childTreeData};if(checkField){aggRow[checkField]=false;}if(indeterminateField){aggRow[indeterminateField]=false;}aggList.push(aggRow);treeData.push(aggRow);fullData.push(aggRow);if(childFullData.length){fullData.push(...childFullData);}});handleeGroupSummary(aggList);}}return{treeData,fullData};};/**
|
|
10861
10902
|
* 加载表格数据
|
|
10862
10903
|
* @param {Array} datas 数据
|
|
10863
|
-
*/const loadTableData=(datas,isReset)=>{const{keepSource,treeConfig,rowGroupConfig}=props;const{rowGroupList,scrollYLoad:oldScrollYLoad}=reactData;const{scrollYStore,scrollXStore,lastScrollLeft,lastScrollTop}=internalData;const rowOpts=computeRowOpts.value;const treeOpts=computeTreeOpts.value;const expandOpts=computeExpandOpts.value;const{transform}=treeOpts;const childrenField=treeOpts.children||treeOpts.childrenField;let treeData=[];let fullData=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.reactive)(datas?datas.slice(0):[]);// 转为响应式数据
|
|
10864
|
-
if(fullData.length>supportMaxRow){errLog('vxe.error.errMaxRow',[supportMaxRow]);}if(treeConfig&&rowGroupList.length){errLog('vxe.error.noTree',['
|
|
10904
|
+
*/const loadTableData=(datas,isReset)=>{const{keepSource,treeConfig,rowGroupConfig,aggregateConfig}=props;const{rowGroupList,scrollYLoad:oldScrollYLoad}=reactData;const{scrollYStore,scrollXStore,lastScrollLeft,lastScrollTop}=internalData;const rowOpts=computeRowOpts.value;const treeOpts=computeTreeOpts.value;const expandOpts=computeExpandOpts.value;const{transform}=treeOpts;const childrenField=treeOpts.children||treeOpts.childrenField;let treeData=[];let fullData=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.reactive)(datas?datas.slice(0):[]);// 转为响应式数据
|
|
10905
|
+
if(fullData.length>supportMaxRow){errLog('vxe.error.errMaxRow',[supportMaxRow]);}if(treeConfig&&rowGroupList.length){errLog('vxe.error.noTree',['aggregate-config']);return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();}if(rowOpts.drag&&rowGroupList.length){errLog('vxe.error.errConflicts',['row-config.drag','aggregate-config']);return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();}let isRGroup=false;if(treeConfig){if(transform){// 树结构自动转换
|
|
10865
10906
|
if(!treeOpts.rowField){errLog('vxe.error.reqProp',['tree-config.rowField']);}if(!treeOpts.parentField){errLog('vxe.error.reqProp',['tree-config.parentField']);}if(!childrenField){errLog('vxe.error.reqProp',['tree-config.childrenField']);}if(!treeOpts.mapChildrenField){errLog('vxe.error.reqProp',['tree-config.mapChildrenField']);}if(childrenField===treeOpts.mapChildrenField){errLog('vxe.error.errConflicts',['tree-config.childrenField','tree-config.mapChildrenField']);}// fullData.forEach(row => {
|
|
10866
10907
|
// if (row[treeOpts.children] && row[treeOpts.children].length) {
|
|
10867
10908
|
// warnLog('vxe.error.errConflicts', ['tree-config.transform', `row.${treeOpts.children}`])
|
|
10868
10909
|
// }
|
|
10869
10910
|
// })
|
|
10870
|
-
treeData=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toArrayTree(fullData,{key:treeOpts.rowField,parentKey:treeOpts.parentField,children:childrenField,mapChildren:treeOpts.mapChildrenField});fullData=treeData.slice(0);}else{treeData=fullData.slice(0);}}else if(rowGroupConfig&&rowGroupList.length){const groupRest=handleGroupData(fullData,rowGroupList);treeData=groupRest.treeData;fullData=groupRest.fullData;isRGroup=true;}reactData.isRowGroupStatus=isRGroup;scrollYStore.startIndex=0;scrollYStore.endIndex=1;scrollXStore.startIndex=0;scrollXStore.endIndex=1;internalData.cvCacheMaps={};reactData.isRowLoading=true;reactData.scrollVMLoading=false;internalData.treeExpandedMaps={};reactData.treeExpandedFlag++;internalData.rowExpandedMaps={};reactData.rowExpandedFlag++;internalData.insertRowMaps={};reactData.insertRowFlag++;internalData.removeRowMaps={};reactData.removeRowFlag++;const sYLoad=updateScrollYStatus(fullData);reactData.isDragColMove=false;reactData.isDragRowMove=false;// 全量数据
|
|
10911
|
+
treeData=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toArrayTree(fullData,{key:treeOpts.rowField,parentKey:treeOpts.parentField,children:childrenField,mapChildren:treeOpts.mapChildrenField});fullData=treeData.slice(0);}else{treeData=fullData.slice(0);}}else if((aggregateConfig||rowGroupConfig)&&rowGroupList.length){const groupRest=handleGroupData(fullData,rowGroupList);treeData=groupRest.treeData;fullData=groupRest.fullData;isRGroup=true;}reactData.isRowGroupStatus=isRGroup;scrollYStore.startIndex=0;scrollYStore.endIndex=1;scrollXStore.startIndex=0;scrollXStore.endIndex=1;internalData.cvCacheMaps={};reactData.isRowLoading=true;reactData.scrollVMLoading=false;internalData.treeExpandedMaps={};reactData.treeExpandedFlag++;internalData.rowExpandedMaps={};reactData.rowExpandedFlag++;internalData.insertRowMaps={};reactData.insertRowFlag++;internalData.removeRowMaps={};reactData.removeRowFlag++;const sYLoad=updateScrollYStatus(fullData);reactData.isDragColMove=false;reactData.isDragRowMove=false;// 全量数据
|
|
10871
10912
|
internalData.tableFullData=fullData;internalData.tableFullTreeData=isRGroup?[]:treeData;internalData.tableFullGroupData=isRGroup?treeData:[];// 缓存数据
|
|
10872
10913
|
$xeTable.cacheRowMap(isReset);// 原始数据
|
|
10873
10914
|
internalData.tableSynchData=datas;if(isReset){internalData.isResizeCellHeight=false;}// 克隆原数据,用于显示编辑状态,与编辑值做对比
|
|
@@ -10885,7 +10926,7 @@ if(!(props.height||props.maxHeight)){errLog('vxe.error.reqProp',['height | max-h
|
|
|
10885
10926
|
// }
|
|
10886
10927
|
if(props.spanMethod){errLog('vxe.error.scrollErrProp',['table.span-method']);}}handleReserveStatus();$xeTable.checkSelectionStatus();return new Promise(resolve=>{(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(()=>handleRecalculateLayout(false)).then(()=>{calcCellHeight();updateRowOffsetTop();return handleRecalculateLayout(false);}).then(()=>{let targetScrollLeft=lastScrollLeft;let targetScrollTop=lastScrollTop;const virtualXOpts=computeVirtualXOpts.value;const virtualYOpts=computeVirtualYOpts.value;// 是否在更新数据之后自动滚动重置滚动条
|
|
10887
10928
|
if(virtualXOpts.scrollToLeftOnChange){targetScrollLeft=0;}if(virtualYOpts.scrollToTopOnChange){targetScrollTop=0;}reactData.isRowLoading=false;handleRecalculateLayout(false);// 是否变更虚拟滚动
|
|
10888
|
-
if(oldScrollYLoad===sYLoad){restoreScrollLocation($xeTable,targetScrollLeft,targetScrollTop).then(()=>{resolve();});}else{setTimeout(()=>{restoreScrollLocation($xeTable,targetScrollLeft,targetScrollTop).then(()=>{resolve();});});}});});});};/**
|
|
10929
|
+
if(oldScrollYLoad===sYLoad){restoreScrollLocation($xeTable,targetScrollLeft,targetScrollTop).then(()=>{calcCellHeight();updateRowOffsetTop();resolve();});}else{setTimeout(()=>{restoreScrollLocation($xeTable,targetScrollLeft,targetScrollTop).then(()=>{calcCellHeight();updateRowOffsetTop();resolve();});});}});});});};/**
|
|
10889
10930
|
* 处理数据加载默认行为
|
|
10890
10931
|
* 默认执行一次,除非被重置
|
|
10891
10932
|
*/const handleLoadDefaults=()=>{handleDefaultSelectionChecked();handleDefaultRadioChecked();handleDefaultRowExpand();handleDefaultTreeExpand();handleDefaultMergeCells();handleDefaultMergeFooterItems();(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(()=>setTimeout(()=>$xeTable.recalculate()));};/**
|
|
@@ -10914,7 +10955,7 @@ const scrollXLoad=!!virtualXOpts.enabled&&virtualXOpts.gt>-1&&(virtualXOpts.gt==
|
|
|
10914
10955
|
// }
|
|
10915
10956
|
if(props.spanMethod){warnLog('vxe.error.scrollErrProp',['span-method']);}if(props.footerSpanMethod){warnLog('vxe.error.scrollErrProp',['footer-span-method']);}if(isReset){const{visibleSize}=handleVirtualXVisible();scrollXStore.startIndex=0;scrollXStore.endIndex=visibleSize;scrollXStore.visibleSize=visibleSize;scrollXStore.visibleStartIndex=0;scrollXStore.visibleEndIndex=visibleSize;}}// 如果列被显示/隐藏,则清除合并状态
|
|
10916
10957
|
// 如果列被设置为固定,则清除合并状态
|
|
10917
|
-
if(visibleColumn.length!==internalData.visibleColumn.length||!internalData.visibleColumn.every((column,index)=>column===visibleColumn[index])){$xeTable.clearMergeCells();$xeTable.clearMergeFooterItems();}reactData.scrollXLoad=scrollXLoad;visibleColumn.forEach((column,index)=>{const colid=column.id;const colRest=fullColumnIdData[colid];if(colRest){colRest._index=index;}});internalData.visibleColumn=visibleColumn;handleTableColumn();if(isReset){updateColumnOffsetLeft();return $xeTable.updateFooter().then(()=>{return $xeTable.recalculate();}).then(()=>{$xeTable.updateCellAreas();return $xeTable.recalculate();});}return $xeTable.updateFooter();};const initColumnSort=()=>{const{collectColumn}=internalData;collectColumn.forEach((column,index)=>{const sortIndex=index+1;column.sortNumber=sortIndex;column.renderSortNumber=sortIndex;});};const handleColumn=collectColumn=>{const expandOpts=computeExpandOpts.value;internalData.collectColumn=collectColumn;const tableFullColumn=getColumnList(collectColumn);internalData.tableFullColumn=tableFullColumn;reactData.isColLoading=true;reactData.isDragColMove=false;initColumnSort();return Promise.resolve(restoreCustomStorage()).then(()=>{const{scrollXLoad,scrollYLoad,expandColumn}=reactData;cacheColumnMap();parseColumns(true).then(()=>{if(reactData.scrollXLoad){loadScrollXData();}});$xeTable.clearMergeCells();$xeTable.clearMergeFooterItems();$xeTable.handleTableData(true);if((scrollXLoad||scrollYLoad)&&expandColumn&&expandOpts.mode!=='fixed'){warnLog('vxe.error.scrollErrProp',['column.type=expand']);}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(()=>{if($xeToolbar){$xeToolbar.syncUpdate({collectColumn:internalData.collectColumn,$table:$xeTable});}if($xeTable.handleUpdateCustomColumn){$xeTable.handleUpdateCustomColumn();}reactData.isColLoading=false;return $xeTable.recalculate();});});};const updateScrollYStatus=fullData=>{const{treeConfig}=props;const virtualYOpts=computeVirtualYOpts.value;const treeOpts=computeTreeOpts.value;const{transform}=treeOpts;const allList=fullData||internalData.tableFullData;// 如果gt为0,则总是启用
|
|
10958
|
+
if(visibleColumn.length!==internalData.visibleColumn.length||!internalData.visibleColumn.every((column,index)=>column===visibleColumn[index])){$xeTable.clearMergeCells();$xeTable.clearMergeFooterItems();}reactData.scrollXLoad=scrollXLoad;visibleColumn.forEach((column,index)=>{const colid=column.id;const colRest=fullColumnIdData[colid];if(colRest){colRest._index=index;}});internalData.visibleColumn=visibleColumn;handleTableColumn();if(isReset){updateColumnOffsetLeft();return $xeTable.updateFooter().then(()=>{return $xeTable.recalculate();}).then(()=>{$xeTable.updateCellAreas();return $xeTable.recalculate();});}return $xeTable.updateFooter();};const initColumnSort=()=>{const{collectColumn}=internalData;collectColumn.forEach((column,index)=>{const sortIndex=index+1;column.sortNumber=sortIndex;column.renderSortNumber=sortIndex;});};const handleColumn=collectColumn=>{const expandOpts=computeExpandOpts.value;internalData.collectColumn=collectColumn;const tableFullColumn=getColumnList(collectColumn);internalData.tableFullColumn=tableFullColumn;reactData.isColLoading=true;reactData.isDragColMove=false;initColumnSort();return Promise.resolve(restoreCustomStorage()).then(()=>{const{scrollXLoad,scrollYLoad,expandColumn}=reactData;cacheColumnMap();parseColumns(true).then(()=>{if(reactData.scrollXLoad){loadScrollXData();}});$xeTable.clearMergeCells();$xeTable.clearMergeFooterItems();$xeTable.handleTableData(true);$xeTable.handleAggregateSummaryData();if((scrollXLoad||scrollYLoad)&&expandColumn&&expandOpts.mode!=='fixed'){warnLog('vxe.error.scrollErrProp',['column.type=expand']);}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(()=>{if($xeToolbar){$xeToolbar.syncUpdate({collectColumn:internalData.collectColumn,$table:$xeTable});}if($xeTable.handleUpdateCustomColumn){$xeTable.handleUpdateCustomColumn();}reactData.isColLoading=false;return $xeTable.recalculate();});});};const updateScrollYStatus=fullData=>{const{treeConfig}=props;const virtualYOpts=computeVirtualYOpts.value;const treeOpts=computeTreeOpts.value;const{transform}=treeOpts;const allList=fullData||internalData.tableFullData;// 如果gt为0,则总是启用
|
|
10918
10959
|
const scrollYLoad=(transform||!treeConfig)&&!!virtualYOpts.enabled&&virtualYOpts.gt>-1&&(virtualYOpts.gt===0||virtualYOpts.gt<allList.length);reactData.scrollYLoad=scrollYLoad;return scrollYLoad;};/**
|
|
10919
10960
|
* 展开与收起树节点
|
|
10920
10961
|
* @param rows
|
|
@@ -10932,7 +10973,7 @@ if(isLoad){result.push(handleAsyncTreeExpandChilds(row));}else{if(row[childrenFi
|
|
|
10932
10973
|
* @param rows
|
|
10933
10974
|
* @param expanded
|
|
10934
10975
|
* @returns
|
|
10935
|
-
*/const handleRowGroupBaseExpand=(rows,expanded)=>{const{fullAllDataRowIdData,tableFullGroupData,rowGroupExpandedMaps}=internalData;const
|
|
10976
|
+
*/const handleRowGroupBaseExpand=(rows,expanded)=>{const{fullAllDataRowIdData,tableFullGroupData,rowGroupExpandedMaps}=internalData;const aggregateOpts=computeAggregateOpts.value;const{mapChildrenField,accordion}=aggregateOpts;const{handleGetRowId}=createHandleGetRowId($xeTable);let validRows=rows;if(mapChildrenField){if(accordion){validRows=validRows.length?[validRows[validRows.length-1]]:[];// 同一级只能展开一个
|
|
10936
10977
|
const matchObj=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findTree(tableFullGroupData,item=>getRowid($xeTable,item)===getRowid($xeTable,validRows[0]),{children:mapChildrenField});if(matchObj){matchObj.items.forEach(item=>{const rowid=handleGetRowId(item);if(rowGroupExpandedMaps[rowid]){delete rowGroupExpandedMaps[rowid];}});}}if(expanded){validRows.forEach(row=>{const rowid=handleGetRowId(row);if(!rowGroupExpandedMaps[rowid]){const rowRest=fullAllDataRowIdData[rowid];if(rowRest){if(row[mapChildrenField]&&row[mapChildrenField].length){rowGroupExpandedMaps[rowid]=row;}}}});}else{validRows.forEach(item=>{const rowid=handleGetRowId(item);if(rowGroupExpandedMaps[rowid]){delete rowGroupExpandedMaps[rowid];}});}}reactData.rowGroupExpandedFlag++;return $xeTable.recalculate();};/**
|
|
10937
10978
|
* 行分组的展开与收起
|
|
10938
10979
|
* @param rows
|
|
@@ -11192,7 +11233,7 @@ rowExpandedMaps={};internalData.rowExpandedMaps=rowExpandedMaps;rows=rows.slice(
|
|
|
11192
11233
|
*/isRowExpandByRow(row){const{rowExpandedFlag}=reactData;const{rowExpandedMaps}=internalData;const rowid=getRowid($xeTable,row);return!!rowExpandedFlag&&!!rowExpandedMaps[rowid];},isExpandByRow(row){// 已废弃
|
|
11193
11234
|
warnLog('vxe.error.delFunc',['isExpandByRow','isRowExpandByRow']);return tableMethods.isRowExpandByRow(row);},/**
|
|
11194
11235
|
* 手动清空展开行状态,数据会恢复成未展开的状态
|
|
11195
|
-
*/clearRowExpand(){const{tableFullData}=internalData;const expandOpts=computeExpandOpts.value;const{reserve}=expandOpts;const expList=$xeTable.getRowExpandRecords();internalData.rowExpandedMaps={};reactData.rowExpandedFlag++;if(reserve){tableFullData.forEach(row=>handleRowExpandReserve(row,false));}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(()=>{if(expList.length){return $xeTable.recalculate(true);}}).then(()=>{updateRowOffsetTop();updateRowExpandStyle();handleRowExpandScroll();return $xeTable.updateCellAreas();});},clearRowExpandReserve(){internalData.rowExpandedReserveRowMap={};return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();},getRowExpandRecords(){const rest=[];external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(internalData.rowExpandedMaps,item=>{if(item){rest.push(item);}});return rest;},setRowGroups(fieldOrColumns){const{rowGroupConfig}=props;if(!rowGroupConfig){errLog('vxe.error.reqProp',['
|
|
11236
|
+
*/clearRowExpand(){const{tableFullData}=internalData;const expandOpts=computeExpandOpts.value;const{reserve}=expandOpts;const expList=$xeTable.getRowExpandRecords();internalData.rowExpandedMaps={};reactData.rowExpandedFlag++;if(reserve){tableFullData.forEach(row=>handleRowExpandReserve(row,false));}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(()=>{if(expList.length){return $xeTable.recalculate(true);}}).then(()=>{updateRowOffsetTop();updateRowExpandStyle();handleRowExpandScroll();return $xeTable.updateCellAreas();});},clearRowExpandReserve(){internalData.rowExpandedReserveRowMap={};return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();},getRowExpandRecords(){const rest=[];external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(internalData.rowExpandedMaps,item=>{if(item){rest.push(item);}});return rest;},setRowGroups(fieldOrColumns){const{aggregateConfig,rowGroupConfig}=props;if(!(aggregateConfig||rowGroupConfig)){errLog('vxe.error.reqProp',['aggregate-config']);return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();}if(fieldOrColumns){handleUpdateRowGroup((external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(fieldOrColumns)?fieldOrColumns:[fieldOrColumns]).map(fieldOrColumn=>{return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(fieldOrColumn)?fieldOrColumn:fieldOrColumn.field;}));return loadTableData(internalData.tableSynchData,true);}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();},clearRowGroups(){const{aggregateConfig,rowGroupConfig}=props;if(!(aggregateConfig||rowGroupConfig)){errLog('vxe.error.reqProp',['aggregate-config']);return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();}handleUpdateRowGroup([]);return loadTableData(internalData.tableSynchData,true);},isRowGroupRecord(row){warnLog('vxe.error.delFunc',['isRowGroupRecord','isAggregateRecord']);return $xeTable.isAggregateRecord(row);},isRowGroupExpandByRow(row){warnLog('vxe.error.delFunc',['isRowGroupExpandByRow','isAggregateExpandByRow']);return $xeTable.isAggregateExpandByRow(row);},isAggregateRecord(row){const{isRowGroupStatus}=reactData;return isRowGroupStatus&&row.isAggregate;},isAggregateExpandByRow(row){const{rowGroupExpandedFlag}=reactData;const{rowGroupExpandedMaps}=internalData;return!!rowGroupExpandedFlag&&!!rowGroupExpandedMaps[getRowid($xeTable,row)];},setRowGroupExpand(rows,expanded){if(rows){if(!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(rows)){rows=[rows];}return handleRowGroupVirtualExpand(rows,expanded);}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();},setAllRowGroupExpand(expanded){const{tableFullGroupData}=internalData;const aggregateOpts=computeAggregateOpts.value;const{mapChildrenField}=aggregateOpts;const rgExpandedMaps={};if(expanded&&mapChildrenField){external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(tableFullGroupData,row=>{if(row[mapChildrenField]&&row[mapChildrenField].length){rgExpandedMaps[getRowid($xeTable,row)]=row;}},{children:mapChildrenField});}internalData.rowGroupExpandedMaps=rgExpandedMaps;handleVirtualTreeToList();reactData.rowGroupExpandedFlag++;return $xeTable.handleTableData();},clearRowGroupExpand(){internalData.rowGroupExpandedMaps={};handleVirtualTreeToList();reactData.rowGroupExpandedFlag++;return $xeTable.handleTableData();},getTreeExpandRecords(){const rest=[];external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(internalData.treeExpandedMaps,item=>{if(item){rest.push(item);}});return rest;},/**
|
|
11196
11237
|
* 判断树节点是否懒加载完成
|
|
11197
11238
|
* @param {Row} row 行对象
|
|
11198
11239
|
*/isTreeExpandLoaded(row){const{fullAllDataRowIdData}=internalData;const rowRest=fullAllDataRowIdData[getRowid($xeTable,row)];return rowRest&&!!rowRest.treeLoaded;},clearTreeExpandLoaded(rows){const{fullAllDataRowIdData,treeExpandedMaps}=internalData;const treeOpts=computeTreeOpts.value;const{transform}=treeOpts;if(rows){if(!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(rows)){rows=[rows];}rows.forEach(row=>{const rowid=getRowid($xeTable,row);const rowRest=fullAllDataRowIdData[rowid];if(rowRest){rowRest.treeLoaded=false;if(treeExpandedMaps[rowid]){delete treeExpandedMaps[rowid];}}});}else{external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(fullAllDataRowIdData,rowRest=>{rowRest.treeLoaded=false;});}internalData.treeExpandedMaps={};if(transform){handleVirtualTreeToList();$xeTable.handleTableData();}reactData.treeExpandedFlag++;return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();},/**
|
|
@@ -11345,7 +11386,7 @@ updateAfterFullData();// 如果为虚拟树,将树结构拍平
|
|
|
11345
11386
|
fullList=handleVirtualTreeToList();}const tableData=scrollYLoad?fullList.slice(scrollYStore.startIndex,scrollYStore.endIndex):fullList.slice(0);const visibleDataRowIdMaps={};tableData.forEach((row,$index)=>{const rowid=getRowid($xeTable,row);const rest=fullDataRowIdData[rowid];if(rest){rest.$index=$index;}visibleDataRowIdMaps[rowid]=row;});reactData.tableData=tableData;internalData.visibleDataRowIdData=visibleDataRowIdMaps;return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();},/**
|
|
11346
11387
|
* 更新数据行的 Map
|
|
11347
11388
|
*/cacheRowMap(isReset){const{treeConfig}=props;const{isRowGroupStatus}=reactData;const{fullAllDataRowIdData,tableFullData,tableFullTreeData,tableFullGroupData,treeExpandedMaps}=internalData;const fullAllDataRowIdMaps=isReset?{}:{...fullAllDataRowIdData};// 存在已删除数据
|
|
11348
|
-
const fullDataRowIdMaps={};const{handleUpdateRowId}=createHandleUpdateRowId($xeTable);const handleRowCache=(row,index,items,currIndex,parentRow,rowid,level,seq)=>{let rowRest=fullAllDataRowIdMaps[rowid];if(!rowRest){rowRest={row,rowid,seq,index:-1,_index:-1,$index:-1,treeIndex:index,items,parent:parentRow,level,height:0,resizeHeight:0,oTop:0,expandHeight:0};fullDataRowIdMaps[rowid]=rowRest;fullAllDataRowIdMaps[rowid]=rowRest;}rowRest.treeLoaded=false;rowRest.expandLoaded=false;rowRest.row=row;rowRest.items=items;rowRest.parent=parentRow;rowRest.level=level;rowRest.index=currIndex;rowRest.treeIndex=index;fullDataRowIdMaps[rowid]=rowRest;fullAllDataRowIdMaps[rowid]=rowRest;};if(treeConfig){const treeOpts=computeTreeOpts.value;const{lazy}=treeOpts;const childrenField=treeOpts.children||treeOpts.childrenField;const hasChildField=treeOpts.hasChild||treeOpts.hasChildField;external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(tableFullTreeData,(row,index,items,path,parentRow,nodes)=>{const rowid=handleUpdateRowId(row);if(treeConfig&&lazy){if(row[hasChildField]&&row[childrenField]===undefined){row[childrenField]=null;}if(treeExpandedMaps[rowid]){if(!row[childrenField]||!row[childrenField].length){delete treeExpandedMaps[rowid];}}}handleRowCache(row,index,items,parentRow?-1:index,parentRow,rowid,nodes.length-1,toTreePathSeq(path));},{children:childrenField});}else if(isRowGroupStatus){const
|
|
11389
|
+
const fullDataRowIdMaps={};const{handleUpdateRowId}=createHandleUpdateRowId($xeTable);const handleRowCache=(row,index,items,currIndex,parentRow,rowid,level,seq)=>{let rowRest=fullAllDataRowIdMaps[rowid];if(!rowRest){rowRest={row,rowid,seq,index:-1,_index:-1,$index:-1,treeIndex:index,items,parent:parentRow,level,height:0,resizeHeight:0,oTop:0,expandHeight:0};fullDataRowIdMaps[rowid]=rowRest;fullAllDataRowIdMaps[rowid]=rowRest;}rowRest.treeLoaded=false;rowRest.expandLoaded=false;rowRest.row=row;rowRest.items=items;rowRest.parent=parentRow;rowRest.level=level;rowRest.index=currIndex;rowRest.treeIndex=index;fullDataRowIdMaps[rowid]=rowRest;fullAllDataRowIdMaps[rowid]=rowRest;};if(treeConfig){const treeOpts=computeTreeOpts.value;const{lazy}=treeOpts;const childrenField=treeOpts.children||treeOpts.childrenField;const hasChildField=treeOpts.hasChild||treeOpts.hasChildField;external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(tableFullTreeData,(row,index,items,path,parentRow,nodes)=>{const rowid=handleUpdateRowId(row);if(treeConfig&&lazy){if(row[hasChildField]&&row[childrenField]===undefined){row[childrenField]=null;}if(treeExpandedMaps[rowid]){if(!row[childrenField]||!row[childrenField].length){delete treeExpandedMaps[rowid];}}}handleRowCache(row,index,items,parentRow?-1:index,parentRow,rowid,nodes.length-1,toTreePathSeq(path));},{children:childrenField});}else if(isRowGroupStatus){const aggregateOpts=computeAggregateOpts.value;const{mapChildrenField}=aggregateOpts;external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(tableFullGroupData,(row,index,items,path,parentRow,nodes)=>{const rowid=handleUpdateRowId(row);handleRowCache(row,index,items,parentRow?-1:index,parentRow,rowid,nodes.length-1,toTreePathSeq(path));},{children:mapChildrenField});}else{tableFullData.forEach((row,index,items)=>{handleRowCache(row,index,items,index,null,handleUpdateRowId(row),0,index+1);});}internalData.fullDataRowIdData=fullDataRowIdMaps;internalData.fullAllDataRowIdData=fullAllDataRowIdMaps;reactData.treeExpandedFlag++;},cacheSourceMap(fullData){const{treeConfig}=props;const treeOpts=computeTreeOpts.value;const sourceData=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().clone(fullData,true);const{handleUpdateRowId}=createHandleUpdateRowId($xeTable);const sourceRowIdData={};const handleSourceRow=row=>{const rowid=handleUpdateRowId(row);sourceRowIdData[rowid]=row;};// 源数据缓存
|
|
11349
11390
|
if(treeConfig){const childrenField=treeOpts.children||treeOpts.childrenField;external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(sourceData,handleSourceRow,{children:treeOpts.transform?treeOpts.mapChildrenField:childrenField});}else{sourceData.forEach(handleSourceRow);}internalData.sourceDataRowIdData=sourceRowIdData;internalData.tableSourceData=sourceData;},/**
|
|
11350
11391
|
* 指定列宽的列进行拆分
|
|
11351
11392
|
*/analyColumnWidth(){const{tableFullColumn}=internalData;const columnOpts=computeColumnOpts.value;const{width:defaultWidth,minWidth:defaultMinWidth}=columnOpts;const resizeList=[];const pxList=[];const pxMinList=[];const autoMinList=[];const scaleList=[];const scaleMinList=[];const autoList=[];const remainList=[];tableFullColumn.forEach(column=>{if(defaultWidth&&!column.width){column.width=defaultWidth;}if(defaultMinWidth&&!column.minWidth){column.minWidth=defaultMinWidth;}if(column.visible){if(column.resizeWidth){resizeList.push(column);}else if(column.width==='auto'){autoList.push(column);}else if(isPx(column.width)){pxList.push(column);}else if(isScale(column.width)){scaleList.push(column);}else if(isPx(column.minWidth)){pxMinList.push(column);}else if(column.minWidth==='auto'){autoMinList.push(column);}else if(isScale(column.minWidth)){scaleMinList.push(column);}else{remainList.push(column);}}});Object.assign(reactData.columnStore,{resizeList,pxList,pxMinList,autoMinList,scaleList,scaleMinList,autoList,remainList});},handleColResizeMousedownEvent(evnt,fixedType,params){evnt.stopPropagation();evnt.preventDefault();const{column}=params;const{columnStore,overflowX,scrollbarHeight}=reactData;const{elemStore,visibleColumn}=internalData;const{leftList,rightList}=columnStore;const resizableOpts=computeResizableOpts.value;const osbHeight=overflowX?scrollbarHeight:0;const tableEl=refElem.value;const leftContainerElem=refLeftContainer.value;const rightContainerElem=refRightContainer.value;const resizeBarElem=refColResizeBar.value;if(!resizeBarElem){return;}const isLeftFixed=fixedType==='left';const isRightFixed=fixedType==='right';const resizeTipElem=resizeBarElem.firstElementChild;const scrollbarXToTop=computeScrollbarXToTop.value;const{clientX:dragClientX}=evnt;const dragBtnElem=evnt.target;let resizeColumn=column;if(column.children&&column.children.length){external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(column.children,childColumn=>{resizeColumn=childColumn;});}const cell=dragBtnElem.parentNode;const cellParams=Object.assign(params,{cell});let dragLeft=0;const bodyScrollElem=getRefElem(elemStore['main-body-scroll']);if(!bodyScrollElem){return;}const tableRect=tableEl.getBoundingClientRect();const rightContainerRect=rightContainerElem?rightContainerElem.getBoundingClientRect():null;const cellRect=cell.getBoundingClientRect();const dragBtnRect=dragBtnElem.getBoundingClientRect();const dragBtnWidth=dragBtnElem.clientWidth;const dragBtnOffsetWidth=Math.floor(dragBtnWidth/2);const dragPosLeft=dragBtnRect.x-tableRect.x+dragBtnOffsetWidth;const minInterval=getColReMinWidth(cellParams)-dragBtnOffsetWidth;// 列之间的最小间距
|
|
@@ -11354,8 +11395,8 @@ const updateEvent=evnt=>{evnt.stopPropagation();evnt.preventDefault();const tabl
|
|
|
11354
11395
|
const updateEvent=evnt=>{evnt.stopPropagation();evnt.preventDefault();const rtWidth=tableEl.clientWidth-osbWidth;const tableHeight=tableEl.clientHeight-osbHeight;let dragTop=evnt.clientY-tableRect.y-targetOffsetY;if(dragTop<minTop){dragTop=minTop;}else{resizeHeight=Math.max(cellMinHeight,currCellHeight+evnt.clientY-dragClientY);}resizeBarElem.style.left=`${scrollbarYToLeft?osbWidth:0}px`;resizeBarElem.style.top=`${dragTop}px`;resizeBarElem.style.width=`${rtWidth}px`;if(resizableOpts.showDragTip&&resizeTipElem){resizeTipElem.textContent=table_getI18n('vxe.table.resizeRowTip',[resizeHeight]);const resizeTipWidth=resizeTipElem.clientWidth;const resizeTipHeight=resizeTipElem.clientHeight;let resizeBarLeft=Math.max(2,evnt.clientX-tableRect.x);let resizeBarTop=0;if(resizeBarLeft+resizeTipWidth>=rtWidth-2){resizeBarLeft=rtWidth-resizeTipWidth-2;}if(dragTop+resizeTipHeight>=tableHeight){resizeBarTop=tableHeight-(dragTop+resizeTipHeight);}resizeTipElem.style.left=`${resizeBarLeft}px`;resizeTipElem.style.top=`${resizeBarTop}px`;}reactData.isDragResize=true;};reactData.isDragResize=true;addClass(tableEl,'row-drag--resize');resizeBarElem.style.display='block';document.onmousemove=updateEvent;document.onmouseup=function(evnt){document.onmousemove=null;document.onmouseup=null;resizeBarElem.style.display='none';internalData._lastResizeTime=Date.now();setTimeout(()=>{reactData.isDragResize=false;},50);if(resizeHeight!==currCellHeight){const resizeParams={...params,resizeHeight,resizeRow:row};internalData.isResizeCellHeight=true;if($xeTable.handleRowResizeCellAreaEvent){$xeTable.handleRowResizeCellAreaEvent(evnt,resizeParams);}else{rowRest.resizeHeight=resizeHeight;handleUpdateRowResize(evnt,resizeParams);updateRowOffsetTop();}}removeClass(tableEl,'row-drag--resize');};updateEvent(evnt);},handleRowResizeDblclickEvent(evnt,params){const resizableOpts=computeResizableOpts.value;const{isDblclickAutoHeight}=resizableOpts;const el=refElem.value;if(isDblclickAutoHeight&&el){evnt.stopPropagation();evnt.preventDefault();const{editStore}=reactData;const{fullAllDataRowIdData}=internalData;const{actived}=editStore;const{row}=params;const rowid=getRowid($xeTable,row);const rowRest=fullAllDataRowIdData[rowid];if(!rowRest){return;}const handleRsHeight=()=>{el.setAttribute('data-calc-row','Y');const resizeHeight=calcCellAutoHeight(rowRest,el);el.removeAttribute('data-calc-row');const resizeParams={...params,resizeHeight,resizeRow:row};reactData.isDragResize=false;internalData._lastResizeTime=Date.now();if($xeTable.handleRowResizeDblclickCellAreaEvent){$xeTable.handleRowResizeDblclickCellAreaEvent(evnt,resizeParams);}else{rowRest.resizeHeight=resizeHeight;handleUpdateRowResize(evnt,resizeParams);}};if(actived.row||actived.column){$xeTable.clearEdit().then(handleRsHeight);}else{handleRsHeight();}}},saveCustomStore(type){const{customConfig}=props;const tableId=computeTableId.value;const customOpts=computeCustomOpts.value;const{updateStore,storage}=customOpts;const isAllCustom=storage===true;const storageOpts=isAllCustom?{}:Object.assign({},storage||{});const isCustomResizable=isAllCustom||storageOpts.resizable;const isCustomVisible=isAllCustom||storageOpts.visible;const isCustomFixed=isAllCustom||storageOpts.fixed;const isCustomSort=isAllCustom||storageOpts.sort;if(type!=='reset'){// fix:修复拖动列宽,重置按钮无法点击的问题
|
|
11355
11396
|
reactData.isCustomStatus=true;}if((customConfig?isEnableConf(customOpts):customOpts.enabled)&&(isCustomResizable||isCustomVisible||isCustomFixed||isCustomSort)){if(!tableId){errLog('vxe.error.reqProp',['id']);return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();}const storeData=type==='reset'?{resizableData:{},sortData:{},visibleData:{},fixedData:{}}:tableMethods.getCustomStoreData();if(updateStore){return updateStore({$table:$xeTable,id:tableId,type,storeData});}else{setCustomStorageMap(tableId,type==='reset'?null:storeData);}}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();},handleCustom(){const{mouseConfig}=props;if(mouseConfig){if($xeTable.clearSelected){$xeTable.clearSelected();}if($xeTable.clearCellAreas){$xeTable.clearCellAreas();$xeTable.clearCopyCellArea();}}tablePrivateMethods.analyColumnWidth();return tableMethods.refreshColumn(true);},handleUpdateDataQueue(){reactData.upDataFlag++;},handleRefreshColumnQueue(){reactData.reColumnFlag++;},preventEvent(evnt,type,args,next,end){let evntList=table_interceptor.get(type);// 兼容老版本
|
|
11356
11397
|
if(!evntList.length&&type==='event.clearEdit'){evntList=table_interceptor.get('event.clearActived');if(evntList.length){warnLog('vxe.error.delEvent',['event.clearActived','event.clearEdit']);}}// 兼容老版本
|
|
11357
|
-
let rest=null;let isStop=false;for(let i=0;i<evntList.length;i++){const func=evntList[i];const fnRest=func(Object.assign({$grid:$xeGrid,$table:$xeTable,$event:evnt},args));if(fnRest===false){isStop=true;break;}else if(fnRest&&fnRest.status===false){rest=fnRest.result;isStop=true;break;}}if(!isStop){if(next){rest=next();}}if(end){end();}return rest;},updateCheckboxStatus(){const{treeConfig}=props;const{isRowGroupStatus}=reactData;const{afterTreeFullData,afterGroupFullData,selectCheckboxMaps,treeIndeterminateRowMaps}=internalData;const
|
|
11358
|
-
const mapChildrenField=
|
|
11398
|
+
let rest=null;let isStop=false;for(let i=0;i<evntList.length;i++){const func=evntList[i];const fnRest=func(Object.assign({$grid:$xeGrid,$table:$xeTable,$event:evnt},args));if(fnRest===false){isStop=true;break;}else if(fnRest&&fnRest.status===false){rest=fnRest.result;isStop=true;break;}}if(!isStop){if(next){rest=next();}}if(end){end();}return rest;},updateCheckboxStatus(){const{treeConfig}=props;const{isRowGroupStatus}=reactData;const{afterTreeFullData,afterGroupFullData,selectCheckboxMaps,treeIndeterminateRowMaps}=internalData;const aggregateOpts=computeAggregateOpts.value;const treeOpts=computeTreeOpts.value;const childrenField=treeOpts.children||treeOpts.childrenField;const checkboxOpts=computeCheckboxOpts.value;const{checkField,checkStrictly,checkMethod}=checkboxOpts;if(checkStrictly){return;}if(isRowGroupStatus||treeConfig){const{handleGetRowId}=createHandleGetRowId($xeTable);const childRowMaps={};const childRowList=[];if(isRowGroupStatus){// 行分组
|
|
11399
|
+
const mapChildrenField=aggregateOpts.mapChildrenField;if(mapChildrenField){external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(afterGroupFullData,row=>{const rowid=handleGetRowId(row);const childList=row[mapChildrenField];if(childList&&childList.length&&!childRowMaps[rowid]){childRowMaps[rowid]=1;childRowList.unshift([row,rowid,childList]);}},{children:mapChildrenField});}}else if(treeConfig){// 树结构
|
|
11359
11400
|
const{transform,mapChildrenField}=treeOpts;external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(afterTreeFullData,row=>{const rowid=handleGetRowId(row);const childList=row[transform?mapChildrenField:childrenField];if(childList&&childList.length&&!childRowMaps[rowid]){childRowMaps[rowid]=1;childRowList.unshift([row,rowid,childList]);}},{children:transform?mapChildrenField:childrenField});}childRowList.forEach(vals=>{const row=vals[0];const rowid=vals[1];const childList=vals[2];let sLen=0;// 已选
|
|
11360
11401
|
let hLen=0;// 半选
|
|
11361
11402
|
let vLen=0;// 有效行
|
|
@@ -11366,20 +11407,20 @@ const rootList=treeConfig?afterTreeFullData:isRowGroupStatus?afterGroupFullData:
|
|
|
11366
11407
|
if(!isSelected&&!halfSelect&&showReserveStatus){halfSelect=!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isEmpty(checkboxReserveRowMap);}reactData.isAllSelected=isSelected;reactData.isIndeterminate=halfSelect;},checkSelectionStatus(){$xeTable.updateCheckboxStatus();$xeTable.updateAllCheckboxStatus();},/**
|
|
11367
11408
|
* 切换选中
|
|
11368
11409
|
* 多选,行选中事件
|
|
11369
|
-
*/handleBatchSelectRows(rows,checked,isForce){const{treeConfig}=props;const{isRowGroupStatus}=reactData;const{selectCheckboxMaps}=internalData;const
|
|
11410
|
+
*/handleBatchSelectRows(rows,checked,isForce){const{treeConfig}=props;const{isRowGroupStatus}=reactData;const{selectCheckboxMaps}=internalData;const aggregateOpts=computeAggregateOpts.value;const treeOpts=computeTreeOpts.value;const{transform,mapChildrenField}=treeOpts;const childrenField=treeOpts.children||treeOpts.childrenField;const checkboxOpts=computeCheckboxOpts.value;const{checkField,checkStrictly,checkMethod}=checkboxOpts;const{handleGetRowId}=createHandleGetRowId($xeTable);// indeterminateField 仅支持读取
|
|
11370
11411
|
const indeterminateField=checkboxOpts.indeterminateField||checkboxOpts.halfField;if(checkField){// 树结构
|
|
11371
11412
|
if((treeConfig||isRowGroupStatus)&&!checkStrictly){// 更新子节点状态
|
|
11372
11413
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(rows,row=>{if(isForce||!checkMethod||checkMethod({$table:$xeTable,row})){external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(row,checkField,checked);if(indeterminateField){external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(row,indeterminateField,false);}handleCheckboxReserveRow(row,checked);}},{children:transform?mapChildrenField:childrenField});reactData.updateCheckboxFlag++;return;}// 列表
|
|
11373
11414
|
rows.forEach(row=>{if(isForce||!checkMethod||checkMethod({$table:$xeTable,row})){external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(row,checkField,checked);handleCheckboxReserveRow(row,checked);}});reactData.updateCheckboxFlag++;return;}// 树结构
|
|
11374
11415
|
if(!checkStrictly){if(isRowGroupStatus){// 更新行分组节点状态
|
|
11375
|
-
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(rows,row=>{const rowid=handleGetRowId(row);if(isForce||!checkMethod||checkMethod({$table:$xeTable,row})){if(checked){selectCheckboxMaps[rowid]=row;}else{if(selectCheckboxMaps[rowid]){delete selectCheckboxMaps[rowid];}}handleCheckboxReserveRow(row,checked);}},{children:
|
|
11416
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(rows,row=>{const rowid=handleGetRowId(row);if(isForce||!checkMethod||checkMethod({$table:$xeTable,row})){if(checked){selectCheckboxMaps[rowid]=row;}else{if(selectCheckboxMaps[rowid]){delete selectCheckboxMaps[rowid];}}handleCheckboxReserveRow(row,checked);}},{children:aggregateOpts.mapChildrenField});reactData.updateCheckboxFlag++;return;}else if(treeConfig){// 更新子节点状态
|
|
11376
11417
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(rows,row=>{const rowid=handleGetRowId(row);if(isForce||!checkMethod||checkMethod({$table:$xeTable,row})){if(checked){selectCheckboxMaps[rowid]=row;}else{if(selectCheckboxMaps[rowid]){delete selectCheckboxMaps[rowid];}}handleCheckboxReserveRow(row,checked);}},{children:transform?mapChildrenField:childrenField});reactData.updateCheckboxFlag++;return;}}// 列表
|
|
11377
11418
|
rows.forEach(row=>{const rowid=handleGetRowId(row);if(isForce||!checkMethod||checkMethod({$table:$xeTable,row})){if(checked){if(!selectCheckboxMaps[rowid]){selectCheckboxMaps[rowid]=row;}}else{if(selectCheckboxMaps[rowid]){delete selectCheckboxMaps[rowid];}}handleCheckboxReserveRow(row,checked);reactData.updateCheckboxFlag++;}});},/**
|
|
11378
11419
|
* 即将移除
|
|
11379
11420
|
* @deprecated
|
|
11380
11421
|
*/handleSelectRow({row},checked,isForce){$xeTable.handleBatchSelectRows([row],checked,isForce);},/**
|
|
11381
11422
|
* 处理合并
|
|
11382
|
-
*/handleUpdateBodyMerge(){const{mergeBodyList}=internalData;internalData.mergeBodyCellMaps=buildMergeData(mergeBodyList);reactData.mergeBodyFlag++;},handleUpdateFooterMerge(){const{mergeFooterList}=internalData;internalData.mergeFooterCellMaps=buildMergeData(mergeFooterList);reactData.mergeFootFlag++;},triggerHeaderTitleEvent(evnt,iconParams,params){const tipContent=iconParams.content||iconParams.message;if(tipContent){const{tooltipStore}=reactData;const{column}=params;const content=getFuncText(tipContent);handleTargetEnterEvent(true);tooltipStore.row=null;tooltipStore.column=column;tooltipStore.visible=true;tooltipStore.currOpts=iconParams;(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(()=>{const $tooltip=refTooltip.value;if($tooltip&&$tooltip.open){$tooltip.open(evnt.currentTarget,content);}});}},/**
|
|
11423
|
+
*/handleUpdateBodyMerge(){const{mergeBodyList}=internalData;internalData.mergeBodyCellMaps=buildMergeData(mergeBodyList);reactData.mergeBodyFlag++;},handleUpdateFooterMerge(){const{mergeFooterList}=internalData;internalData.mergeFooterCellMaps=buildMergeData(mergeFooterList);reactData.mergeFootFlag++;},handleAggregateSummaryData(){return updateGroupData();},triggerHeaderTitleEvent(evnt,iconParams,params){const tipContent=iconParams.content||iconParams.message;if(tipContent){const{tooltipStore}=reactData;const{column}=params;const content=getFuncText(tipContent);handleTargetEnterEvent(true);tooltipStore.row=null;tooltipStore.column=column;tooltipStore.visible=true;tooltipStore.currOpts=iconParams;(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(()=>{const $tooltip=refTooltip.value;if($tooltip&&$tooltip.open){$tooltip.open(evnt.currentTarget,content);}});}},/**
|
|
11383
11424
|
* 触发表头 tooltip 事件
|
|
11384
11425
|
*/triggerHeaderTooltipEvent(evnt,params){const{tooltipStore}=reactData;const{column}=params;handleTargetEnterEvent(true);const titleElem=evnt.currentTarget;if(!titleElem){return;}const cWrapperEl=titleElem.parentElement;if(!cWrapperEl){return;}const cellEl=cWrapperEl.parentElement;if(!cellEl){return;}const thEl=cellEl.parentElement;if(!thEl){return;}if(tooltipStore.column!==column||!tooltipStore.visible){const ctEl=thEl.querySelector('.vxe-cell--title');handleTooltip(evnt,thEl,(hasClass(thEl,'col--ellipsis')?ctEl:cWrapperEl)||cWrapperEl,ctEl||cellEl,params);}},/**
|
|
11385
11426
|
* 触发单元格 tooltip 事件
|
|
@@ -11392,10 +11433,10 @@ if(actived.row===row&&actived.column===column){return;}}if(tooltipStore.column!=
|
|
|
11392
11433
|
* 列点击事件
|
|
11393
11434
|
* 如果是单击模式,则激活为编辑状态
|
|
11394
11435
|
* 如果是双击模式,则单击后选中状态
|
|
11395
|
-
*/triggerCellClickEvent(evnt,params){const{highlightCurrentRow,highlightCurrentColumn,editConfig}=props;const{editStore,isDragResize}=reactData;if(isDragResize){return;}const expandOpts=computeExpandOpts.value;const editOpts=computeEditOpts.value;const treeOpts=computeTreeOpts.value;const radioOpts=computeRadioOpts.value;const checkboxOpts=computeCheckboxOpts.value;const keyboardOpts=computeKeyboardOpts.value;const
|
|
11436
|
+
*/triggerCellClickEvent(evnt,params){const{highlightCurrentRow,highlightCurrentColumn,editConfig}=props;const{editStore,isDragResize}=reactData;if(isDragResize){return;}const expandOpts=computeExpandOpts.value;const editOpts=computeEditOpts.value;const treeOpts=computeTreeOpts.value;const radioOpts=computeRadioOpts.value;const checkboxOpts=computeCheckboxOpts.value;const keyboardOpts=computeKeyboardOpts.value;const aggregateOpts=computeAggregateOpts.value;const rowOpts=computeRowOpts.value;const columnOpts=computeColumnOpts.value;const currentColumnOpts=computeCurrentColumnOpts.value;const{actived,focused}=editStore;const{row,column}=params;const{type,treeNode,rowGroupNode}=column;const isRadioType=type==='radio';const isCheckboxType=type==='checkbox';const isExpandType=type==='expand';const cell=evnt.currentTarget;const triggerRadio=isRadioType&&getEventTargetNode(evnt,cell,'vxe-cell--radio').flag;const triggerCheckbox=isCheckboxType&&getEventTargetNode(evnt,cell,'vxe-cell--checkbox').flag;const triggerTreeNode=treeNode&&getEventTargetNode(evnt,cell,'vxe-cell--tree-btn').flag;const triggerExpandNode=isExpandType&&getEventTargetNode(evnt,cell,'vxe-table--expanded').flag;const triggerRowGroupNode=isExpandType&&getEventTargetNode(evnt,cell,'vxe-row-group--node-btn').flag;params=Object.assign({cell,triggerRadio,triggerCheckbox,triggerTreeNode,triggerExpandNode},params);if(!triggerCheckbox&&!triggerRadio){// 如果是展开行
|
|
11396
11437
|
if(!triggerExpandNode&&(expandOpts.trigger==='row'||isExpandType&&expandOpts.trigger==='cell')){$xeTable.triggerRowExpandEvent(evnt,params);}// 如果是树形表格
|
|
11397
11438
|
if(treeOpts.trigger==='row'||treeNode&&treeOpts.trigger==='cell'){$xeTable.triggerTreeExpandEvent(evnt,params);}// 如果是行分组
|
|
11398
|
-
if(
|
|
11439
|
+
if(aggregateOpts.trigger==='row'||rowGroupNode&&aggregateOpts.trigger==='cell'){$xeTable.triggerRowGroupExpandEvent(evnt,params);}}// 如果点击了树节点
|
|
11399
11440
|
if(!triggerTreeNode){if(!triggerExpandNode&&!triggerRowGroupNode){// 如果是当前行
|
|
11400
11441
|
if(rowOpts.isCurrent||highlightCurrentRow){if(!triggerCheckbox&&!triggerRadio){$xeTable.triggerCurrentRowEvent(evnt,params);}}// 如果是当前列
|
|
11401
11442
|
if((columnOpts.isCurrent||highlightCurrentColumn)&&(!currentColumnOpts.trigger||['cell','default'].includes(currentColumnOpts.trigger))){if(!triggerCheckbox&&!triggerRadio){$xeTable.triggerCurrentColumnEvent(evnt,params);}}// 如果是单选框
|
|
@@ -11415,7 +11456,7 @@ dispatchEvent('current-change',{oldValue,newValue,...params},evnt);}}else{dispat
|
|
|
11415
11456
|
* 展开行事件
|
|
11416
11457
|
*/triggerRowExpandEvent(evnt,params){const{expandColumn}=reactData;const{rowExpandLazyLoadedMaps}=internalData;const expandOpts=computeExpandOpts.value;const{row}=params;const{lazy,trigger}=expandOpts;if(trigger==='manual'){return;}evnt.stopPropagation();const rowid=getRowid($xeTable,row);if(!lazy||!rowExpandLazyLoadedMaps[rowid]){const expanded=!$xeTable.isRowExpandByRow(row);const columnIndex=expandColumn?$xeTable.getColumnIndex(expandColumn):-1;const $columnIndex=expandColumn?$xeTable.getVMColumnIndex(expandColumn):-1;$xeTable.setRowExpand(row,expanded);dispatchEvent('toggle-row-expand',{expanded,column:expandColumn,columnIndex,$columnIndex,row,rowIndex:$xeTable.getRowIndex(row),$rowIndex:$xeTable.getVMRowIndex(row)},evnt);}},/**
|
|
11417
11458
|
* 行分组事件
|
|
11418
|
-
*/triggerRowGroupExpandEvent(evnt,params){const{rowGroupExpandedMaps}=internalData;const
|
|
11459
|
+
*/triggerRowGroupExpandEvent(evnt,params){const{rowGroupExpandedMaps}=internalData;const aggregateOpts=computeAggregateOpts.value;const{row,column}=params;const{trigger}=aggregateOpts;if(trigger==='manual'){return;}evnt.stopPropagation();const rowid=getRowid($xeTable,row);const expanded=!rowGroupExpandedMaps[rowid];const columnIndex=$xeTable.getColumnIndex(column);const $columnIndex=$xeTable.getVMColumnIndex(column);$xeTable.setRowGroupExpand(row,expanded);dispatchEvent('toggle-row-group-expand',{expanded,column,columnIndex,$columnIndex,row},evnt);},/**
|
|
11419
11460
|
* 展开树节点事件
|
|
11420
11461
|
*/triggerTreeExpandEvent(evnt,params){const{treeExpandLazyLoadedMaps,treeEATime}=internalData;const treeOpts=computeTreeOpts.value;const{row,column}=params;const{lazy,trigger,accordion}=treeOpts;if(trigger==='manual'){return;}evnt.stopPropagation();const rowid=getRowid($xeTable,row);if(!lazy||!treeExpandLazyLoadedMaps[rowid]){const expanded=!$xeTable.isTreeExpandByRow(row);const columnIndex=$xeTable.getColumnIndex(column);const $columnIndex=$xeTable.getVMColumnIndex(column);if(treeEATime){clearTimeout(treeEATime);}$xeTable.setTreeExpand(row,expanded).then(()=>{if(accordion){internalData.treeEATime=setTimeout(()=>{internalData.treeEATime=undefined;$xeTable.scrollToRow(row);},30);}});dispatchEvent('toggle-tree-expand',{expanded,column,columnIndex,$columnIndex,row},evnt);}},handleColumnSortEvent(evnt,column){const{mouseConfig}=props;const mouseOpts=computeMouseOpts.value;const{field,sortable,order}=column;if(sortable){const params={$table:$xeTable,$event:evnt,column,field,property:field,order,sortList:tableMethods.getSortColumns(),sortTime:column.sortTime};if(mouseConfig&&mouseOpts.area&&$xeTable.handleSortEvent){$xeTable.handleSortEvent(evnt,params);}if(!order){dispatchEvent('clear-sort',params,evnt);}dispatchEvent('sort-change',params,evnt);}},/**
|
|
11421
11462
|
* 点击排序事件
|
|
@@ -11460,7 +11501,7 @@ if(isRollX){evnt.preventDefault();internalData.inWheelScroll=true;if(browseObj.f
|
|
|
11460
11501
|
* 对于树形结构中,可以直接滚动到指定深层节点中
|
|
11461
11502
|
* 对于某些特定的场景可能会用到,比如定位到某一节点
|
|
11462
11503
|
* @param {Row} row 行对象
|
|
11463
|
-
*/scrollToTreeRow(row){const{treeConfig}=props;const{isRowGroupStatus}=reactData;const{tableFullData}=internalData;const rests=[];if(treeConfig||isRowGroupStatus){const
|
|
11504
|
+
*/scrollToTreeRow(row){const{treeConfig}=props;const{isRowGroupStatus}=reactData;const{tableFullData}=internalData;const rests=[];if(treeConfig||isRowGroupStatus){const aggregateOpts=computeAggregateOpts.value;const treeOpts=computeTreeOpts.value;const childrenField=treeOpts.children||treeOpts.childrenField;const matchObj=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findTree(tableFullData,item=>$xeTable.eqRow(item,row),{children:isRowGroupStatus?aggregateOpts.mapChildrenField:childrenField});if(matchObj){const nodes=matchObj.nodes;nodes.forEach((row,index)=>{if(index<nodes.length-1&&!$xeTable.isTreeExpandByRow(row)){rests.push($xeTable.setTreeExpand(row,true));}});}}return Promise.all(rests).then(()=>rowToVisible($xeTable,row));},updateScrollYStatus,// 更新横向 X 可视渲染上下剩余空间大小
|
|
11464
11505
|
updateScrollXSpace(){const{scrollXLoad,overflowX,scrollXWidth}=reactData;const{visibleColumn,scrollXStore,elemStore,fullColumnIdData}=internalData;const mouseOpts=computeMouseOpts.value;const tableBody=refTableBody.value;const tableBodyElem=tableBody?tableBody.$el:null;if(tableBodyElem){const bodyScrollElem=getRefElem(elemStore['main-body-scroll']);const bodyTableElem=getRefElem(elemStore['main-body-table']);const headerTableElem=getRefElem(elemStore['main-header-table']);const footerTableElem=getRefElem(elemStore['main-footer-table']);let xSpaceLeft=0;const firstColumn=visibleColumn[scrollXStore.startIndex];if(firstColumn){const colRest=fullColumnIdData[firstColumn.id]||{};xSpaceLeft=colRest.oLeft;}let clientWidth=0;if(bodyScrollElem){clientWidth=bodyScrollElem.clientWidth;}// 虚拟渲染
|
|
11465
11506
|
let isScrollXBig=false;let ySpaceWidth=scrollXWidth;if(scrollXWidth>maxXWidth){// 触右
|
|
11466
11507
|
if(bodyScrollElem&&bodyTableElem&&bodyScrollElem.scrollLeft+clientWidth>=maxXWidth){xSpaceLeft=maxXWidth-bodyTableElem.clientWidth;}else{xSpaceLeft=(maxXWidth-clientWidth)*(xSpaceLeft/(scrollXWidth-clientWidth));}ySpaceWidth=maxXWidth;isScrollXBig=true;}if(!(scrollXLoad&&overflowX)){xSpaceLeft=0;}if(headerTableElem){headerTableElem.style.transform=headerTableElem.getAttribute('xvm')?`translate(${xSpaceLeft}px, 0px)`:'';}if(bodyTableElem){bodyTableElem.style.transform=`translate(${xSpaceLeft}px, ${reactData.scrollYTop||0}px)`;}if(footerTableElem){footerTableElem.style.transform=footerTableElem.getAttribute('xvm')?`translate(${xSpaceLeft}px, 0px)`:'';}const containerList=['main'];containerList.forEach(name=>{const layoutList=['header','body','footer'];layoutList.forEach(layout=>{const xSpaceElem=getRefElem(elemStore[`${name}-${layout}-xSpace`]);if(xSpaceElem){xSpaceElem.style.width=scrollXLoad?`${ySpaceWidth}px`:'';}});});reactData.scrollXLeft=xSpaceLeft;reactData.scrollXWidth=ySpaceWidth;reactData.isScrollXBig=isScrollXBig;const scrollXSpaceEl=refScrollXSpaceElem.value;if(scrollXSpaceEl){scrollXSpaceEl.style.width=`${ySpaceWidth}px`;}if(isScrollXBig&&mouseOpts.area){errLog('vxe.error.notProp',['mouse-config.area']);}calcScrollbar();return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(()=>{updateStyle();});}},// 更新纵向 Y 可视渲染上下剩余空间大小
|
|
@@ -11524,14 +11565,14 @@ if(bodyScrollElem&&bodyTableElem&&bodyScrollElem.scrollTop+clientHeight>=maxYHei
|
|
|
11524
11565
|
// warnLog('vxe.error.checkProp', ['checkbox-config.checkField'])
|
|
11525
11566
|
// }
|
|
11526
11567
|
if((scrollXLoad||scrollYLoad)&&expandColumn&&expandOpts.mode!=='fixed'){warnLog('vxe.error.scrollErrProp',['column.type=expand']);}return tableMethods.recalculate();});});const staticColumnFlag=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)(0);(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(()=>reactData.staticColumns.length,()=>{staticColumnFlag.value++;});(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(()=>reactData.staticColumns,()=>{staticColumnFlag.value++;});(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(staticColumnFlag,()=>{handleColumn(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().clone(reactData.staticColumns));});const tableColumnFlag=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)(0);(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(()=>reactData.tableColumn.length,()=>{tableColumnFlag.value++;});(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(()=>reactData.tableColumn,()=>{tableColumnFlag.value++;});(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(tableColumnFlag,()=>{tablePrivateMethods.analyColumnWidth();});(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(()=>reactData.upDataFlag,()=>{(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(()=>{tableMethods.updateData();});});(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(()=>reactData.reColumnFlag,()=>{(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(()=>{tableMethods.refreshColumn();});});const reScrollFlag=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)(0);(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(computeSize,()=>{reScrollFlag.value++;});(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(()=>props.showHeader,()=>{reScrollFlag.value++;});(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(()=>props.showFooter,()=>{reScrollFlag.value++;});(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(()=>reactData.overflowX,()=>{reScrollFlag.value++;});(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(()=>reactData.overflowY,()=>{reScrollFlag.value++;});(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(reScrollFlag,()=>{(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(()=>{tableMethods.recalculate(true).then(()=>tableMethods.refreshScroll());});});const reLayoutFlag=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)(0);(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(()=>props.height,()=>{reLayoutFlag.value++;});(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(()=>props.maxHeight,()=>{reLayoutFlag.value++;});(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(computeScrollbarXToTop,()=>{reLayoutFlag.value++;});(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(computeScrollbarYToLeft,()=>{reLayoutFlag.value++;});(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(()=>core_.VxeUI.getLanguage(),()=>{reLayoutFlag.value++;});(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(reLayoutFlag,()=>{(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(()=>tableMethods.recalculate(true));});const footFlag=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)(0);(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(()=>props.footerData?props.footerData.length:-1,()=>{footFlag.value++;});(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(()=>props.footerData,()=>{footFlag.value++;});(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(footFlag,()=>{tableMethods.updateFooter();});(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(()=>props.syncResize,value=>{if(value){handleUpdateResize();(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(()=>{handleUpdateResize();setTimeout(()=>handleUpdateResize());});}});const mergeCellFlag=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)(0);(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(()=>props.mergeCells?props.mergeCells.length:-1,()=>{mergeCellFlag.value++;});(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(()=>props.mergeCells,()=>{mergeCellFlag.value++;});(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(mergeCellFlag,()=>{tableMethods.clearMergeCells();(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(()=>{if(props.mergeCells){tableMethods.setMergeCells(props.mergeCells);}});});const mergeFooterItemFlag=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)(0);(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(()=>props.mergeFooterItems?props.mergeFooterItems.length:-1,()=>{mergeFooterItemFlag.value++;});(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(()=>props.mergeFooterItems,()=>{mergeFooterItemFlag.value++;});(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(mergeFooterItemFlag,()=>{tableMethods.clearMergeFooterItems();(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(()=>{if(props.mergeFooterItems){tableMethods.setMergeFooterItems(props.mergeFooterItems);}});});(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(computeRowGroupFields,val=>{handleUpdateRowGroup(val);});(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(computeRowField,()=>{const{inited,tableFullData}=internalData;// 行主键被改变,重载表格
|
|
11527
|
-
if(inited){handleKeyField();reactData.tableData=[];(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(()=>{$xeTable.reloadData(tableFullData);});}});if($xeTabs){(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(()=>$xeTabs?$xeTabs.reactData.resizeFlag:null,()=>{handleGlobalResizeEvent();});}handleKeyField();table_hooks.forEach(options=>{const{setupTable}=options;if(setupTable){const hookRest=setupTable($xeTable);if(hookRest&&external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isObject(hookRest)){Object.assign($xeTable,hookRest);}}});tablePrivateMethods.preventEvent(null,'created',{$table:$xeTable});let resizeObserver;(0,external_commonjs_vue_commonjs2_vue_root_Vue_.onActivated)(()=>{tableMethods.recalculate().then(()=>tableMethods.refreshScroll());tablePrivateMethods.preventEvent(null,'activated',{$table:$xeTable});});(0,external_commonjs_vue_commonjs2_vue_root_Vue_.onDeactivated)(()=>{internalData.isActivated=false;tablePrivateMethods.preventEvent(null,'deactivated',{$table:$xeTable});});(0,external_commonjs_vue_commonjs2_vue_root_Vue_.onMounted)(()=>{const columnOpts=computeColumnOpts.value;const rowOpts=computeRowOpts.value;const customOpts=computeCustomOpts.value;const
|
|
11568
|
+
if(inited){handleKeyField();reactData.tableData=[];(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(()=>{$xeTable.reloadData(tableFullData);});}});if($xeTabs){(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(()=>$xeTabs?$xeTabs.reactData.resizeFlag:null,()=>{handleGlobalResizeEvent();});}handleKeyField();table_hooks.forEach(options=>{const{setupTable}=options;if(setupTable){const hookRest=setupTable($xeTable);if(hookRest&&external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isObject(hookRest)){Object.assign($xeTable,hookRest);}}});tablePrivateMethods.preventEvent(null,'created',{$table:$xeTable});let resizeObserver;(0,external_commonjs_vue_commonjs2_vue_root_Vue_.onActivated)(()=>{tableMethods.recalculate().then(()=>tableMethods.refreshScroll());tablePrivateMethods.preventEvent(null,'activated',{$table:$xeTable});});(0,external_commonjs_vue_commonjs2_vue_root_Vue_.onDeactivated)(()=>{internalData.isActivated=false;tablePrivateMethods.preventEvent(null,'deactivated',{$table:$xeTable});});(0,external_commonjs_vue_commonjs2_vue_root_Vue_.onMounted)(()=>{const columnOpts=computeColumnOpts.value;const rowOpts=computeRowOpts.value;const customOpts=computeCustomOpts.value;const aggregateOpts=computeAggregateOpts.value;const virtualYOpts=computeVirtualYOpts.value;const{groupFields}=aggregateOpts;if(columnOpts.drag||rowOpts.drag||customOpts.allowSort){initTpImg();}handleUpdateRowGroup(groupFields);(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(()=>{const{data,exportConfig,importConfig,treeConfig,showOverflow,highlightCurrentRow,highlightCurrentColumn}=props;const{scrollXStore,scrollYStore}=internalData;const editOpts=computeEditOpts.value;const treeOpts=computeTreeOpts.value;const radioOpts=computeRadioOpts.value;const checkboxOpts=computeCheckboxOpts.value;const expandOpts=computeExpandOpts.value;const rowOpts=computeRowOpts.value;const customOpts=computeCustomOpts.value;const mouseOpts=computeMouseOpts.value;const exportOpts=computeExportOpts.value;const importOpts=computeImportOpts.value;const currentRowOpts=computeCurrentRowOpts.value;const currentColumnOpts=computeCurrentColumnOpts.value;const keyboardOpts=computeKeyboardOpts.value;const aggregateOpts=computeAggregateOpts.value;if(props.rowId){warnLog('vxe.error.delProp',['row-id','row-config.keyField']);}if(props.rowKey){warnLog('vxe.error.delProp',['row-key','row-config.useKey']);}if(props.columnKey){warnLog('vxe.error.delProp',['column-id','column-config.useKey']);}if(!(props.rowId||rowOpts.keyField)&&(checkboxOpts.reserve||checkboxOpts.checkRowKeys||radioOpts.reserve||radioOpts.checkRowKey||expandOpts.expandRowKeys||treeOpts.expandRowKeys)){warnLog('vxe.error.reqProp',['row-config.keyField']);}if(props.editConfig&&(editOpts.showStatus||editOpts.showUpdateStatus||editOpts.showInsertStatus)&&!props.keepSource){warnLog('vxe.error.reqProp',['keep-source']);}if(treeConfig&&(treeOpts.showLine||treeOpts.line)&&!showOverflow){warnLog('vxe.error.reqProp',['show-overflow']);}if(treeConfig&&!treeOpts.transform&&props.stripe){warnLog('vxe.error.noTree',['stripe']);}if(props.showFooter&&!(props.footerMethod||props.footerData)){warnLog('vxe.error.reqProp',['footer-data | footer-method']);}if(rowOpts.height){warnLog('vxe.error.delProp',['row-config.height','cell-config.height']);}if(props.highlightCurrentRow){warnLog('vxe.error.delProp',['highlight-current-row','row-config.isCurrent']);}if(props.highlightHoverRow){warnLog('vxe.error.delProp',['highlight-hover-row','row-config.isHover']);}if(props.highlightCurrentColumn){warnLog('vxe.error.delProp',['highlight-current-column','column-config.isCurrent']);}if(props.highlightHoverColumn){warnLog('vxe.error.delProp',['highlight-hover-column','column-config.isHover']);}if(props.resizable){warnLog('vxe.error.delProp',['resizable','column-config.resizable']);}// if (props.scrollY) {
|
|
11528
11569
|
// warnLog('vxe.error.delProp', ['scroll-y', 'virtual-y-config'])
|
|
11529
11570
|
// }
|
|
11530
11571
|
// if (props.scrollX) {
|
|
11531
11572
|
// warnLog('vxe.error.delProp', ['scroll-x', 'virtual-x-config'])
|
|
11532
11573
|
// }
|
|
11533
11574
|
// 检查导入导出类型,如果自定义导入导出方法,则不校验类型
|
|
11534
|
-
if(importConfig&&importOpts.types&&!importOpts.importMethod&&!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().includeArrays(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().keys(importOpts._typeMaps),importOpts.types)){warnLog('vxe.error.errProp',[`export-config.types=${importOpts.types.join(',')}`,importOpts.types.filter(type=>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(importOpts._typeMaps),type)).join(',')||external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().keys(importOpts._typeMaps).join(',')]);}if(exportConfig&&exportOpts.types&&!exportOpts.exportMethod&&!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().includeArrays(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().keys(exportOpts._typeMaps),exportOpts.types)){warnLog('vxe.error.errProp',[`export-config.types=${exportOpts.types.join(',')}`,exportOpts.types.filter(type=>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)).join(',')||external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().keys(exportOpts._typeMaps).join(',')]);}if(!props.id){if((props.customConfig?isEnableConf(customOpts):customOpts.enabled)&&customOpts.storage){errLog('vxe.error.reqProp',['id']);}}if(props.treeConfig&&checkboxOpts.range){errLog('vxe.error.noTree',['checkbox-config.range']);}if(rowOpts.height&&!props.showOverflow){warnLog('vxe.error.notProp',['table.show-overflow']);}if(!$xeTable.triggerCellAreaMousedownEvent){if(props.areaConfig){warnLog('vxe.error.notProp',['area-config']);}if(props.clipConfig){warnLog('vxe.error.notProp',['clip-config']);}if(props.fnrConfig){warnLog('vxe.error.notProp',['fnr-config']);}if(mouseOpts.area){errLog('vxe.error.notProp',['mouse-config.area']);return;}}if(treeConfig&&rowOpts.drag&&!treeOpts.transform){errLog('vxe.error.notSupportProp',['column-config.drag','tree-config.transform=false','tree-config.transform=true']);}if(props.dragConfig){warnLog('vxe.error.delProp',['drag-config','row-drag-config']);}if(props.treeConfig&&treeOpts.children){warnLog('vxe.error.delProp',['tree-config.children','tree-config.childrenField']);}if(props.treeConfig&&treeOpts.line){warnLog('vxe.error.delProp',['tree-config.line','tree-config.showLine']);}if(mouseOpts.area&&mouseOpts.selected){warnLog('vxe.error.errConflicts',['mouse-config.area','mouse-config.selected']);}if(mouseOpts.area&&props.treeConfig&&!treeOpts.transform){errLog('vxe.error.noTree',['mouse-config.area']);}if(props.editConfig&&editOpts.activeMethod){warnLog('vxe.error.delProp',['edit-config.activeMethod','edit-config.beforeEditMethod']);}if(props.treeConfig&&checkboxOpts.isShiftKey){errLog('vxe.error.errConflicts',['tree-config','checkbox-config.isShiftKey']);}if(checkboxOpts.halfField){warnLog('vxe.error.delProp',['checkbox-config.halfField','checkbox-config.indeterminateField']);}if(rowOpts.currentMethod){warnLog('vxe.error.delProp',['row-config.currentMethod','current-row-config.beforeSelectMethod']);}if(columnOpts.currentMethod){warnLog('vxe.error.delProp',['row-config.currentMethod','current-column-config.beforeSelectMethod']);}if((rowOpts.isCurrent||highlightCurrentRow)&&props.keyboardConfig&&keyboardOpts.isArrow&&!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(currentRowOpts.isFollowSelected)){warnLog('vxe.error.notConflictProp',['row-config.isCurrent','current-row-config.isFollowSelected']);}if((columnOpts.isCurrent||highlightCurrentColumn)&&props.keyboardConfig&&keyboardOpts.isArrow&&!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(currentColumnOpts.isFollowSelected)){warnLog('vxe.error.notConflictProp',['column-config.isCurrent','current-column-config.isFollowSelected']);}// 如果不支持虚拟滚动
|
|
11575
|
+
if(importConfig&&importOpts.types&&!importOpts.importMethod&&!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().includeArrays(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().keys(importOpts._typeMaps),importOpts.types)){warnLog('vxe.error.errProp',[`export-config.types=${importOpts.types.join(',')}`,importOpts.types.filter(type=>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(importOpts._typeMaps),type)).join(',')||external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().keys(importOpts._typeMaps).join(',')]);}if(exportConfig&&exportOpts.types&&!exportOpts.exportMethod&&!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().includeArrays(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().keys(exportOpts._typeMaps),exportOpts.types)){warnLog('vxe.error.errProp',[`export-config.types=${exportOpts.types.join(',')}`,exportOpts.types.filter(type=>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)).join(',')||external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().keys(exportOpts._typeMaps).join(',')]);}if(!props.id){if((props.customConfig?isEnableConf(customOpts):customOpts.enabled)&&customOpts.storage){errLog('vxe.error.reqProp',['id']);}}if(props.treeConfig&&checkboxOpts.range){errLog('vxe.error.noTree',['checkbox-config.range']);}if(rowOpts.height&&!props.showOverflow){warnLog('vxe.error.notProp',['table.show-overflow']);}if(!$xeTable.triggerCellAreaMousedownEvent){if(props.areaConfig){warnLog('vxe.error.notProp',['area-config']);}if(props.clipConfig){warnLog('vxe.error.notProp',['clip-config']);}if(props.fnrConfig){warnLog('vxe.error.notProp',['fnr-config']);}if(mouseOpts.area){errLog('vxe.error.notProp',['mouse-config.area']);return;}}if(treeConfig&&rowOpts.drag&&!treeOpts.transform){errLog('vxe.error.notSupportProp',['column-config.drag','tree-config.transform=false','tree-config.transform=true']);}if(props.dragConfig){warnLog('vxe.error.delProp',['drag-config','row-drag-config']);}if(props.rowGroupConfig){warnLog('vxe.error.delProp',['row-group-config','aggregate-config']);}if(aggregateOpts.countFields){warnLog('vxe.error.delProp',['row-group-config.countFields','column.agg-func']);}if(aggregateOpts.countMethod){warnLog('vxe.error.delProp',['row-group-config.countMethod','aggregate-config.aggregateMethod']);}if(props.treeConfig&&treeOpts.children){warnLog('vxe.error.delProp',['tree-config.children','tree-config.childrenField']);}if(props.treeConfig&&treeOpts.line){warnLog('vxe.error.delProp',['tree-config.line','tree-config.showLine']);}if(mouseOpts.area&&mouseOpts.selected){warnLog('vxe.error.errConflicts',['mouse-config.area','mouse-config.selected']);}if(mouseOpts.area&&props.treeConfig&&!treeOpts.transform){errLog('vxe.error.noTree',['mouse-config.area']);}if(props.editConfig&&editOpts.activeMethod){warnLog('vxe.error.delProp',['edit-config.activeMethod','edit-config.beforeEditMethod']);}if(props.treeConfig&&checkboxOpts.isShiftKey){errLog('vxe.error.errConflicts',['tree-config','checkbox-config.isShiftKey']);}if(checkboxOpts.halfField){warnLog('vxe.error.delProp',['checkbox-config.halfField','checkbox-config.indeterminateField']);}if(rowOpts.currentMethod){warnLog('vxe.error.delProp',['row-config.currentMethod','current-row-config.beforeSelectMethod']);}if(columnOpts.currentMethod){warnLog('vxe.error.delProp',['row-config.currentMethod','current-column-config.beforeSelectMethod']);}if((rowOpts.isCurrent||highlightCurrentRow)&&props.keyboardConfig&&keyboardOpts.isArrow&&!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(currentRowOpts.isFollowSelected)){warnLog('vxe.error.notConflictProp',['row-config.isCurrent','current-row-config.isFollowSelected']);}if((columnOpts.isCurrent||highlightCurrentColumn)&&props.keyboardConfig&&keyboardOpts.isArrow&&!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(currentColumnOpts.isFollowSelected)){warnLog('vxe.error.notConflictProp',['column-config.isCurrent','current-column-config.isFollowSelected']);}// 如果不支持虚拟滚动
|
|
11535
11576
|
// if (props.spanMethod) {
|
|
11536
11577
|
// if (virtualXOpts.enabled) {
|
|
11537
11578
|
// warnLog('vxe.error.notConflictProp', ['span-method', 'virtual-x-config.enabled=false'])
|
|
@@ -12244,7 +12285,7 @@ const {
|
|
|
12244
12285
|
renderEmptyElement: grid_renderEmptyElement
|
|
12245
12286
|
} = core_.VxeUI;
|
|
12246
12287
|
const tableComponentPropKeys = Object.keys(src_props);
|
|
12247
|
-
const tableComponentMethodKeys = ['clearAll', 'syncData', 'updateData', 'loadData', 'reloadData', 'reloadRow', 'loadColumn', 'reloadColumn', 'getRowNode', 'getColumnNode', 'getRowIndex', 'getVTRowIndex', 'getVMRowIndex', 'getColumnIndex', 'getVTColumnIndex', 'getVMColumnIndex', 'setRow', 'createData', 'createRow', 'revertData', 'clearData', 'isRemoveByRow', 'isInsertByRow', 'isUpdateByRow', 'getColumns', 'getColumnById', 'getColumnByField', 'getTableColumn', 'getFullColumns', 'getData', 'getCheckboxRecords', 'getParentRow', 'getTreeRowChildren', 'getTreeParentRow', 'getRowSeq', 'getRowById', 'getRowid', 'getTableData', 'getFullData', 'setColumnFixed', 'clearColumnFixed', 'setColumnWidth', 'getColumnWidth', 'setRowHeightConf', 'getRowHeightConf', 'setRowHeight', 'getRowHeight', 'hideColumn', 'showColumn', 'resetColumn', 'refreshColumn', 'refreshScroll', 'recalculate', 'closeTooltip', 'isAllCheckboxChecked', 'isAllCheckboxIndeterminate', 'getCheckboxIndeterminateRecords', 'setCheckboxRow', 'setCheckboxRowKey', 'isCheckedByCheckboxRow', 'isCheckedByCheckboxRowKey', 'isIndeterminateByCheckboxRow', 'isIndeterminateByCheckboxRowKey', 'toggleCheckboxRow', 'setAllCheckboxRow', 'getRadioReserveRecord', 'clearRadioReserve', 'getCheckboxReserveRecords', 'clearCheckboxReserve', 'toggleAllCheckboxRow', 'clearCheckboxRow', 'setCurrentRow', 'isCheckedByRadioRow', 'isCheckedByRadioRowKey', 'setRadioRow', 'setRadioRowKey', 'clearCurrentRow', 'clearRadioRow', 'getCurrentRecord', 'getRadioRecord', 'getCurrentColumn', 'setCurrentColumn', 'clearCurrentColumn', 'setPendingRow', 'togglePendingRow', 'hasPendingByRow', 'isPendingByRow', 'getPendingRecords', 'clearPendingRow', 'sort', 'setSort', 'clearSort', 'clearSortByEvent', 'isSort', 'getSortColumns', 'closeFilter', 'isFilter', 'clearFilterByEvent', 'isActiveFilterByColumn', 'isRowExpandLoaded', 'clearRowExpandLoaded', 'reloadRowExpand', 'reloadRowExpand', 'toggleRowExpand', 'setAllRowExpand', 'setRowExpand', 'isExpandByRow', 'isRowExpandByRow', 'clearRowExpand', 'clearRowExpandReserve', 'getRowExpandRecords', 'getTreeExpandRecords', 'isTreeExpandLoaded', 'clearTreeExpandLoaded', 'reloadTreeExpand', 'reloadTreeChilds', 'toggleTreeExpand', 'setAllTreeExpand', 'setTreeExpand', 'isTreeExpandByRow', 'clearTreeExpand', 'clearTreeExpandReserve', 'getScroll', 'scrollTo', 'scrollToRow', 'scrollToColumn', 'clearScroll', 'updateFooter', 'updateStatus', 'setMergeCells', 'removeInsertRow', 'removeMergeCells', 'getMergeCells', 'clearMergeCells', 'setMergeFooterItems', 'removeMergeFooterItems', 'getMergeFooterItems', 'clearMergeFooterItems', 'getCustomStoreData', 'setRowGroupExpand', 'setAllRowGroupExpand', 'clearRowGroupExpand', 'isRowGroupExpandByRow', 'isRowGroupRecord', 'setRowGroups', 'clearRowGroups', 'openTooltip', 'moveColumnTo', 'moveRowTo', 'getCellLabel', 'getCellElement', 'focus', 'blur', 'connect'];
|
|
12288
|
+
const tableComponentMethodKeys = ['clearAll', 'syncData', 'updateData', 'loadData', 'reloadData', 'reloadRow', 'loadColumn', 'reloadColumn', 'getRowNode', 'getColumnNode', 'getRowIndex', 'getVTRowIndex', 'getVMRowIndex', 'getColumnIndex', 'getVTColumnIndex', 'getVMColumnIndex', 'setRow', 'createData', 'createRow', 'revertData', 'clearData', 'isRemoveByRow', 'isInsertByRow', 'isUpdateByRow', 'getColumns', 'getColumnById', 'getColumnByField', 'getTableColumn', 'getFullColumns', 'getData', 'getCheckboxRecords', 'getParentRow', 'getTreeRowChildren', 'getTreeParentRow', 'getRowSeq', 'getRowById', 'getRowid', 'getTableData', 'getFullData', 'setColumnFixed', 'clearColumnFixed', 'setColumnWidth', 'getColumnWidth', 'setRowHeightConf', 'getRowHeightConf', 'setRowHeight', 'getRowHeight', 'hideColumn', 'showColumn', 'resetColumn', 'refreshColumn', 'refreshScroll', 'recalculate', 'closeTooltip', 'isAllCheckboxChecked', 'isAllCheckboxIndeterminate', 'getCheckboxIndeterminateRecords', 'setCheckboxRow', 'setCheckboxRowKey', 'isCheckedByCheckboxRow', 'isCheckedByCheckboxRowKey', 'isIndeterminateByCheckboxRow', 'isIndeterminateByCheckboxRowKey', 'toggleCheckboxRow', 'setAllCheckboxRow', 'getRadioReserveRecord', 'clearRadioReserve', 'getCheckboxReserveRecords', 'clearCheckboxReserve', 'toggleAllCheckboxRow', 'clearCheckboxRow', 'setCurrentRow', 'isCheckedByRadioRow', 'isCheckedByRadioRowKey', 'setRadioRow', 'setRadioRowKey', 'clearCurrentRow', 'clearRadioRow', 'getCurrentRecord', 'getRadioRecord', 'getCurrentColumn', 'setCurrentColumn', 'clearCurrentColumn', 'setPendingRow', 'togglePendingRow', 'hasPendingByRow', 'isPendingByRow', 'getPendingRecords', 'clearPendingRow', 'sort', 'setSort', 'clearSort', 'clearSortByEvent', 'isSort', 'getSortColumns', 'closeFilter', 'isFilter', 'clearFilterByEvent', 'isActiveFilterByColumn', 'isRowExpandLoaded', 'clearRowExpandLoaded', 'reloadRowExpand', 'reloadRowExpand', 'toggleRowExpand', 'setAllRowExpand', 'setRowExpand', 'isExpandByRow', 'isRowExpandByRow', 'clearRowExpand', 'clearRowExpandReserve', 'getRowExpandRecords', 'getTreeExpandRecords', 'isTreeExpandLoaded', 'clearTreeExpandLoaded', 'reloadTreeExpand', 'reloadTreeChilds', 'toggleTreeExpand', 'setAllTreeExpand', 'setTreeExpand', 'isTreeExpandByRow', 'clearTreeExpand', 'clearTreeExpandReserve', 'getScroll', 'scrollTo', 'scrollToRow', 'scrollToColumn', 'clearScroll', 'updateFooter', 'updateStatus', 'setMergeCells', 'removeInsertRow', 'removeMergeCells', 'getMergeCells', 'clearMergeCells', 'setMergeFooterItems', 'removeMergeFooterItems', 'getMergeFooterItems', 'clearMergeFooterItems', 'getCustomStoreData', 'setRowGroupExpand', 'setAllRowGroupExpand', 'clearRowGroupExpand', 'isRowGroupExpandByRow', 'isRowGroupRecord', 'isAggregateRecord', 'isAggregateExpandByRow', 'setRowGroups', 'clearRowGroups', 'openTooltip', 'moveColumnTo', 'moveRowTo', 'getCellLabel', 'getCellElement', 'focus', 'blur', 'connect'];
|
|
12248
12289
|
const gridComponentEmits = [...emits, 'page-change', 'form-submit', 'form-submit-invalid', 'form-reset', 'form-collapse', 'form-toggle-collapse', 'proxy-query', 'proxy-delete', 'proxy-save', 'toolbar-button-click', 'toolbar-tool-click', 'zoom'];
|
|
12249
12290
|
/* harmony default export */ var grid = ((0,external_commonjs_vue_commonjs2_vue_root_Vue_.defineComponent)({
|
|
12250
12291
|
name: 'VxeGrid',
|