vxe-table 3.21.13 → 3.21.15
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/index.css +1 -1
- package/es/index.min.css +1 -1
- package/es/locale/lang/ar-EG.js +7 -0
- package/es/locale/lang/de-DE.js +7 -0
- package/es/locale/lang/en-US.js +7 -0
- package/es/locale/lang/es-ES.js +7 -0
- package/es/locale/lang/fr-FR.js +7 -0
- package/es/locale/lang/hu-HU.js +7 -0
- package/es/locale/lang/hy-AM.js +7 -0
- package/es/locale/lang/id-ID.js +7 -0
- package/es/locale/lang/it-IT.js +7 -0
- package/es/locale/lang/ja-JP.js +7 -0
- package/es/locale/lang/ko-KR.js +7 -0
- package/es/locale/lang/ms-MY.js +7 -0
- package/es/locale/lang/nb-NO.js +7 -0
- package/es/locale/lang/pt-BR.js +7 -0
- package/es/locale/lang/ru-RU.js +7 -0
- package/es/locale/lang/th-TH.js +7 -0
- package/es/locale/lang/ug-CN.js +7 -0
- package/es/locale/lang/uk-UA.js +7 -0
- package/es/locale/lang/uz-UZ.js +7 -0
- package/es/locale/lang/vi-VN.js +7 -0
- package/es/locale/lang/zh-CHT.js +7 -0
- package/es/locale/lang/zh-CN.js +7 -0
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/module/edit/mixin.js +5 -5
- package/es/table/render/index.js +46 -18
- package/es/table/src/methods.js +206 -61
- package/es/table/src/table.js +14 -7
- package/es/table/style.css +10 -5
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +10 -5
- package/es/vxe-table/style.min.css +1 -1
- package/lib/index.css +1 -1
- package/lib/index.min.css +1 -1
- package/lib/index.umd.js +104 -33
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/ar-EG.js +7 -0
- package/lib/locale/lang/ar-EG.min.js +1 -1
- package/lib/locale/lang/ar-EG.umd.js +7 -0
- package/lib/locale/lang/de-DE.js +7 -0
- package/lib/locale/lang/de-DE.min.js +1 -1
- package/lib/locale/lang/de-DE.umd.js +7 -0
- package/lib/locale/lang/en-US.js +7 -0
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +7 -0
- package/lib/locale/lang/es-ES.js +7 -0
- package/lib/locale/lang/es-ES.min.js +1 -1
- package/lib/locale/lang/es-ES.umd.js +7 -0
- package/lib/locale/lang/fr-FR.js +7 -0
- package/lib/locale/lang/fr-FR.min.js +1 -1
- package/lib/locale/lang/fr-FR.umd.js +7 -0
- package/lib/locale/lang/hu-HU.js +7 -0
- package/lib/locale/lang/hu-HU.min.js +1 -1
- package/lib/locale/lang/hu-HU.umd.js +7 -0
- package/lib/locale/lang/hy-AM.js +7 -0
- package/lib/locale/lang/hy-AM.min.js +1 -1
- package/lib/locale/lang/hy-AM.umd.js +7 -0
- package/lib/locale/lang/id-ID.js +7 -0
- package/lib/locale/lang/id-ID.min.js +1 -1
- package/lib/locale/lang/id-ID.umd.js +7 -0
- package/lib/locale/lang/it-IT.js +7 -0
- package/lib/locale/lang/it-IT.min.js +1 -1
- package/lib/locale/lang/it-IT.umd.js +7 -0
- package/lib/locale/lang/ja-JP.js +7 -0
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +7 -0
- package/lib/locale/lang/ko-KR.js +7 -0
- package/lib/locale/lang/ko-KR.min.js +1 -1
- package/lib/locale/lang/ko-KR.umd.js +7 -0
- package/lib/locale/lang/ms-MY.js +7 -0
- package/lib/locale/lang/ms-MY.min.js +1 -1
- package/lib/locale/lang/ms-MY.umd.js +7 -0
- package/lib/locale/lang/nb-NO.js +7 -0
- package/lib/locale/lang/nb-NO.min.js +1 -1
- package/lib/locale/lang/nb-NO.umd.js +7 -0
- package/lib/locale/lang/pt-BR.js +7 -0
- package/lib/locale/lang/pt-BR.min.js +1 -1
- package/lib/locale/lang/pt-BR.umd.js +7 -0
- package/lib/locale/lang/ru-RU.js +7 -0
- package/lib/locale/lang/ru-RU.min.js +1 -1
- package/lib/locale/lang/ru-RU.umd.js +7 -0
- package/lib/locale/lang/th-TH.js +7 -0
- package/lib/locale/lang/th-TH.min.js +1 -1
- package/lib/locale/lang/th-TH.umd.js +7 -0
- package/lib/locale/lang/ug-CN.js +7 -0
- package/lib/locale/lang/ug-CN.min.js +1 -1
- package/lib/locale/lang/ug-CN.umd.js +7 -0
- package/lib/locale/lang/uk-UA.js +7 -0
- package/lib/locale/lang/uk-UA.min.js +1 -1
- package/lib/locale/lang/uk-UA.umd.js +7 -0
- package/lib/locale/lang/uz-UZ.js +7 -0
- package/lib/locale/lang/uz-UZ.min.js +1 -1
- package/lib/locale/lang/uz-UZ.umd.js +7 -0
- package/lib/locale/lang/vi-VN.js +7 -0
- package/lib/locale/lang/vi-VN.min.js +1 -1
- package/lib/locale/lang/vi-VN.umd.js +7 -0
- package/lib/locale/lang/zh-CHT.js +7 -0
- package/lib/locale/lang/zh-CHT.min.js +1 -1
- package/lib/locale/lang/zh-CHT.umd.js +7 -0
- package/lib/locale/lang/zh-CN.js +7 -0
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +7 -0
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/module/edit/mixin.js +5 -0
- package/lib/table/module/edit/mixin.min.js +1 -1
- package/lib/table/render/index.js +62 -18
- package/lib/table/render/index.min.js +1 -1
- package/lib/table/src/methods.js +14 -7
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +14 -6
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/style/style.css +10 -5
- package/lib/table/style/style.min.css +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/lib/vxe-table/style/style.css +10 -5
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/locale/lang/ar-EG.ts +7 -0
- package/packages/locale/lang/de-DE.ts +7 -0
- package/packages/locale/lang/en-US.ts +7 -0
- package/packages/locale/lang/es-ES.ts +7 -0
- package/packages/locale/lang/fr-FR.ts +7 -0
- package/packages/locale/lang/hu-HU.ts +7 -0
- package/packages/locale/lang/hy-AM.ts +7 -0
- package/packages/locale/lang/id-ID.ts +7 -0
- package/packages/locale/lang/it-IT.ts +7 -0
- package/packages/locale/lang/ja-JP.ts +7 -0
- package/packages/locale/lang/ko-KR.ts +7 -0
- package/packages/locale/lang/ms-MY.ts +7 -0
- package/packages/locale/lang/nb-NO.ts +7 -0
- package/packages/locale/lang/pt-BR.ts +7 -0
- package/packages/locale/lang/ru-RU.ts +7 -0
- package/packages/locale/lang/th-TH.ts +7 -0
- package/packages/locale/lang/ug-CN.ts +7 -0
- package/packages/locale/lang/uk-UA.ts +7 -0
- package/packages/locale/lang/uz-UZ.ts +7 -0
- package/packages/locale/lang/vi-VN.ts +7 -0
- package/packages/locale/lang/zh-CHT.ts +7 -0
- package/packages/locale/lang/zh-CN.ts +7 -0
- package/packages/table/module/edit/mixin.ts +5 -5
- package/packages/table/render/index.ts +46 -18
- package/packages/table/src/methods.ts +210 -60
- package/packages/table/src/table.ts +14 -7
- package/styles/components/table.scss +8 -4
- /package/es/{iconfont.1781229212834.ttf → iconfont.1781675364289.ttf} +0 -0
- /package/es/{iconfont.1781229212834.woff → iconfont.1781675364289.woff} +0 -0
- /package/es/{iconfont.1781229212834.woff2 → iconfont.1781675364289.woff2} +0 -0
- /package/lib/{iconfont.1781229212834.ttf → iconfont.1781675364289.ttf} +0 -0
- /package/lib/{iconfont.1781229212834.woff → iconfont.1781675364289.woff} +0 -0
- /package/lib/{iconfont.1781229212834.woff2 → iconfont.1781675364289.woff2} +0 -0
package/lib/index.umd.js
CHANGED
|
@@ -3311,7 +3311,7 @@ function getClass(property, params) {
|
|
|
3311
3311
|
/* unused harmony import specifier */ var VxeUI;
|
|
3312
3312
|
|
|
3313
3313
|
|
|
3314
|
-
const version = "3.21.
|
|
3314
|
+
const version = "3.21.15";
|
|
3315
3315
|
core_.VxeUI.version = version;
|
|
3316
3316
|
core_.VxeUI.tableVersion = version;
|
|
3317
3317
|
core_.VxeUI.setConfig({
|
|
@@ -4074,7 +4074,7 @@ function wheelScrollTopTo(diffNum, cb) {
|
|
|
4074
4074
|
const {
|
|
4075
4075
|
log: log_log
|
|
4076
4076
|
} = core_.VxeUI;
|
|
4077
|
-
const log_version = `table v${"3.21.
|
|
4077
|
+
const log_version = `table v${"3.21.15"}`;
|
|
4078
4078
|
const warnLog = log_log.create('warn', log_version);
|
|
4079
4079
|
const errLog = log_log.create('error', log_version);
|
|
4080
4080
|
;// ./packages/table/src/columnInfo.ts
|
|
@@ -7741,10 +7741,10 @@ const matchObj=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe
|
|
|
7741
7741
|
* @returns
|
|
7742
7742
|
*/function handleRowGroupVirtualExpand($xeTable,rows,expanded){const reactData=$xeTable;return handleRowGroupBaseExpand($xeTable,rows,expanded).then(()=>{handleVirtualTreeToList($xeTable);$xeTable.handleTableData();reactData.rowGroupExpandedFlag++;updateAfterDataIndex($xeTable);return $xeTable.$nextTick();}).then(()=>{return handleLazyRecalculate($xeTable,true,true,true);}).then(()=>{setTimeout(()=>{$xeTable.updateCellAreas();},30);});}/**
|
|
7743
7743
|
* 处理默认展开分组行
|
|
7744
|
-
*/function handleDefaultRowGroupExpand($xeTable){const reactData=$xeTable;const{isRowGroupStatus}=reactData;if(isRowGroupStatus){const aggregateOpts=$xeTable.computeAggregateOpts;const{expandAll,expandGroupFields}=aggregateOpts;if(expandAll){$xeTable.setAllRowGroupExpand(true);}else if(expandGroupFields&&expandGroupFields.length){$xeTable.setRowGroupExpandByField(expandGroupFields,true);}}}function
|
|
7744
|
+
*/function handleDefaultRowGroupExpand($xeTable){const reactData=$xeTable;const{isRowGroupStatus}=reactData;if(isRowGroupStatus){const aggregateOpts=$xeTable.computeAggregateOpts;const{expandAll,expandGroupFields}=aggregateOpts;if(expandAll){$xeTable.setAllRowGroupExpand(true);}else if(expandGroupFields&&expandGroupFields.length){$xeTable.setRowGroupExpandByField(expandGroupFields,true);}}}function updateAfterTreeIndex($xeTable){const internalData=$xeTable;const{fullDataRowIdData,fullAllDataRowIdData,afterFullData,afterTreeFullData}=internalData;const treeOpts=$xeTable.computeTreeOpts;const{transform,mapChildrenField}=treeOpts;const childrenField=treeOpts.children||treeOpts.childrenField;const fullMaps={};let rowNum=0;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._seq=rowNum;rowRest.treeIndex=index;rowRest._tIndex=rowNum;}else{const rest={row,rowid,_seq:rowNum,seq,index:-1,$index:-1,_index:-1,treeIndex:-1,_tIndex:rowNum,items:[],parent:null,level:0,height:0,resizeHeight:0,oTop:0,expandHeight:0};fullAllDataRowIdData[rowid]=rest;fullDataRowIdData[rowid]=rest;}rowNum++;fullMaps[rowid]=row;},{children:transform?mapChildrenField:childrenField});if(transform){afterFullData.forEach((row,index)=>{const rowid=handleGetRowId(row);const rowRest=fullAllDataRowIdData[rowid];if(rowRest){rowRest._index=index;}});}internalData.afterFullRowMaps=fullMaps;}function updateAfterListIndex($xeTable){const internalData=$xeTable;const{afterFullData,fullDataRowIdData,fullAllDataRowIdData}=internalData;const{handleGetRowId}=createHandleGetRowId($xeTable);const fullMaps={};let rowNum=0;afterFullData.forEach((row,index)=>{const rowid=handleGetRowId(row);const rowRest=fullAllDataRowIdData[rowid];const seq=index+1;if(rowRest){rowRest.seq=seq;rowRest._seq=rowNum;rowRest._index=index;}else{const rest={row,rowid,_seq:rowNum,seq,index:-1,$index:-1,_index:index,treeIndex:-1,_tIndex:-1,items:[],parent:null,level:0,height:0,resizeHeight:0,oTop:0,expandHeight:0};fullAllDataRowIdData[rowid]=rest;fullDataRowIdData[rowid]=rest;}rowNum++;fullMaps[rowid]=row;});internalData.afterFullRowMaps=fullMaps;}/**
|
|
7745
7745
|
* 预编译
|
|
7746
7746
|
* 对渲染中的数据提前解析序号及索引。牺牲提前编译耗时换取渲染中额外损耗,使运行时更加流畅
|
|
7747
|
-
*/function updateAfterDataIndex($xeTable){const props=$xeTable;const
|
|
7747
|
+
*/function updateAfterDataIndex($xeTable){const props=$xeTable;const{treeConfig}=props;if(treeConfig){updateAfterTreeIndex($xeTable);}else{updateAfterListIndex($xeTable);}}/**
|
|
7748
7748
|
* 如果为虚拟树、行分组、则将树结构拍平
|
|
7749
7749
|
* @returns
|
|
7750
7750
|
*/function handleVirtualTreeToList($xeTable){const props=$xeTable;const reactData=$xeTable;const internalData=$xeTable;const{treeConfig}=props;const{isRowGroupStatus}=reactData;const{fullAllDataRowIdData,treeExpandedMaps,rowGroupExpandedMaps}=internalData;const aggregateOpts=$xeTable.computeAggregateOpts;const treeOpts=$xeTable.computeTreeOpts;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($xeTable,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($xeTable,fullData);return fullData;}return internalData.afterFullData;}/**
|
|
@@ -7862,8 +7862,9 @@ function computeScrollLoad($xeTable){const reactData=$xeTable;const internalData
|
|
|
7862
7862
|
if(scrollXLoad){const{toVisibleIndex:toXVisibleIndex,visibleSize:visibleXSize}=handleVirtualXVisible($xeTable);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($xeTable);});}else{$xeTable.updateScrollXSpace();}// 计算 Y 逻辑
|
|
7863
7863
|
const rowHeight=computeRowHeight($xeTable);scrollYStore.rowHeight=rowHeight;// 已废弃
|
|
7864
7864
|
reactData.rowHeight=rowHeight;const{toVisibleIndex:toYVisibleIndex,visibleSize:visibleYSize}=handleVirtualYVisible($xeTable);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($xeTable);});}else{$xeTable.updateScrollYSpace();}});}function calcScrollbar($xeTable){const reactData=$xeTable;const internalData=$xeTable;const{scrollXWidth,scrollYHeight}=reactData;const{elemStore}=internalData;const scrollbarOpts=$xeTable.computeScrollbarOpts;const el=$xeTable.$refs.refElem;if(!el||!el.clientWidth){return;}const bodyWrapperElem=getRefElem(elemStore['main-body-wrapper']);const headerTableElem=getRefElem(elemStore['main-header-table']);const footerTableElem=getRefElem(elemStore['main-footer-table']);const xHandleEl=$xeTable.$refs.refScrollXHandleElem;const yHandleEl=$xeTable.$refs.refScrollYHandleElem;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;}reactData.overflowX=overflowX;const hHeight=headerTableElem?headerTableElem.clientHeight:0;const fHeight=footerTableElem?footerTableElem.clientHeight:0;internalData.tableHeight=bodyWrapperElem.offsetHeight;internalData.tHeaderHeight=hHeight;internalData.tFooterHeight=fHeight;reactData.overflowX=overflowX;reactData.parentHeight=Math.max(hHeight+fHeight+20,$xeTable.getParentHeight());}if(overflowX){$xeTable.checkScrolling();}}function handleRecalculateStyle($xeTable,reFull,reWidth,reHeight){const internalData=$xeTable;const el=$xeTable.$refs.refElem;if(!el||!el.clientWidth){return $xeTable.$nextTick();}const varEl=$xeTable.$refs.refVarElem;if(varEl){const[defEl,mediumEl,smallEl,miniEl]=varEl.children;calcVarRowHeightConfig($xeTable,'default',defEl);calcVarRowHeightConfig($xeTable,'medium',mediumEl);calcVarRowHeightConfig($xeTable,'small',smallEl);calcVarRowHeightConfig($xeTable,'mini',miniEl);}if(reWidth){calcCellWidth($xeTable);}if(reFull){autoCellWidth($xeTable);}calcScrollbar($xeTable);updateStyle($xeTable);updateRowExpandStyle($xeTable);if(reFull){updateTreeLineStyle($xeTable);}internalData.rceRunTime=Date.now();return computeScrollLoad($xeTable).then(()=>{// 初始化时需要在列计算之后再执行优化运算,达到最优显示效果
|
|
7865
|
-
if(reWidth){calcCellWidth($xeTable);}if(reFull){autoCellWidth($xeTable);}if(reHeight){calcCellHeight($xeTable);}updateStyle($xeTable);calcScrollbar($xeTable);if(reFull){updateRowOffsetTop($xeTable);}updateRowExpandStyle($xeTable);if(reFull){updateTreeLineStyle($xeTable);}internalData.rceRunTime=Date.now();if(reFull){return computeScrollLoad($xeTable);}});}const
|
|
7866
|
-
if(rceRunTime&&rceRunTime>Date.now()-500){rceDelay+=50;}else{rceDelay=0;}internalData.rceDelay=rceDelay;const refreshDelay=resizeOpts.refreshDelay||30;const reDelay=rceDelay+refreshDelay;const el=$xeTable.$refs.refElem;if(el&&el.clientWidth){autoCellWidth($xeTable);updateRowExpandStyle($xeTable);}if(customStore.visible&&$xeTable.handleCustomStyle){$xeTable.handleCustomStyle();}if(rceTimeout){clearTimeout(rceTimeout)
|
|
7865
|
+
if(reWidth){calcCellWidth($xeTable);}if(reFull){autoCellWidth($xeTable);}if(reHeight){calcCellHeight($xeTable);}updateStyle($xeTable);calcScrollbar($xeTable);if(reFull){updateRowOffsetTop($xeTable);}updateRowExpandStyle($xeTable);if(reFull){updateTreeLineStyle($xeTable);}internalData.rceRunTime=Date.now();if(reFull){return computeScrollLoad($xeTable);}});}const defaultMinRunDelay=50;function handleLazyRecalculate($xeTable,reFull,reWidth,reHeight,options){const reactData=$xeTable;const internalData=$xeTable;const minRunDelay=(options?options.minRunDelay:defaultMinRunDelay)||defaultMinRunDelay;return new Promise(resolve=>{const{customStore}=reactData;const{rceTimeout,rceRunTime}=internalData;const $xeGanttView=internalData.xeGanttView;const resizeOpts=$xeTable.computeResizeOpts;let rceDelay=internalData.rceDelay;// 如果在500毫秒内频繁执行,则执行次数减缓
|
|
7866
|
+
if(rceRunTime&&rceRunTime>Date.now()-500){rceDelay+=50;}else{rceDelay=0;}internalData.rceDelay=rceDelay;const refreshDelay=resizeOpts.refreshDelay||30;const reDelay=rceDelay+refreshDelay;const el=$xeTable.$refs.refElem;if(el&&el.clientWidth){autoCellWidth($xeTable);updateRowExpandStyle($xeTable);}if(customStore.visible&&$xeTable.handleCustomStyle){$xeTable.handleCustomStyle();}if(rceTimeout){clearTimeout(rceTimeout);// 多少毫秒内至少执行一次
|
|
7867
|
+
if(rceRunTime&&rceRunTime+minRunDelay<Date.now()){resolve(handleRecalculateStyle($xeTable,reFull,reWidth,reHeight));}else{$xeTable.$nextTick(()=>{resolve();});}}else{resolve(handleRecalculateStyle($xeTable,reFull,reWidth,reHeight));}if($xeGanttView&&$xeGanttView.handleLazyRecalculate){$xeGanttView.handleLazyRecalculate();}internalData.rceTimeout=setTimeout(()=>{internalData.rceTimeout=undefined;handleRecalculateStyle($xeTable,reFull,reWidth,reHeight);},reDelay);});}function handleResizeEvent($xeTable){const internalData=$xeTable;if(internalData.rsePending){return;}internalData.rsePending=true;handleLazyRecalculate($xeTable,true,true,true,{minRunDelay:200}).then(()=>{internalData.rsePending=false;}).catch(()=>{internalData.rsePending=false;});}function handleUpdateAggValues($xeTable){const reactData=$xeTable;const internalData=$xeTable;const{visibleColumn}=internalData;const aggCols=[];visibleColumn.forEach(column=>{if(column.aggFunc){aggCols.push(column);}});reactData.aggHandleAggColumns=aggCols;}function handleUpdateRowGroup($xeTable,groupFields){const reactData=$xeTable;const aggGroupFields=[];const aggGroupConfs=[];if(groupFields){(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(groupFields)?groupFields:[groupFields]).forEach(field=>{aggGroupFields.push(field);aggGroupConfs.push({field});});}reactData.rowGroupList=aggGroupConfs;reactData.aggHandleFields=aggGroupFields;handleUpdateAggValues($xeTable);}function handleeGroupSummary($xeTable,aggList){const internalData=$xeTable;const{fullColumnFieldData}=internalData;const aggregateOpts=$xeTable.computeAggregateOpts;const aggFuncColumns=$xeTable.computeAggFuncColumns;const{mapChildrenField}=aggregateOpts;const aggCalcMethod=aggregateOpts.calcValuesMethod||aggregateOpts.countMethod||aggregateOpts.aggregateMethod;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.handlePivotTableAggData){$xeTable.handlePivotTableAggData(aggList);}else{external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().lastEach(aggList,aggRow=>{const aggDtObj={};const aggData=aggRow.aggData;const groupField=aggRow.groupField;const groupContent=aggRow.groupContent;const childList=mapChildrenField?aggRow[mapChildrenField]||[]:[];const childCount=aggRow.childCount;const colRest=fullColumnFieldData[groupField]||{};aggFuncColumns.forEach(column=>{const{field}=column;const currAggData=aggData?aggData[field]:null;const ctParams={$table:$xeTable,groupField,groupColumn:colRest?colRest.column:null,column,groupValue:groupContent,childList,childCount,aggValue:currAggData?currAggData.value:0,/**
|
|
7867
7868
|
* 已废弃
|
|
7868
7869
|
* @deprecated
|
|
7869
7870
|
*/children:childList,/**
|
|
@@ -8001,9 +8002,9 @@ if(virtualXOpts.scrollToLeftOnChange){targetScrollLeft=0;}if(virtualYOpts.scroll
|
|
|
8001
8002
|
*/reloadColumn(columns){return this.clearAll().then(()=>{return this.loadColumn(columns);});},handleInitColumn(collectColumn){const $xeTable=this;return handleInitColumn($xeTable,collectColumn);},/**
|
|
8002
8003
|
* 更新数据行的 Map
|
|
8003
8004
|
*/cacheRowMap(isReset){const $xeTable=this;const props=$xeTable;const reactData=$xeTable;const internalData=$xeTable;const{treeConfig}=props;const{isRowGroupStatus}=reactData;const{currKeyField,fullAllDataRowIdData,tableFullData,tableFullTreeData,tableFullGroupData,treeExpandedMaps,rowExpandedMaps,selectCheckboxMaps}=internalData;const fullAllDataRowIdMaps=isReset?{}:{...fullAllDataRowIdData};// 存在已删除数据
|
|
8004
|
-
const fullDataRowIdMaps={};const idMaps={};const{handleUpdateRowId}=createHandleUpdateRowId($xeTable);const handleRowCache=(row,index,items,currIndex,parentRow,rowid,level,seq)=>{let rowRest=fullAllDataRowIdMaps[rowid];if(idMaps[rowid]){errLog('vxe.error.repeatKey',[currKeyField,rowid]);}if(!rowRest){rowRest={row,rowid,seq,index:-1,_index:-1,$index:-1,treeIndex:index,_tIndex:-1,items,parent:parentRow,level,height:0,resizeHeight:0,oTop:0,expandHeight:0};}rowRest.treeLoaded=false;rowRest.expandLoaded=false;rowRest.row=row;rowRest.items=items;rowRest.parent=parentRow;rowRest.level=level;rowRest.index=currIndex;rowRest.treeIndex=index;// 更新缓存
|
|
8005
|
+
const fullDataRowIdMaps={};const idMaps={};const{handleUpdateRowId}=createHandleUpdateRowId($xeTable);let rowNum=0;const handleRowCache=(row,index,items,currIndex,parentRow,rowid,level,seq)=>{let rowRest=fullAllDataRowIdMaps[rowid];if(idMaps[rowid]){errLog('vxe.error.repeatKey',[currKeyField,rowid]);}if(!rowRest){rowRest={row,rowid,_seq:-1,seq,index:-1,_index:-1,$index:-1,treeIndex:index,_tIndex:-1,items,parent:parentRow,level,height:0,resizeHeight:0,oTop:0,expandHeight:0};}rowRest.treeLoaded=false;rowRest.expandLoaded=false;rowRest._seq=rowNum++;rowRest.row=row;rowRest.items=items;rowRest.parent=parentRow;rowRest.level=level;rowRest.index=currIndex;rowRest.treeIndex=index;// 更新缓存
|
|
8005
8006
|
if(selectCheckboxMaps[rowid]){selectCheckboxMaps[rowid]=row;}if(rowExpandedMaps[rowid]){rowExpandedMaps[rowid]=row;}idMaps[rowid]=true;fullDataRowIdMaps[rowid]=rowRest;fullAllDataRowIdMaps[rowid]=rowRest;};if(treeConfig){const treeOpts=$xeTable.computeTreeOpts;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(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=$xeTable.computeAggregateOpts;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 $xeTable=this;const props=$xeTable;const internalData=$xeTable;const{treeConfig}=props;const treeOpts=$xeTable.computeTreeOpts;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;};// 源数据缓存
|
|
8006
|
-
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;},getParams(){const $xeTable=this;const props=$xeTable;return props.params;},loadTreeChildren(row,childRecords){const $xeTable=this;const props=$xeTable;const internalData=$xeTable;const{keepSource}=props;const{tableSourceData,fullDataRowIdData,fullAllDataRowIdData,sourceDataRowIdData}=internalData;const treeOpts=$xeTable.computeTreeOpts;const{transform,mapChildrenField}=treeOpts;const childrenField=treeOpts.children||treeOpts.childrenField;const parentRest=fullAllDataRowIdData[getRowid($xeTable,row)];const parentLevel=parentRest?parentRest.level:0;return this.createData(childRecords).then(rows=>{if(keepSource){const rowid=getRowid(this,row);const matchObj=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findTree(tableSourceData,item=>rowid===getRowid(this,item),{children:childrenField});if(matchObj){matchObj.item[childrenField]=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().clone(rows,true);}rows.forEach(childRow=>{const rowid=getRowid(this,childRow);sourceDataRowIdData[rowid]=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().clone(childRow,true);});}external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(rows,(childRow,index,items,path,parentItem,nodes)=>{const rowid=getRowid($xeTable,childRow);const parentRow=parentItem||parentRest.row;const rest={row:childRow,rowid,seq:-1,index,_index:-1,$index:-1,treeIndex:-1,_tIndex:-1,items,parent:parentRow,level:parentLevel+nodes.length,height:0,resizeHeight:0,oTop:0,expandHeight:0};fullDataRowIdData[rowid]=rest;fullAllDataRowIdData[rowid]=rest;},{children:childrenField});row[childrenField]=rows;if(transform){row[mapChildrenField]=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().clone(rows,false);}updateAfterDataIndex($xeTable);return rows;});},/**
|
|
8007
|
+
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;},getParams(){const $xeTable=this;const props=$xeTable;return props.params;},loadTreeChildren(row,childRecords){const $xeTable=this;const props=$xeTable;const internalData=$xeTable;const{keepSource}=props;const{tableSourceData,fullDataRowIdData,fullAllDataRowIdData,sourceDataRowIdData}=internalData;const treeOpts=$xeTable.computeTreeOpts;const{transform,mapChildrenField}=treeOpts;const childrenField=treeOpts.children||treeOpts.childrenField;const parentRest=fullAllDataRowIdData[getRowid($xeTable,row)];const parentLevel=parentRest?parentRest.level:0;return this.createData(childRecords).then(rows=>{if(keepSource){const rowid=getRowid(this,row);const matchObj=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findTree(tableSourceData,item=>rowid===getRowid(this,item),{children:childrenField});if(matchObj){matchObj.item[childrenField]=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().clone(rows,true);}rows.forEach(childRow=>{const rowid=getRowid(this,childRow);sourceDataRowIdData[rowid]=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().clone(childRow,true);});}external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(rows,(childRow,index,items,path,parentItem,nodes)=>{const rowid=getRowid($xeTable,childRow);const parentRow=parentItem||parentRest.row;const rest={row:childRow,rowid,_seq:-1,seq:-1,index,_index:-1,$index:-1,treeIndex:-1,_tIndex:-1,items,parent:parentRow,level:parentLevel+nodes.length,height:0,resizeHeight:0,oTop:0,expandHeight:0};fullDataRowIdData[rowid]=rest;fullAllDataRowIdData[rowid]=rest;},{children:childrenField});row[childrenField]=rows;if(transform){row[mapChildrenField]=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().clone(rows,false);}updateAfterDataIndex($xeTable);return rows;});},/**
|
|
8007
8008
|
* 根据 tr 元素获取对应的 row 信息
|
|
8008
8009
|
* @param {Element} tr 元素
|
|
8009
8010
|
*/getRowNode(tr){const $xeTable=this;const internalData=$xeTable;if(tr){const{fullAllDataRowIdData}=internalData;const rowid=tr.getAttribute('rowid');if(rowid){const rowRest=fullAllDataRowIdData[rowid];if(rowRest){return{rowid:rowRest.rowid,item:rowRest.row,index:rowRest.index,items:rowRest.items,parent:rowRest.parent};}}}return null;},/**
|
|
@@ -8290,7 +8291,13 @@ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default(
|
|
|
8290
8291
|
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($xeTable,row,checked);reactData.updateCheckboxFlag++;}});},/**
|
|
8291
8292
|
* 即将移除
|
|
8292
8293
|
* @deprecated
|
|
8293
|
-
*/handleSelectRow({row},checked,isForce){const $xeTable=this;$xeTable.handleBatchSelectRows([row],checked,isForce);},handleToggleCheckRowEvent(evnt,params){const $xeTable=this;const internalData=$xeTable;const{selectCheckboxMaps}=internalData;const checkboxOpts=$xeTable.computeCheckboxOpts;const{checkField,trigger}=checkboxOpts;const{row}=params;if(trigger==='manual'){return;}let checked=false;if(checkField){checked=!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row,checkField);}else{checked=!selectCheckboxMaps[getRowid($xeTable,row)];}if(evnt){$xeTable.triggerCheckRowEvent(evnt,params,checked);}else{$xeTable.handleBatchSelectRows([row],checked);$xeTable.checkSelectionStatus();}},triggerCheckRowEvent(evnt,params,checked){const $xeTable=this;const props=$xeTable;const reactData=$xeTable;const internalData=$xeTable;const{treeConfig}=props;const{row}=params;const{isRowGroupStatus}=reactData;const{afterFullData}=internalData;const checkboxOpts=$xeTable.computeCheckboxOpts;const{checkMethod,trigger}=checkboxOpts;if(trigger==='manual'){return;}evnt.stopPropagation();if(checkboxOpts.isShiftKey&&evnt.shiftKey
|
|
8294
|
+
*/handleSelectRow({row},checked,isForce){const $xeTable=this;$xeTable.handleBatchSelectRows([row],checked,isForce);},handleToggleCheckRowEvent(evnt,params){const $xeTable=this;const internalData=$xeTable;const{selectCheckboxMaps}=internalData;const checkboxOpts=$xeTable.computeCheckboxOpts;const{checkField,trigger}=checkboxOpts;const{row}=params;if(trigger==='manual'){return;}let checked=false;if(checkField){checked=!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row,checkField);}else{checked=!selectCheckboxMaps[getRowid($xeTable,row)];}if(evnt){$xeTable.triggerCheckRowEvent(evnt,params,checked);}else{$xeTable.handleBatchSelectRows([row],checked);$xeTable.checkSelectionStatus();}},triggerCheckRowEvent(evnt,params,checked){const $xeTable=this;const props=$xeTable;const reactData=$xeTable;const internalData=$xeTable;const{treeConfig}=props;const{row}=params;const{isRowGroupStatus}=reactData;const{fullAllDataRowIdData,afterFullData,afterTreeFullData,afterGroupFullData}=internalData;const checkboxOpts=$xeTable.computeCheckboxOpts;const aggregateOpts=$xeTable.computeAggregateOpts;const treeOpts=$xeTable.computeTreeOpts;const{checkMethod,trigger,checkStrictly}=checkboxOpts;if(trigger==='manual'){return;}evnt.stopPropagation();if(checkboxOpts.isShiftKey&&evnt.shiftKey){const{handleGetRowId}=createHandleGetRowId($xeTable);const checkboxRecords=$xeTable.getCheckboxRecords();let currSeq=-1;let currRow=null;const currRowid=handleGetRowId(row);const rowRest=fullAllDataRowIdData[currRowid];if(rowRest){currRow=rowRest.row;currSeq=rowRest._seq;}if(currRow&&checkboxRecords.length){let rangeRows=[];let firstSeq=-1;let firstRow=null;let firstRowid='';let lastSeq=-1;let lastRow=null;let lastRowid='';// 根据序号取出范围最小/最大的行
|
|
8295
|
+
const selectMaps={};checkboxRecords.forEach(item=>{const rowid=handleGetRowId(item);const rowRest=fullAllDataRowIdData[rowid];if(rowRest){if(!firstRow||firstSeq>rowRest._seq){firstRowid=rowRest.rowid;firstRow=rowRest.row;firstSeq=rowRest._seq;}if(!lastRow||lastSeq<rowRest._seq){lastRowid=rowRest.rowid;lastRow=rowRest.row;lastSeq=rowRest._seq;}}selectMaps[rowid]=item;});// 如果已选只有一条并选择当前则跳过
|
|
8296
|
+
if(firstRow&&lastRow&&(checkboxRecords.length>1||currRowid!==firstRowid)&&(Math.abs(firstSeq-lastSeq)>1||Math.abs(currSeq-firstSeq)>1||Math.abs(currSeq-lastSeq)>1)){// 树与分组
|
|
8297
|
+
if(treeConfig||isRowGroupStatus){const{transform}=treeOpts;const childrenField=treeOpts.children||treeOpts.childrenField;const iteratorChildField=treeConfig?transform?treeOpts.mapChildrenField:childrenField:aggregateOpts.mapChildrenField;let isMatchFirst=false;let matchStartRowid='';let matchEndRowid='';const handleGetChildRowid=(rowid,isLast)=>{const rowRest=fullAllDataRowIdData[rowid];if(rowRest){const item=rowRest.row;const childList=item[iteratorChildField];if(childList&&childList.length){const targetRow=isLast?external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().last(childList):external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().first(childList);return handleGetChildRowid(handleGetRowId(targetRow),isLast);}}return rowid;};const handleGetSelectParentRowid=rowid=>{const rowRest=fullAllDataRowIdData[rowid];if(rowRest){const parentItem=rowRest.parent;if(parentItem){const parentRowid=handleGetRowId(parentItem);if(selectMaps[parentRowid]){return handleGetSelectParentRowid(parentRowid);}}}return rowid;};const handleGetRootRow=row=>{const rowid=handleGetRowId(row);if(rowid){const rest=fullAllDataRowIdData[rowid];if(rest){return rest.parent?handleGetRootRow(rest.parent):rest;}}return null;};if(currSeq<firstSeq){matchStartRowid=handleGetChildRowid(currRowid,0);matchEndRowid=handleGetChildRowid(firstRowid,1);}else{if(currSeq>lastSeq){matchStartRowid=handleGetSelectParentRowid(lastRowid);}else{matchStartRowid=handleGetChildRowid(firstRowid,0);}matchEndRowid=handleGetChildRowid(currRowid,1);}const handleRangeRow=item=>{const rowid=handleGetRowId(item);const childList=item[iteratorChildField];if(!isMatchFirst&&rowid===matchStartRowid){isMatchFirst=true;}// 如果是父子关联,则排除父节点
|
|
8298
|
+
if(isMatchFirst&&(checkStrictly||!childList||!childList.length)){rangeRows.push(item);}// break
|
|
8299
|
+
return rowid===matchEndRowid;};if(treeConfig){const matchStartRowRest=fullAllDataRowIdData[matchStartRowid];const firstRootRowRest=matchStartRowRest?handleGetRootRow(matchStartRowRest.row):null;if(firstRootRowRest){// 优化查找复杂度
|
|
8300
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findTree(afterTreeFullData.slice(firstRootRowRest.treeIndex),handleRangeRow,{children:iteratorChildField});}else{external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findTree(afterTreeFullData,handleRangeRow,{children:iteratorChildField});}}else{external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findTree(afterGroupFullData,handleRangeRow,{children:iteratorChildField});}}else{const _currRowIndex=$xeTable.getVTRowIndex(currRow);const _firstRowIndex=$xeTable.getVTRowIndex(firstRow);const _lastRowIndex=$xeTable.getVTRowIndex(lastRow);if(_currRowIndex<_firstRowIndex){rangeRows=afterFullData.slice(_currRowIndex,_firstRowIndex+1);}else if(_currRowIndex>_lastRowIndex){rangeRows=afterFullData.slice(_lastRowIndex,_currRowIndex+1);}else{rangeRows=afterFullData.slice(_firstRowIndex,_currRowIndex+1);}}$xeTable.setAllCheckboxRow(false);$xeTable.$nextTick(()=>{handleCheckedCheckboxRow($xeTable,rangeRows,true,false);});$xeTable.dispatchEvent('checkbox-range-select',Object.assign({rangeRecords:rangeRows},params),evnt);}}}if(!checkMethod||checkMethod({$table:$xeTable,row})){$xeTable.handleBatchSelectRows([row],checked);$xeTable.checkSelectionStatus();$xeTable.dispatchEvent('checkbox-change',Object.assign({records:()=>$xeTable.getCheckboxRecords(),reserves:()=>$xeTable.getCheckboxReserveRecords(),indeterminates:()=>$xeTable.getCheckboxIndeterminateRecords(),checked},params),evnt);}},/**
|
|
8294
8301
|
* 多选,切换某一行的选中状态
|
|
8295
8302
|
*/toggleCheckboxRow(row){const $xeTable=this;const internalData=$xeTable;const{selectCheckboxMaps}=internalData;const checkboxOpts=$xeTable.computeCheckboxOpts;const{checkField}=checkboxOpts;const checked=checkField?!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row,checkField):!selectCheckboxMaps[getRowid($xeTable,row)];$xeTable.handleBatchSelectRows([row],checked,true);$xeTable.checkSelectionStatus();return $xeTable.$nextTick();},/**
|
|
8296
8303
|
* 用于多选行,设置所有行的选中状态
|
|
@@ -14749,6 +14756,7 @@ function insertTreeRow($xeTable, newRecords, isAppend) {
|
|
|
14749
14756
|
const rest = {
|
|
14750
14757
|
row: item,
|
|
14751
14758
|
rowid,
|
|
14759
|
+
_seq: -1,
|
|
14752
14760
|
seq: -1,
|
|
14753
14761
|
index: -1,
|
|
14754
14762
|
_index: -1,
|
|
@@ -14774,6 +14782,7 @@ function insertTreeRow($xeTable, newRecords, isAppend) {
|
|
|
14774
14782
|
const rest = {
|
|
14775
14783
|
row: item,
|
|
14776
14784
|
rowid,
|
|
14785
|
+
_seq: -1,
|
|
14777
14786
|
seq: -1,
|
|
14778
14787
|
index: -1,
|
|
14779
14788
|
_index: -1,
|
|
@@ -14869,6 +14878,7 @@ function handleInsertRowAt($xeTable, records, targetRowOrRowid, isInsertNextRow)
|
|
|
14869
14878
|
const rest = {
|
|
14870
14879
|
row: item,
|
|
14871
14880
|
rowid,
|
|
14881
|
+
_seq: -1,
|
|
14872
14882
|
seq: -1,
|
|
14873
14883
|
index: -1,
|
|
14874
14884
|
_index: -1,
|
|
@@ -14916,6 +14926,7 @@ function handleInsertRowAt($xeTable, records, targetRowOrRowid, isInsertNextRow)
|
|
|
14916
14926
|
const rest = {
|
|
14917
14927
|
row: item,
|
|
14918
14928
|
rowid,
|
|
14929
|
+
_seq: -1,
|
|
14919
14930
|
seq: -1,
|
|
14920
14931
|
index: -1,
|
|
14921
14932
|
_index: -1,
|
|
@@ -14974,6 +14985,7 @@ function handleInsertRowAt($xeTable, records, targetRowOrRowid, isInsertNextRow)
|
|
|
14974
14985
|
const rest = {
|
|
14975
14986
|
row: item,
|
|
14976
14987
|
rowid,
|
|
14988
|
+
_seq: -1,
|
|
14977
14989
|
seq: -1,
|
|
14978
14990
|
index: -1,
|
|
14979
14991
|
_index: -1,
|
|
@@ -21330,6 +21342,7 @@ function renderBody(h, $xeTable) {
|
|
|
21330
21342
|
} = reactData;
|
|
21331
21343
|
const editDirtyOpts = $xeTable.computeEditDirtyOpts;
|
|
21332
21344
|
const {
|
|
21345
|
+
extraFields,
|
|
21333
21346
|
includeFields,
|
|
21334
21347
|
excludeFields
|
|
21335
21348
|
} = editDirtyOpts;
|
|
@@ -21338,10 +21351,19 @@ function renderBody(h, $xeTable) {
|
|
|
21338
21351
|
if (includeFields && includeFields.length) {
|
|
21339
21352
|
return includeFields;
|
|
21340
21353
|
}
|
|
21341
|
-
const
|
|
21354
|
+
const excludeFdMaps = {};
|
|
21342
21355
|
if (excludeFields && excludeFields.length) {
|
|
21343
21356
|
excludeFields.forEach(field => {
|
|
21344
|
-
|
|
21357
|
+
excludeFdMaps[field] = 1;
|
|
21358
|
+
});
|
|
21359
|
+
}
|
|
21360
|
+
const addFdMaps = {};
|
|
21361
|
+
if (extraFields && extraFields.length) {
|
|
21362
|
+
extraFields.forEach(field => {
|
|
21363
|
+
if (!addFdMaps[field]) {
|
|
21364
|
+
addFdMaps[field] = 1;
|
|
21365
|
+
kpFields.push(field);
|
|
21366
|
+
}
|
|
21345
21367
|
});
|
|
21346
21368
|
}
|
|
21347
21369
|
for (let i = 0; i < tableFullColumn.length; i++) {
|
|
@@ -21352,7 +21374,8 @@ function renderBody(h, $xeTable) {
|
|
|
21352
21374
|
editRender,
|
|
21353
21375
|
cellRender
|
|
21354
21376
|
} = column;
|
|
21355
|
-
if (field && !type && (editRender || cellRender) && !
|
|
21377
|
+
if (field && !type && (editRender || cellRender) && !addFdMaps[field] && !excludeFdMaps[field]) {
|
|
21378
|
+
addFdMaps[field] = 1;
|
|
21356
21379
|
kpFields.push(field);
|
|
21357
21380
|
}
|
|
21358
21381
|
}
|
|
@@ -21867,9 +21890,6 @@ function renderBody(h, $xeTable) {
|
|
|
21867
21890
|
if (props.editConfig && editOpts.activeMethod) {
|
|
21868
21891
|
warnLog('vxe.error.delProp', ['table.edit-config.activeMethod', 'table.edit-config.beforeEditMethod']);
|
|
21869
21892
|
}
|
|
21870
|
-
if (props.treeConfig && checkboxOpts.isShiftKey) {
|
|
21871
|
-
errLog('vxe.error.reqSupportProp', ['tree-config', 'checkbox-config.isShiftKey=false']);
|
|
21872
|
-
}
|
|
21873
21893
|
if (checkboxOpts.halfField) {
|
|
21874
21894
|
warnLog('vxe.error.delProp', ['checkbox-config.halfField', 'checkbox-config.indeterminateField']);
|
|
21875
21895
|
}
|
|
@@ -26505,14 +26525,14 @@ function handleSetTreeSelectValue(renderOpts, params) {
|
|
|
26505
26525
|
*/
|
|
26506
26526
|
render_renderer.mixin({
|
|
26507
26527
|
input: {
|
|
26508
|
-
tableAutoFocus:
|
|
26528
|
+
tableAutoFocus: true,
|
|
26509
26529
|
renderTableEdit: nativeEditRender,
|
|
26510
26530
|
renderTableDefault: nativeEditRender,
|
|
26511
26531
|
renderTableFilter: nativeFilterRender,
|
|
26512
26532
|
tableFilterDefaultMethod: handleInputFilterMethod
|
|
26513
26533
|
},
|
|
26514
26534
|
textarea: {
|
|
26515
|
-
tableAutoFocus:
|
|
26535
|
+
tableAutoFocus: true,
|
|
26516
26536
|
renderTableEdit: nativeEditRender
|
|
26517
26537
|
},
|
|
26518
26538
|
select: {
|
|
@@ -26574,7 +26594,7 @@ render_renderer.mixin({
|
|
|
26574
26594
|
tableExportMethod: handleExportSelectMethod
|
|
26575
26595
|
},
|
|
26576
26596
|
VxeInput: {
|
|
26577
|
-
tableAutoFocus:
|
|
26597
|
+
tableAutoFocus: true,
|
|
26578
26598
|
renderTableEdit: defaultEditRender,
|
|
26579
26599
|
renderTableCell(h, renderOpts, params) {
|
|
26580
26600
|
const {
|
|
@@ -26622,7 +26642,7 @@ render_renderer.mixin({
|
|
|
26622
26642
|
}
|
|
26623
26643
|
},
|
|
26624
26644
|
VxeNumberInput: {
|
|
26625
|
-
tableAutoFocus:
|
|
26645
|
+
tableAutoFocus: true,
|
|
26626
26646
|
renderTableEdit: defaultEditRender,
|
|
26627
26647
|
renderTableCell: handleNumberCell,
|
|
26628
26648
|
renderTableFooter(h, renderOpts, params) {
|
|
@@ -26686,7 +26706,7 @@ render_renderer.mixin({
|
|
|
26686
26706
|
}
|
|
26687
26707
|
},
|
|
26688
26708
|
VxeDatePicker: {
|
|
26689
|
-
tableAutoFocus:
|
|
26709
|
+
tableAutoFocus: true,
|
|
26690
26710
|
renderTableEdit: defaultEditRender,
|
|
26691
26711
|
renderTableCell(h, renderOpts, params) {
|
|
26692
26712
|
const props = renderOpts.props || {};
|
|
@@ -26720,7 +26740,7 @@ render_renderer.mixin({
|
|
|
26720
26740
|
tableFilterDefaultMethod: handleFilterMethod
|
|
26721
26741
|
},
|
|
26722
26742
|
VxeDateRangePicker: {
|
|
26723
|
-
tableAutoFocus:
|
|
26743
|
+
tableAutoFocus: true,
|
|
26724
26744
|
renderTableEdit(h, renderOpts, params) {
|
|
26725
26745
|
const {
|
|
26726
26746
|
startField,
|
|
@@ -26843,7 +26863,7 @@ render_renderer.mixin({
|
|
|
26843
26863
|
}
|
|
26844
26864
|
},
|
|
26845
26865
|
VxeTextarea: {
|
|
26846
|
-
tableAutoFocus:
|
|
26866
|
+
tableAutoFocus: true,
|
|
26847
26867
|
renderTableDefault: defaultEditRender,
|
|
26848
26868
|
renderTableEdit: defaultEditRender
|
|
26849
26869
|
},
|
|
@@ -26865,7 +26885,7 @@ render_renderer.mixin({
|
|
|
26865
26885
|
}
|
|
26866
26886
|
},
|
|
26867
26887
|
VxeSelect: {
|
|
26868
|
-
tableAutoFocus:
|
|
26888
|
+
tableAutoFocus: true,
|
|
26869
26889
|
renderTableEdit: defaultSelectEditRender,
|
|
26870
26890
|
renderTableDefault: defaultSelectEditRender,
|
|
26871
26891
|
renderTableCell(h, renderOpts, params) {
|
|
@@ -27053,7 +27073,7 @@ render_renderer.mixin({
|
|
|
27053
27073
|
tableExportMethod: handleExportSelectMethod
|
|
27054
27074
|
},
|
|
27055
27075
|
VxeTreeSelect: {
|
|
27056
|
-
tableAutoFocus:
|
|
27076
|
+
tableAutoFocus: true,
|
|
27057
27077
|
renderTableEdit: defaultTableOrTreeSelectEditRender,
|
|
27058
27078
|
renderTableCell(h, renderOpts, params) {
|
|
27059
27079
|
const {
|
|
@@ -27147,8 +27167,52 @@ render_renderer.mixin({
|
|
|
27147
27167
|
tableCellPasteMethod: handleSetTreeSelectValue,
|
|
27148
27168
|
tableExportMethod: handleExportTreeSelectMethod
|
|
27149
27169
|
},
|
|
27170
|
+
VxeCascader: {
|
|
27171
|
+
tableAutoFocus: true,
|
|
27172
|
+
renderTableEdit: defaultTableOrTreeSelectEditRender,
|
|
27173
|
+
renderTableCell(h, renderOpts, params) {
|
|
27174
|
+
const {
|
|
27175
|
+
options,
|
|
27176
|
+
optionGroups
|
|
27177
|
+
} = renderOpts;
|
|
27178
|
+
const {
|
|
27179
|
+
$table,
|
|
27180
|
+
row,
|
|
27181
|
+
column
|
|
27182
|
+
} = params;
|
|
27183
|
+
const opSize = options ? options.length : null;
|
|
27184
|
+
const ogSize = optionGroups ? optionGroups.length : null;
|
|
27185
|
+
const {
|
|
27186
|
+
cellResult
|
|
27187
|
+
} = $table.effectCellData(row, column, {
|
|
27188
|
+
key: 'render_table_cell',
|
|
27189
|
+
isChanged({
|
|
27190
|
+
oldValue,
|
|
27191
|
+
cellValue
|
|
27192
|
+
}) {
|
|
27193
|
+
return oldValue && oldValue[0] === cellValue && oldValue[1] === opSize && oldValue[2] === ogSize;
|
|
27194
|
+
},
|
|
27195
|
+
setValue({
|
|
27196
|
+
cellValue
|
|
27197
|
+
}) {
|
|
27198
|
+
return [cellValue, opSize, ogSize];
|
|
27199
|
+
},
|
|
27200
|
+
getResult({
|
|
27201
|
+
cellValue
|
|
27202
|
+
}) {
|
|
27203
|
+
return handleTreeSelectCellValue(cellValue, renderOpts);
|
|
27204
|
+
}
|
|
27205
|
+
});
|
|
27206
|
+
// const cellResult = getTreeSelectCellValue(renderOpts, params)
|
|
27207
|
+
return getCellLabelVNs(h, renderOpts, params, cellResult);
|
|
27208
|
+
},
|
|
27209
|
+
tableCellFormatter: handleFormatTreeSelect,
|
|
27210
|
+
tableCellCopyMethod: handleFormatTreeSelect,
|
|
27211
|
+
tableCellPasteMethod: handleSetTreeSelectValue,
|
|
27212
|
+
tableExportMethod: handleExportTreeSelectMethod
|
|
27213
|
+
},
|
|
27150
27214
|
VxeTableSelect: {
|
|
27151
|
-
tableAutoFocus:
|
|
27215
|
+
tableAutoFocus: true,
|
|
27152
27216
|
renderTableEdit: defaultTableOrTreeSelectEditRender,
|
|
27153
27217
|
renderTableCell(h, renderOpts, params) {
|
|
27154
27218
|
const {
|
|
@@ -27192,7 +27256,7 @@ render_renderer.mixin({
|
|
|
27192
27256
|
tableExportMethod: handleExportTreeSelectMethod
|
|
27193
27257
|
},
|
|
27194
27258
|
VxeColorPicker: {
|
|
27195
|
-
tableAutoFocus:
|
|
27259
|
+
tableAutoFocus: true,
|
|
27196
27260
|
renderTableEdit(h, renderOpts, params) {
|
|
27197
27261
|
const {
|
|
27198
27262
|
row,
|
|
@@ -27226,7 +27290,7 @@ render_renderer.mixin({
|
|
|
27226
27290
|
}
|
|
27227
27291
|
},
|
|
27228
27292
|
VxeIconPicker: {
|
|
27229
|
-
tableAutoFocus:
|
|
27293
|
+
tableAutoFocus: true,
|
|
27230
27294
|
renderTableEdit(h, renderOpts, params) {
|
|
27231
27295
|
const {
|
|
27232
27296
|
row,
|
|
@@ -27338,7 +27402,7 @@ render_renderer.mixin({
|
|
|
27338
27402
|
},
|
|
27339
27403
|
// 以下已废弃
|
|
27340
27404
|
$input: {
|
|
27341
|
-
tableAutoFocus: '
|
|
27405
|
+
tableAutoFocus: 'input',
|
|
27342
27406
|
renderTableEdit: oldEditRender,
|
|
27343
27407
|
renderTableCell(h, renderOpts, params) {
|
|
27344
27408
|
const {
|
|
@@ -27370,7 +27434,7 @@ render_renderer.mixin({
|
|
|
27370
27434
|
tableFilterDefaultMethod: handleInputFilterMethod
|
|
27371
27435
|
},
|
|
27372
27436
|
$textarea: {
|
|
27373
|
-
tableAutoFocus: '
|
|
27437
|
+
tableAutoFocus: 'textarea'
|
|
27374
27438
|
},
|
|
27375
27439
|
$button: {
|
|
27376
27440
|
renderTableDefault: oldButtonEditRender
|
|
@@ -27379,7 +27443,7 @@ render_renderer.mixin({
|
|
|
27379
27443
|
renderTableDefault: oldButtonsEditRender
|
|
27380
27444
|
},
|
|
27381
27445
|
$select: {
|
|
27382
|
-
tableAutoFocus: '
|
|
27446
|
+
tableAutoFocus: 'input',
|
|
27383
27447
|
renderTableEdit: oldSelectEditRender,
|
|
27384
27448
|
renderTableDefault: oldSelectEditRender,
|
|
27385
27449
|
renderTableCell(h, renderOpts, params) {
|
|
@@ -27413,13 +27477,13 @@ render_renderer.mixin({
|
|
|
27413
27477
|
tableExportMethod: handleExportSelectMethod
|
|
27414
27478
|
},
|
|
27415
27479
|
$radio: {
|
|
27416
|
-
tableAutoFocus: '
|
|
27480
|
+
tableAutoFocus: 'input'
|
|
27417
27481
|
},
|
|
27418
27482
|
$checkbox: {
|
|
27419
|
-
tableAutoFocus: '
|
|
27483
|
+
tableAutoFocus: 'input'
|
|
27420
27484
|
},
|
|
27421
27485
|
$switch: {
|
|
27422
|
-
tableAutoFocus: '
|
|
27486
|
+
tableAutoFocus: 'button',
|
|
27423
27487
|
renderTableEdit: oldEditRender,
|
|
27424
27488
|
renderTableDefault: oldEditRender
|
|
27425
27489
|
}
|
|
@@ -27843,6 +27907,13 @@ const Toolbar = VxeToolbar;
|
|
|
27843
27907
|
yearLabel: '{0} 年',
|
|
27844
27908
|
monthLabel: '{0} 月'
|
|
27845
27909
|
},
|
|
27910
|
+
cascader: {
|
|
27911
|
+
clearChecked: '清除',
|
|
27912
|
+
allChecked: '全选',
|
|
27913
|
+
total: '已选 {0} 项',
|
|
27914
|
+
close: '关闭',
|
|
27915
|
+
search: '搜索'
|
|
27916
|
+
},
|
|
27846
27917
|
numberInput: {
|
|
27847
27918
|
currencySymbol: '¥'
|
|
27848
27919
|
},
|