vxe-table 4.17.31 → 4.17.33
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/style.css +1 -1
- package/es/table/src/cell.js +11 -3
- package/es/table/src/header.js +3 -3
- package/es/table/src/table.js +17 -14
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/index.umd.js +34 -16
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/src/cell.js +26 -8
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/header.js +3 -3
- package/lib/table/src/header.min.js +1 -1
- package/lib/table/src/table.js +3 -3
- package/lib/table/src/table.min.js +1 -1
- package/lib/ui/index.js +1 -1
- 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/package.json +1 -1
- package/packages/table/src/cell.ts +11 -3
- package/packages/table/src/header.ts +3 -3
- package/packages/table/src/table.ts +17 -13
- /package/es/{iconfont.1765852932267.ttf → iconfont.1766365237751.ttf} +0 -0
- /package/es/{iconfont.1765852932267.woff → iconfont.1766365237751.woff} +0 -0
- /package/es/{iconfont.1765852932267.woff2 → iconfont.1766365237751.woff2} +0 -0
- /package/lib/{iconfont.1765852932267.ttf → iconfont.1766365237751.ttf} +0 -0
- /package/lib/{iconfont.1765852932267.woff → iconfont.1766365237751.woff} +0 -0
- /package/lib/{iconfont.1765852932267.woff2 → iconfont.1766365237751.woff2} +0 -0
package/es/table/src/cell.js
CHANGED
|
@@ -360,6 +360,7 @@ export const Cell = {
|
|
|
360
360
|
const renderOpts = editConfig && isEnableConf(editRender) ? editRender : (isEnableConf(cellRender) ? cellRender : null);
|
|
361
361
|
const defaultSlot = slots ? slots.default : null;
|
|
362
362
|
const gcSlot = slots ? (slots.groupContent || slots['group-content']) : null;
|
|
363
|
+
const gvSlot = slots ? (slots.groupValues || slots['group-values']) : null;
|
|
363
364
|
let cellValue = '';
|
|
364
365
|
if (isRowGroupStatus && field && row.isAggregate) {
|
|
365
366
|
const aggRow = row;
|
|
@@ -394,9 +395,6 @@ export const Cell = {
|
|
|
394
395
|
*/
|
|
395
396
|
totalValue: childCount
|
|
396
397
|
};
|
|
397
|
-
if (gcSlot) {
|
|
398
|
-
return renderCellBaseVNs(params, $table.callSlot(gcSlot, Object.assign({ groupField, groupContent, childList, childCount }, params)));
|
|
399
|
-
}
|
|
400
398
|
if (mode === 'column' ? field === aggRow.groupField : rowGroupNode) {
|
|
401
399
|
cellValue = groupContent;
|
|
402
400
|
if (contentMethod) {
|
|
@@ -405,9 +403,16 @@ export const Cell = {
|
|
|
405
403
|
if (showTotal) {
|
|
406
404
|
cellValue = getI18n('vxe.table.rowGroupContentTotal', [cellValue, totalMethod ? totalMethod(ctParams) : childCount, childCount]);
|
|
407
405
|
}
|
|
406
|
+
if (gcSlot) {
|
|
407
|
+
return renderCellBaseVNs(params, $table.callSlot(gcSlot, Object.assign({ groupField, groupContent, childList, childCount }, params)));
|
|
408
|
+
}
|
|
408
409
|
}
|
|
409
410
|
else if ($table.getPivotTableAggregateCellAggValue) {
|
|
410
411
|
cellValue = $table.getPivotTableAggregateCellAggValue(params);
|
|
412
|
+
ctParams.aggValue = cellValue;
|
|
413
|
+
if (gvSlot) {
|
|
414
|
+
return renderCellBaseVNs(params, $table.callSlot(gvSlot, Object.assign({ groupField, groupContent, childList, childCount }, params, ctParams)));
|
|
415
|
+
}
|
|
411
416
|
}
|
|
412
417
|
else if (aggFunc === true || (countFields && countFields.includes(field))) {
|
|
413
418
|
cellValue = currAggData ? currAggData.value : childCount;
|
|
@@ -415,6 +420,9 @@ export const Cell = {
|
|
|
415
420
|
if (formatValuesMethod) {
|
|
416
421
|
cellValue = formatValuesMethod(ctParams);
|
|
417
422
|
}
|
|
423
|
+
if (gvSlot) {
|
|
424
|
+
return renderCellBaseVNs(params, $table.callSlot(gvSlot, Object.assign({ groupField, groupContent, childList, childCount }, params, ctParams)));
|
|
425
|
+
}
|
|
418
426
|
}
|
|
419
427
|
}
|
|
420
428
|
else {
|
package/es/table/src/header.js
CHANGED
|
@@ -323,7 +323,7 @@ export default defineVxeComponent({
|
|
|
323
323
|
]);
|
|
324
324
|
});
|
|
325
325
|
};
|
|
326
|
-
const renderHeads = (isGroup, isOptimizeMode, headerGroups) => {
|
|
326
|
+
const renderHeads = (isGroup, isOptimizeMode, headerGroups, renderColumnList) => {
|
|
327
327
|
const { fixedType } = props;
|
|
328
328
|
const { headerRowClassName, headerRowStyle } = tableProps;
|
|
329
329
|
const floatingFilterOpts = computeFloatingFilterOpts.value;
|
|
@@ -344,7 +344,7 @@ export default defineVxeComponent({
|
|
|
344
344
|
class: [
|
|
345
345
|
'vxe-header--row'
|
|
346
346
|
]
|
|
347
|
-
}, renderFilterRows(isOptimizeMode,
|
|
347
|
+
}, renderFilterRows(isOptimizeMode, renderColumnList)));
|
|
348
348
|
}
|
|
349
349
|
return rowVNs;
|
|
350
350
|
};
|
|
@@ -446,7 +446,7 @@ export default defineVxeComponent({
|
|
|
446
446
|
*/
|
|
447
447
|
h('thead', {
|
|
448
448
|
ref: refHeaderTHead
|
|
449
|
-
}, renderHeads(isGroup, isOptimizeMode, renderHeaderList))
|
|
449
|
+
}, renderHeads(isGroup, isOptimizeMode, renderHeaderList, renderColumnList))
|
|
450
450
|
]),
|
|
451
451
|
mouseConfig && mouseOpts.area
|
|
452
452
|
? h('div', {
|
package/es/table/src/table.js
CHANGED
|
@@ -3614,7 +3614,6 @@ export default defineVxeComponent({
|
|
|
3614
3614
|
};
|
|
3615
3615
|
const initData = () => {
|
|
3616
3616
|
const { data } = props;
|
|
3617
|
-
dispatchEvent('ready', {}, null);
|
|
3618
3617
|
loadTableData(data || [], true, true).then(() => {
|
|
3619
3618
|
if (data && data.length) {
|
|
3620
3619
|
internalData.inited = true;
|
|
@@ -3628,6 +3627,9 @@ export default defineVxeComponent({
|
|
|
3628
3627
|
updateRowOffsetTop();
|
|
3629
3628
|
}
|
|
3630
3629
|
});
|
|
3630
|
+
nextTick(() => {
|
|
3631
|
+
dispatchEvent('ready', {}, null);
|
|
3632
|
+
});
|
|
3631
3633
|
};
|
|
3632
3634
|
/**
|
|
3633
3635
|
* 加载表格数据
|
|
@@ -3774,19 +3776,6 @@ export default defineVxeComponent({
|
|
|
3774
3776
|
}
|
|
3775
3777
|
handleReserveStatus();
|
|
3776
3778
|
$xeTable.checkSelectionStatus();
|
|
3777
|
-
if (initStatus) {
|
|
3778
|
-
dispatchEvent('data-rendered', {
|
|
3779
|
-
isReload,
|
|
3780
|
-
visibleColumn: internalData.visibleColumn,
|
|
3781
|
-
visibleData: internalData.afterFullData
|
|
3782
|
-
}, null);
|
|
3783
|
-
}
|
|
3784
|
-
else {
|
|
3785
|
-
dispatchEvent('init-rendered', {
|
|
3786
|
-
visibleColumn: internalData.visibleColumn,
|
|
3787
|
-
visibleData: internalData.afterFullData
|
|
3788
|
-
}, null);
|
|
3789
|
-
}
|
|
3790
3779
|
$xeTable.dispatchEvent('data-change', {
|
|
3791
3780
|
visibleColumn: internalData.visibleColumn,
|
|
3792
3781
|
visibleData: internalData.afterFullData
|
|
@@ -3842,6 +3831,20 @@ export default defineVxeComponent({
|
|
|
3842
3831
|
});
|
|
3843
3832
|
}
|
|
3844
3833
|
});
|
|
3834
|
+
}).then(() => {
|
|
3835
|
+
if (initStatus) {
|
|
3836
|
+
dispatchEvent('data-rendered', {
|
|
3837
|
+
isReload,
|
|
3838
|
+
visibleColumn: internalData.visibleColumn,
|
|
3839
|
+
visibleData: internalData.afterFullData
|
|
3840
|
+
}, null);
|
|
3841
|
+
}
|
|
3842
|
+
else {
|
|
3843
|
+
dispatchEvent('init-rendered', {
|
|
3844
|
+
visibleColumn: internalData.visibleColumn,
|
|
3845
|
+
visibleData: internalData.afterFullData
|
|
3846
|
+
}, null);
|
|
3847
|
+
}
|
|
3845
3848
|
});
|
|
3846
3849
|
});
|
|
3847
3850
|
};
|
package/es/ui/index.js
CHANGED
package/es/ui/src/log.js
CHANGED
package/lib/index.umd.js
CHANGED
|
@@ -3141,7 +3141,7 @@ function eqEmptyValue(cellValue) {
|
|
|
3141
3141
|
;// ./packages/ui/index.ts
|
|
3142
3142
|
|
|
3143
3143
|
|
|
3144
|
-
const version = "4.17.
|
|
3144
|
+
const version = "4.17.33";
|
|
3145
3145
|
core_.VxeUI.version = version;
|
|
3146
3146
|
core_.VxeUI.tableVersion = version;
|
|
3147
3147
|
core_.VxeUI.setConfig({
|
|
@@ -3656,7 +3656,7 @@ var esnext_iterator_some = __webpack_require__(7550);
|
|
|
3656
3656
|
const {
|
|
3657
3657
|
log: log_log
|
|
3658
3658
|
} = core_.VxeUI;
|
|
3659
|
-
const log_version = `table v${"4.17.
|
|
3659
|
+
const log_version = `table v${"4.17.33"}`;
|
|
3660
3660
|
const warnLog = log_log.create('warn', log_version);
|
|
3661
3661
|
const errLog = log_log.create('error', log_version);
|
|
3662
3662
|
;// ./packages/table/src/columnInfo.ts
|
|
@@ -5410,6 +5410,7 @@ const Cell = {
|
|
|
5410
5410
|
const renderOpts = editConfig && isEnableConf(editRender) ? editRender : isEnableConf(cellRender) ? cellRender : null;
|
|
5411
5411
|
const defaultSlot = slots ? slots.default : null;
|
|
5412
5412
|
const gcSlot = slots ? slots.groupContent || slots['group-content'] : null;
|
|
5413
|
+
const gvSlot = slots ? slots.groupValues || slots['group-values'] : null;
|
|
5413
5414
|
let cellValue = '';
|
|
5414
5415
|
if (isRowGroupStatus && field && row.isAggregate) {
|
|
5415
5416
|
const aggRow = row;
|
|
@@ -5456,14 +5457,6 @@ const Cell = {
|
|
|
5456
5457
|
*/
|
|
5457
5458
|
totalValue: childCount
|
|
5458
5459
|
};
|
|
5459
|
-
if (gcSlot) {
|
|
5460
|
-
return renderCellBaseVNs(params, $table.callSlot(gcSlot, Object.assign({
|
|
5461
|
-
groupField,
|
|
5462
|
-
groupContent,
|
|
5463
|
-
childList,
|
|
5464
|
-
childCount
|
|
5465
|
-
}, params)));
|
|
5466
|
-
}
|
|
5467
5460
|
if (mode === 'column' ? field === aggRow.groupField : rowGroupNode) {
|
|
5468
5461
|
cellValue = groupContent;
|
|
5469
5462
|
if (contentMethod) {
|
|
@@ -5472,14 +5465,39 @@ const Cell = {
|
|
|
5472
5465
|
if (showTotal) {
|
|
5473
5466
|
cellValue = cell_getI18n('vxe.table.rowGroupContentTotal', [cellValue, totalMethod ? totalMethod(ctParams) : childCount, childCount]);
|
|
5474
5467
|
}
|
|
5468
|
+
if (gcSlot) {
|
|
5469
|
+
return renderCellBaseVNs(params, $table.callSlot(gcSlot, Object.assign({
|
|
5470
|
+
groupField,
|
|
5471
|
+
groupContent,
|
|
5472
|
+
childList,
|
|
5473
|
+
childCount
|
|
5474
|
+
}, params)));
|
|
5475
|
+
}
|
|
5475
5476
|
} else if ($table.getPivotTableAggregateCellAggValue) {
|
|
5476
5477
|
cellValue = $table.getPivotTableAggregateCellAggValue(params);
|
|
5478
|
+
ctParams.aggValue = cellValue;
|
|
5479
|
+
if (gvSlot) {
|
|
5480
|
+
return renderCellBaseVNs(params, $table.callSlot(gvSlot, Object.assign({
|
|
5481
|
+
groupField,
|
|
5482
|
+
groupContent,
|
|
5483
|
+
childList,
|
|
5484
|
+
childCount
|
|
5485
|
+
}, params, ctParams)));
|
|
5486
|
+
}
|
|
5477
5487
|
} else if (aggFunc === true || countFields && countFields.includes(field)) {
|
|
5478
5488
|
cellValue = currAggData ? currAggData.value : childCount;
|
|
5479
5489
|
ctParams.aggValue = cellValue;
|
|
5480
5490
|
if (formatValuesMethod) {
|
|
5481
5491
|
cellValue = formatValuesMethod(ctParams);
|
|
5482
5492
|
}
|
|
5493
|
+
if (gvSlot) {
|
|
5494
|
+
return renderCellBaseVNs(params, $table.callSlot(gvSlot, Object.assign({
|
|
5495
|
+
groupField,
|
|
5496
|
+
groupContent,
|
|
5497
|
+
childList,
|
|
5498
|
+
childCount
|
|
5499
|
+
}, params, ctParams)));
|
|
5500
|
+
}
|
|
5483
5501
|
}
|
|
5484
5502
|
} else {
|
|
5485
5503
|
if (defaultSlot) {
|
|
@@ -8554,7 +8572,7 @@ const header_renderType = 'header';
|
|
|
8554
8572
|
}, flSlot ? $xeTable.callSlot(flSlot, cellParams) : rtFloatingFilter && firstFilterOption ? getSlotVNs(rtFloatingFilter(filterRender, cellParams)) : [])])]);
|
|
8555
8573
|
});
|
|
8556
8574
|
};
|
|
8557
|
-
const renderHeads = (isGroup, isOptimizeMode, headerGroups) => {
|
|
8575
|
+
const renderHeads = (isGroup, isOptimizeMode, headerGroups, renderColumnList) => {
|
|
8558
8576
|
const {
|
|
8559
8577
|
fixedType
|
|
8560
8578
|
} = props;
|
|
@@ -8580,7 +8598,7 @@ const header_renderType = 'header';
|
|
|
8580
8598
|
rowVNs.push((0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('tr', {
|
|
8581
8599
|
key: 'ff',
|
|
8582
8600
|
class: ['vxe-header--row']
|
|
8583
|
-
}, renderFilterRows(isOptimizeMode,
|
|
8601
|
+
}, renderFilterRows(isOptimizeMode, renderColumnList)));
|
|
8584
8602
|
}
|
|
8585
8603
|
return rowVNs;
|
|
8586
8604
|
};
|
|
@@ -8690,7 +8708,7 @@ const header_renderType = 'header';
|
|
|
8690
8708
|
*/
|
|
8691
8709
|
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('thead', {
|
|
8692
8710
|
ref: refHeaderTHead
|
|
8693
|
-
}, renderHeads(isGroup, isOptimizeMode, renderHeaderList))]), mouseConfig && mouseOpts.area ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
8711
|
+
}, renderHeads(isGroup, isOptimizeMode, renderHeaderList, renderColumnList))]), mouseConfig && mouseOpts.area ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
8694
8712
|
class: 'vxe-table--cell-area',
|
|
8695
8713
|
xid: xID
|
|
8696
8714
|
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
|
|
@@ -19187,7 +19205,7 @@ if(reWidth){calcCellWidth();}if(reFull){autoCellWidth();}if(reHeight){calcCellHe
|
|
|
19187
19205
|
* 已废弃
|
|
19188
19206
|
* @deprecated
|
|
19189
19207
|
*/totalValue:childCount};let aggVal=0;// 如果下层同时也是分组
|
|
19190
|
-
if(childList.length&&childList[0].isAggregate){external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(childList,row=>{if(row.isAggregate){const currAggData=row.aggData[field];if(currAggData){aggVal+=currAggData.value;}}});}else{aggVal=aggCalcMethod?aggCalcMethod(ctParams):aggRow.childCount;}aggDtObj[field]={type:'count',value:aggVal,label:aggVal};});aggRow.aggData=aggDtObj;});}}}};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};};const initData=()=>{const{data}=props;
|
|
19208
|
+
if(childList.length&&childList[0].isAggregate){external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(childList,row=>{if(row.isAggregate){const currAggData=row.aggData[field];if(currAggData){aggVal+=currAggData.value;}}});}else{aggVal=aggCalcMethod?aggCalcMethod(ctParams):aggRow.childCount;}aggDtObj[field]={type:'count',value:aggVal,label:aggVal};});aggRow.aggData=aggDtObj;});}}}};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};};const initData=()=>{const{data}=props;loadTableData(data||[],true,true).then(()=>{if(data&&data.length){internalData.inited=true;internalData.initStatus=true;handleLoadDefaults();}handleInitDefaults();updateStyle();if(!reactData.isAllOverflow){calcCellHeight();updateRowOffsetTop();}});(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(()=>{dispatchEvent('ready',{},null);});};/**
|
|
19191
19209
|
* 加载表格数据
|
|
19192
19210
|
* @param {Array} datas 数据
|
|
19193
19211
|
*/const loadTableData=(datas,isReload,isReset)=>{const{keepSource,treeConfig,rowGroupConfig,aggregateConfig}=props;const{rowGroupList,scrollYLoad:oldScrollYLoad}=reactData;const{initStatus,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):[]);// 转为响应式数据
|
|
@@ -19216,10 +19234,10 @@ if(!(props.height||props.maxHeight)){errLog('vxe.error.reqProp',['height | max-h
|
|
|
19216
19234
|
// if (props.spanMethod) {
|
|
19217
19235
|
// warnLog('vxe.error.scrollErrProp', ['span-method'])
|
|
19218
19236
|
// }
|
|
19219
|
-
}handleReserveStatus();$xeTable.checkSelectionStatus()
|
|
19237
|
+
}handleReserveStatus();$xeTable.checkSelectionStatus();$xeTable.dispatchEvent('data-change',{visibleColumn:internalData.visibleColumn,visibleData:internalData.afterFullData},null);return new Promise(resolve=>{(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(()=>handleRecalculateStyle(false,false,false)).then(()=>{handleRecalculateStyle(false,true,true);updateRowOffsetTop();}).then(()=>{let targetScrollLeft=lastScrollLeft;let targetScrollTop=lastScrollTop;const virtualXOpts=computeVirtualXOpts.value;const virtualYOpts=computeVirtualYOpts.value;// 是否在更新数据之后自动滚动重置滚动条
|
|
19220
19238
|
if(virtualXOpts.scrollToLeftOnChange){targetScrollLeft=0;}if(virtualYOpts.scrollToTopOnChange){targetScrollTop=0;}reactData.isRowLoading=false;handleRecalculateStyle(false,false,false);updateTreeLineStyle();// 如果是自动行高,特殊情况需调用 recalculate 手动刷新
|
|
19221
19239
|
if(!props.showOverflow){setTimeout(()=>{handleLazyRecalculate(false,true,true);setTimeout(()=>handleLazyRecalculate(false,true,true),3000);},2000);}// 是否变更虚拟滚动
|
|
19222
|
-
if(oldScrollYLoad===sYLoad){restoreScrollLocation($xeTable,targetScrollLeft,targetScrollTop).then(()=>{handleRecalculateStyle(false,true,true);updateRowOffsetTop();updateTreeLineStyle();(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(()=>resolve());});}else{setTimeout(()=>{restoreScrollLocation($xeTable,targetScrollLeft,targetScrollTop).then(()=>{handleRecalculateStyle(false,true,true);updateRowOffsetTop();updateTreeLineStyle();(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(()=>resolve());});});}});});});};/**
|
|
19240
|
+
if(oldScrollYLoad===sYLoad){restoreScrollLocation($xeTable,targetScrollLeft,targetScrollTop).then(()=>{handleRecalculateStyle(false,true,true);updateRowOffsetTop();updateTreeLineStyle();(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(()=>resolve());});}else{setTimeout(()=>{restoreScrollLocation($xeTable,targetScrollLeft,targetScrollTop).then(()=>{handleRecalculateStyle(false,true,true);updateRowOffsetTop();updateTreeLineStyle();(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(()=>resolve());});});}});}).then(()=>{if(initStatus){dispatchEvent('data-rendered',{isReload,visibleColumn:internalData.visibleColumn,visibleData:internalData.afterFullData},null);}else{dispatchEvent('init-rendered',{visibleColumn:internalData.visibleColumn,visibleData:internalData.afterFullData},null);}});});};/**
|
|
19223
19241
|
* 处理数据加载默认行为
|
|
19224
19242
|
* 默认执行一次,除非被重置
|
|
19225
19243
|
*/const handleLoadDefaults=()=>{handleDefaultSelectionChecked();handleDefaultRadioChecked();handleDefaultRowExpand();handleDefaultTreeExpand();handleDefaultRowGroupExpand();handleDefaultMergeCells();handleDefaultMergeHeaderItems();handleDefaultMergeFooterItems();(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(()=>{setTimeout(()=>$xeTable.recalculate());});};/**
|