vxe-table 4.15.0-beta.11 → 4.15.0-beta.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/grid/src/grid.js +38 -6
- package/es/style.css +1 -1
- package/es/table/module/edit/hook.js +5 -5
- package/es/table/src/body.js +7 -6
- package/es/table/src/table.js +14 -10
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/grid/src/grid.js +48 -6
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.umd.js +67 -19
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/module/edit/hook.js +5 -0
- package/lib/table/module/edit/hook.min.js +1 -1
- package/lib/table/src/body.js +7 -6
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/table.js +5 -5
- 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 +2 -2
- package/packages/grid/src/grid.ts +39 -6
- package/packages/table/module/edit/hook.ts +5 -5
- package/packages/table/src/body.ts +7 -6
- package/packages/table/src/table.ts +14 -10
- /package/es/{iconfont.1753525726129.ttf → iconfont.1753775832074.ttf} +0 -0
- /package/es/{iconfont.1753525726129.woff → iconfont.1753775832074.woff} +0 -0
- /package/es/{iconfont.1753525726129.woff2 → iconfont.1753775832074.woff2} +0 -0
- /package/lib/{iconfont.1753525726129.ttf → iconfont.1753775832074.ttf} +0 -0
- /package/lib/{iconfont.1753525726129.woff → iconfont.1753775832074.woff} +0 -0
- /package/lib/{iconfont.1753525726129.woff2 → iconfont.1753775832074.woff2} +0 -0
package/lib/index.umd.js
CHANGED
|
@@ -3138,7 +3138,7 @@ function eqEmptyValue(cellValue) {
|
|
|
3138
3138
|
;// ./packages/ui/index.ts
|
|
3139
3139
|
|
|
3140
3140
|
|
|
3141
|
-
const version = "4.15.0-beta.
|
|
3141
|
+
const version = "4.15.0-beta.13";
|
|
3142
3142
|
core_.VxeUI.version = version;
|
|
3143
3143
|
core_.VxeUI.tableVersion = version;
|
|
3144
3144
|
core_.VxeUI.setConfig({
|
|
@@ -3629,7 +3629,7 @@ var esnext_iterator_some = __webpack_require__(7550);
|
|
|
3629
3629
|
const {
|
|
3630
3630
|
log: log_log
|
|
3631
3631
|
} = core_.VxeUI;
|
|
3632
|
-
const log_version = `table v${"4.15.0-beta.
|
|
3632
|
+
const log_version = `table v${"4.15.0-beta.13"}`;
|
|
3633
3633
|
const warnLog = log_log.create('warn', log_version);
|
|
3634
3634
|
const errLog = log_log.create('error', log_version);
|
|
3635
3635
|
;// ./packages/table/src/columnInfo.ts
|
|
@@ -6902,7 +6902,7 @@ const renderType = 'body';
|
|
|
6902
6902
|
if (!fixedHiddenColumn && editConfig && (editRender || cellRender) && (editOpts.showStatus || editOpts.showUpdateStatus)) {
|
|
6903
6903
|
isDirty = $xeTable.isUpdateByRow(row, column.field);
|
|
6904
6904
|
}
|
|
6905
|
-
const isVNAutoHeight =
|
|
6905
|
+
const isVNAutoHeight = !hasEllipsis && (scrollYLoad || scrollXLoad);
|
|
6906
6906
|
let cellHeight = getCellRestHeight(rowRest, cellOpts, rowOpts, defaultRowHeight);
|
|
6907
6907
|
const isLastColumn = $columnIndex === columns.length - 1;
|
|
6908
6908
|
const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto');
|
|
@@ -6938,7 +6938,7 @@ const renderType = 'body';
|
|
|
6938
6938
|
}
|
|
6939
6939
|
tcStyle.width = `${column.renderWidth + mergeColWidth - cellOffsetWidth}px`;
|
|
6940
6940
|
}
|
|
6941
|
-
if (scrollYLoad || hasEllipsis || isCsHeight || isRsHeight) {
|
|
6941
|
+
if (scrollYLoad || scrollXLoad || hasEllipsis || isCsHeight || isRsHeight) {
|
|
6942
6942
|
tcStyle.height = `${cellHeight}px`;
|
|
6943
6943
|
} else {
|
|
6944
6944
|
tcStyle.minHeight = `${cellHeight}px`;
|
|
@@ -7119,14 +7119,15 @@ const renderType = 'body';
|
|
|
7119
7119
|
};
|
|
7120
7120
|
}
|
|
7121
7121
|
if (rowRest) {
|
|
7122
|
+
rowIndex = rowRest.index;
|
|
7123
|
+
_rowIndex = rowRest._index;
|
|
7122
7124
|
rowLevel = rowRest.level;
|
|
7125
|
+
seq = rowRest.seq;
|
|
7123
7126
|
if (hasRowGroupAggregate || treeConfig && transform && seqMode === 'increasing') {
|
|
7124
7127
|
seq = rowRest._index + 1;
|
|
7125
|
-
} else {
|
|
7126
|
-
seq = rowRest.
|
|
7128
|
+
} else if (treeConfig && seqMode === 'fixed') {
|
|
7129
|
+
seq = rowRest._tIndex + 1;
|
|
7127
7130
|
}
|
|
7128
|
-
rowIndex = rowRest.index;
|
|
7129
|
-
_rowIndex = rowRest._index;
|
|
7130
7131
|
}
|
|
7131
7132
|
const params = {
|
|
7132
7133
|
$table: $xeTable,
|
|
@@ -11041,10 +11042,10 @@ resizeList.forEach(column=>{const reWidth=external_root_XEUtils_commonjs_xe_util
|
|
|
11041
11042
|
remainList.forEach(column=>{const width=Math.max(meanWidth,minCellWidth);column.renderWidth=width;tWidth+=width;});if(fit){/**
|
|
11042
11043
|
* 偏移量算法
|
|
11043
11044
|
* 如果所有列足够放的情况下,从最后动态列开始分配
|
|
11044
|
-
*/const dynamicList=scaleList.concat(scaleMinList).concat(pxMinList).concat(autoMinList).concat(remainList);let dynamicSize=dynamicList.length-1;if(dynamicSize>0){let i=bodyWidth-tWidth;if(i>0){while(i>0&&dynamicSize>=0){i--;dynamicList[dynamicSize--].renderWidth++;}tWidth=bodyWidth;}}}reactData.scrollXWidth=tWidth;reactData.resizeWidthFlag++;updateColumnOffsetLeft();updateHeight();};const calcCellAutoHeight=(rowRest,wrapperEl)=>{const cellElemList=wrapperEl.querySelectorAll(`.vxe-cell--wrapper[rowid="${rowRest.rowid}"]`);let colHeight=rowRest.height;for(let i=0;i<cellElemList.length;i++){const cellElem=cellElemList[i];const tdEl=cellElem.parentElement;const topBottomPadding=Math.ceil(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(tdEl.style.paddingTop)+external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(tdEl.style.paddingBottom));const cellHeight=cellElem?cellElem.clientHeight:0;colHeight=Math.max(colHeight-topBottomPadding,Math.ceil(cellHeight));}return colHeight;};const calcCellHeight=()=>{const{tableData,isAllOverflow,scrollYLoad,scrollXLoad}=reactData;const{fullAllDataRowIdData}=internalData;const defaultRowHeight=computeDefaultRowHeight.value;const el=refElem.value;if(!isAllOverflow&&scrollYLoad&&el){const{handleGetRowId}=createHandleGetRowId($xeTable);el.setAttribute('data-calc-row','Y');tableData.forEach(row=>{const rowid=handleGetRowId(row);const rowRest=fullAllDataRowIdData[rowid];if(rowRest){const reHeight=calcCellAutoHeight(rowRest,el);rowRest.height=Math.max(defaultRowHeight,scrollXLoad?Math.max(rowRest.height,reHeight):reHeight);}el.removeAttribute('data-calc-row');});reactData.calcCellHeightFlag++;}};const getOrderField=column=>{const{sortBy,sortType}=column;return row=>{let cellValue;if(sortBy){cellValue=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(sortBy)?sortBy({row,column}):external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row,sortBy);}else{cellValue=tableMethods.getCellLabel(row,column);}if(!sortType||sortType==='auto'){return isNaN(cellValue)?cellValue:external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellValue);}else if(sortType==='number'){return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellValue);}else if(sortType==='string'){return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toValueString(cellValue);}return cellValue;};};const updateAfterListIndex=()=>{const{treeConfig}=props;const{afterFullData,fullDataRowIdData,fullAllDataRowIdData}=internalData;const{handleGetRowId}=createHandleGetRowId($xeTable);const fullMaps={};afterFullData.forEach((row,index)=>{const rowid=handleGetRowId(row);const rowRest=fullAllDataRowIdData[rowid];const seq=index+1;if(rowRest){if(!treeConfig){rowRest.seq=seq;}rowRest._index=index;}else{const rest={row,rowid,seq,index:-1,$index:-1,_index:index,treeIndex:-1,items:[],parent:null,level:0,height:0,resizeHeight:0,oTop:0,expandHeight:0};fullAllDataRowIdData[rowid]=rest;fullDataRowIdData[rowid]=rest;}fullMaps[rowid]=row;});internalData.afterFullRowMaps=fullMaps;};/**
|
|
11045
|
+
*/const dynamicList=scaleList.concat(scaleMinList).concat(pxMinList).concat(autoMinList).concat(remainList);let dynamicSize=dynamicList.length-1;if(dynamicSize>0){let i=bodyWidth-tWidth;if(i>0){while(i>0&&dynamicSize>=0){i--;dynamicList[dynamicSize--].renderWidth++;}tWidth=bodyWidth;}}}reactData.scrollXWidth=tWidth;reactData.resizeWidthFlag++;updateColumnOffsetLeft();updateHeight();};const calcCellAutoHeight=(rowRest,wrapperEl)=>{const cellElemList=wrapperEl.querySelectorAll(`.vxe-cell--wrapper[rowid="${rowRest.rowid}"]`);let colHeight=rowRest.height;for(let i=0;i<cellElemList.length;i++){const cellElem=cellElemList[i];const tdEl=cellElem.parentElement;const topBottomPadding=Math.ceil(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(tdEl.style.paddingTop)+external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(tdEl.style.paddingBottom));const cellHeight=cellElem?cellElem.clientHeight:0;colHeight=Math.max(colHeight-topBottomPadding,Math.ceil(cellHeight));}return colHeight;};const calcCellHeight=()=>{const{tableData,isAllOverflow,scrollYLoad,scrollXLoad}=reactData;const{fullAllDataRowIdData}=internalData;const defaultRowHeight=computeDefaultRowHeight.value;const el=refElem.value;if(!isAllOverflow&&(scrollYLoad||scrollXLoad)&&el){const{handleGetRowId}=createHandleGetRowId($xeTable);el.setAttribute('data-calc-row','Y');tableData.forEach(row=>{const rowid=handleGetRowId(row);const rowRest=fullAllDataRowIdData[rowid];if(rowRest){const reHeight=calcCellAutoHeight(rowRest,el);rowRest.height=Math.max(defaultRowHeight,scrollXLoad?Math.max(rowRest.height,reHeight):reHeight);}el.removeAttribute('data-calc-row');});reactData.calcCellHeightFlag++;}};const getOrderField=column=>{const{sortBy,sortType}=column;return row=>{let cellValue;if(sortBy){cellValue=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(sortBy)?sortBy({row,column}):external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row,sortBy);}else{cellValue=tableMethods.getCellLabel(row,column);}if(!sortType||sortType==='auto'){return isNaN(cellValue)?cellValue:external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellValue);}else if(sortType==='number'){return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellValue);}else if(sortType==='string'){return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toValueString(cellValue);}return cellValue;};};const updateAfterListIndex=()=>{const{treeConfig}=props;const{afterFullData,fullDataRowIdData,fullAllDataRowIdData}=internalData;const{handleGetRowId}=createHandleGetRowId($xeTable);const fullMaps={};afterFullData.forEach((row,index)=>{const rowid=handleGetRowId(row);const rowRest=fullAllDataRowIdData[rowid];const seq=index+1;if(rowRest){if(!treeConfig){rowRest.seq=seq;}rowRest._index=index;}else{const rest={row,rowid,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;}fullMaps[rowid]=row;});internalData.afterFullRowMaps=fullMaps;};/**
|
|
11045
11046
|
* 预编译
|
|
11046
11047
|
* 对渲染中的数据提前解析序号及索引。牺牲提前编译耗时换取渲染中额外损耗,使运行时更加流畅
|
|
11047
|
-
*/const updateAfterDataIndex=()=>{const{treeConfig}=props;const{fullDataRowIdData,fullAllDataRowIdData,afterFullData,afterTreeFullData}=internalData;const treeOpts=computeTreeOpts.value;const{transform}=treeOpts;const childrenField=treeOpts.children||treeOpts.childrenField;const fullMaps={};if(treeConfig){const{handleGetRowId}=createHandleGetRowId($xeTable);external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(afterTreeFullData,(row,index,items,path)=>{const rowid=handleGetRowId(row);const rowRest=fullAllDataRowIdData[rowid];const seq=path.map((num,i)=>i%2===0?Number(num)+1:'.').join('');if(rowRest){rowRest.seq=seq;rowRest.treeIndex=index;}else{const rest={row,rowid,seq,index:-1,$index:-1,_index:-1,treeIndex:-1,items:[],parent:null,level:0,height:0,resizeHeight:0,oTop:0,expandHeight:0};fullAllDataRowIdData[rowid]=rest;fullDataRowIdData[rowid]=rest;}fullMaps[rowid]=row;},{children:transform?treeOpts.mapChildrenField:childrenField});if(transform){afterFullData.forEach((row,index)=>{const rowid=handleGetRowId(row);const rowRest=fullAllDataRowIdData[rowid];const seq=index+1;if(rowRest){if(!treeConfig){rowRest.seq=seq;}rowRest._index=index;}});}internalData.afterFullRowMaps=fullMaps;}else{updateAfterListIndex();}};/**
|
|
11048
|
+
*/const updateAfterDataIndex=()=>{const{treeConfig}=props;const{fullDataRowIdData,fullAllDataRowIdData,afterFullData,afterTreeFullData}=internalData;const treeOpts=computeTreeOpts.value;const{transform}=treeOpts;const childrenField=treeOpts.children||treeOpts.childrenField;const fullMaps={};if(treeConfig){let _treeIndex=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.treeIndex=index;rowRest._tIndex=_treeIndex;}else{const rest={row,rowid,seq,index:-1,$index:-1,_index:-1,treeIndex:-1,_tIndex:_treeIndex,items:[],parent:null,level:0,height:0,resizeHeight:0,oTop:0,expandHeight:0};fullAllDataRowIdData[rowid]=rest;fullDataRowIdData[rowid]=rest;}_treeIndex++;fullMaps[rowid]=row;},{children:transform?treeOpts.mapChildrenField:childrenField});if(transform){afterFullData.forEach((row,index)=>{const rowid=handleGetRowId(row);const rowRest=fullAllDataRowIdData[rowid];const seq=index+1;if(rowRest){if(!treeConfig){rowRest.seq=seq;}rowRest._index=index;}});}internalData.afterFullRowMaps=fullMaps;}else{updateAfterListIndex();}};/**
|
|
11048
11049
|
* 如果为虚拟树、行分组、则将树结构拍平
|
|
11049
11050
|
* @returns
|
|
11050
11051
|
*/const handleVirtualTreeToList=()=>{const{treeConfig}=props;const{isRowGroupStatus}=reactData;const{fullAllDataRowIdData,treeExpandedMaps,rowGroupExpandedMaps}=internalData;const aggregateOpts=computeAggregateOpts.value;const treeOpts=computeTreeOpts.value;const{handleGetRowId}=createHandleGetRowId($xeTable);const fullData=[];const expandMaps={};if(treeConfig&&treeOpts.transform){const childrenField=treeOpts.children||treeOpts.childrenField;external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(internalData.afterTreeFullData,(row,index,items,path,parentRow)=>{const rowid=handleGetRowId(row);const parentRowid=handleGetRowId(parentRow);if(!parentRow||expandMaps[parentRowid]&&treeExpandedMaps[parentRowid]){const rowRest=fullAllDataRowIdData[rowid];if(rowRest){rowRest._index=fullData.length;}expandMaps[rowid]=1;fullData.push(row);}},{children:childrenField});internalData.afterFullData=fullData;updateScrollYStatus(fullData);return fullData;}else if(isRowGroupStatus){const{childrenField}=aggregateOpts;external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(internalData.afterGroupFullData,(row,index,items,path,parentRow)=>{const rowid=handleGetRowId(row);const parentRowid=handleGetRowId(parentRow);if(!parentRow||expandMaps[parentRowid]&&rowGroupExpandedMaps[parentRowid]){const rowRest=fullAllDataRowIdData[rowid];if(rowRest){rowRest._index=fullData.length;}expandMaps[rowid]=1;fullData.push(row);}},{children:childrenField});internalData.afterFullData=fullData;updateScrollYStatus(fullData);return fullData;}return internalData.afterFullData;};/**
|
|
@@ -11251,7 +11252,7 @@ setTimeout(()=>handleLazyRecalculate(false,true,true),50);});},/**
|
|
|
11251
11252
|
* @param {String} field 字段名
|
|
11252
11253
|
*/reloadRow(row,record,field){const{keepSource}=props;const{tableData}=reactData;const{sourceDataRowIdData}=internalData;if(keepSource){if($xeTable.isAggregateRecord(row)){return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();}const oRow=sourceDataRowIdData[getRowid($xeTable,row)];if(oRow&&row){if(field){const newValue=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().clone(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(record||row,field),true);external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(row,field,newValue);external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(oRow,field,newValue);}else{const rowkey=getRowkey($xeTable);const rowid=getRowid($xeTable,row);const newRecord=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().clone(Object.assign({},record),true);external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(newRecord,rowkey,rowid);external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().destructuring(oRow,Object.assign(row,newRecord));}}reactData.tableData=tableData.slice(0);}else{errLog('vxe.error.reqProp',['keep-source']);}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();},getParams(){return props.params;},/**
|
|
11253
11254
|
* 用于树结构,给行数据加载子节点
|
|
11254
|
-
*/loadTreeChildren(row,childRecords){const{keepSource}=props;const{tableSourceData,fullDataRowIdData,fullAllDataRowIdData,sourceDataRowIdData}=internalData;const treeOpts=computeTreeOpts.value;const{transform,mapChildrenField}=treeOpts;const childrenField=treeOpts.children||treeOpts.childrenField;const parentRest=fullAllDataRowIdData[getRowid($xeTable,row)];const parentLevel=parentRest?parentRest.level:0;return tableMethods.createData(childRecords).then(rows=>{if(keepSource){const rowid=getRowid($xeTable,row);const matchObj=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findTree(tableSourceData,item=>rowid===getRowid($xeTable,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($xeTable,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,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();return rows;});},/**
|
|
11255
|
+
*/loadTreeChildren(row,childRecords){const{keepSource}=props;const{tableSourceData,fullDataRowIdData,fullAllDataRowIdData,sourceDataRowIdData}=internalData;const treeOpts=computeTreeOpts.value;const{transform,mapChildrenField}=treeOpts;const childrenField=treeOpts.children||treeOpts.childrenField;const parentRest=fullAllDataRowIdData[getRowid($xeTable,row)];const parentLevel=parentRest?parentRest.level:0;return tableMethods.createData(childRecords).then(rows=>{if(keepSource){const rowid=getRowid($xeTable,row);const matchObj=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findTree(tableSourceData,item=>rowid===getRowid($xeTable,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($xeTable,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();return rows;});},/**
|
|
11255
11256
|
* 加载列配置
|
|
11256
11257
|
* 对于表格列需要重载、局部递增场景下可能会用到
|
|
11257
11258
|
* @param {ColumnInfo} columns 列配置
|
|
@@ -11624,7 +11625,7 @@ updateAfterFullData();// 如果为虚拟树,将树结构拍平
|
|
|
11624
11625
|
fullList=handleVirtualTreeToList();}const tableData=scrollYLoad?fullList.slice(scrollYStore.startIndex,scrollYStore.endIndex):fullList.slice(0);const visibleDataRowIdMaps={};tableData.forEach((row,$index)=>{const rowid=getRowid($xeTable,row);const rest=fullDataRowIdData[rowid];if(rest){rest.$index=$index;}visibleDataRowIdMaps[rowid]=row;});reactData.tableData=tableData;internalData.visibleDataRowIdData=visibleDataRowIdMaps;return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();},/**
|
|
11625
11626
|
* 更新数据行的 Map
|
|
11626
11627
|
*/cacheRowMap(isReset){const{treeConfig}=props;const{isRowGroupStatus}=reactData;const{fullAllDataRowIdData,tableFullData,tableFullTreeData,tableFullGroupData,treeExpandedMaps}=internalData;const fullAllDataRowIdMaps=isReset?{}:{...fullAllDataRowIdData};// 存在已删除数据
|
|
11627
|
-
const fullDataRowIdMaps={};const{handleUpdateRowId}=createHandleUpdateRowId($xeTable);const handleRowCache=(row,index,items,currIndex,parentRow,rowid,level,seq)=>{let rowRest=fullAllDataRowIdMaps[rowid];if(!rowRest){rowRest={row,rowid,seq,index:-1,_index:-1,$index:-1,treeIndex:index,items,parent:parentRow,level,height:0,resizeHeight:0,oTop:0,expandHeight:0};fullDataRowIdMaps[rowid]=rowRest;fullAllDataRowIdMaps[rowid]=rowRest;}rowRest.treeLoaded=false;rowRest.expandLoaded=false;rowRest.row=row;rowRest.items=items;rowRest.parent=parentRow;rowRest.level=level;rowRest.index=currIndex;rowRest.treeIndex=index;fullDataRowIdMaps[rowid]=rowRest;fullAllDataRowIdMaps[rowid]=rowRest;};if(treeConfig){const treeOpts=computeTreeOpts.value;const{lazy}=treeOpts;const childrenField=treeOpts.children||treeOpts.childrenField;const hasChildField=treeOpts.hasChild||treeOpts.hasChildField;external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(tableFullTreeData,(row,index,items,path,parentRow,nodes)=>{const rowid=handleUpdateRowId(row);if(treeConfig&&lazy){if(row[hasChildField]&&row[childrenField]===undefined){row[childrenField]=null;}if(treeExpandedMaps[rowid]){if(!row[childrenField]||!row[childrenField].length){delete treeExpandedMaps[rowid];}}}handleRowCache(row,index,items,parentRow?-1:index,parentRow,rowid,nodes.length-1,toTreePathSeq(path));},{children:childrenField});}else if(isRowGroupStatus){const aggregateOpts=computeAggregateOpts.value;const{mapChildrenField}=aggregateOpts;external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(tableFullGroupData,(row,index,items,path,parentRow,nodes)=>{const rowid=handleUpdateRowId(row);handleRowCache(row,index,items,parentRow?-1:index,parentRow,rowid,nodes.length-1,toTreePathSeq(path));},{children:mapChildrenField});}else{tableFullData.forEach((row,index,items)=>{handleRowCache(row,index,items,index,null,handleUpdateRowId(row),0,index+1);});}internalData.fullDataRowIdData=fullDataRowIdMaps;internalData.fullAllDataRowIdData=fullAllDataRowIdMaps;reactData.treeExpandedFlag++;},cacheSourceMap(fullData){const{treeConfig}=props;const treeOpts=computeTreeOpts.value;const sourceData=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().clone(fullData,true);const{handleUpdateRowId}=createHandleUpdateRowId($xeTable);const sourceRowIdData={};const handleSourceRow=row=>{const rowid=handleUpdateRowId(row);sourceRowIdData[rowid]=row;};// 源数据缓存
|
|
11628
|
+
const fullDataRowIdMaps={};const{handleUpdateRowId}=createHandleUpdateRowId($xeTable);const handleRowCache=(row,index,items,currIndex,parentRow,rowid,level,seq)=>{let rowRest=fullAllDataRowIdMaps[rowid];if(!rowRest){rowRest={row,rowid,seq,index:-1,_index:-1,$index:-1,treeIndex:index,_tIndex:-1,items,parent:parentRow,level,height:0,resizeHeight:0,oTop:0,expandHeight:0};fullDataRowIdMaps[rowid]=rowRest;fullAllDataRowIdMaps[rowid]=rowRest;}rowRest.treeLoaded=false;rowRest.expandLoaded=false;rowRest.row=row;rowRest.items=items;rowRest.parent=parentRow;rowRest.level=level;rowRest.index=currIndex;rowRest.treeIndex=index;fullDataRowIdMaps[rowid]=rowRest;fullAllDataRowIdMaps[rowid]=rowRest;};if(treeConfig){const treeOpts=computeTreeOpts.value;const{lazy}=treeOpts;const childrenField=treeOpts.children||treeOpts.childrenField;const hasChildField=treeOpts.hasChild||treeOpts.hasChildField;external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(tableFullTreeData,(row,index,items,path,parentRow,nodes)=>{const rowid=handleUpdateRowId(row);if(treeConfig&&lazy){if(row[hasChildField]&&row[childrenField]===undefined){row[childrenField]=null;}if(treeExpandedMaps[rowid]){if(!row[childrenField]||!row[childrenField].length){delete treeExpandedMaps[rowid];}}}handleRowCache(row,index,items,parentRow?-1:index,parentRow,rowid,nodes.length-1,toTreePathSeq(path));},{children:childrenField});}else if(isRowGroupStatus){const aggregateOpts=computeAggregateOpts.value;const{mapChildrenField}=aggregateOpts;external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(tableFullGroupData,(row,index,items,path,parentRow,nodes)=>{const rowid=handleUpdateRowId(row);handleRowCache(row,index,items,parentRow?-1:index,parentRow,rowid,nodes.length-1,toTreePathSeq(path));},{children:mapChildrenField});}else{tableFullData.forEach((row,index,items)=>{handleRowCache(row,index,items,index,null,handleUpdateRowId(row),0,index+1);});}internalData.fullDataRowIdData=fullDataRowIdMaps;internalData.fullAllDataRowIdData=fullAllDataRowIdMaps;reactData.treeExpandedFlag++;},cacheSourceMap(fullData){const{treeConfig}=props;const treeOpts=computeTreeOpts.value;const sourceData=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().clone(fullData,true);const{handleUpdateRowId}=createHandleUpdateRowId($xeTable);const sourceRowIdData={};const handleSourceRow=row=>{const rowid=handleUpdateRowId(row);sourceRowIdData[rowid]=row;};// 源数据缓存
|
|
11628
11629
|
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;},/**
|
|
11629
11630
|
* 指定列宽的列进行拆分
|
|
11630
11631
|
*/analyColumnWidth(){const{tableFullColumn}=internalData;const columnOpts=computeColumnOpts.value;const{width:defaultWidth,minWidth:defaultMinWidth}=columnOpts;const resizeList=[];const pxList=[];const pxMinList=[];const autoMinList=[];const scaleList=[];const scaleMinList=[];const autoList=[];const remainList=[];tableFullColumn.forEach(column=>{if(defaultWidth&&!column.width){column.width=defaultWidth;}if(defaultMinWidth&&!column.minWidth){column.minWidth=defaultMinWidth;}if(column.visible){if(column.resizeWidth){resizeList.push(column);}else if(column.width==='auto'){autoList.push(column);}else if(isPx(column.width)){pxList.push(column);}else if(isScale(column.width)){scaleList.push(column);}else if(isPx(column.minWidth)){pxMinList.push(column);}else if(column.minWidth==='auto'){autoMinList.push(column);}else if(isScale(column.minWidth)){scaleMinList.push(column);}else{remainList.push(column);}}});Object.assign(reactData.columnStore,{resizeList,pxList,pxMinList,autoMinList,scaleList,scaleMinList,autoList,remainList});},handleColResizeMousedownEvent(evnt,fixedType,params){evnt.stopPropagation();evnt.preventDefault();const{column}=params;const{columnStore,overflowX,scrollbarHeight}=reactData;const{visibleColumn}=internalData;const{leftList,rightList}=columnStore;const resizableOpts=computeResizableOpts.value;const osbHeight=overflowX?scrollbarHeight:0;const tableEl=refElem.value;const leftContainerElem=refLeftContainer.value;const rightContainerElem=refRightContainer.value;const resizeBarElem=refColResizeBar.value;if(!resizeBarElem){return;}const isLeftFixed=fixedType==='left';const isRightFixed=fixedType==='right';const resizeTipElem=resizeBarElem.firstElementChild;const scrollbarXToTop=computeScrollbarXToTop.value;const{clientX:dragClientX}=evnt;const dragBtnElem=evnt.target;let resizeColumn=column;const isDragGroupCol=column.children&&column.children.length;if(isDragGroupCol){external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(column.children,childColumn=>{resizeColumn=childColumn;});}let cell=dragBtnElem.parentElement;if(isDragGroupCol){const trEl=cell?cell.parentElement:null;const theadEl=trEl?trEl.parentElement:null;cell=theadEl?theadEl.querySelector(`.vxe-header--column[colid="${resizeColumn.id}"]`):null;}if(!cell){return;}const cellParams=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().assign(params,{cell});let dragLeft=0;const tableRect=tableEl.getBoundingClientRect();const rightContainerRect=rightContainerElem?rightContainerElem.getBoundingClientRect():null;const cellRect=cell.getBoundingClientRect();const dragBtnRect=dragBtnElem.getBoundingClientRect();const dragBtnWidth=dragBtnElem.clientWidth;const dragBtnOffsetWidth=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().floor(dragBtnWidth/2);const dragPosLeft=dragBtnRect.x-tableRect.x+dragBtnOffsetWidth;const minInterval=getColReMinWidth(cellParams)-dragBtnOffsetWidth;// 列之间的最小间距
|
|
@@ -11773,7 +11774,7 @@ if(bodyScrollElem&&bodyTableElem&&bodyScrollElem.scrollTop+clientHeight>=maxYHei
|
|
|
11773
11774
|
* 分别渲染左边固定列和右边固定列
|
|
11774
11775
|
* 如果宽度足够情况下,则不需要渲染固定列
|
|
11775
11776
|
* @param {String} fixedType 固定列类型
|
|
11776
|
-
*/const renderFixed=fixedType=>{const{showHeader,showFooter}=props;const{tableData,tableColumn,tableGroupColumn,columnStore,footerTableData}=reactData;const isFixedLeft=fixedType==='left';const fixedColumn=isFixedLeft?columnStore.leftList:columnStore.rightList;return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div',{ref:isFixedLeft?refLeftContainer:refRightContainer,class:`vxe-table--fixed-${fixedType}-wrapper`},[showHeader?(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(header,{ref:isFixedLeft?refTableLeftHeader:refTableRightHeader,fixedType,tableData,tableColumn,tableGroupColumn,fixedColumn}):table_renderEmptyElement($xeTable),(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(body,{ref:isFixedLeft?refTableLeftBody:refTableRightBody,fixedType,tableData,tableColumn,fixedColumn}),showFooter?(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(footer,{ref:isFixedLeft?refTableLeftFooter:refTableRightFooter,footerTableData,tableColumn,fixedColumn,fixedType}):table_renderEmptyElement($xeTable)]);};const renderEmptyBody=()=>{const emptyOpts=computeEmptyOpts.value;const emptySlot=slots.empty;const emptyParams={$table:$xeTable,$grid:$xeGrid};if(emptySlot){return emptySlot(emptyParams);}else{const compConf=emptyOpts.name?table_renderer.get(emptyOpts.name):null;const rtEmptyView=compConf?compConf.renderTableEmpty||compConf.renderTableEmptyView||compConf.renderEmpty:null;if(rtEmptyView){return getSlotVNs(rtEmptyView(emptyOpts,emptyParams));}}return getFuncText(props.emptyText)||table_getI18n('vxe.table.emptyText');};const renderDragTipContents=()=>{const{dragConfig}=props;const{dragRow,dragCol,dragTipText}=reactData;const columnDragOpts=computeColumnDragOpts.value;const rowDragOpts=computeRowDragOpts.value;const rowDragSlots=rowDragOpts.slots||{};const rTipSlot=rowDragSlots.tip||(dragConfig&&dragConfig.slots?dragConfig.slots.rowTip:null);const columnDragSlots=columnDragOpts.slots||{};const cTipSlot=columnDragSlots.tip;if(dragRow&&rTipSlot){return callSlot(rTipSlot,{row:dragRow});}if(dragCol&&cTipSlot){return callSlot(cTipSlot,{column:dragCol});}return[(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span',dragTipText)];};const renderDragTip=()=>{const{dragRow,dragCol}=reactData;const rowOpts=computeRowOpts.value;const columnOpts=computeColumnOpts.value;const rowDragOpts=computeRowDragOpts.value;const columnDragOpts=computeColumnDragOpts.value;if(rowOpts.drag||columnOpts.drag){return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div',{class:'vxe-table--drag-wrapper'},[(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div',{ref:refDragRowLineElem,class:['vxe-table--drag-row-line',{'is--guides':rowDragOpts.showGuidesStatus}]}),(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div',{ref:refDragColLineElem,class:['vxe-table--drag-col-line',{'is--guides':columnDragOpts.showGuidesStatus}]}),dragRow&&rowDragOpts.showDragTip||dragCol&&columnDragOpts.showDragTip?(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div',{ref:refDragTipElem,class:'vxe-table--drag-sort-tip'},[(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div',{class:'vxe-table--drag-sort-tip-wrapper'},[(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div',{class:'vxe-table--drag-sort-tip-status'},[(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span',{class:['vxe-table--drag-sort-tip-normal-status',dragRow?table_getIcon().TABLE_DRAG_STATUS_ROW:table_getIcon().TABLE_DRAG_STATUS_COLUMN]}),(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span',{class:['vxe-table--drag-sort-tip-sub-status',table_getIcon().TABLE_DRAG_STATUS_SUB_ROW]}),(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span',{class:['vxe-table--drag-sort-tip-disabled-status',table_getIcon().TABLE_DRAG_DISABLED]})]),(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div',{class:'vxe-table--drag-sort-tip-content'},renderDragTipContents())])]):table_renderEmptyElement($xeTable)]);}return table_renderEmptyElement($xeTable);};const renderRowExpandedVNs=()=>{const{treeConfig}=props;const{expandColumn,isRowGroupStatus}=reactData;const tableRowExpandedList=computeTableRowExpandedList.value;const expandOpts=computeExpandOpts.value;const{mode}=expandOpts;if(mode!=='fixed'){return table_renderEmptyElement($xeTable);}const expandVNs=[(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div',{key:'repY',ref:refRowExpandYSpaceElem})];if(expandColumn){const{handleGetRowId}=createHandleGetRowId($xeTable);tableRowExpandedList.forEach(row=>{const expandOpts=computeExpandOpts.value;const{height:expandHeight,padding,indent}=expandOpts;const{fullAllDataRowIdData,fullColumnIdData}=internalData;const treeOpts=computeTreeOpts.value;const{transform,seqMode}=treeOpts;const cellStyle={};const rowid=handleGetRowId(row);const rowRest=fullAllDataRowIdData[rowid];const colid=expandColumn.id;const colRest=fullColumnIdData[colid]||{};let rowLevel=0;let seq=-1;let _rowIndex=-1;let rowIndex=-1;let $rowIndex=-1;if(rowRest){rowLevel=rowRest.level;if(isRowGroupStatus||treeConfig&&transform&&seqMode==='increasing'){seq=rowRest._index+1;}else{seq=rowRest.
|
|
11777
|
+
*/const renderFixed=fixedType=>{const{showHeader,showFooter}=props;const{tableData,tableColumn,tableGroupColumn,columnStore,footerTableData}=reactData;const isFixedLeft=fixedType==='left';const fixedColumn=isFixedLeft?columnStore.leftList:columnStore.rightList;return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div',{ref:isFixedLeft?refLeftContainer:refRightContainer,class:`vxe-table--fixed-${fixedType}-wrapper`},[showHeader?(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(header,{ref:isFixedLeft?refTableLeftHeader:refTableRightHeader,fixedType,tableData,tableColumn,tableGroupColumn,fixedColumn}):table_renderEmptyElement($xeTable),(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(body,{ref:isFixedLeft?refTableLeftBody:refTableRightBody,fixedType,tableData,tableColumn,fixedColumn}),showFooter?(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(footer,{ref:isFixedLeft?refTableLeftFooter:refTableRightFooter,footerTableData,tableColumn,fixedColumn,fixedType}):table_renderEmptyElement($xeTable)]);};const renderEmptyBody=()=>{const emptyOpts=computeEmptyOpts.value;const emptySlot=slots.empty;const emptyParams={$table:$xeTable,$grid:$xeGrid};if(emptySlot){return emptySlot(emptyParams);}else{const compConf=emptyOpts.name?table_renderer.get(emptyOpts.name):null;const rtEmptyView=compConf?compConf.renderTableEmpty||compConf.renderTableEmptyView||compConf.renderEmpty:null;if(rtEmptyView){return getSlotVNs(rtEmptyView(emptyOpts,emptyParams));}}return getFuncText(props.emptyText)||table_getI18n('vxe.table.emptyText');};const renderDragTipContents=()=>{const{dragConfig}=props;const{dragRow,dragCol,dragTipText}=reactData;const columnDragOpts=computeColumnDragOpts.value;const rowDragOpts=computeRowDragOpts.value;const rowDragSlots=rowDragOpts.slots||{};const rTipSlot=rowDragSlots.tip||(dragConfig&&dragConfig.slots?dragConfig.slots.rowTip:null);const columnDragSlots=columnDragOpts.slots||{};const cTipSlot=columnDragSlots.tip;if(dragRow&&rTipSlot){return callSlot(rTipSlot,{row:dragRow});}if(dragCol&&cTipSlot){return callSlot(cTipSlot,{column:dragCol});}return[(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span',dragTipText)];};const renderDragTip=()=>{const{dragRow,dragCol}=reactData;const rowOpts=computeRowOpts.value;const columnOpts=computeColumnOpts.value;const rowDragOpts=computeRowDragOpts.value;const columnDragOpts=computeColumnDragOpts.value;if(rowOpts.drag||columnOpts.drag){return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div',{class:'vxe-table--drag-wrapper'},[(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div',{ref:refDragRowLineElem,class:['vxe-table--drag-row-line',{'is--guides':rowDragOpts.showGuidesStatus}]}),(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div',{ref:refDragColLineElem,class:['vxe-table--drag-col-line',{'is--guides':columnDragOpts.showGuidesStatus}]}),dragRow&&rowDragOpts.showDragTip||dragCol&&columnDragOpts.showDragTip?(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div',{ref:refDragTipElem,class:'vxe-table--drag-sort-tip'},[(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div',{class:'vxe-table--drag-sort-tip-wrapper'},[(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div',{class:'vxe-table--drag-sort-tip-status'},[(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span',{class:['vxe-table--drag-sort-tip-normal-status',dragRow?table_getIcon().TABLE_DRAG_STATUS_ROW:table_getIcon().TABLE_DRAG_STATUS_COLUMN]}),(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span',{class:['vxe-table--drag-sort-tip-sub-status',table_getIcon().TABLE_DRAG_STATUS_SUB_ROW]}),(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span',{class:['vxe-table--drag-sort-tip-disabled-status',table_getIcon().TABLE_DRAG_DISABLED]})]),(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div',{class:'vxe-table--drag-sort-tip-content'},renderDragTipContents())])]):table_renderEmptyElement($xeTable)]);}return table_renderEmptyElement($xeTable);};const renderRowExpandedVNs=()=>{const{treeConfig}=props;const{expandColumn,isRowGroupStatus}=reactData;const tableRowExpandedList=computeTableRowExpandedList.value;const expandOpts=computeExpandOpts.value;const{mode}=expandOpts;if(mode!=='fixed'){return table_renderEmptyElement($xeTable);}const expandVNs=[(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div',{key:'repY',ref:refRowExpandYSpaceElem})];if(expandColumn){const{handleGetRowId}=createHandleGetRowId($xeTable);tableRowExpandedList.forEach(row=>{const expandOpts=computeExpandOpts.value;const{height:expandHeight,padding,indent}=expandOpts;const{fullAllDataRowIdData,fullColumnIdData}=internalData;const treeOpts=computeTreeOpts.value;const{transform,seqMode}=treeOpts;const cellStyle={};const rowid=handleGetRowId(row);const rowRest=fullAllDataRowIdData[rowid];const colid=expandColumn.id;const colRest=fullColumnIdData[colid]||{};let rowLevel=0;let seq=-1;let _rowIndex=-1;let rowIndex=-1;let $rowIndex=-1;if(rowRest){rowIndex=rowRest.index;$rowIndex=rowRest.$index;_rowIndex=rowRest._index;rowLevel=rowRest.level;seq=rowRest.seq;if(isRowGroupStatus||treeConfig&&transform&&seqMode==='increasing'){seq=rowRest._index+1;}else if(treeConfig&&seqMode==='fixed'){seq=rowRest._tIndex+1;}}if(expandHeight){cellStyle.height=`${expandHeight}px`;}if(isRowGroupStatus||treeConfig){cellStyle.paddingLeft=`${rowLevel*(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(indent)?indent:treeOpts.indent)+30}px`;}let columnIndex=-1;let $columnIndex=-1;let _columnIndex=-1;if(colRest){columnIndex=colRest.index;$columnIndex=colRest.$index;_columnIndex=colRest._index;}const expandParams={$grid:$xeGrid,$table:$xeTable,seq,column:expandColumn,columnIndex,$columnIndex,_columnIndex,fixed:'',type:'body',level:rowLevel,rowid,row,rowIndex,$rowIndex,_rowIndex,isHidden:false,isEdit:false,visibleData:[],data:[],items:[]};expandVNs.push((0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div',{key:rowid,class:['vxe-body--row-expanded-cell',{'is--padding':padding,'is--ellipsis':expandHeight}],rowid,style:cellStyle},expandColumn.renderData(expandParams)));});}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div',{ref:refRowExpandElem,class:'vxe-table--row-expanded-wrapper'},expandVNs);};const renderScrollX=()=>{return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div',{key:'vsx',ref:refScrollXVirtualElem,class:'vxe-table--scroll-x-virtual'},[(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div',{ref:refScrollXLeftCornerElem,class:'vxe-table--scroll-x-left-corner'}),(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div',{ref:refScrollXWrapperElem,class:'vxe-table--scroll-x-wrapper'},[(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div',{ref:refScrollXHandleElem,class:'vxe-table--scroll-x-handle',onScroll:$xeTable.triggerVirtualScrollXEvent},[(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div',{ref:refScrollXSpaceElem,class:'vxe-table--scroll-x-space'})])]),(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div',{ref:refScrollXRightCornerElem,class:'vxe-table--scroll-x-right-corner'})]);};const renderScrollY=()=>{return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div',{ref:refScrollYVirtualElem,class:'vxe-table--scroll-y-virtual'},[(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div',{ref:refScrollYTopCornerElem,class:'vxe-table--scroll-y-top-corner'}),(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div',{ref:refScrollYWrapperElem,class:'vxe-table--scroll-y-wrapper'},[(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div',{ref:refScrollYHandleElem,class:'vxe-table--scroll-y-handle',onScroll:$xeTable.triggerVirtualScrollYEvent},[(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div',{ref:refScrollYSpaceElem,class:'vxe-table--scroll-y-space'})])]),(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div',{ref:refScrollYBottomCornerElem,class:'vxe-table--scroll-y-bottom-corner'})]);};const renderViewport=()=>{const{showHeader,showFooter}=props;const{overflowX,tableData,tableColumn,tableGroupColumn,footerTableData,columnStore}=reactData;const{leftList,rightList}=columnStore;return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div',{ref:refTableViewportElem,class:'vxe-table--viewport-wrapper'},[(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div',{class:'vxe-table--main-wrapper'},[/**
|
|
11777
11778
|
* 表头
|
|
11778
11779
|
*/showHeader?(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(header,{ref:refTableHeader,tableData,tableColumn,tableGroupColumn}):table_renderEmptyElement($xeTable),/**
|
|
11779
11780
|
* 表体
|
|
@@ -12836,6 +12837,12 @@ const gridComponentEmits = [...emits, 'page-change', 'form-submit', 'form-submit
|
|
|
12836
12837
|
const pagerOpts = computePagerOpts.value;
|
|
12837
12838
|
return pagerOpts.total;
|
|
12838
12839
|
});
|
|
12840
|
+
const computePageCount = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
12841
|
+
const {
|
|
12842
|
+
tablePage
|
|
12843
|
+
} = reactData;
|
|
12844
|
+
return Math.max(Math.ceil(tablePage.total / tablePage.pageSize), 1);
|
|
12845
|
+
});
|
|
12839
12846
|
const computeIsLoading = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
12840
12847
|
const {
|
|
12841
12848
|
loading,
|
|
@@ -12921,7 +12928,7 @@ const gridComponentEmits = [...emits, 'page-change', 'form-submit', 'form-submit
|
|
|
12921
12928
|
tablePage.pageSize = pageSize;
|
|
12922
12929
|
}
|
|
12923
12930
|
if (total) {
|
|
12924
|
-
tablePage.
|
|
12931
|
+
tablePage.total = total;
|
|
12925
12932
|
}
|
|
12926
12933
|
}
|
|
12927
12934
|
}
|
|
@@ -14005,6 +14012,9 @@ const gridComponentEmits = [...emits, 'page-change', 'form-submit', 'form-submit
|
|
|
14005
14012
|
}
|
|
14006
14013
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
14007
14014
|
},
|
|
14015
|
+
getParams() {
|
|
14016
|
+
return props.params;
|
|
14017
|
+
},
|
|
14008
14018
|
zoom() {
|
|
14009
14019
|
if (reactData.isZMax) {
|
|
14010
14020
|
return gridMethods.revert();
|
|
@@ -14066,26 +14076,59 @@ const gridComponentEmits = [...emits, 'page-change', 'form-submit', 'form-submit
|
|
|
14066
14076
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
14067
14077
|
},
|
|
14068
14078
|
homePage() {
|
|
14079
|
+
const {
|
|
14080
|
+
tablePage
|
|
14081
|
+
} = reactData;
|
|
14082
|
+
tablePage.currentPage = 1;
|
|
14083
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
14084
|
+
},
|
|
14085
|
+
homePageByEvent(evnt) {
|
|
14069
14086
|
const $pager = refPager.value;
|
|
14070
14087
|
if ($pager) {
|
|
14071
|
-
|
|
14088
|
+
$pager.homePageByEvent(evnt);
|
|
14072
14089
|
}
|
|
14073
|
-
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
14074
14090
|
},
|
|
14075
14091
|
endPage() {
|
|
14092
|
+
const {
|
|
14093
|
+
tablePage
|
|
14094
|
+
} = reactData;
|
|
14095
|
+
const pageCount = computePageCount.value;
|
|
14096
|
+
tablePage.currentPage = pageCount;
|
|
14097
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
14098
|
+
},
|
|
14099
|
+
endPageByEvent(evnt) {
|
|
14076
14100
|
const $pager = refPager.value;
|
|
14077
14101
|
if ($pager) {
|
|
14078
|
-
|
|
14102
|
+
$pager.endPageByEvent(evnt);
|
|
14079
14103
|
}
|
|
14104
|
+
},
|
|
14105
|
+
setCurrentPage(currentPage) {
|
|
14106
|
+
const {
|
|
14107
|
+
tablePage
|
|
14108
|
+
} = reactData;
|
|
14109
|
+
const pageCount = computePageCount.value;
|
|
14110
|
+
tablePage.currentPage = Math.min(pageCount, Math.max(1, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(currentPage)));
|
|
14080
14111
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
14081
14112
|
},
|
|
14082
|
-
|
|
14113
|
+
setCurrentPageByEvent(evnt, currentPage) {
|
|
14083
14114
|
const $pager = refPager.value;
|
|
14084
14115
|
if ($pager) {
|
|
14085
|
-
|
|
14116
|
+
$pager.setCurrentPageByEvent(evnt, currentPage);
|
|
14086
14117
|
}
|
|
14118
|
+
},
|
|
14119
|
+
setPageSize(pageSize) {
|
|
14120
|
+
const {
|
|
14121
|
+
tablePage
|
|
14122
|
+
} = reactData;
|
|
14123
|
+
tablePage.pageSize = Math.max(1, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(pageSize));
|
|
14087
14124
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
14088
14125
|
},
|
|
14126
|
+
setPageSizeByEvent(evnt, pageSize) {
|
|
14127
|
+
const $pager = refPager.value;
|
|
14128
|
+
if ($pager) {
|
|
14129
|
+
$pager.setPageSizeByEvent(evnt, pageSize);
|
|
14130
|
+
}
|
|
14131
|
+
},
|
|
14089
14132
|
getProxyInfo() {
|
|
14090
14133
|
const $xeTable = refTable.value;
|
|
14091
14134
|
if (props.proxyConfig) {
|
|
@@ -15343,6 +15386,7 @@ edit_hook_hooks.add('tableEditModule', {
|
|
|
15343
15386
|
_index: -1,
|
|
15344
15387
|
$index: -1,
|
|
15345
15388
|
treeIndex: -1,
|
|
15389
|
+
_tIndex: -1,
|
|
15346
15390
|
items: parentChilds,
|
|
15347
15391
|
parent: parentRow,
|
|
15348
15392
|
level: parentLevel + 1,
|
|
@@ -15367,6 +15411,7 @@ edit_hook_hooks.add('tableEditModule', {
|
|
|
15367
15411
|
_index: -1,
|
|
15368
15412
|
$index: -1,
|
|
15369
15413
|
treeIndex: -1,
|
|
15414
|
+
_tIndex: -1,
|
|
15370
15415
|
items: tableFullTreeData,
|
|
15371
15416
|
parent: null,
|
|
15372
15417
|
level: 0,
|
|
@@ -15434,6 +15479,7 @@ edit_hook_hooks.add('tableEditModule', {
|
|
|
15434
15479
|
_index: -1,
|
|
15435
15480
|
$index: -1,
|
|
15436
15481
|
treeIndex: -1,
|
|
15482
|
+
_tIndex: -1,
|
|
15437
15483
|
items: afterFullData,
|
|
15438
15484
|
parent: null,
|
|
15439
15485
|
level: 0,
|
|
@@ -15479,6 +15525,7 @@ edit_hook_hooks.add('tableEditModule', {
|
|
|
15479
15525
|
index: -1,
|
|
15480
15526
|
_index: -1,
|
|
15481
15527
|
treeIndex: -1,
|
|
15528
|
+
_tIndex: -1,
|
|
15482
15529
|
$index: -1,
|
|
15483
15530
|
items: afterFullData,
|
|
15484
15531
|
parent: null,
|
|
@@ -15530,6 +15577,7 @@ edit_hook_hooks.add('tableEditModule', {
|
|
|
15530
15577
|
_index: -1,
|
|
15531
15578
|
$index: -1,
|
|
15532
15579
|
treeIndex: -1,
|
|
15580
|
+
_tIndex: -1,
|
|
15533
15581
|
items: parentMapChilds,
|
|
15534
15582
|
parent: parentRow,
|
|
15535
15583
|
level: parentLevel + 1,
|