vxe-table 4.15.0-beta.2 → 4.15.0-beta.4
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/table.js +29 -11
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/index.umd.js +4 -4
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/src/table.js +2 -2
- 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/table.ts +29 -11
- /package/es/{iconfont.1753241382802.ttf → iconfont.1753251273753.ttf} +0 -0
- /package/es/{iconfont.1753241382802.woff → iconfont.1753251273753.woff} +0 -0
- /package/es/{iconfont.1753241382802.woff2 → iconfont.1753251273753.woff2} +0 -0
- /package/lib/{iconfont.1753241382802.ttf → iconfont.1753251273753.ttf} +0 -0
- /package/lib/{iconfont.1753241382802.woff → iconfont.1753251273753.woff} +0 -0
- /package/lib/{iconfont.1753241382802.woff2 → iconfont.1753251273753.woff2} +0 -0
package/es/table/src/table.js
CHANGED
|
@@ -3828,21 +3828,13 @@ export default defineVxeComponent({
|
|
|
3828
3828
|
const handleDefaultRowGroupExpand = () => {
|
|
3829
3829
|
const { isRowGroupStatus } = reactData;
|
|
3830
3830
|
if (isRowGroupStatus) {
|
|
3831
|
-
const { fullDataRowIdData } = internalData;
|
|
3832
3831
|
const aggregateOpts = computeAggregateOpts.value;
|
|
3833
|
-
const { expandAll,
|
|
3832
|
+
const { expandAll, expandGroupFields } = aggregateOpts;
|
|
3834
3833
|
if (expandAll) {
|
|
3835
3834
|
$xeTable.setAllRowGroupExpand(true);
|
|
3836
3835
|
}
|
|
3837
|
-
else if (
|
|
3838
|
-
|
|
3839
|
-
expandRowKeys.forEach((rowid) => {
|
|
3840
|
-
const rowRest = fullDataRowIdData[rowid];
|
|
3841
|
-
if (rowRest) {
|
|
3842
|
-
defExpandeds.push(rowRest.row);
|
|
3843
|
-
}
|
|
3844
|
-
});
|
|
3845
|
-
$xeTable.setRowGroupExpand(defExpandeds, true);
|
|
3836
|
+
else if (expandGroupFields && expandGroupFields.length) {
|
|
3837
|
+
$xeTable.setRowGroupExpandByField(expandGroupFields, true);
|
|
3846
3838
|
}
|
|
3847
3839
|
}
|
|
3848
3840
|
};
|
|
@@ -6238,6 +6230,32 @@ export default defineVxeComponent({
|
|
|
6238
6230
|
}
|
|
6239
6231
|
return nextTick();
|
|
6240
6232
|
},
|
|
6233
|
+
setRowGroupExpandByField(groupFields, expanded) {
|
|
6234
|
+
const { isRowGroupStatus } = reactData;
|
|
6235
|
+
const aggregateOpts = computeAggregateOpts.value;
|
|
6236
|
+
const { childrenField } = aggregateOpts;
|
|
6237
|
+
if (groupFields) {
|
|
6238
|
+
if (!XEUtils.isArray(groupFields)) {
|
|
6239
|
+
groupFields = [groupFields];
|
|
6240
|
+
}
|
|
6241
|
+
if (isRowGroupStatus) {
|
|
6242
|
+
const rows = [];
|
|
6243
|
+
const gfKeys = {};
|
|
6244
|
+
groupFields.forEach(groupField => {
|
|
6245
|
+
gfKeys[groupField] = true;
|
|
6246
|
+
});
|
|
6247
|
+
XEUtils.eachTree(internalData.afterGroupFullData, (row) => {
|
|
6248
|
+
if (row.isAggregate && gfKeys[row.groupField]) {
|
|
6249
|
+
rows.push(row);
|
|
6250
|
+
}
|
|
6251
|
+
}, { children: childrenField });
|
|
6252
|
+
if (rows.length) {
|
|
6253
|
+
return handleRowGroupVirtualExpand(rows, expanded);
|
|
6254
|
+
}
|
|
6255
|
+
}
|
|
6256
|
+
}
|
|
6257
|
+
return nextTick();
|
|
6258
|
+
},
|
|
6241
6259
|
setAllRowGroupExpand(expanded) {
|
|
6242
6260
|
const { tableFullGroupData } = internalData;
|
|
6243
6261
|
const aggregateOpts = computeAggregateOpts.value;
|
package/es/ui/index.js
CHANGED
package/es/ui/src/log.js
CHANGED
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.15.0-beta.
|
|
3141
|
+
const version = "4.15.0-beta.4";
|
|
3142
3142
|
core_.VxeUI.version = version;
|
|
3143
3143
|
core_.VxeUI.tableVersion = version;
|
|
3144
3144
|
core_.VxeUI.setConfig({
|
|
@@ -3628,7 +3628,7 @@ var esnext_iterator_some = __webpack_require__(7550);
|
|
|
3628
3628
|
const {
|
|
3629
3629
|
log: log_log
|
|
3630
3630
|
} = core_.VxeUI;
|
|
3631
|
-
const log_version = `table v${"4.15.0-beta.
|
|
3631
|
+
const log_version = `table v${"4.15.0-beta.4"}`;
|
|
3632
3632
|
const warnLog = log_log.create('warn', log_version);
|
|
3633
3633
|
const errLog = log_log.create('error', log_version);
|
|
3634
3634
|
;// ./packages/table/src/columnInfo.ts
|
|
@@ -11220,7 +11220,7 @@ const matchObj=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe
|
|
|
11220
11220
|
* @returns
|
|
11221
11221
|
*/const handleRowGroupVirtualExpand=(rows,expanded)=>{return handleRowGroupBaseExpand(rows,expanded).then(()=>{handleVirtualTreeToList();$xeTable.handleTableData();reactData.rowGroupExpandedFlag++;updateAfterDataIndex();return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();}).then(()=>{return handleLazyRecalculate(true,true,true);}).then(()=>{setTimeout(()=>{$xeTable.updateCellAreas();},30);});};/**
|
|
11222
11222
|
* 处理默认展开分组行
|
|
11223
|
-
*/const handleDefaultRowGroupExpand=()=>{const{isRowGroupStatus}=reactData;if(isRowGroupStatus){const
|
|
11223
|
+
*/const handleDefaultRowGroupExpand=()=>{const{isRowGroupStatus}=reactData;if(isRowGroupStatus){const aggregateOpts=computeAggregateOpts.value;const{expandAll,expandGroupFields}=aggregateOpts;if(expandAll){$xeTable.setAllRowGroupExpand(true);}else if(expandGroupFields&&expandGroupFields.length){$xeTable.setRowGroupExpandByField(expandGroupFields,true);}}};const handleCheckAllEvent=(evnt,value)=>{handleCheckedAllCheckboxRow(value);if(evnt){dispatchEvent('checkbox-all',{records:()=>$xeTable.getCheckboxRecords(),reserves:()=>$xeTable.getCheckboxReserveRecords(),indeterminates:()=>$xeTable.getCheckboxIndeterminateRecords(),checked:value},evnt);}};/**
|
|
11224
11224
|
* 纵向 Y 可视渲染处理
|
|
11225
11225
|
*/const loadScrollYData=()=>{const{isAllOverflow,isScrollYBig}=reactData;const{mergeBodyList,scrollYStore}=internalData;const{preloadSize,startIndex,endIndex,offsetSize}=scrollYStore;const autoOffsetYSize=isAllOverflow?offsetSize:offsetSize+1;const{toVisibleIndex,visibleSize}=handleVirtualYVisible();const offsetItem={startIndex:Math.max(0,isScrollYBig?toVisibleIndex-1:toVisibleIndex-1-offsetSize-preloadSize),endIndex:isScrollYBig?toVisibleIndex+visibleSize:toVisibleIndex+visibleSize+autoOffsetYSize+preloadSize};scrollYStore.visibleStartIndex=toVisibleIndex-1;scrollYStore.visibleEndIndex=toVisibleIndex+visibleSize+1;calculateMergerOffsetIndex(mergeBodyList,offsetItem,'row');const{startIndex:offsetStartIndex,endIndex:offsetEndIndex}=offsetItem;if(toVisibleIndex<=startIndex||toVisibleIndex>=endIndex-visibleSize-1){if(startIndex!==offsetStartIndex||endIndex!==offsetEndIndex){scrollYStore.startIndex=offsetStartIndex;scrollYStore.endIndex=offsetEndIndex;$xeTable.updateScrollYData();}}};const createGetRowCacheProp=prop=>{return function(row){const{fullAllDataRowIdData}=internalData;if(row){const rowid=getRowid($xeTable,row);const rowRest=fullAllDataRowIdData[rowid];if(rowRest){return rowRest[prop];}}return-1;};};const createGetColumnCacheProp=prop=>{return function(column){const{fullColumnIdData}=internalData;if(column){const colRest=fullColumnIdData[column.id];if(colRest){return colRest[prop];}}return-1;};};const lazyScrollXData=()=>{const{lxTimeout,lxRunTime,scrollXStore}=internalData;const{visibleSize}=scrollXStore;const fpsTime=visibleSize>26?26:visibleSize>16?14:6;if(lxTimeout){clearTimeout(lxTimeout);}if(!lxRunTime||lxRunTime+fpsTime<Date.now()){internalData.lxRunTime=Date.now();loadScrollXData();}internalData.lxTimeout=setTimeout(()=>{internalData.lxTimeout=undefined;internalData.lxRunTime=undefined;loadScrollXData();},fpsTime);};const lazyScrollYData=()=>{const{lyTimeout,lyRunTime,scrollYStore}=internalData;const{visibleSize}=scrollYStore;const fpsTime=visibleSize>30?32:visibleSize>20?18:8;if(lyTimeout){clearTimeout(lyTimeout);}if(!lyRunTime||lyRunTime+fpsTime<Date.now()){internalData.lyRunTime=Date.now();loadScrollYData();}internalData.lyTimeout=setTimeout(()=>{internalData.lyTimeout=undefined;internalData.lyRunTime=undefined;loadScrollYData();},fpsTime);};const checkLastSyncScroll=(isRollX,isRollY)=>{const{scrollXLoad,scrollYLoad,isAllOverflow}=reactData;const{lcsTimeout}=internalData;reactData.lazScrollLoading=true;if(lcsTimeout){clearTimeout(lcsTimeout);}internalData.lcsTimeout=setTimeout(()=>{internalData.lcsRunTime=Date.now();internalData.lcsTimeout=undefined;internalData.intoRunScroll=false;internalData.inVirtualScroll=false;internalData.inWheelScroll=false;internalData.inHeaderScroll=false;internalData.inBodyScroll=false;internalData.inFooterScroll=false;reactData.lazScrollLoading=false;internalData.scrollRenderType='';if(!isAllOverflow){calcCellHeight();updateRowOffsetTop();}if(isRollX&&scrollXLoad){$xeTable.updateScrollXData();}if(isRollY&&scrollYLoad){$xeTable.updateScrollYData().then(()=>{if(!isAllOverflow){calcCellHeight();updateRowOffsetTop();}$xeTable.updateScrollYSpace();});}updateRowExpandStyle();$xeTable.updateCellAreas();},200);};const getWheelSpeed=lastScrollTime=>{let multiple=1;const currTime=Date.now();if(lastScrollTime+25>currTime){multiple=1.18;}else if(lastScrollTime+30>currTime){multiple=1.15;}else if(lastScrollTime+40>currTime){multiple=1.12;}else if(lastScrollTime+55>currTime){multiple=1.09;}else if(lastScrollTime+75>currTime){multiple=1.06;}else if(lastScrollTime+100>currTime){multiple=1.03;}return multiple;};const wheelScrollLeftTo=(scrollLeft,cb)=>{requestAnimationFrame(()=>{cb(scrollLeft);});};const wheelScrollTopTo=(diffNum,cb)=>{const duration=Math.abs(diffNum);const startTime=performance.now();let countTop=0;const step=timestamp=>{let progress=(timestamp-startTime)/duration;if(progress>1){progress=1;}const easedProgress=Math.pow(progress,2);const offsetTop=Math.floor(diffNum*easedProgress)-countTop;countTop+=offsetTop;cb(offsetTop);if(progress<1){requestAnimationFrame(step);}};requestAnimationFrame(step);};const dispatchEvent=(type,params,evnt)=>{emit(type,createEvent(evnt,{$table:$xeTable,$grid:$xeGrid},params));};const handleScrollToRowColumn=(fieldOrColumn,row)=>{const{fullColumnIdData}=internalData;const column=handleFieldOrColumn($xeTable,fieldOrColumn);if(column&&fullColumnIdData[column.id]){return colToVisible($xeTable,column,row);}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();};const handleUpdateResize=()=>{const el=refElem.value;if(el&&el.clientWidth&&el.clientHeight){$xeTable.recalculate();}};const handleUpdateColResize=(evnt,params)=>{$xeTable.analyColumnWidth();$xeTable.recalculate().then(()=>{$xeTable.saveCustomStore('update:width');$xeTable.updateCellAreas();$xeTable.dispatchEvent('column-resizable-change',params,evnt);// 已废弃 resizable-change
|
|
11226
11226
|
$xeTable.dispatchEvent('resizable-change',params,evnt);setTimeout(()=>$xeTable.recalculate(true),300);});};const handleUpdateRowResize=(evnt,params)=>{reactData.resizeHeightFlag++;$xeTable.recalculate().then(()=>{$xeTable.updateCellAreas();$xeTable.dispatchEvent('row-resizable-change',params,evnt);setTimeout(()=>$xeTable.recalculate(true),300);});};const updateColumnOffsetLeft=()=>{const{visibleColumn,fullColumnIdData}=internalData;let offsetLeft=0;for(let cIndex=0,rLen=visibleColumn.length;cIndex<rLen;cIndex++){const column=visibleColumn[cIndex];const colid=column.id;const colRest=fullColumnIdData[colid];if(colRest){colRest.oLeft=offsetLeft;}offsetLeft+=column.renderWidth;}};const updateRowOffsetTop=()=>{const{expandColumn}=reactData;const{afterFullData,fullAllDataRowIdData,rowExpandedMaps}=internalData;const expandOpts=computeExpandOpts.value;const rowOpts=computeRowOpts.value;const cellOpts=computeCellOpts.value;const defaultRowHeight=computeDefaultRowHeight.value;const{handleGetRowId}=createHandleGetRowId($xeTable);let offsetTop=0;for(let rIndex=0,rLen=afterFullData.length;rIndex<rLen;rIndex++){const row=afterFullData[rIndex];const rowid=handleGetRowId(row);const rowRest=fullAllDataRowIdData[rowid]||{};rowRest.oTop=offsetTop;offsetTop+=rowRest.resizeHeight||cellOpts.height||rowOpts.height||rowRest.height||defaultRowHeight;// 是否展开行
|
|
@@ -11474,7 +11474,7 @@ rowExpandedMaps={};internalData.rowExpandedMaps=rowExpandedMaps;rows=rows.slice(
|
|
|
11474
11474
|
*/isRowExpandByRow(row){const{rowExpandedFlag}=reactData;const{rowExpandedMaps}=internalData;const rowid=getRowid($xeTable,row);return!!rowExpandedFlag&&!!rowExpandedMaps[rowid];},isExpandByRow(row){// 已废弃
|
|
11475
11475
|
warnLog('vxe.error.delFunc',['isExpandByRow','isRowExpandByRow']);return tableMethods.isRowExpandByRow(row);},/**
|
|
11476
11476
|
* 手动清空展开行状态,数据会恢复成未展开的状态
|
|
11477
|
-
*/clearRowExpand(){const{tableFullData,scrollYStore}=internalData;const expandOpts=computeExpandOpts.value;const{reserve}=expandOpts;const expList=$xeTable.getRowExpandRecords();internalData.rowExpandedMaps={};if(reserve){tableFullData.forEach(row=>handleRowExpandReserve(row,false));}reactData.rowExpandedFlag++;scrollYStore.startIndex=0;scrollYStore.endIndex=1;return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(()=>{if(expList.length){return handleLazyRecalculate(true,true,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;const aggregateOpts=computeAggregateOpts.value;const{maxGroupSize}=aggregateOpts;if(!(aggregateConfig||rowGroupConfig)){errLog('vxe.error.reqProp',['aggregate-config']);return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();}const confList=fieldOrColumns?external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(fieldOrColumns)?fieldOrColumns:[fieldOrColumns]:[];if(maxGroupSize&&confList.length>maxGroupSize){if(core_.VxeUI.modal){core_.VxeUI.modal.message({status:'error',content:table_getI18n('vxe.table.maxGroupCol',[maxGroupSize])});}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();}if(confList.length){handleUpdateRowGroup(confList.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;},getAggregateContentByRow(row){const{isRowGroupStatus}=reactData;return isRowGroupStatus&&row&&row.isAggregate?row.groupContent:'';},getAggregateRowChildren(row){const aggregateOpts=computeAggregateOpts.value;const{childrenField,mapChildrenField}=aggregateOpts;const{isRowGroupStatus}=reactData;return isRowGroupStatus&&row&&row.isAggregate&&childrenField&&mapChildrenField?row[mapChildrenField]||[]:[];},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();$xeTable.handleTableData();updateAfterDataIndex();reactData.rowGroupExpandedFlag++;return handleLazyRecalculate(true,true,true);},clearRowGroupExpand(){internalData.rowGroupExpandedMaps={};handleVirtualTreeToList();$xeTable.handleTableData();updateAfterDataIndex();reactData.rowGroupExpandedFlag++;return handleLazyRecalculate(true,true,true);},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;},/**
|
|
11477
|
+
*/clearRowExpand(){const{tableFullData,scrollYStore}=internalData;const expandOpts=computeExpandOpts.value;const{reserve}=expandOpts;const expList=$xeTable.getRowExpandRecords();internalData.rowExpandedMaps={};if(reserve){tableFullData.forEach(row=>handleRowExpandReserve(row,false));}reactData.rowExpandedFlag++;scrollYStore.startIndex=0;scrollYStore.endIndex=1;return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(()=>{if(expList.length){return handleLazyRecalculate(true,true,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;const aggregateOpts=computeAggregateOpts.value;const{maxGroupSize}=aggregateOpts;if(!(aggregateConfig||rowGroupConfig)){errLog('vxe.error.reqProp',['aggregate-config']);return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();}const confList=fieldOrColumns?external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(fieldOrColumns)?fieldOrColumns:[fieldOrColumns]:[];if(maxGroupSize&&confList.length>maxGroupSize){if(core_.VxeUI.modal){core_.VxeUI.modal.message({status:'error',content:table_getI18n('vxe.table.maxGroupCol',[maxGroupSize])});}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();}if(confList.length){handleUpdateRowGroup(confList.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;},getAggregateContentByRow(row){const{isRowGroupStatus}=reactData;return isRowGroupStatus&&row&&row.isAggregate?row.groupContent:'';},getAggregateRowChildren(row){const aggregateOpts=computeAggregateOpts.value;const{childrenField,mapChildrenField}=aggregateOpts;const{isRowGroupStatus}=reactData;return isRowGroupStatus&&row&&row.isAggregate&&childrenField&&mapChildrenField?row[mapChildrenField]||[]:[];},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)();},setRowGroupExpandByField(groupFields,expanded){const{isRowGroupStatus}=reactData;const aggregateOpts=computeAggregateOpts.value;const{childrenField}=aggregateOpts;if(groupFields){if(!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(groupFields)){groupFields=[groupFields];}if(isRowGroupStatus){const rows=[];const gfKeys={};groupFields.forEach(groupField=>{gfKeys[groupField]=true;});external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(internalData.afterGroupFullData,row=>{if(row.isAggregate&&gfKeys[row.groupField]){rows.push(row);}},{children:childrenField});if(rows.length){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();$xeTable.handleTableData();updateAfterDataIndex();reactData.rowGroupExpandedFlag++;return handleLazyRecalculate(true,true,true);},clearRowGroupExpand(){internalData.rowGroupExpandedMaps={};handleVirtualTreeToList();$xeTable.handleTableData();updateAfterDataIndex();reactData.rowGroupExpandedFlag++;return handleLazyRecalculate(true,true,true);},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;},/**
|
|
11478
11478
|
* 判断树节点是否懒加载完成
|
|
11479
11479
|
* @param {Row} row 行对象
|
|
11480
11480
|
*/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)();},/**
|