vxe-table 4.19.6 → 4.19.8
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/dist/all.esm.js +203 -75
- package/dist/style.css +1 -1
- package/es/grid/src/grid.js +1 -1
- package/es/style.css +1 -1
- package/es/table/src/body.js +11 -11
- package/es/table/src/group.js +3 -0
- package/es/table/src/table.js +169 -61
- package/es/table/src/util.js +18 -1
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/grid/src/grid.js +1 -1
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.umd.js +70 -31
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/src/body.js +11 -11
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/group.js +3 -0
- package/lib/table/src/group.min.js +1 -1
- package/lib/table/src/table.js +35 -16
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +19 -1
- package/lib/table/src/util.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 +1 -1
- package/packages/table/src/body.ts +13 -13
- package/packages/table/src/group.ts +4 -0
- package/packages/table/src/table.ts +175 -63
- package/packages/table/src/util.ts +21 -1
- /package/es/{iconfont.1780293024194.ttf → iconfont.1780726776354.ttf} +0 -0
- /package/es/{iconfont.1780293024194.woff → iconfont.1780726776354.woff} +0 -0
- /package/es/{iconfont.1780293024194.woff2 → iconfont.1780726776354.woff2} +0 -0
- /package/lib/{iconfont.1780293024194.ttf → iconfont.1780726776354.ttf} +0 -0
- /package/lib/{iconfont.1780293024194.woff → iconfont.1780726776354.woff} +0 -0
- /package/lib/{iconfont.1780293024194.woff2 → iconfont.1780726776354.woff2} +0 -0
package/lib/index.umd.js
CHANGED
|
@@ -3314,7 +3314,7 @@ function getDefaultConfig(val1, def1) {
|
|
|
3314
3314
|
/* unused harmony import specifier */ var VxeUI;
|
|
3315
3315
|
|
|
3316
3316
|
|
|
3317
|
-
const version = "4.19.
|
|
3317
|
+
const version = "4.19.8";
|
|
3318
3318
|
core_.VxeUI.version = version;
|
|
3319
3319
|
core_.VxeUI.tableVersion = version;
|
|
3320
3320
|
core_.VxeUI.setConfig({
|
|
@@ -3848,7 +3848,7 @@ var es_iterator_some = __webpack_require__(3579);
|
|
|
3848
3848
|
const {
|
|
3849
3849
|
log: log_log
|
|
3850
3850
|
} = core_.VxeUI;
|
|
3851
|
-
const log_version = `table v${"4.19.
|
|
3851
|
+
const log_version = `table v${"4.19.8"}`;
|
|
3852
3852
|
const warnLog = log_log.create('warn', log_version);
|
|
3853
3853
|
const errLog = log_log.create('error', log_version);
|
|
3854
3854
|
;// ./packages/table/src/columnInfo.ts
|
|
@@ -4422,6 +4422,7 @@ function createInternalData() {
|
|
|
4422
4422
|
sourceDataRowIdData: {},
|
|
4423
4423
|
fullColumnIdData: {},
|
|
4424
4424
|
fullColumnFieldData: {},
|
|
4425
|
+
fullCellHeightMaps: {},
|
|
4425
4426
|
// 当前行
|
|
4426
4427
|
currentRow: null,
|
|
4427
4428
|
// 合并表头单元格的数据
|
|
@@ -4482,7 +4483,8 @@ function createInternalData() {
|
|
|
4482
4483
|
inited: false,
|
|
4483
4484
|
tooltipTimeout: null,
|
|
4484
4485
|
initStatus: false,
|
|
4485
|
-
isActivated: false
|
|
4486
|
+
isActivated: false,
|
|
4487
|
+
rceDelay: 0
|
|
4486
4488
|
// _sToTime: null
|
|
4487
4489
|
};
|
|
4488
4490
|
}
|
|
@@ -4730,6 +4732,21 @@ function createReactData() {
|
|
|
4730
4732
|
isColLoading: false
|
|
4731
4733
|
};
|
|
4732
4734
|
}
|
|
4735
|
+
const maxKey = '__max';
|
|
4736
|
+
function getRowMaxHeight(chRest, isForce) {
|
|
4737
|
+
if (isForce || !chRest[maxKey]) {
|
|
4738
|
+
let max = 0;
|
|
4739
|
+
for (const key in chRest) {
|
|
4740
|
+
const val = chRest[key];
|
|
4741
|
+
if (key !== maxKey && external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(val) && val > max) {
|
|
4742
|
+
max = val;
|
|
4743
|
+
}
|
|
4744
|
+
}
|
|
4745
|
+
chRest[maxKey] = max;
|
|
4746
|
+
return max;
|
|
4747
|
+
}
|
|
4748
|
+
return chRest[maxKey];
|
|
4749
|
+
}
|
|
4733
4750
|
const getAllConvertColumns = (columns, parentColumn) => {
|
|
4734
4751
|
const result = [];
|
|
4735
4752
|
columns.forEach(column => {
|
|
@@ -7314,6 +7331,9 @@ const Column = VxeColumn;
|
|
|
7314
7331
|
if (slots.header) {
|
|
7315
7332
|
columnSlots.header = slots.header;
|
|
7316
7333
|
}
|
|
7334
|
+
if (slots.title) {
|
|
7335
|
+
columnSlots.title = slots.title;
|
|
7336
|
+
}
|
|
7317
7337
|
columnConfig.slots = columnSlots;
|
|
7318
7338
|
columnConfig.children = [];
|
|
7319
7339
|
watchColumn($xeTable, props, columnConfig);
|
|
@@ -8235,16 +8255,6 @@ const renderType = 'body';
|
|
|
8235
8255
|
class: 'vxe-cell--wrapper vxe-body-cell--wrapper'
|
|
8236
8256
|
}, column.renderCell(cellParams)));
|
|
8237
8257
|
}
|
|
8238
|
-
tdVNs.push((0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
8239
|
-
key: 'tc',
|
|
8240
|
-
class: ['vxe-cell', {
|
|
8241
|
-
'c--title': showTitle,
|
|
8242
|
-
'c--tooltip': showTooltip,
|
|
8243
|
-
'c--ellipsis': showEllipsis
|
|
8244
|
-
}],
|
|
8245
|
-
style: tcStyle,
|
|
8246
|
-
title: showTitle ? $xeTable.getCellLabel(row, column) : null
|
|
8247
|
-
}, clVNs));
|
|
8248
8258
|
if (showValidTip && errorValidItem) {
|
|
8249
8259
|
const errRule = errorValidItem.rule;
|
|
8250
8260
|
const validSlot = slots ? slots.valid : null;
|
|
@@ -8253,7 +8263,7 @@ const renderType = 'body';
|
|
|
8253
8263
|
...errorValidItem,
|
|
8254
8264
|
rule: errorValidItem
|
|
8255
8265
|
};
|
|
8256
|
-
|
|
8266
|
+
clVNs.push((0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
8257
8267
|
key: 'tcv',
|
|
8258
8268
|
class: ['vxe-cell--valid-error-tip', getPropClass(validOpts.className, validParams)],
|
|
8259
8269
|
style: errRule && errRule.maxWidth ? {
|
|
@@ -8265,6 +8275,16 @@ const renderType = 'body';
|
|
|
8265
8275
|
class: 'vxe-cell--valid-error-msg'
|
|
8266
8276
|
}, errorValidItem.content)]])]));
|
|
8267
8277
|
}
|
|
8278
|
+
tdVNs.push((0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
8279
|
+
key: 'tc',
|
|
8280
|
+
class: ['vxe-cell', {
|
|
8281
|
+
'c--title': showTitle,
|
|
8282
|
+
'c--tooltip': showTooltip,
|
|
8283
|
+
'c--ellipsis': showEllipsis
|
|
8284
|
+
}],
|
|
8285
|
+
style: tcStyle,
|
|
8286
|
+
title: showTitle ? $xeTable.getCellLabel(row, column) : null
|
|
8287
|
+
}, clVNs));
|
|
8268
8288
|
}
|
|
8269
8289
|
let showAreaRowStatus = false;
|
|
8270
8290
|
if (mouseConfig && mouseOpts.area && !_columnIndex && selectCellToRow) {
|
|
@@ -20360,9 +20380,9 @@ remainList.forEach(column=>{const width=Math.max(meanWidth,minCellWidth);column.
|
|
|
20360
20380
|
* 排除已设置 max-width
|
|
20361
20381
|
*/const dynamicList=scaleList.concat(scaleMinList).concat(pxMinList).concat(autoMinList).concat(remainList).filter(column=>!parseColumnMaxWidth(column));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();};/**
|
|
20362
20382
|
* 计算自适应行高
|
|
20363
|
-
*/const calcCellAutoHeight=(rowRest,wrapperEl)=>{const{
|
|
20383
|
+
*/const calcCellAutoHeight=(rowid,rowRest,wrapperEl)=>{const{fullCellHeightMaps}=internalData;let chRest=fullCellHeightMaps[rowid];if(!chRest){chRest={};fullCellHeightMaps[rowid]=chRest;}const wrapperElemList=wrapperEl.querySelectorAll(`.vxe-cell--wrapper[rowid="${rowRest.rowid}"]`);let firstCellStyle=null;let topBottomPadding=0;let changeCH=false;for(let i=0;i<wrapperElemList.length;i++){const wrapperElem=wrapperElemList[i];const cellElem=wrapperElem.parentElement;const cellStyle=cellElem.style;const orHeight=cellStyle.height;const colid=wrapperElem.getAttribute('colid')||'';cellStyle.height='';if(!firstCellStyle){firstCellStyle=getComputedStyle(cellElem);topBottomPadding=firstCellStyle?Math.ceil(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(firstCellStyle.paddingTop)+external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(firstCellStyle.paddingBottom)):0;}const cellHeight=wrapperElem?wrapperElem.clientHeight:0;const colHeight=Math.ceil(cellHeight+topBottomPadding);if(chRest[colid]!==colHeight){changeCH=true;chRest[colid]=colHeight;}cellStyle.height=orHeight;}const cellMaxHeight=getRowMaxHeight(chRest,changeCH);return cellMaxHeight;};/**
|
|
20364
20384
|
* 自适应行高
|
|
20365
|
-
*/const calcCellHeight=()=>{const{treeConfig}=props;const{tableData,isAllOverflow,scrollYLoad,scrollXLoad}=reactData;const{fullAllDataRowIdData}=internalData;const el=refElem.value;if(!el||!el.clientWidth){return;}const treeOpts=computeTreeOpts.value;const defaultRowHeight=computeDefaultRowHeight.value;if(!isAllOverflow&&(scrollYLoad||scrollXLoad||treeConfig&&treeOpts.showLine)){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,reHeight);}el.removeAttribute('data-calc-row');});reactData.calcCellHeightFlag++;}};const getOrderField=column=>{const{isRowGroupStatus}=reactData;const{sortBy,sortType,aggFunc}=column;return isRowGroupStatus&&aggFunc?row=>{if(row.isAggregate){const aggData=row.aggData;const currAggData=aggData?aggData[column.field]:null;return currAggData?currAggData.value:null;}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=$xeTable.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;}: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=$xeTable.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;};/**
|
|
20385
|
+
*/const calcCellHeight=()=>{const{treeConfig}=props;const{tableData,isAllOverflow,scrollYLoad,scrollXLoad}=reactData;const{fullAllDataRowIdData}=internalData;const el=refElem.value;if(!el||!el.clientWidth){return;}const treeOpts=computeTreeOpts.value;const defaultRowHeight=computeDefaultRowHeight.value;if(!isAllOverflow&&(scrollYLoad||scrollXLoad||treeConfig&&treeOpts.showLine)){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(rowid,rowRest,el);rowRest.height=Math.max(defaultRowHeight,reHeight);}el.removeAttribute('data-calc-row');});reactData.calcCellHeightFlag++;}};const getOrderField=column=>{const{isRowGroupStatus}=reactData;const{sortBy,sortType,aggFunc}=column;return isRowGroupStatus&&aggFunc?row=>{if(row.isAggregate){const aggData=row.aggData;const currAggData=aggData?aggData[column.field]:null;return currAggData?currAggData.value:null;}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=$xeTable.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;}: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=$xeTable.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;};/**
|
|
20366
20386
|
* 预编译
|
|
20367
20387
|
* 对渲染中的数据提前解析序号及索引。牺牲提前编译耗时换取渲染中额外损耗,使运行时更加流畅
|
|
20368
20388
|
*/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();}};/**
|
|
@@ -20385,7 +20405,7 @@ if(allSortMethod){const sortRests=allSortMethod({data:tableTree,sortList:orderCo
|
|
|
20385
20405
|
if(allSortMethod){const sortRests=allSortMethod({data:tableTree,sortList:orderColumns,$table:$xeTable});tableTree=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(sortRests)?sortRests:tableTree;}else{const treeList=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toTreeArray(tableTree,{children:mapChildrenField});tableTree=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toArrayTree(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().orderBy(treeList,orderColumns.map(({column,order})=>[getOrderField(column),order])),{key:rowField,parentKey:parentField,children:childrenField,mapChildren:mapChildrenField});}tableData=tableTree;}else{if(allSortMethod){const sortRests=allSortMethod({data:tableData,sortList:orderColumns,$table:$xeTable});tableData=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(sortRests)?sortRests:tableData;}else{tableData=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().orderBy(tableData,orderColumns.map(({column,order})=>[getOrderField(column),order]));}tableTree=tableData;}}}else{if(isRowGroupStatus){// 还原行分组
|
|
20386
20406
|
// 还原虚拟树
|
|
20387
20407
|
tableTree=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().searchTree(tableFullGroupData,()=>true,{original:true,isEvery:true,children:aggregateOpts.mapChildrenField,mapChildren:aggregateOpts.childrenField});tableData=tableTree;}else if(treeConfig&&transform&&isSortDeep!==false){// 还原虚拟树
|
|
20388
|
-
tableTree=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().searchTree(tableFullTreeData,()=>true,{original:true,isEvery,children:mapChildrenField,mapChildren:childrenField});tableData=tableTree;}else{tableData=treeConfig?tableFullTreeData.slice(0):tableFullData.slice(0);tableTree=tableData;}}internalData.afterFullData=tableData;internalData.afterTreeFullData=tableTree;internalData.afterGroupFullData=tableTree;updateAfterDataIndex();};const updateStyle=()=>{const{mouseConfig}=props;const{isGroup,tableColumn,overflowX,scrollbarWidth,overflowY,scrollbarHeight,scrollXWidth,columnStore,editStore,isColLoading}=reactData;const{visibleColumn,tableHeight,elemStore,currentRow,customHeight,customMinHeight,customMaxHeight,tHeaderHeight,tFooterHeight}=internalData;const $xeGanttView=internalData.xeGanttView;const el=refElem.value;if(!el||internalData.tBodyHeight&&!el.clientHeight){return;}const containerList=['main','left','right'];const{leftList,rightList}=columnStore;let osbWidth=overflowY?scrollbarWidth:0;let osbHeight=overflowX?scrollbarHeight:0;const emptyPlaceholderElem=refEmptyPlaceholder.value;const isHeaderRenderOptimize=computeIsHeaderRenderOptimize.value;const isBodyRenderOptimize=computeIsBodyRenderOptimize.value;const isFooterRenderOptimize=computeIsFooterRenderOptimize.value;const scrollbarOpts=computeScrollbarOpts.value;const mouseOpts=computeMouseOpts.value;const bodyWrapperElem=getRefElem(elemStore['main-body-wrapper']);const bodyTableElem=getRefElem(elemStore['main-body-table']);if(emptyPlaceholderElem){emptyPlaceholderElem.style.top=`${tHeaderHeight}px`;emptyPlaceholderElem.style.height=bodyWrapperElem?`${bodyWrapperElem.offsetHeight-osbHeight}px`:'';}const scrollbarXConf=scrollbarOpts.x||{};const scrollbarYConf=scrollbarOpts.y||{};const scrollbarYToLeft=computeScrollbarYToLeft.value;let xScrollbarVisible=overflowX?'visible':'hidden';if(scrollbarXConf.visible==='visible'||$xeGanttView){osbHeight=scrollbarHeight;xScrollbarVisible='visible';}else if(scrollbarXConf.visible==='hidden'||scrollbarXConf.visible===false){osbHeight=0;xScrollbarVisible='hidden';}let yScrollbarVisible=overflowY?'visible':'hidden';if(scrollbarYConf.visible==='hidden'||scrollbarYConf.visible===false||$xeGanttView&&!scrollbarYToLeft){osbWidth=0;yScrollbarVisible='hidden';}else if(scrollbarYConf.visible==='visible'){osbWidth=scrollbarWidth;yScrollbarVisible='visible';}let tbHeight=0;let bodyMaxHeight=0;const bodyMinHeight=customMinHeight-tHeaderHeight-tFooterHeight-osbHeight;if(customMaxHeight){bodyMaxHeight=Math.max(bodyMinHeight,customMaxHeight-tHeaderHeight-tFooterHeight-osbHeight);}if(customHeight){tbHeight=customHeight-tHeaderHeight-tFooterHeight-osbHeight;}if(!tbHeight){if(bodyTableElem){tbHeight=bodyTableElem.clientHeight;}}if(tbHeight){if(bodyMaxHeight){tbHeight=Math.min(bodyMaxHeight,tbHeight);}tbHeight=Math.max(bodyMinHeight,tbHeight);}const xLeftCornerEl=refScrollXLeftCornerElem.value;const xRightCornerEl=refScrollXRightCornerElem.value;const scrollXVirtualEl=refScrollXVirtualElem.value;if(scrollXVirtualEl){scrollXVirtualEl.style.height=`${osbHeight}px`;scrollXVirtualEl.style.visibility=xScrollbarVisible;}const xWrapperEl=refScrollXWrapperElem.value;if(xWrapperEl){xWrapperEl.style.width=`${el.clientWidth-osbWidth}px`;if(scrollbarYToLeft){xWrapperEl.style.left=`${osbWidth}px`;}else{xWrapperEl.style.left='';}}if(xLeftCornerEl){if(scrollbarYToLeft){xLeftCornerEl.style.width=`${osbWidth}px`;xLeftCornerEl.style.display=overflowY&&osbWidth?'block':'';}else{xLeftCornerEl.style.display='';}}if(xRightCornerEl){if(scrollbarYToLeft){xRightCornerEl.style.display='';}else{xRightCornerEl.style.width=`${osbWidth}px`;xRightCornerEl.style.display=xScrollbarVisible==='visible'?'block':'';}}const scrollYVirtualEl=refScrollYVirtualElem.value;if(scrollYVirtualEl){scrollYVirtualEl.style.width=`${osbWidth}px`;scrollYVirtualEl.style.height=`${tbHeight+tHeaderHeight+tFooterHeight}px`;scrollYVirtualEl.style.visibility=yScrollbarVisible;}const yTopCornerEl=refScrollYTopCornerElem.value;if(yTopCornerEl){yTopCornerEl.style.height=`${tHeaderHeight}px`;yTopCornerEl.style.display=tHeaderHeight&&yScrollbarVisible==='visible'?'block':'';}const yWrapperEl=refScrollYWrapperElem.value;if(yWrapperEl){yWrapperEl.style.height=`${tbHeight}px`;yWrapperEl.style.top=`${tHeaderHeight}px`;}const yBottomCornerEl=refScrollYBottomCornerElem.value;if(yBottomCornerEl){yBottomCornerEl.style.height=`${tFooterHeight}px`;yBottomCornerEl.style.top=`${tHeaderHeight+tbHeight}px`;yBottomCornerEl.style.display=tFooterHeight&&yScrollbarVisible==='visible'?'block':'';}const rowExpandEl=refRowExpandElem.value;if(rowExpandEl){rowExpandEl.style.height=`${tbHeight}px`;rowExpandEl.style.top=`${tHeaderHeight}px`;}internalData.tBodyHeight=tbHeight;containerList.forEach((name,index)=>{const fixedType=index>0?name:'';const layoutList=['header','body','footer'];const isFixedLeft=fixedType==='left';let fixedColumn=[];let fixedWrapperElem;if(fixedType){fixedColumn=isFixedLeft?leftList:rightList;fixedWrapperElem=isFixedLeft?refLeftContainer.value:refRightContainer.value;}layoutList.forEach(layout=>{const wrapperElem=getRefElem(elemStore[`${name}-${layout}-wrapper`]);const currScrollElem=getRefElem(elemStore[`${name}-${layout}-scroll`]);const tableElem=getRefElem(elemStore[`${name}-${layout}-table`]);if(layout==='header'){// 表头体样式处理
|
|
20408
|
+
tableTree=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().searchTree(tableFullTreeData,()=>true,{original:true,isEvery,children:mapChildrenField,mapChildren:childrenField});tableData=tableTree;}else{tableData=treeConfig?tableFullTreeData.slice(0):tableFullData.slice(0);tableTree=tableData;}}internalData.afterFullData=tableData;internalData.afterTreeFullData=tableTree;internalData.afterGroupFullData=tableTree;updateAfterDataIndex();};const updateStyle=()=>{const{mouseConfig}=props;const{isGroup,tableColumn,overflowX,scrollbarWidth,overflowY,scrollbarHeight,scrollXWidth,columnStore,editStore,isColLoading}=reactData;const{visibleColumn,tableHeight,elemStore,currentRow,customHeight,customMinHeight,customMaxHeight,tHeaderHeight,tFooterHeight}=internalData;const $xeGanttView=internalData.xeGanttView;const el=refElem.value;if(!el||internalData.tBodyHeight&&!el.clientHeight){return;}const containerList=['main','left','right'];const{leftList,rightList}=columnStore;let osbWidth=overflowY?scrollbarWidth:0;let osbHeight=overflowX?scrollbarHeight:0;const emptyPlaceholderElem=refEmptyPlaceholder.value;const isHeaderRenderOptimize=computeIsHeaderRenderOptimize.value;const isBodyRenderOptimize=computeIsBodyRenderOptimize.value;const isFooterRenderOptimize=computeIsFooterRenderOptimize.value;const scrollbarOpts=computeScrollbarOpts.value;const mouseOpts=computeMouseOpts.value;const bodyWrapperElem=getRefElem(elemStore['main-body-wrapper']);const bodyTableElem=getRefElem(elemStore['main-body-table']);if(emptyPlaceholderElem){emptyPlaceholderElem.style.top=`${tHeaderHeight}px`;emptyPlaceholderElem.style.height=bodyWrapperElem?`${bodyWrapperElem.offsetHeight-osbHeight}px`:'';}const scrollbarXConf=scrollbarOpts.x||{};const scrollbarYConf=scrollbarOpts.y||{};const scrollbarYToLeft=computeScrollbarYToLeft.value;let xScrollbarVisible=overflowX?'visible':'hidden';if(scrollbarXConf.visible==='visible'||$xeGanttView){osbHeight=scrollbarHeight;xScrollbarVisible='visible';}else if(scrollbarXConf.visible==='hidden'||scrollbarXConf.visible===false){osbHeight=0;xScrollbarVisible='hidden';}let yScrollbarVisible=overflowY?'visible':'hidden';if(scrollbarYConf.visible==='hidden'||scrollbarYConf.visible===false||$xeGantt&&$xeGanttView&&$xeGantt.reactData.showRightView&&!scrollbarYToLeft){osbWidth=0;yScrollbarVisible='hidden';}else if(scrollbarYConf.visible==='visible'){osbWidth=scrollbarWidth;yScrollbarVisible='visible';}let tbHeight=0;let bodyMaxHeight=0;const bodyMinHeight=customMinHeight-tHeaderHeight-tFooterHeight-osbHeight;if(customMaxHeight){bodyMaxHeight=Math.max(bodyMinHeight,customMaxHeight-tHeaderHeight-tFooterHeight-osbHeight);}if(customHeight){tbHeight=customHeight-tHeaderHeight-tFooterHeight-osbHeight;}if(!tbHeight){if(bodyTableElem){tbHeight=bodyTableElem.clientHeight;}}if(tbHeight){if(bodyMaxHeight){tbHeight=Math.min(bodyMaxHeight,tbHeight);}tbHeight=Math.max(bodyMinHeight,tbHeight);}const xLeftCornerEl=refScrollXLeftCornerElem.value;const xRightCornerEl=refScrollXRightCornerElem.value;const scrollXVirtualEl=refScrollXVirtualElem.value;if(scrollXVirtualEl){scrollXVirtualEl.style.height=`${osbHeight}px`;scrollXVirtualEl.style.visibility=xScrollbarVisible;}const xWrapperEl=refScrollXWrapperElem.value;if(xWrapperEl){xWrapperEl.style.width=`${el.clientWidth-osbWidth}px`;if(scrollbarYToLeft){xWrapperEl.style.left=`${osbWidth}px`;}else{xWrapperEl.style.left='';}}if(xLeftCornerEl){if(scrollbarYToLeft){xLeftCornerEl.style.width=`${osbWidth}px`;xLeftCornerEl.style.display=overflowY&&osbWidth?'block':'';}else{xLeftCornerEl.style.display='';}}if(xRightCornerEl){if(scrollbarYToLeft){xRightCornerEl.style.display='';}else{xRightCornerEl.style.width=`${osbWidth}px`;xRightCornerEl.style.display=xScrollbarVisible==='visible'?'block':'';}}const scrollYVirtualEl=refScrollYVirtualElem.value;if(scrollYVirtualEl){scrollYVirtualEl.style.width=`${osbWidth}px`;scrollYVirtualEl.style.height=`${tbHeight+tHeaderHeight+tFooterHeight}px`;scrollYVirtualEl.style.visibility=yScrollbarVisible;}const yTopCornerEl=refScrollYTopCornerElem.value;if(yTopCornerEl){yTopCornerEl.style.height=`${tHeaderHeight}px`;yTopCornerEl.style.display=tHeaderHeight&&yScrollbarVisible==='visible'?'block':'';}const yWrapperEl=refScrollYWrapperElem.value;if(yWrapperEl){yWrapperEl.style.height=`${tbHeight}px`;yWrapperEl.style.top=`${tHeaderHeight}px`;}const yBottomCornerEl=refScrollYBottomCornerElem.value;if(yBottomCornerEl){yBottomCornerEl.style.height=`${tFooterHeight}px`;yBottomCornerEl.style.top=`${tHeaderHeight+tbHeight}px`;yBottomCornerEl.style.display=tFooterHeight&&yScrollbarVisible==='visible'?'block':'';}const rowExpandEl=refRowExpandElem.value;if(rowExpandEl){rowExpandEl.style.height=`${tbHeight}px`;rowExpandEl.style.top=`${tHeaderHeight}px`;}internalData.tBodyHeight=tbHeight;containerList.forEach((name,index)=>{const fixedType=index>0?name:'';const layoutList=['header','body','footer'];const isFixedLeft=fixedType==='left';let fixedColumn=[];let fixedWrapperElem;if(fixedType){fixedColumn=isFixedLeft?leftList:rightList;fixedWrapperElem=isFixedLeft?refLeftContainer.value:refRightContainer.value;}layoutList.forEach(layout=>{const wrapperElem=getRefElem(elemStore[`${name}-${layout}-wrapper`]);const currScrollElem=getRefElem(elemStore[`${name}-${layout}-scroll`]);const tableElem=getRefElem(elemStore[`${name}-${layout}-table`]);if(layout==='header'){// 表头体样式处理
|
|
20389
20409
|
// 横向滚动渲染
|
|
20390
20410
|
let renderColumnList=tableColumn;const isOptimizeMode=isHeaderRenderOptimize;if(isGroup){renderColumnList=visibleColumn;}else{if(!isOptimizeMode||!isColLoading&&(fixedType||!overflowX)){renderColumnList=visibleColumn;}if(fixedType){// 如果是使用优化模式
|
|
20391
20411
|
if(isOptimizeMode){renderColumnList=fixedColumn||[];}}}const tWidth=renderColumnList.reduce((previous,column)=>previous+column.renderWidth,0);if(fixedType){if(isGroup){if(wrapperElem){wrapperElem.style.width=scrollXWidth?`${scrollXWidth}px`:'';}}else{if(isOptimizeMode){if(wrapperElem){wrapperElem.style.width=tWidth?`${tWidth}px`:'';}}else{if(wrapperElem){wrapperElem.style.width=scrollXWidth?`${scrollXWidth}px`:'';}}}}if(currScrollElem){currScrollElem.style.height=`${tHeaderHeight}px`;}if(tableElem){tableElem.style.width=tWidth?`${tWidth}px`:'';}}else if(layout==='body'){if(currScrollElem){currScrollElem.style.maxHeight=customMaxHeight?`${bodyMaxHeight}px`:'';currScrollElem.style.height=customHeight?`${tbHeight}px`:'';currScrollElem.style.minHeight=`${bodyMinHeight}px`;}// 如果是固定列
|
|
@@ -20449,8 +20469,9 @@ if(!checkStrictly&&$xeTable.isCheckedByCheckboxRow(row)){handleCheckedCheckboxRo
|
|
|
20449
20469
|
const computeScrollLoad=()=>{return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(()=>{const{scrollXLoad,scrollYLoad}=reactData;const{scrollXStore,scrollYStore}=internalData;const virtualYOpts=computeVirtualYOpts.value;const virtualXOpts=computeVirtualXOpts.value;// 计算 X 逻辑
|
|
20450
20470
|
if(scrollXLoad){const{toVisibleIndex:toXVisibleIndex,visibleSize:visibleXSize}=handleVirtualXVisible();const offsetXSize=Math.max(0,virtualXOpts.oSize?external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(virtualXOpts.oSize):0);scrollXStore.preloadSize=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(virtualXOpts.preSize);scrollXStore.offsetSize=offsetXSize;scrollXStore.visibleSize=visibleXSize;scrollXStore.endIndex=Math.max(scrollXStore.startIndex+scrollXStore.visibleSize+offsetXSize,scrollXStore.endIndex);scrollXStore.visibleStartIndex=Math.max(scrollXStore.startIndex,toXVisibleIndex);scrollXStore.visibleEndIndex=Math.min(scrollXStore.endIndex,toXVisibleIndex+visibleXSize);$xeTable.updateScrollXData().then(()=>{loadScrollXData();});}else{$xeTable.updateScrollXSpace();}// 计算 Y 逻辑
|
|
20451
20471
|
const rowHeight=computeRowHeight();scrollYStore.rowHeight=rowHeight;// 已废弃
|
|
20452
|
-
reactData.rowHeight=rowHeight;const{toVisibleIndex:toYVisibleIndex,visibleSize:visibleYSize}=handleVirtualYVisible();if(scrollYLoad){const offsetYSize=Math.max(0,virtualYOpts.oSize?external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(virtualYOpts.oSize):0);scrollYStore.preloadSize=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(virtualYOpts.preSize);scrollYStore.offsetSize=offsetYSize;scrollYStore.visibleSize=visibleYSize;scrollYStore.endIndex=Math.max(scrollYStore.startIndex+visibleYSize+offsetYSize,scrollYStore.endIndex);scrollYStore.visibleStartIndex=Math.max(scrollYStore.startIndex,toYVisibleIndex);scrollYStore.visibleEndIndex=Math.min(scrollYStore.endIndex,toYVisibleIndex+visibleYSize);$xeTable.updateScrollYData().then(()=>{loadScrollYData();});}else{$xeTable.updateScrollYSpace();}});};const calcScrollbar=()=>{const{scrollXWidth,scrollYHeight}=reactData;const{elemStore}=internalData;const scrollbarOpts=computeScrollbarOpts.value;const el=refElem.value;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=refScrollXHandleElem.value;const yHandleEl=refScrollYHandleElem.value;let overflowY=false;let overflowX=false;if(bodyWrapperElem){overflowY=scrollYHeight>bodyWrapperElem.clientHeight;if(yHandleEl){reactData.scrollbarWidth=scrollbarOpts.width||yHandleEl.offsetWidth-yHandleEl.clientWidth||14;}reactData.overflowY=overflowY;overflowX=scrollXWidth>bodyWrapperElem.clientWidth;if(xHandleEl){reactData.scrollbarHeight=scrollbarOpts.height||xHandleEl.offsetHeight-xHandleEl.clientHeight||14;}const 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();}};const handleRecalculateStyle=(reFull,reWidth,reHeight)=>{const el=refElem.value;
|
|
20453
|
-
if(reWidth){calcCellWidth();}if(reFull){autoCellWidth();}if(reHeight){calcCellHeight();}updateStyle();calcScrollbar();if(reFull){updateRowOffsetTop();}updateRowExpandStyle();if(reFull){updateTreeLineStyle();}if(reFull){return computeScrollLoad();}});};const handleLazyRecalculate=(reFull,reWidth,reHeight)=>{return new Promise(resolve=>{const $xeGanttView=internalData.xeGanttView;const{customStore}=reactData;const{rceTimeout,rceRunTime}=internalData;const resizeOpts=computeResizeOpts.value;
|
|
20472
|
+
reactData.rowHeight=rowHeight;const{toVisibleIndex:toYVisibleIndex,visibleSize:visibleYSize}=handleVirtualYVisible();if(scrollYLoad){const offsetYSize=Math.max(0,virtualYOpts.oSize?external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(virtualYOpts.oSize):0);scrollYStore.preloadSize=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(virtualYOpts.preSize);scrollYStore.offsetSize=offsetYSize;scrollYStore.visibleSize=visibleYSize;scrollYStore.endIndex=Math.max(scrollYStore.startIndex+visibleYSize+offsetYSize,scrollYStore.endIndex);scrollYStore.visibleStartIndex=Math.max(scrollYStore.startIndex,toYVisibleIndex);scrollYStore.visibleEndIndex=Math.min(scrollYStore.endIndex,toYVisibleIndex+visibleYSize);$xeTable.updateScrollYData().then(()=>{loadScrollYData();});}else{$xeTable.updateScrollYSpace();}});};const calcScrollbar=()=>{const{scrollXWidth,scrollYHeight}=reactData;const{elemStore}=internalData;const scrollbarOpts=computeScrollbarOpts.value;const el=refElem.value;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=refScrollXHandleElem.value;const yHandleEl=refScrollYHandleElem.value;let overflowY=false;let overflowX=false;if(bodyWrapperElem){overflowY=scrollYHeight>bodyWrapperElem.clientHeight;if(yHandleEl){reactData.scrollbarWidth=scrollbarOpts.width||yHandleEl.offsetWidth-yHandleEl.clientWidth||14;}reactData.overflowY=overflowY;overflowX=scrollXWidth>bodyWrapperElem.clientWidth;if(xHandleEl){reactData.scrollbarHeight=scrollbarOpts.height||xHandleEl.offsetHeight-xHandleEl.clientHeight||14;}const 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();}};const handleRecalculateStyle=(reFull,reWidth,reHeight)=>{const el=refElem.value;if(!el||!el.clientWidth){return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();}const varEl=refVarElem.value;if(varEl){const[defEl,mediumEl,smallEl,miniEl]=varEl.children;calcVarRowHeightConfig('default',defEl);calcVarRowHeightConfig('medium',mediumEl);calcVarRowHeightConfig('small',smallEl);calcVarRowHeightConfig('mini',miniEl);}if(reWidth){calcCellWidth();}if(reFull){autoCellWidth();}calcScrollbar();updateStyle();updateRowExpandStyle();if(reFull){updateTreeLineStyle();}internalData.rceRunTime=Date.now();return computeScrollLoad().then(()=>{// 初始化时需要在列计算之后再执行优化运算,达到最优显示效果
|
|
20473
|
+
if(reWidth){calcCellWidth();}if(reFull){autoCellWidth();}if(reHeight){calcCellHeight();}updateStyle();calcScrollbar();if(reFull){updateRowOffsetTop();}updateRowExpandStyle();if(reFull){updateTreeLineStyle();}internalData.rceRunTime=Date.now();if(reFull){return computeScrollLoad();}});};const minRunDelay=50;const handleLazyRecalculate=(reFull,reWidth,reHeight)=>{return new Promise(resolve=>{const $xeGanttView=internalData.xeGanttView;const{customStore}=reactData;const{rceTimeout,rceRunTime}=internalData;const resizeOpts=computeResizeOpts.value;let rceDelay=internalData.rceDelay;// 如果在500毫秒内频繁执行,则执行次数减缓
|
|
20474
|
+
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=refElem.value;if(el&&el.clientWidth){autoCellWidth();updateRowExpandStyle();}if(customStore.visible&&$xeTable.handleCustomStyle){$xeTable.handleCustomStyle();}if(rceTimeout){clearTimeout(rceTimeout);if(rceRunTime&&rceRunTime+minRunDelay<Date.now()){resolve(handleRecalculateStyle(reFull,reWidth,reHeight));}else{(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(()=>{resolve();});}}else{resolve(handleRecalculateStyle(reFull,reWidth,reHeight));}if($xeGanttView&&$xeGanttView.handleLazyRecalculate){$xeGanttView.handleLazyRecalculate();}internalData.rceTimeout=setTimeout(()=>{internalData.rceTimeout=undefined;handleRecalculateStyle(reFull,reWidth,reHeight);if($xeGanttView&&$xeGanttView.handleLazyRecalculate){$xeGanttView.handleLazyRecalculate();}},reDelay);});};let resizePending=false;const handleResizeEvent=()=>{if(resizePending){return;}resizePending=true;handleLazyRecalculate(true,true,true).then(()=>{resizePending=false;}).catch(()=>{resizePending=false;});};const handleUpdateAggValues=()=>{const{visibleColumn}=internalData;const aggCols=[];visibleColumn.forEach(column=>{if(column.aggFunc){aggCols.push(column);}});reactData.aggHandleAggColumns=aggCols;};const handleUpdateRowGroup=groupFields=>{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();};const handleeGroupSummary=aggList=>{const{fullColumnFieldData}=internalData;const aggregateOpts=computeAggregateOpts.value;const aggFuncColumns=computeAggFuncColumns.value;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{if(aggFuncColumns.length){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,/**
|
|
20454
20475
|
* 已废弃
|
|
20455
20476
|
* @deprecated
|
|
20456
20477
|
*/children:childList,/**
|
|
@@ -20467,11 +20488,11 @@ if(!treeOpts.rowField){errLog('vxe.error.reqProp',['tree-config.rowField']);}if(
|
|
|
20467
20488
|
// warnLog('vxe.error.errConflicts', ['tree-config.transform', `row.${treeOpts.children}`])
|
|
20468
20489
|
// }
|
|
20469
20490
|
// })
|
|
20470
|
-
treeData=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toArrayTree(fullData,{key:treeOpts.rowField,parentKey:treeOpts.parentField,children:childrenField,mapChildren:treeOpts.mapChildrenField});fullData=treeData.slice(0);}else{treeData=fullData.slice(0);}}else if((aggregateConfig||rowGroupConfig)&&rowGroupList.length){const groupRest=initGroupData(fullData,rowGroupList);treeData=groupRest.treeData;fullData=groupRest.fullData;isRGroup=true;}reactData.isRowGroupStatus=isRGroup;scrollYStore.startIndex=0;scrollYStore.endIndex=1;scrollXStore.startIndex=0;scrollXStore.endIndex=1;internalData.cvCacheMaps={};reactData.isRowLoading=true;reactData.scrollVMLoading=false;reactData.treeExpandedFlag++;reactData.rowExpandedFlag++;internalData.insertRowMaps={};reactData.insertRowFlag++;internalData.removeRowMaps={};reactData.removeRowFlag++;const sYLoad=updateScrollYStatus(fullData);// 全量数据
|
|
20491
|
+
treeData=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toArrayTree(fullData,{key:treeOpts.rowField,parentKey:treeOpts.parentField,children:childrenField,mapChildren:treeOpts.mapChildrenField});fullData=treeData.slice(0);}else{treeData=fullData.slice(0);}}else if((aggregateConfig||rowGroupConfig)&&rowGroupList.length){const groupRest=initGroupData(fullData,rowGroupList);treeData=groupRest.treeData;fullData=groupRest.fullData;isRGroup=true;}reactData.isRowGroupStatus=isRGroup;scrollYStore.startIndex=0;scrollYStore.endIndex=1;scrollXStore.startIndex=0;scrollXStore.endIndex=1;internalData.cvCacheMaps={};reactData.isRowLoading=true;reactData.scrollVMLoading=false;reactData.treeExpandedFlag++;reactData.rowExpandedFlag++;internalData.insertRowMaps={};reactData.insertRowFlag++;internalData.removeRowMaps={};reactData.removeRowFlag++;internalData.fullCellHeightMaps={};const sYLoad=updateScrollYStatus(fullData);// 全量数据
|
|
20471
20492
|
internalData.tableFullData=fullData;internalData.tableFullTreeData=isRGroup?[]:treeData;internalData.tableFullGroupData=isRGroup?treeData:[];// 缓存数据
|
|
20472
20493
|
$xeTable.cacheRowMap(isReset);// 原始数据
|
|
20473
20494
|
internalData.tableSynchData=datas;if(isReset){internalData.isResizeCellHeight=false;}// 克隆原数据,用于显示编辑状态,与编辑值做对比
|
|
20474
|
-
if(keepSource){$xeTable.cacheSourceMap(fullData);}if($xeTable.clearCellAreas&&props.mouseConfig){$xeTable.clearCellAreas();$xeTable.clearCopyCellArea();}$xeTable.clearMergeCells();$xeTable.clearMergeFooterItems();$xeTable.clearHistory();$xeTable.handleTableData(true);$xeTable.updateFooter();$xeTable.handleUpdateBodyMerge();return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(()=>{updateHeight();updateStyle();}).then(()=>{computeScrollLoad();}).then(()=>{const virtualYOpts=computeVirtualYOpts.value;// 是否启用了虚拟滚动
|
|
20495
|
+
if(keepSource){$xeTable.cacheSourceMap(fullData);}if($xeTable.clearCellAreas&&props.mouseConfig){$xeTable.clearCellAreas();$xeTable.clearCopyCellArea();}$xeTable.clearMergeCells();$xeTable.clearMergeFooterItems();$xeTable.clearHistory();$xeTable.handleTableData(true);$xeTable.updateFooter();$xeTable.handleUpdateBodyMerge();return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(()=>{updateHeight();updateStyle();}).then(()=>{computeScrollLoad();syncGanttScrollYStatus();}).then(()=>{const virtualYOpts=computeVirtualYOpts.value;// 是否启用了虚拟滚动
|
|
20475
20496
|
if(sYLoad){scrollYStore.endIndex=scrollYStore.visibleSize;}if(sYLoad){if(reactData.expandColumn&&expandOpts.mode!=='fixed'){errLog('vxe.error.notConflictProp',['column.type="expand','expand-config.mode="fixed"']);}if(virtualYOpts.mode==='scroll'&&reactData.expandColumn&&expandOpts.mode==='fixed'){warnLog('vxe.error.notConflictProp',['virtual-y-config.mode=scroll','expand-config.mode=inside']);}// if (showOverflow) {
|
|
20476
20497
|
// if (!rowOpts.height) {
|
|
20477
20498
|
// const errColumn = internalData.tableFullColumn.find(column => column.showOverflow === false)
|
|
@@ -20487,7 +20508,7 @@ if(!(props.height||props.maxHeight)){errLog('vxe.error.reqSupportProp',['virtual
|
|
|
20487
20508
|
// warnLog('vxe.error.scrollErrProp', ['span-method'])
|
|
20488
20509
|
// }
|
|
20489
20510
|
}handleReserveStatus();$xeTable.checkSelectionStatus();$xeTable.dispatchEvent('data-change',{visibleColumn:internalData.visibleColumn,visibleData:internalData.afterFullData},null);return new Promise(resolve=>{(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(()=>handleRecalculateStyle(false,false,false)).then(()=>{handleRecalculateStyle(false,true,true);updateRowOffsetTop();}).then(()=>{let targetScrollLeft=lastScrollLeft;let targetScrollTop=lastScrollTop;const virtualXOpts=computeVirtualXOpts.value;const virtualYOpts=computeVirtualYOpts.value;// 是否在更新数据之后自动滚动重置滚动条
|
|
20490
|
-
if(virtualXOpts.scrollToLeftOnChange){targetScrollLeft=0;}if(virtualYOpts.scrollToTopOnChange){targetScrollTop=0;}reactData.isRowLoading=false;handleRecalculateStyle(false,false,false);updateTreeLineStyle();// 如果是自动行高,特殊情况需调用 recalculate 手动刷新
|
|
20511
|
+
if(virtualXOpts.scrollToLeftOnChange){targetScrollLeft=0;}if(virtualYOpts.scrollToTopOnChange){targetScrollTop=0;}reactData.isRowLoading=false;handleRecalculateStyle(false,false,false);updateTreeLineStyle();syncGanttScrollYStatus();// 如果是自动行高,特殊情况需调用 recalculate 手动刷新
|
|
20491
20512
|
if(!props.showOverflow){setTimeout(()=>{handleLazyRecalculate(false,true,true);setTimeout(()=>handleLazyRecalculate(false,true,true),3000);},2000);}// 是否变更虚拟滚动
|
|
20492
20513
|
if(oldScrollYLoad===sYLoad){restoreScrollLocation($xeTable,targetScrollLeft,targetScrollTop).then(()=>{handleRecalculateStyle(false,true,true);updateRowOffsetTop();updateTreeLineStyle();(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(()=>resolve());});}else{setTimeout(()=>{restoreScrollLocation($xeTable,targetScrollLeft,targetScrollTop).then(()=>{handleRecalculateStyle(false,true,true);updateRowOffsetTop();updateTreeLineStyle();(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(()=>resolve());});});}});}).then(()=>{if(initStatus){dispatchEvent('data-rendered',{isReload,visibleColumn:internalData.visibleColumn,visibleData:internalData.afterFullData},null);}else{dispatchEvent('init-rendered',{visibleColumn:internalData.visibleColumn,visibleData:internalData.afterFullData},null);}});});};/**
|
|
20493
20514
|
* 处理数据加载默认行为
|
|
@@ -20516,9 +20537,9 @@ tableFullColumn.forEach(column=>{if(column.visible){if(column.fixed==='left'){le
|
|
|
20516
20537
|
// }
|
|
20517
20538
|
if(props.spanMethod){warnLog('vxe.error.scrollErrProp',['span-method']);}if(props.footerSpanMethod){warnLog('vxe.error.scrollErrProp',['footer-span-method']);}if(isReset){const{visibleSize}=handleVirtualXVisible();scrollXStore.startIndex=0;scrollXStore.endIndex=visibleSize;scrollXStore.visibleSize=visibleSize;scrollXStore.visibleStartIndex=0;scrollXStore.visibleEndIndex=visibleSize;}}// 如果列被显示/隐藏,则清除合并状态
|
|
20518
20539
|
// 如果列被设置为固定,则清除合并状态
|
|
20519
|
-
if(visibleColumn.length!==internalData.visibleColumn.length||!internalData.visibleColumn.every((column,index)=>column===visibleColumn[index])){$xeTable.clearMergeCells();$xeTable.clearMergeFooterItems();}visibleColumn.forEach((column,index)=>{const colid=column.id;const colRest=fullColumnIdData[colid];if(colRest){colRest._index=index;}});handleTableColumn();handleUpdateAggValues();if(isReset){updateColumnOffsetLeft();return $xeTable.updateFooter().then(()=>{return $xeTable.recalculate();}).then(()=>{$xeTable.updateCellAreas();return $xeTable.recalculate();});}return $xeTable.updateFooter();};const initColumnHierarchy=()=>{const{collectColumn}=internalData;const fullColIdData={};const fullColFieldData={};let sortIndex=1;external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(collectColumn,(column,index,items,path,parentColumn)=>{const{id:colid,field}=column;const parentId=parentColumn?parentColumn.id:null;const rest={$index:-1,_index:-1,column,colid,index,items,parent:parentColumn||null,width:0,oLeft:0};column.parentId=parentId;column.defaultParentId=parentId;column.sortNumber=sortIndex;column.renderSortNumber=sortIndex;sortIndex++;if(field){if(fullColFieldData[field]){errLog('vxe.error.colRepet',['field',field]);}fullColFieldData[field]=rest;}fullColIdData[colid]=rest;});internalData.fullColumnIdData=fullColIdData;internalData.fullColumnFieldData=fullColFieldData;};const
|
|
20520
|
-
const scrollXLoad=!!virtualXOpts.enabled&&virtualXOpts.gt>-1&&(virtualXOpts.gt===0||virtualXOpts.gt<allCols.length);reactData.scrollXLoad=scrollXLoad;return scrollXLoad;};const updateScrollYStatus=fullData=>{const{treeConfig}=props;const
|
|
20521
|
-
const scrollYLoad=(transform||!treeConfig)&&!!virtualYOpts.enabled&&virtualYOpts.gt>-1&&(virtualYOpts.gt===0||virtualYOpts.gt<allList.length);reactData.scrollYLoad=scrollYLoad;
|
|
20540
|
+
if(visibleColumn.length!==internalData.visibleColumn.length||!internalData.visibleColumn.every((column,index)=>column===visibleColumn[index])){$xeTable.clearMergeCells();$xeTable.clearMergeFooterItems();}visibleColumn.forEach((column,index)=>{const colid=column.id;const colRest=fullColumnIdData[colid];if(colRest){colRest._index=index;}});handleTableColumn();handleUpdateAggValues();if(isReset){updateColumnOffsetLeft();return $xeTable.updateFooter().then(()=>{return $xeTable.recalculate();}).then(()=>{$xeTable.updateCellAreas();return $xeTable.recalculate();});}return $xeTable.updateFooter();};const initColumnHierarchy=()=>{const{collectColumn}=internalData;const fullColIdData={};const fullColFieldData={};let sortIndex=1;external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(collectColumn,(column,index,items,path,parentColumn)=>{const{id:colid,field}=column;const parentId=parentColumn?parentColumn.id:null;const rest={$index:-1,_index:-1,column,colid,index,items,parent:parentColumn||null,width:0,oLeft:0};column.parentId=parentId;column.defaultParentId=parentId;column.sortNumber=sortIndex;column.renderSortNumber=sortIndex;sortIndex++;if(field){if(fullColFieldData[field]){errLog('vxe.error.colRepet',['field',field]);}fullColFieldData[field]=rest;}fullColIdData[colid]=rest;});internalData.fullColumnIdData=fullColIdData;internalData.fullColumnFieldData=fullColFieldData;};const buildColumnInfo=()=>{const{scrollXLoad,scrollYLoad,expandColumn}=reactData;const expandOpts=computeExpandOpts.value;cacheColumnMap();parseColumns(true).then(()=>{if(reactData.scrollXLoad){loadScrollXData();}});$xeTable.clearHeaderFormatterCache();$xeTable.clearMergeCells();$xeTable.clearMergeFooterItems();$xeTable.handleTableData(true);$xeTable.handleAggregateSummaryData();if((scrollXLoad||scrollYLoad)&&expandColumn&&expandOpts.mode!=='fixed'){warnLog('vxe.error.scrollErrProp',['column.type=expand']);}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(()=>{if($xeToolbar){$xeToolbar.syncUpdate({collectColumn:internalData.collectColumn,$table:$xeTable});}if($xeTable.handleUpdateCustomColumn){$xeTable.handleUpdateCustomColumn();}const columnOpts=computeColumnOpts.value;if(props.showCustomHeader&&reactData.isGroup&&(columnOpts.resizable||props.resizable)){warnLog('vxe.error.notConflictProp',['show-custom-header & colgroup','column-config.resizable=false']);}reactData.isColLoading=false;return handleLazyRecalculate(false,true,true);});};const handleInitColumn=collectColumn=>{internalData.collectColumn=collectColumn;const tFullColumn=getColumnList(collectColumn);internalData.tableFullColumn=tFullColumn;reactData.updateColFlag++;reactData.isColLoading=true;initColumnHierarchy();return Promise.resolve(restoreCustomStorage()).then(()=>{return buildColumnInfo();});};const updateScrollXStatus=fullColumn=>{const virtualXOpts=computeVirtualXOpts.value;const allCols=fullColumn||internalData.tableFullColumn;// 如果gt为0,则总是启用
|
|
20541
|
+
const scrollXLoad=!!virtualXOpts.enabled&&virtualXOpts.gt>-1&&(virtualXOpts.gt===0||virtualXOpts.gt<allCols.length);reactData.scrollXLoad=scrollXLoad;return scrollXLoad;};const syncGanttScrollYStatus=()=>{const $xeGanttView=internalData.xeGanttView;if($xeGanttView&&$xeGanttView.handleUpdateSYStatus){$xeGanttView.handleUpdateSYStatus(reactData.scrollYLoad);}};const updateScrollYStatus=fullData=>{const{treeConfig}=props;const virtualYOpts=computeVirtualYOpts.value;const treeOpts=computeTreeOpts.value;const{transform}=treeOpts;const allList=fullData||internalData.tableFullData;// 如果gt为0,则总是启用
|
|
20542
|
+
const scrollYLoad=(transform||!treeConfig)&&!!virtualYOpts.enabled&&virtualYOpts.gt>-1&&(virtualYOpts.gt===0||virtualYOpts.gt<allList.length);reactData.scrollYLoad=scrollYLoad;syncGanttScrollYStatus();return scrollYLoad;};/**
|
|
20522
20543
|
* 展开与收起树节点
|
|
20523
20544
|
* @param rows
|
|
20524
20545
|
* @param expanded
|
|
@@ -20710,7 +20731,7 @@ if(!targetColumn.fixed&&isMaxFixedColumn){if(core_.VxeUI.modal){core_.VxeUI.moda
|
|
|
20710
20731
|
* 刷新列信息
|
|
20711
20732
|
* 将固定的列左边、右边分别靠边
|
|
20712
20733
|
* 如果传 true 则会检查列顺序并排序
|
|
20713
|
-
*/refreshColumn(initSort){if(initSort){handleUpdateColumn();}return parseColumns(true).then(()=>{return $xeTable.refreshScroll();}).then(()=>{return handleLazyRecalculate(false,true,true);});},setRowHeightConf(heightConf){const{fullAllDataRowIdData}=internalData;let status=false;if(heightConf){external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(heightConf,(height,rowid)=>{const rowRest=fullAllDataRowIdData[rowid];if(rowRest){const rHeight=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toInteger(height);if(rHeight){rowRest.resizeHeight=rHeight;if(!status){status=true;}}}});if(status){internalData.isResizeCellHeight=true;reactData.resizeHeightFlag++;}}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(()=>{updateRowOffsetTop();return{status};});},getRowHeightConf(isFull){const{fullAllDataRowIdData,afterFullData}=internalData;const{handleGetRowId}=createHandleGetRowId($xeTable);const rowOpts=computeRowOpts.value;const cellOpts=computeCellOpts.value;const defaultRowHeight=computeDefaultRowHeight.value;const rest={};afterFullData.forEach(row=>{const rowid=handleGetRowId(row);const rowRest=fullAllDataRowIdData[rowid];if(rowRest){const resizeHeight=rowRest.resizeHeight;if(resizeHeight||isFull){const currCellHeight=resizeHeight||cellOpts.height||rowOpts.height||rowRest.height||defaultRowHeight;rest[rowid]=currCellHeight;}}});return rest;},recalcRowHeight(rowOrId){const{fullAllDataRowIdData}=internalData;const rows=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(rowOrId)?rowOrId:[rowOrId];const el=refElem.value;if(el){const{handleGetRowId}=createHandleGetRowId($xeTable);el.setAttribute('data-calc-row','Y');rows.forEach(row=>{const rowid=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(row)||external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(row)?row:handleGetRowId(row);const rowRest=fullAllDataRowIdData[rowid];if(rowRest){rowRest.resizeHeight=calcCellAutoHeight(rowRest,el);}el.removeAttribute('data-calc-row');});reactData.calcCellHeightFlag++;}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();},setRowHeight(rowOrId,height){const{fullAllDataRowIdData}=internalData;let status=false;const rows=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(rowOrId)?rowOrId:[rowOrId];let rHeight=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toInteger(height);if(isScale(height)){const tableBody=refTableBody.value;const bodyElem=tableBody?tableBody.$el:null;const bodyHeight=bodyElem?bodyElem.clientHeight-1:0;rHeight=Math.floor(rHeight*bodyHeight);}if(rHeight){const{handleGetRowId}=createHandleGetRowId($xeTable);rows.forEach(row=>{const rowid=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(row)||external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(row)?row:handleGetRowId(row);const rowRest=fullAllDataRowIdData[rowid];if(rowRest){rowRest.resizeHeight=rHeight;if(!status){status=true;}}});if(status){internalData.isResizeCellHeight=true;reactData.resizeHeightFlag++;}}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(()=>{return{status};});},getRowHeight(rowOrId){const{fullAllDataRowIdData}=internalData;const rowOpts=computeRowOpts.value;const cellOpts=computeCellOpts.value;const defaultRowHeight=computeDefaultRowHeight.value;const rowid=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(rowOrId)||external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(rowOrId)?rowOrId:getRowid($xeTable,rowOrId);const rowRest=fullAllDataRowIdData[rowid];if(rowRest){return rowRest.resizeHeight||cellOpts.height||rowOpts.height||rowRest.height||defaultRowHeight;}return 0;},/**
|
|
20734
|
+
*/refreshColumn(initSort){if(initSort){handleUpdateColumn();}return parseColumns(true).then(()=>{return $xeTable.refreshScroll();}).then(()=>{return handleLazyRecalculate(false,true,true);});},setRowHeightConf(heightConf){const{fullAllDataRowIdData}=internalData;let status=false;if(heightConf){external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(heightConf,(height,rowid)=>{const rowRest=fullAllDataRowIdData[rowid];if(rowRest){const rHeight=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toInteger(height);if(rHeight){rowRest.resizeHeight=rHeight;if(!status){status=true;}}}});if(status){internalData.isResizeCellHeight=true;reactData.resizeHeightFlag++;}}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(()=>{updateRowOffsetTop();return{status};});},getRowHeightConf(isFull){const{fullAllDataRowIdData,afterFullData}=internalData;const{handleGetRowId}=createHandleGetRowId($xeTable);const rowOpts=computeRowOpts.value;const cellOpts=computeCellOpts.value;const defaultRowHeight=computeDefaultRowHeight.value;const rest={};afterFullData.forEach(row=>{const rowid=handleGetRowId(row);const rowRest=fullAllDataRowIdData[rowid];if(rowRest){const resizeHeight=rowRest.resizeHeight;if(resizeHeight||isFull){const currCellHeight=resizeHeight||cellOpts.height||rowOpts.height||rowRest.height||defaultRowHeight;rest[rowid]=currCellHeight;}}});return rest;},recalcRowHeight(rowOrId){const{fullAllDataRowIdData}=internalData;const rows=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(rowOrId)?rowOrId:[rowOrId];const el=refElem.value;if(el){const{handleGetRowId}=createHandleGetRowId($xeTable);el.setAttribute('data-calc-row','Y');rows.forEach(row=>{const rowid=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(row)||external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(row)?row:handleGetRowId(row);const rowRest=fullAllDataRowIdData[rowid];if(rowRest){rowRest.resizeHeight=calcCellAutoHeight(rowid,rowRest,el);}el.removeAttribute('data-calc-row');});reactData.calcCellHeightFlag++;}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();},setRowHeight(rowOrId,height){const{fullAllDataRowIdData}=internalData;let status=false;const rows=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(rowOrId)?rowOrId:[rowOrId];let rHeight=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toInteger(height);if(isScale(height)){const tableBody=refTableBody.value;const bodyElem=tableBody?tableBody.$el:null;const bodyHeight=bodyElem?bodyElem.clientHeight-1:0;rHeight=Math.floor(rHeight*bodyHeight);}if(rHeight){const{handleGetRowId}=createHandleGetRowId($xeTable);rows.forEach(row=>{const rowid=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(row)||external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(row)?row:handleGetRowId(row);const rowRest=fullAllDataRowIdData[rowid];if(rowRest){rowRest.resizeHeight=rHeight;if(!status){status=true;}}});if(status){internalData.isResizeCellHeight=true;reactData.resizeHeightFlag++;}}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(()=>{return{status};});},getRowHeight(rowOrId){const{fullAllDataRowIdData}=internalData;const rowOpts=computeRowOpts.value;const cellOpts=computeCellOpts.value;const defaultRowHeight=computeDefaultRowHeight.value;const rowid=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(rowOrId)||external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(rowOrId)?rowOrId:getRowid($xeTable,rowOrId);const rowRest=fullAllDataRowIdData[rowid];if(rowRest){return rowRest.resizeHeight||cellOpts.height||rowOpts.height||rowRest.height||defaultRowHeight;}return 0;},/**
|
|
20714
20735
|
* 刷新滚动操作,手动同步滚动相关位置(对于某些特殊的操作,比如滚动条错位、固定列不同步)
|
|
20715
20736
|
*/refreshScroll(){const{elemStore,lastScrollLeft,lastScrollTop}=internalData;const headerScrollElem=getRefElem(elemStore['main-header-scroll']);const bodyScrollElem=getRefElem(elemStore['main-body-scroll']);const footerScrollElem=getRefElem(elemStore['main-footer-scroll']);const leftScrollElem=getRefElem(elemStore['left-body-scroll']);const rightScrollElem=getRefElem(elemStore['right-body-scroll']);const xHandleEl=refScrollXHandleElem.value;const yHandleEl=refScrollYHandleElem.value;return new Promise(resolve=>{// 还原滚动条位置
|
|
20716
20737
|
if(lastScrollLeft||lastScrollTop){return restoreScrollLocation($xeTable,lastScrollLeft,lastScrollTop).then(()=>{// 存在滚动行为未结束情况
|
|
@@ -20878,7 +20899,17 @@ return $xeTable.removeMergeFooterCells(merges);},/**
|
|
|
20878
20899
|
return $xeTable.getMergeFooterCells();},/**
|
|
20879
20900
|
* 清除所有表尾合并
|
|
20880
20901
|
*/clearMergeFooterCells(){internalData.mergeFooterList=[];internalData.mergeFooterMaps={};internalData.mergeFooterCellMaps={};internalData.mergeFooterRowMaps={};internalData.mergeFooterColMaps={};reactData.mergeFootFlag++;return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(()=>{return updateStyle();});},clearMergeFooterItems(){// errLog('vxe.error.delFunc', ['clearMergeFooterItems', 'clearMergeFooterCells'])
|
|
20881
|
-
return $xeTable.clearMergeFooterCells();},updateCellAreas(){const{mouseConfig}=props;const mouseOpts=computeMouseOpts.value;if(mouseConfig&&mouseOpts.area&&$xeTable.handleRecalculateCellAreaEvent){return $xeTable.handleRecalculateCellAreaEvent();}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();},undo(){return $xeTable.handleUndoStackEvent(null);},redo(){return $xeTable.handleRedoStackEvent(null);},clearHistory(){return $xeTable.handleClearStack();}
|
|
20902
|
+
return $xeTable.clearMergeFooterCells();},updateCellAreas(){const{mouseConfig}=props;const mouseOpts=computeMouseOpts.value;if(mouseConfig&&mouseOpts.area&&$xeTable.handleRecalculateCellAreaEvent){return $xeTable.handleRecalculateCellAreaEvent();}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();},undo(){return $xeTable.handleUndoStackEvent(null);},redo(){return $xeTable.handleRedoStackEvent(null);},clearHistory(){return $xeTable.handleClearStack();},/**
|
|
20903
|
+
* 用于 custom-config,用于手动恢复自定义列设置信息,恢复表格重置为初始状态
|
|
20904
|
+
* @param storeData
|
|
20905
|
+
* @returns
|
|
20906
|
+
*/setCustomStoreData(storeData){if(!storeData){return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();}const customOpts=computeCustomOpts.value;const{checkMethod}=customOpts;// 重置状态
|
|
20907
|
+
clearTableAllStatus($xeTable);// 恢复列
|
|
20908
|
+
const allCols=[];external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(internalData.collectColumn,column=>{column.resizeWidth=0;column.fixed=column.defaultFixed;column.renderSortNumber=column.sortNumber;column.parentId=column.defaultParentId;if(!checkMethod||checkMethod({$table:$xeTable,column})){column.visible=column.defaultVisible;}column.aggFunc=column.defaultAggFunc;column.renderAggFn=column.defaultAggFunc;column.renderResizeWidth=column.renderWidth;allCols.push(column);});const newCollectCols=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toArrayTree(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().orderBy(allCols,'renderSortNumber'),{key:'id',parentKey:'parentId',children:'children'});internalData.collectColumn=newCollectCols;internalData.tableFullColumn=getColumnList(newCollectCols);reactData.updateColFlag++;reactData.isColLoading=true;initColumnHierarchy();return Promise.resolve(handleCustomRestore(storeData)).then(()=>{return buildColumnInfo();}).then(()=>{// 恢复数据聚合分组
|
|
20909
|
+
const{isRowGroupStatus,rowGroupList}=reactData;if(isRowGroupStatus&&!!$xeTable.handlePivotTableAggData){const rowGroupFields=computeRowGroupFields.value;if(rowGroupFields?rowGroupFields.length:rowGroupList.length){if(rowGroupFields&&rowGroupFields.length){$xeTable.setRowGroups(rowGroupFields);}else{$xeTable.clearRowGroups();}}else{$xeTable.handleUpdateAggData();}}});},/**
|
|
20910
|
+
* 用于 custom-config,用于获取自定义列设置信息,用于自定义保持
|
|
20911
|
+
* @returns
|
|
20912
|
+
*/getCustomStoreData(){const{id}=props;const customOpts=computeCustomOpts.value;const{isRowGroupStatus,rowGroupList}=reactData;const{fullColumnFieldData,collectColumn}=internalData;const{storage,checkMethod,storeOptions}=customOpts;const isAllCustom=storage===true;const storageOpts=Object.assign({},isAllCustom?{}:storage||{},storeOptions);const isCustomResizable=hangleStorageDefaultValue(storageOpts.resizable,isAllCustom);const isCustomVisible=hangleStorageDefaultValue(storageOpts.visible,isAllCustom);const isCustomFixed=hangleStorageDefaultValue(storageOpts.fixed,isAllCustom);const isCustomSort=hangleStorageDefaultValue(storageOpts.sort,isAllCustom);const isCustomAggGroup=hangleStorageDefaultValue(storageOpts.aggGroup,isAllCustom);const isCustomAggFunc=hangleStorageDefaultValue(storageOpts.aggFunc,isAllCustom);const resizableData={};const sortData=[];const visibleData={};const fixedData={};const aggGroupData={};const aggFuncData={};const storeData={resizableData:undefined,sortData:undefined,visibleData:undefined,fixedData:undefined,aggGroupData:undefined,aggFuncData:undefined};if(!id){if(storage){errLog('vxe.error.reqProp',['id']);}return storeData;}let hasResizable=0;let hasSort=0;let hasFixed=0;let hasVisible=0;let hasAggFunc=0;const sortMaps={};external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(collectColumn,(column,index,items,path,parentColumn)=>{const colKey=column.getKey();if(!colKey){errLog('vxe.error.reqProp',[`${column.getTitle()||column.type||''} -> column.field=?`]);return;}if(parentColumn){if(isCustomSort){const pColKey=parentColumn.getKey();const psObj=sortMaps[pColKey];hasSort=1;if(psObj){const sObj={k:colKey};sortMaps[colKey]=sObj;if(!psObj.c){psObj.c=[];}psObj.c.push(sObj);}}}else{if(isCustomSort){hasSort=1;const sObj={k:colKey};sortMaps[colKey]=sObj;sortData.push(sObj);}// 只支持一级
|
|
20882
20913
|
if(isCustomFixed&&(column.fixed||'')!==(column.defaultFixed||'')){hasFixed=1;fixedData[colKey]=column.fixed;}}if(isCustomResizable&&column.resizeWidth){hasResizable=1;resizableData[colKey]=column.renderWidth;}if(isCustomVisible&&(!checkMethod||checkMethod({$table:$xeTable,column}))){if(!column.visible&&column.defaultVisible){hasVisible=1;visibleData[colKey]=false;}else if(column.visible&&!column.defaultVisible){hasVisible=1;visibleData[colKey]=true;}}if(isCustomAggFunc&&(column.aggFunc||'')!==(column.defaultAggFunc||'')){hasAggFunc=1;aggFuncData[colKey]=column.aggFunc;}});if(hasResizable){storeData.resizableData=resizableData;}if(hasSort){storeData.sortData=sortData;}if(hasFixed){storeData.fixedData=fixedData;}if(hasVisible){storeData.visibleData=visibleData;}if(isCustomAggGroup&&isRowGroupStatus){rowGroupList.forEach(aggConf=>{const colRest=fullColumnFieldData[aggConf.field];if(colRest){aggGroupData[colRest.column.getKey()]=true;}});storeData.aggGroupData=aggGroupData;}if(hasAggFunc){storeData.aggFuncData=aggFuncData;}return storeData;},focus(){internalData.isActivated=true;return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();},blur(){internalData.isActivated=false;return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();},/**
|
|
20883
20914
|
* 已废弃,被 connectToolbar 替换
|
|
20884
20915
|
* @deprecated
|
|
@@ -20993,9 +21024,17 @@ if(treeConfig){const childrenField=treeOpts.children||treeOpts.childrenField;ext
|
|
|
20993
21024
|
const maxInterval=getColReMaxWidth(cellParams);// 列之间的最大间距
|
|
20994
21025
|
const dragMinLeft=isRightFixed?0:cellRect.x-tableRect.x+dragBtnWidth+minInterval;const dragMaxLeft=cellRect.x-tableRect.x+cell.clientWidth-minInterval;let fixedLeftRemainWidth=0;let fixedRightRemainWidth=0;if(isLeftFixed||isRightFixed){let isMach=false;const fixedColumn=isLeftFixed?leftList:rightList;for(let i=0;i<fixedColumn.length;i++){const item=fixedColumn[i];if(isMach){fixedLeftRemainWidth+=item.renderWidth;}else{isMach=item.id===resizeColumn.id;if(!isMach){fixedRightRemainWidth+=item.renderWidth;}}}}// 处理拖动事件
|
|
20995
21026
|
const updateEvent=evnt=>{evnt.stopPropagation();evnt.preventDefault();const tableHeight=tableEl.clientHeight;const offsetX=evnt.clientX-dragClientX;let left=dragPosLeft+offsetX;if(isLeftFixed){if(rightContainerRect){left=Math.min(left,rightContainerRect.x-tableRect.x-fixedLeftRemainWidth-minInterval);}}else if(isRightFixed){if(leftContainerElem){left=Math.max(left,leftContainerElem.clientWidth+fixedRightRemainWidth+minInterval);}left=Math.min(left,dragMaxLeft);}dragLeft=Math.max(left,dragMinLeft);// 最大宽
|
|
20996
|
-
if(maxInterval>1){dragLeft=Math.min(dragLeft,maxInterval+dragMinLeft-minInterval);}const resizeBarLeft=Math.max(1,dragLeft);resizeBarElem.style.left=`${resizeBarLeft}px`;resizeBarElem.style.top=`${scrollbarXToTop?osbHeight:0}px`;resizeBarElem.style.height=`${scrollbarXToTop?tableHeight-osbHeight:tableHeight}px`;if(resizableOpts.showDragTip&&resizeTipElem){resizeTipElem.textContent=table_getI18n('vxe.table.resizeColTip',[Math.floor(resizeColumn.renderWidth+(isRightFixed?dragPosLeft-dragLeft:dragLeft-dragPosLeft))]);const tableWrapperWidth=tableEl.clientWidth;const resizeBarWidth=resizeBarElem.clientWidth;const resizeTipWidth=resizeTipElem.clientWidth;const resizeTipHeight=resizeTipElem.clientHeight;let resizeTipLeft=-resizeTipWidth;if(resizeBarLeft<resizeTipWidth+resizeBarWidth){resizeTipLeft=0;}else if(resizeBarLeft>tableWrapperWidth){resizeTipLeft+=tableWrapperWidth-resizeBarLeft;}resizeTipElem.style.left=`${resizeTipLeft}px`;resizeTipElem.style.top=`${Math.min(tableHeight-resizeTipHeight,Math.max(0,evnt.clientY-tableRect.y-resizeTipHeight/2))}px`;}reactData.isDragResize=true;};reactData.isDragResize=true;addClass(tableEl,'col-drag--resize');resizeBarElem.style.display='block';document.onmousemove=updateEvent;document.onmouseup=function(evnt){document.onmousemove=null;document.onmouseup=null;resizeBarElem.style.display='none';internalData._lastResizeTime=Date.now();setTimeout(()=>{reactData.isDragResize=false;},50);const resizeWidth=resizeColumn.renderWidth+(isRightFixed?dragPosLeft-dragLeft:dragLeft-dragPosLeft);const resizeParams={...params,resizeWidth,resizeColumn};if(resizableOpts.dragMode==='fixed'){visibleColumn.forEach(item=>{if(item.id!==resizeColumn.id){if(!item.resizeWidth){item.resizeWidth=item.renderWidth;}}});}if($xeTable.handleColResizeCellAreaEvent){$xeTable.handleColResizeCellAreaEvent(evnt,resizeParams);}else{resizeColumn.resizeWidth=resizeWidth;handleUpdateColResize(evnt,resizeParams);}removeClass(tableEl,'col-drag--resize');};updateEvent(evnt);if($xeTable.closeMenu){$xeTable.closeMenu();}},handleColResizeDblclickEvent(evnt,params){const resizableOpts=computeResizableOpts.value;const{isDblclickAutoWidth}=resizableOpts;const el=refElem.value;if(isDblclickAutoWidth&&el){evnt.stopPropagation();evnt.preventDefault();const{fullColumnIdData}=internalData;const{column}=params;let resizeColumn=column;if(column.children&&column.children.length){external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(column.children,childColumn=>{resizeColumn=childColumn;});}const colid=resizeColumn.id;const colRest=fullColumnIdData[colid];const dragBtnElem=evnt.target;const cell=dragBtnElem.parentNode;const cellParams=Object.assign(params,{cell,$table:$xeTable});const colMinWidth=getColReMinWidth(cellParams);const colMaxWidth=getColReMaxWidth(cellParams);el.setAttribute('data-calc-col','Y');let resizeWidth=calcColumnAutoWidth(resizeColumn,el);el.removeAttribute('data-calc-col');if(colRest){resizeWidth=Math.max(resizeWidth,colRest.width);}resizeWidth=Math.max(colMinWidth,resizeWidth);if(colMaxWidth>1){resizeWidth=Math.min(colMaxWidth,resizeWidth);}const resizeParams={...params,resizeWidth,resizeColumn};reactData.isDragResize=false;internalData._lastResizeTime=Date.now();if($xeTable.handleColResizeDblclickCellAreaEvent){$xeTable.handleColResizeDblclickCellAreaEvent(evnt,resizeParams);}else{resizeColumn.resizeWidth=resizeWidth;handleUpdateColResize(evnt,resizeParams);}}}
|
|
20997
|
-
|
|
20998
|
-
|
|
21027
|
+
if(maxInterval>1){dragLeft=Math.min(dragLeft,maxInterval+dragMinLeft-minInterval);}const resizeBarLeft=Math.max(1,dragLeft);resizeBarElem.style.left=`${resizeBarLeft}px`;resizeBarElem.style.top=`${scrollbarXToTop?osbHeight:0}px`;resizeBarElem.style.height=`${scrollbarXToTop?tableHeight-osbHeight:tableHeight}px`;if(resizableOpts.showDragTip&&resizeTipElem){resizeTipElem.textContent=table_getI18n('vxe.table.resizeColTip',[Math.floor(resizeColumn.renderWidth+(isRightFixed?dragPosLeft-dragLeft:dragLeft-dragPosLeft))]);const tableWrapperWidth=tableEl.clientWidth;const resizeBarWidth=resizeBarElem.clientWidth;const resizeTipWidth=resizeTipElem.clientWidth;const resizeTipHeight=resizeTipElem.clientHeight;let resizeTipLeft=-resizeTipWidth;if(resizeBarLeft<resizeTipWidth+resizeBarWidth){resizeTipLeft=0;}else if(resizeBarLeft>tableWrapperWidth){resizeTipLeft+=tableWrapperWidth-resizeBarLeft;}resizeTipElem.style.left=`${resizeTipLeft}px`;resizeTipElem.style.top=`${Math.min(tableHeight-resizeTipHeight,Math.max(0,evnt.clientY-tableRect.y-resizeTipHeight/2))}px`;}reactData.isDragResize=true;};reactData.isDragResize=true;addClass(tableEl,'col-drag--resize');resizeBarElem.style.display='block';document.onmousemove=updateEvent;document.onmouseup=function(evnt){document.onmousemove=null;document.onmouseup=null;resizeBarElem.style.display='none';internalData._lastResizeTime=Date.now();setTimeout(()=>{reactData.isDragResize=false;},50);const resizeWidth=resizeColumn.renderWidth+(isRightFixed?dragPosLeft-dragLeft:dragLeft-dragPosLeft);const resizeParams={...params,resizeWidth,resizeColumn};if(resizableOpts.dragMode==='fixed'){visibleColumn.forEach(item=>{if(item.id!==resizeColumn.id){if(!item.resizeWidth){item.resizeWidth=item.renderWidth;}}});}if($xeTable.handleColResizeCellAreaEvent){$xeTable.handleColResizeCellAreaEvent(evnt,resizeParams);}else{resizeColumn.resizeWidth=resizeWidth;handleUpdateColResize(evnt,resizeParams);}removeClass(tableEl,'col-drag--resize');};updateEvent(evnt);if($xeTable.closeMenu){$xeTable.closeMenu();}},handleColResizeDblclickEvent(evnt,params){const resizableOpts=computeResizableOpts.value;const{isDblclickAutoWidth}=resizableOpts;const el=refElem.value;if(isDblclickAutoWidth&&el){evnt.stopPropagation();evnt.preventDefault();const{fullColumnIdData}=internalData;const{column}=params;let resizeColumn=column;if(column.children&&column.children.length){external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(column.children,childColumn=>{resizeColumn=childColumn;});}const colid=resizeColumn.id;const colRest=fullColumnIdData[colid];const dragBtnElem=evnt.target;const cell=dragBtnElem.parentNode;const cellParams=Object.assign(params,{cell,$table:$xeTable});const colMinWidth=getColReMinWidth(cellParams);const colMaxWidth=getColReMaxWidth(cellParams);el.setAttribute('data-calc-col','Y');let resizeWidth=calcColumnAutoWidth(resizeColumn,el);el.removeAttribute('data-calc-col');if(colRest){resizeWidth=Math.max(resizeWidth,colRest.width);}resizeWidth=Math.max(colMinWidth,resizeWidth);if(colMaxWidth>1){resizeWidth=Math.min(colMaxWidth,resizeWidth);}const resizeParams={...params,resizeWidth,resizeColumn};reactData.isDragResize=false;internalData._lastResizeTime=Date.now();if($xeTable.handleColResizeDblclickCellAreaEvent){$xeTable.handleColResizeDblclickCellAreaEvent(evnt,resizeParams);}else{resizeColumn.resizeWidth=resizeWidth;handleUpdateColResize(evnt,resizeParams);}}},/**
|
|
21028
|
+
* @private
|
|
21029
|
+
*/handleRowResizeMousedownEvent(evnt,params){evnt.stopPropagation();evnt.preventDefault();const{row}=params;const{showOverflow}=props;const{overflowX,scrollbarWidth,overflowY,scrollbarHeight}=reactData;const{elemStore,fullAllDataRowIdData}=internalData;const osbWidth=overflowY?scrollbarWidth:0;const osbHeight=overflowX?scrollbarHeight:0;const scrollbarYToLeft=computeScrollbarYToLeft.value;const resizableOpts=computeResizableOpts.value;const rowOpts=computeRowOpts.value;const cellOpts=computeCellOpts.value;let tableEl=refElem.value;if($xeGantt){const{refGanttContainerElem}=$xeGantt.getRefMaps();const ganttContainerElem=refGanttContainerElem.value;if(ganttContainerElem){tableEl=ganttContainerElem;}}const resizeBarElem=refRowResizeBar.value;if(!resizeBarElem){return;}const{clientY:dragClientY}=evnt;const resizeTipElem=resizeBarElem.firstElementChild;const dragBtnElem=evnt.currentTarget;const tdEl=dragBtnElem.parentNode;const trEl=tdEl.parentNode;const bodyScrollElem=getRefElem(elemStore['main-body-scroll']);if(!bodyScrollElem){return;}const rowid=getRowid($xeTable,row);const rowRest=fullAllDataRowIdData[rowid];if(!rowRest){return;}const defaultRowHeight=computeDefaultRowHeight.value;let currCellHeight=rowRest.resizeHeight||cellOpts.height||rowOpts.height||rowRest.height||defaultRowHeight;if(!showOverflow){currCellHeight=tdEl.clientHeight;}const tableRect=tableEl.getBoundingClientRect();const trRect=trEl.getBoundingClientRect();const targetOffsetY=dragClientY-trRect.y-trEl.clientHeight;let resizeHeight=currCellHeight;const cellEl=tdEl.querySelector('.vxe-cell');let cellMinHeight=0;if(cellEl){const cellStyle=getComputedStyle(cellEl);cellMinHeight=Math.max(1,Math.ceil(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellStyle.paddingTop)+external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellStyle.paddingBottom)));}const minTop=trRect.y-tableRect.y+cellMinHeight;// 处理拖动事件
|
|
21030
|
+
const updateEvent=evnt=>{evnt.stopPropagation();evnt.preventDefault();const rtWidth=tableEl.clientWidth-osbWidth;const tableHeight=tableEl.clientHeight-osbHeight;let dragTop=evnt.clientY-tableRect.y-targetOffsetY;if(dragTop<minTop){dragTop=minTop;}else{resizeHeight=Math.max(cellMinHeight,currCellHeight+evnt.clientY-dragClientY);}resizeBarElem.style.left=`${scrollbarYToLeft?osbWidth:0}px`;resizeBarElem.style.top=`${dragTop}px`;resizeBarElem.style.width=`${rtWidth}px`;if(resizableOpts.showDragTip&&resizeTipElem){resizeTipElem.textContent=table_getI18n('vxe.table.resizeRowTip',[resizeHeight]);const resizeTipWidth=resizeTipElem.clientWidth;const resizeTipHeight=resizeTipElem.clientHeight;let resizeBarLeft=Math.max(2,evnt.clientX-tableRect.x);let resizeBarTop=0;if(resizeBarLeft+resizeTipWidth>=rtWidth-2){resizeBarLeft=rtWidth-resizeTipWidth-2;}if(dragTop+resizeTipHeight>=tableHeight){resizeBarTop=tableHeight-(dragTop+resizeTipHeight);}resizeTipElem.style.left=`${resizeBarLeft}px`;resizeTipElem.style.top=`${resizeBarTop}px`;}reactData.isDragResize=true;};reactData.isDragResize=true;addClass(tableEl,'row-drag--resize');resizeBarElem.style.display='block';document.onmousemove=updateEvent;document.onmouseup=function(evnt){document.onmousemove=null;document.onmouseup=null;resizeBarElem.style.display='none';internalData._lastResizeTime=Date.now();setTimeout(()=>{reactData.isDragResize=false;},50);if(resizeHeight!==currCellHeight){const resizeParams={...params,resizeHeight,resizeRow:row};internalData.isResizeCellHeight=true;if($xeTable.handleRowResizeCellAreaEvent){$xeTable.handleRowResizeCellAreaEvent(evnt,resizeParams);}else{rowRest.resizeHeight=resizeHeight;handleUpdateRowResize(evnt,resizeParams);updateRowOffsetTop();}}removeClass(tableEl,'row-drag--resize');};updateEvent(evnt);},/**
|
|
21031
|
+
* @private
|
|
21032
|
+
*/handleRowResizeDblclickEvent(evnt,params){const resizableOpts=computeResizableOpts.value;const{isDblclickAutoHeight}=resizableOpts;const el=refElem.value;if(isDblclickAutoHeight&&el){evnt.stopPropagation();evnt.preventDefault();const{editStore}=reactData;const{fullAllDataRowIdData}=internalData;const{actived}=editStore;const{row}=params;const rowid=getRowid($xeTable,row);const rowRest=fullAllDataRowIdData[rowid];if(!rowRest){return;}const handleRsHeight=()=>{el.setAttribute('data-calc-row','Y');const resizeHeight=calcCellAutoHeight(rowid,rowRest,el);el.removeAttribute('data-calc-row');const resizeParams={...params,resizeHeight,resizeRow:row};reactData.isDragResize=false;internalData._lastResizeTime=Date.now();if($xeTable.handleRowResizeDblclickCellAreaEvent){$xeTable.handleRowResizeDblclickCellAreaEvent(evnt,resizeParams);}else{rowRest.resizeHeight=resizeHeight;handleUpdateRowResize(evnt,resizeParams);}};if(actived.row||actived.column){$xeTable.clearEdit().then(handleRsHeight);}else{handleRsHeight();}}},/**
|
|
21033
|
+
* @private
|
|
21034
|
+
*/saveCustomStore(type){const{customConfig}=props;const tableId=computeTableId.value;const customOpts=computeCustomOpts.value;const{updateStore,storage,storeOptions}=customOpts;const isAllCustom=storage===true;const storageOpts=Object.assign({},isAllCustom?{}:storage||{},storeOptions);const isCustomResizable=hangleStorageDefaultValue(storageOpts.resizable,isAllCustom);const isCustomVisible=hangleStorageDefaultValue(storageOpts.visible,isAllCustom);const isCustomFixed=hangleStorageDefaultValue(storageOpts.fixed,isAllCustom);const isCustomSort=hangleStorageDefaultValue(storageOpts.sort,isAllCustom);const isCustomAggGroup=hangleStorageDefaultValue(storageOpts.aggGroup,isAllCustom);const isCustomAggFunc=hangleStorageDefaultValue(storageOpts.aggFunc,isAllCustom);if(type!=='reset'){// fix:修复拖动列宽,重置按钮无法点击的问题
|
|
21035
|
+
reactData.isCustomStatus=true;}if(storage&&(customConfig?isEnableConf(customOpts):customOpts.enabled)&&(isCustomResizable||isCustomVisible||isCustomFixed||isCustomSort||isCustomAggGroup||isCustomAggFunc)){if(!tableId){errLog('vxe.error.reqProp',['id']);return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();}const storeData=type==='reset'?{resizableData:{},sortData:[],visibleData:{},fixedData:{},aggGroupData:{},aggFuncData:{}}:$xeTable.getCustomStoreData();if(updateStore){return updateStore({$table:$xeTable,id:tableId,type,storeData});}else{setCustomStorageMap(tableId,type==='reset'?null:storeData);}}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();},/**
|
|
21036
|
+
* @private
|
|
21037
|
+
*/handleCustom(){const{mouseConfig}=props;if(mouseConfig){if($xeTable.clearSelected){$xeTable.clearSelected();}if($xeTable.clearCellAreas){$xeTable.clearCellAreas();$xeTable.clearCopyCellArea();}}$xeTable.analyColumnWidth();return $xeTable.refreshColumn(true);},handleUpdateDataQueue(){reactData.upDataFlag++;},handleRefreshColumnQueue(){reactData.reColumnFlag++;},handleFilterOptions(column){if(column){const{filterStore}=reactData;const{filterRender,filters}=column;const filterOptions=filters||[];const compConf=isEnableConf(filterRender)?table_renderer.get(filterRender.name):null;const frMethod=column.filterRecoverMethod||(compConf?compConf.tableFilterRecoverMethod||compConf.filterRecoverMethod:null);filterStore.column=column;// 复原状态
|
|
20999
21038
|
filterOptions.forEach(option=>{const{_checked,checked}=option;option._checked=checked;if(!checked&&_checked!==checked){if(frMethod){frMethod({option,column,$table:$xeTable});}}});$xeTable.checkFilterOptions();}},preventEvent(evnt,type,args,next,end){let evntList=table_interceptor.get(type);// 兼容老版本
|
|
21000
21039
|
if(!evntList.length&&type==='event.clearEdit'){evntList=table_interceptor.get('event.clearActived');if(evntList.length){warnLog('vxe.error.delEvent',['event.clearActived','event.clearEdit']);}}// 兼容老版本
|
|
21001
21040
|
let rest=null;let isStop=false;for(let i=0;i<evntList.length;i++){const func=evntList[i];const fnRest=func(Object.assign({$table:$xeTable,$grid:$xeGrid,gantt:$xeGantt,$event:evnt},args));if(fnRest===false){isStop=true;break;}else if(fnRest&&fnRest.status===false){rest=fnRest.result;isStop=true;break;}}if(!isStop){if(next){rest=next();}}if(end){end();}return rest;},updateCheckboxStatus(){const{treeConfig}=props;const{isRowGroupStatus}=reactData;const{afterTreeFullData,afterGroupFullData,selectCheckboxMaps,treeIndeterminateRowMaps}=internalData;const aggregateOpts=computeAggregateOpts.value;const treeOpts=computeTreeOpts.value;const childrenField=treeOpts.children||treeOpts.childrenField;const checkboxOpts=computeCheckboxOpts.value;const{checkField,indeterminateField,checkStrictly,checkMethod}=checkboxOpts;if(checkStrictly){return;}if(isRowGroupStatus||treeConfig){const{handleGetRowId}=createHandleGetRowId($xeTable);const childRowMaps={};const childRowList=[];if(isRowGroupStatus){// 行分组
|
|
@@ -22040,7 +22079,7 @@ const {
|
|
|
22040
22079
|
renderEmptyElement: grid_renderEmptyElement
|
|
22041
22080
|
} = core_.VxeUI;
|
|
22042
22081
|
const tableComponentPropKeys = Object.keys(tableProps);
|
|
22043
|
-
const tableComponentMethodKeys = ['clearAll', 'syncData', 'updateData', 'loadData', 'reloadData', 'reloadRow', 'loadColumn', 'reloadColumn', 'getRowNode', 'getColumnNode', 'getRowIndex', 'getVTRowIndex', 'getVMRowIndex', 'getColumnIndex', 'getVTColumnIndex', 'getVMColumnIndex', 'setRow', 'createData', 'createRow', 'revertData', 'clearData', 'isRemoveByRow', 'isInsertByRow', 'isUpdateByRow', 'getColumns', 'getColumnById', 'getColumnByField', 'getTableColumn', 'getFullColumns', 'getData', 'getCheckboxRecords', 'getParentRow', 'getTreeRowChildren', 'getTreeRowLevel', 'getTreeParentRow', 'getRowSeq', 'getRowById', 'getRowid', 'getTableData', 'getFullData', 'setColumnFixed', 'clearColumnFixed', 'setColumnWidth', 'getColumnWidth', 'recalcRowHeight', 'setRowHeightConf', 'getRowHeightConf', 'setRowHeight', 'getRowHeight', 'hideColumn', 'showColumn', 'resetColumn', 'refreshColumn', 'refreshScroll', 'recalculate', 'closeTooltip', 'isAllCheckboxChecked', 'isAllCheckboxIndeterminate', 'getCheckboxIndeterminateRecords', 'setCheckboxRow', 'setCheckboxRowKey', 'isCheckedByCheckboxRow', 'isCheckedByCheckboxRowKey', 'isIndeterminateByCheckboxRow', 'isIndeterminateByCheckboxRowKey', 'toggleCheckboxRow', 'setAllCheckboxRow', 'getRadioReserveRecord', 'clearRadioReserve', 'getCheckboxReserveRecords', 'clearCheckboxReserve', 'toggleAllCheckboxRow', 'clearCheckboxRow', 'setCurrentRow', 'isCheckedByRadioRow', 'isCheckedByRadioRowKey', 'setRadioRow', 'setRadioRowKey', 'clearCurrentRow', 'clearRadioRow', 'getCurrentRecord', 'getRadioRecord', 'getCurrentColumn', 'setCurrentColumn', 'clearCurrentColumn', 'setPendingRow', 'togglePendingRow', 'hasPendingByRow', 'isPendingByRow', 'getPendingRecords', 'clearPendingRow', 'setFilterByEvent', 'sort', 'setSort', 'setSortByEvent', 'clearSort', 'clearSortByEvent', 'isSort', 'getSortColumns', 'closeFilter', 'isFilter', 'clearFilterByEvent', 'isActiveFilterByColumn', 'isRowExpandLoaded', 'clearRowExpandLoaded', 'reloadRowExpand', 'reloadRowExpand', 'toggleRowExpand', 'setAllRowExpand', 'setRowExpand', 'isExpandByRow', 'isRowExpandByRow', 'clearRowExpand', 'clearRowExpandReserve', 'getRowExpandRecords', 'getTreeExpandRecords', 'isTreeExpandLoaded', 'clearTreeExpandLoaded', 'reloadTreeExpand', 'reloadTreeChilds', 'toggleTreeExpand', 'setAllTreeExpand', 'setTreeExpand', 'isTreeExpandByRow', 'clearTreeExpand', 'clearTreeExpandReserve', 'getScroll', 'getScrollData', 'scrollTo', 'scrollToStartRow', 'scrollToEndRow', 'scrollToRow', 'scrollToStartColumn', 'scrollToEndColumn', 'scrollToColumn', 'clearScroll', 'updateFooter', 'updateStatus', 'setMergeCells', 'removeInsertRow', 'removeMergeCells', 'getMergeCells', 'setMergeHeaderCells', 'removeMergeHeaderCells', 'getMergeHeaderCells', 'clearMergeHeaderCells', 'clearMergeCells', 'setMergeFooterItems', 'removeMergeFooterItems', 'getMergeFooterItems', 'clearMergeFooterItems', 'getCustomStoreData', 'setRowGroupExpand', 'setRowGroupExpandByField', 'setAllRowGroupExpand', 'clearRowGroupExpand', 'isRowGroupExpandByRow', 'isRowGroupRecord', 'isAggregateRecord', 'isAggregateExpandByRow', 'getAggregateContentByRow', 'getAggregateRowChildren', 'setRowGroups', 'clearRowGroups', 'openTooltip', 'moveColumnTo', 'moveRowTo', 'getCellLabel', 'updateCellLabel', 'clearFormatterCache', 'getFooterCellLabel', 'updateFooterCellLabel', 'clearFooterFormatterCache', 'undo', 'redo', 'getCellElement', 'focus', 'blur', 'connect', 'connectToolbar'];
|
|
22082
|
+
const tableComponentMethodKeys = ['clearAll', 'syncData', 'updateData', 'loadData', 'reloadData', 'reloadRow', 'loadColumn', 'reloadColumn', 'getRowNode', 'getColumnNode', 'getRowIndex', 'getVTRowIndex', 'getVMRowIndex', 'getColumnIndex', 'getVTColumnIndex', 'getVMColumnIndex', 'setRow', 'createData', 'createRow', 'revertData', 'clearData', 'isRemoveByRow', 'isInsertByRow', 'isUpdateByRow', 'getColumns', 'getColumnById', 'getColumnByField', 'getTableColumn', 'getFullColumns', 'getData', 'getCheckboxRecords', 'getParentRow', 'getTreeRowChildren', 'getTreeRowLevel', 'getTreeParentRow', 'getRowSeq', 'getRowById', 'getRowid', 'getTableData', 'getFullData', 'setColumnFixed', 'clearColumnFixed', 'setColumnWidth', 'getColumnWidth', 'recalcRowHeight', 'setRowHeightConf', 'getRowHeightConf', 'setRowHeight', 'getRowHeight', 'hideColumn', 'showColumn', 'resetColumn', 'refreshColumn', 'refreshScroll', 'recalculate', 'closeTooltip', 'isAllCheckboxChecked', 'isAllCheckboxIndeterminate', 'getCheckboxIndeterminateRecords', 'setCheckboxRow', 'setCheckboxRowKey', 'isCheckedByCheckboxRow', 'isCheckedByCheckboxRowKey', 'isIndeterminateByCheckboxRow', 'isIndeterminateByCheckboxRowKey', 'toggleCheckboxRow', 'setAllCheckboxRow', 'getRadioReserveRecord', 'clearRadioReserve', 'getCheckboxReserveRecords', 'clearCheckboxReserve', 'toggleAllCheckboxRow', 'clearCheckboxRow', 'setCurrentRow', 'isCheckedByRadioRow', 'isCheckedByRadioRowKey', 'setRadioRow', 'setRadioRowKey', 'clearCurrentRow', 'clearRadioRow', 'getCurrentRecord', 'getRadioRecord', 'getCurrentColumn', 'setCurrentColumn', 'clearCurrentColumn', 'setPendingRow', 'togglePendingRow', 'hasPendingByRow', 'isPendingByRow', 'getPendingRecords', 'clearPendingRow', 'setFilterByEvent', 'sort', 'setSort', 'setSortByEvent', 'clearSort', 'clearSortByEvent', 'isSort', 'getSortColumns', 'closeFilter', 'isFilter', 'clearFilterByEvent', 'isActiveFilterByColumn', 'isRowExpandLoaded', 'clearRowExpandLoaded', 'reloadRowExpand', 'reloadRowExpand', 'toggleRowExpand', 'setAllRowExpand', 'setRowExpand', 'isExpandByRow', 'isRowExpandByRow', 'clearRowExpand', 'clearRowExpandReserve', 'getRowExpandRecords', 'getTreeExpandRecords', 'isTreeExpandLoaded', 'clearTreeExpandLoaded', 'reloadTreeExpand', 'reloadTreeChilds', 'toggleTreeExpand', 'setAllTreeExpand', 'setTreeExpand', 'isTreeExpandByRow', 'clearTreeExpand', 'clearTreeExpandReserve', 'getScroll', 'getScrollData', 'scrollTo', 'scrollToStartRow', 'scrollToEndRow', 'scrollToRow', 'scrollToStartColumn', 'scrollToEndColumn', 'scrollToColumn', 'clearScroll', 'updateFooter', 'updateStatus', 'setMergeCells', 'removeInsertRow', 'removeMergeCells', 'getMergeCells', 'setMergeHeaderCells', 'removeMergeHeaderCells', 'getMergeHeaderCells', 'clearMergeHeaderCells', 'clearMergeCells', 'setMergeFooterItems', 'removeMergeFooterItems', 'getMergeFooterItems', 'clearMergeFooterItems', 'setCustomStoreData', 'getCustomStoreData', 'setRowGroupExpand', 'setRowGroupExpandByField', 'setAllRowGroupExpand', 'clearRowGroupExpand', 'isRowGroupExpandByRow', 'isRowGroupRecord', 'isAggregateRecord', 'isAggregateExpandByRow', 'getAggregateContentByRow', 'getAggregateRowChildren', 'setRowGroups', 'clearRowGroups', 'openTooltip', 'moveColumnTo', 'moveRowTo', 'getCellLabel', 'updateCellLabel', 'clearFormatterCache', 'getFooterCellLabel', 'updateFooterCellLabel', 'clearFooterFormatterCache', 'undo', 'redo', 'getCellElement', 'focus', 'blur', 'connect', 'connectToolbar'];
|
|
22044
22083
|
function grid_createReactData() {
|
|
22045
22084
|
return {
|
|
22046
22085
|
tableLoading: false,
|