vxe-table 3.21.7 → 3.21.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/style.css +1 -1
- package/es/table/render/index.js +166 -24
- package/es/table/src/methods.js +205 -56
- package/es/table/src/util.js +19 -1
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/index.umd.js +324 -40
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/render/index.js +272 -25
- package/lib/table/render/index.min.js +1 -1
- package/lib/table/src/methods.js +31 -12
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/util.js +20 -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/table/render/index.ts +166 -24
- package/packages/table/src/methods.ts +214 -58
- package/packages/table/src/util.ts +23 -1
- /package/es/{iconfont.1780638727189.ttf → iconfont.1780878069088.ttf} +0 -0
- /package/es/{iconfont.1780638727189.woff → iconfont.1780878069088.woff} +0 -0
- /package/es/{iconfont.1780638727189.woff2 → iconfont.1780878069088.woff2} +0 -0
- /package/lib/{iconfont.1780638727189.ttf → iconfont.1780878069088.ttf} +0 -0
- /package/lib/{iconfont.1780638727189.woff → iconfont.1780878069088.woff} +0 -0
- /package/lib/{iconfont.1780638727189.woff2 → iconfont.1780878069088.woff2} +0 -0
package/lib/index.umd.js
CHANGED
|
@@ -3311,7 +3311,7 @@ function getClass(property, params) {
|
|
|
3311
3311
|
/* unused harmony import specifier */ var VxeUI;
|
|
3312
3312
|
|
|
3313
3313
|
|
|
3314
|
-
const version = "3.21.
|
|
3314
|
+
const version = "3.21.9";
|
|
3315
3315
|
core_.VxeUI.version = version;
|
|
3316
3316
|
core_.VxeUI.tableVersion = version;
|
|
3317
3317
|
core_.VxeUI.setConfig({
|
|
@@ -3842,7 +3842,7 @@ var es_iterator_some = __webpack_require__(3579);
|
|
|
3842
3842
|
const {
|
|
3843
3843
|
log: log_log
|
|
3844
3844
|
} = core_.VxeUI;
|
|
3845
|
-
const log_version = `table v${"3.21.
|
|
3845
|
+
const log_version = `table v${"3.21.9"}`;
|
|
3846
3846
|
const warnLog = log_log.create('warn', log_version);
|
|
3847
3847
|
const errLog = log_log.create('error', log_version);
|
|
3848
3848
|
;// ./packages/table/src/columnInfo.ts
|
|
@@ -4395,6 +4395,8 @@ function createInternalData() {
|
|
|
4395
4395
|
sourceDataRowIdData: {},
|
|
4396
4396
|
fullColumnIdData: {},
|
|
4397
4397
|
fullColumnFieldData: {},
|
|
4398
|
+
fullCellHeightMaps: {},
|
|
4399
|
+
fullCellStoreMaps: {},
|
|
4398
4400
|
// 当前行
|
|
4399
4401
|
currentRow: null,
|
|
4400
4402
|
// 合并表头单元格的数据
|
|
@@ -4454,7 +4456,8 @@ function createInternalData() {
|
|
|
4454
4456
|
inited: false,
|
|
4455
4457
|
tooltipTimeout: null,
|
|
4456
4458
|
initStatus: false,
|
|
4457
|
-
isActivated: false
|
|
4459
|
+
isActivated: false,
|
|
4460
|
+
rceDelay: 0
|
|
4458
4461
|
// _sToTime: null
|
|
4459
4462
|
};
|
|
4460
4463
|
}
|
|
@@ -4702,6 +4705,21 @@ function createReactData() {
|
|
|
4702
4705
|
isColLoading: false
|
|
4703
4706
|
};
|
|
4704
4707
|
}
|
|
4708
|
+
const maxKey = '__max';
|
|
4709
|
+
function getRowMaxHeight(chRest, isForce) {
|
|
4710
|
+
if (isForce || !chRest[maxKey]) {
|
|
4711
|
+
let max = 0;
|
|
4712
|
+
for (const key in chRest) {
|
|
4713
|
+
const val = chRest[key];
|
|
4714
|
+
if (key !== maxKey && external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(val) && val > max) {
|
|
4715
|
+
max = val;
|
|
4716
|
+
}
|
|
4717
|
+
}
|
|
4718
|
+
chRest[maxKey] = max;
|
|
4719
|
+
return max;
|
|
4720
|
+
}
|
|
4721
|
+
return chRest[maxKey];
|
|
4722
|
+
}
|
|
4705
4723
|
const getAllConvertColumns = (columns, parentColumn) => {
|
|
4706
4724
|
const result = [];
|
|
4707
4725
|
columns.forEach(column => {
|
|
@@ -7816,9 +7834,9 @@ remainList.forEach(column=>{const width=Math.max(meanWidth,minCellWidth);column.
|
|
|
7816
7834
|
* 排除已设置 max-width
|
|
7817
7835
|
*/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($xeTable);updateHeight($xeTable);}/**
|
|
7818
7836
|
* 计算自适应行高
|
|
7819
|
-
*/const calcCellAutoHeight=($xeTable,rowRest,wrapperEl)=>{const
|
|
7837
|
+
*/const calcCellAutoHeight=($xeTable,rowid,rowRest,wrapperEl)=>{const internalData=$xeTable;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;};/**
|
|
7820
7838
|
* 自适应行高
|
|
7821
|
-
*/const calcCellHeight=$xeTable=>{const props=$xeTable;const reactData=$xeTable;const internalData=$xeTable;const{treeConfig}=props;const{tableData,isAllOverflow,scrollYLoad,scrollXLoad}=reactData;const{fullAllDataRowIdData}=internalData;const el=$xeTable.$refs.refElem;if(!el||!el.clientWidth){return;}const treeOpts=$xeTable.computeTreeOpts;const defaultRowHeight=$xeTable.computeDefaultRowHeight;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 height=calcCellAutoHeight($xeTable,rowRest,el);rowRest.height=Math.max(defaultRowHeight,height);}el.removeAttribute('data-calc-row');});reactData.calcCellHeightFlag++;}};function getOrderField($xeTable,column){const reactData=$xeTable;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;};}function handleTargetEnterEvent($xeTable,isClear){const internalData=$xeTable;const $tooltip=$xeTable.$refs.refTooltip;clearTimeout(internalData.tooltipTimeout);if(isClear){$xeTable.closeTooltip();}else{if($tooltip&&$tooltip.setActived){$tooltip.setActived(true);}}}function clearCrossTableDragStatus($xeTable){const crossTableDragRowInfo=getCrossTableDragRowInfo($xeTable);crossTableDragRowObj=null;crossTableDragRowInfo.row=null;}function clearDragStatus($xeTable){const reactData=$xeTable;const{dragRow,dragCol}=reactData;if(dragRow||dragCol){clearColDropOrigin($xeTable);clearRowDropOrigin($xeTable);hideDropTip($xeTable);clearCrossTableDragStatus($xeTable);reactData.dragRow=null;reactData.dragCol=null;}}function handleRowDragEndClearStatus($xeTable){clearRowDragData($xeTable);clearCrossTableDragStatus($xeTable);handleRecalculateStyle($xeTable,false,true,true);}function handleColDragEndClearStatus($xeTable){clearColDragData($xeTable);clearCrossTableDragStatus($xeTable);handleRecalculateStyle($xeTable,true,true,true);}function clearRowDropOrigin($xeTable){const el=$xeTable.$el;if(el){const clss='row--drag-origin';external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(el.querySelectorAll(`.${clss}`),elem=>{elem.draggable=false;removeClass(elem,clss);});}}function updateRowDropOrigin($xeTable,row){const el=$xeTable.$el;if(el){const clss='row--drag-origin';const rowid=getRowid($xeTable,row);external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(el.querySelectorAll(`[rowid="${rowid}"]`),elem=>{addClass(elem,clss);});}}function updateRowDropTipContent($xeTable,tdEl){const reactData=$xeTable;const props=$xeTable;const{dragConfig}=props;const{dragRow}=reactData;const rowDragOpts=$xeTable.computeRowDragOpts;const{tooltipMethod}=rowDragOpts;const rTooltipMethod=tooltipMethod||(dragConfig?dragConfig.rowTooltipMethod:null);let tipContent='';if(rTooltipMethod){const rtParams={$table:$xeTable,row:dragRow};tipContent=`${rTooltipMethod(rtParams)||''}`;}else{tipContent=methods_getI18n('vxe.table.dragTip',[tdEl.textContent||'']);}reactData.dragTipText=tipContent;}function updateColDropOrigin($xeTable,column){const el=$xeTable.$el;if(el){const colQuerys=[];external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree([column],item=>{colQuerys.push(`[colid="${item.id}"]`);});const clss='col--drag-origin';external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(el.querySelectorAll(colQuerys.join(',')),elem=>{addClass(elem,clss);});}}function clearColDropOrigin($xeTable){const el=$xeTable.$el;if(el){const clss='col--drag-origin';external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(el.querySelectorAll(`.${clss}`),elem=>{elem.draggable=false;removeClass(elem,clss);});}}function updateColDropTipContent($xeTable,tdEl){const reactData=$xeTable;const{dragCol}=reactData;const columnDragOpts=$xeTable.computeColumnDragOpts;const{tooltipMethod}=columnDragOpts;let tipContent='';if(tooltipMethod){const dtParams={$table:$xeTable,column:dragCol};tipContent=`${tooltipMethod(dtParams)||''}`;}else{tipContent=methods_getI18n('vxe.table.dragTip',[tdEl.textContent||'']);}reactData.dragTipText=tipContent;}function showDropTip($xeTable,evnt,trEl,thEl,showLine,dragPos){const $xeGantt=$xeTable.$xeGantt;const reactData=$xeTable;const internalData=$xeTable;let wrapperEl=$xeTable.$refs.refElem;if($xeGantt&&trEl){const ganttContainerElem=$xeGantt.$refs.refGanttContainerElem;if(ganttContainerElem){wrapperEl=ganttContainerElem;}}if(!wrapperEl){return;}const{overflowX,scrollbarWidth,overflowY,scrollbarHeight}=reactData;const{prevDragToChild}=internalData;const wrapperRect=wrapperEl.getBoundingClientRect();const osbWidth=overflowY?scrollbarWidth:0;const osbHeight=overflowX?scrollbarHeight:0;const tableWrapperWidth=wrapperEl.clientWidth;const tableWrapperHeight=wrapperEl.clientHeight;if(trEl){const rdLineEl=$xeTable.$refs.refDragRowLineElem;if(rdLineEl){if(showLine){const scrollbarYToLeft=$xeTable.computeScrollbarYToLeft;const trRect=trEl.getBoundingClientRect();let trHeight=trEl.clientHeight;const offsetTop=Math.max(1,trRect.y-wrapperRect.y);if(offsetTop+trHeight>tableWrapperHeight-osbHeight){trHeight=tableWrapperHeight-offsetTop-osbHeight;}rdLineEl.style.display='block';rdLineEl.style.left=`${scrollbarYToLeft?osbWidth:0}px`;rdLineEl.style.top=`${offsetTop}px`;rdLineEl.style.height=`${trHeight}px`;rdLineEl.style.width=`${tableWrapperWidth-osbWidth}px`;rdLineEl.setAttribute('drag-pos',dragPos);rdLineEl.setAttribute('drag-to-child',prevDragToChild?'y':'n');}else{rdLineEl.style.display='';}}}else if(thEl){const cdLineEl=$xeTable.$refs.refDragColLineElem;if(cdLineEl){if(showLine){const scrollbarXToTop=$xeTable.computeScrollbarXToTop;const leftContainerElem=$xeTable.$refs.refLeftContainer;const leftContainerWidth=leftContainerElem?leftContainerElem.clientWidth:0;const rightContainerElem=$xeTable.$refs.refRightContainer;const rightContainerWidth=rightContainerElem?rightContainerElem.clientWidth:0;const thRect=thEl.getBoundingClientRect();let thWidth=thEl.clientWidth;const offsetTop=Math.max(0,thRect.y-wrapperRect.y);const startX=leftContainerWidth;let offsetLeft=thRect.x-wrapperRect.x;if(offsetLeft<startX){thWidth-=startX-offsetLeft;offsetLeft=startX;}const endX=tableWrapperWidth-rightContainerWidth-(rightContainerWidth?0:osbWidth);if(offsetLeft+thWidth>endX){thWidth=endX-offsetLeft;}cdLineEl.style.display='block';cdLineEl.style.top=`${offsetTop}px`;cdLineEl.style.left=`${offsetLeft}px`;cdLineEl.style.width=`${thWidth}px`;if(prevDragToChild){cdLineEl.style.height=`${thRect.height}px`;}else{cdLineEl.style.height=`${tableWrapperHeight-offsetTop-(scrollbarXToTop?0:osbHeight)}px`;}cdLineEl.setAttribute('drag-pos',dragPos);cdLineEl.setAttribute('drag-to-child',prevDragToChild?'y':'n');}else{cdLineEl.style.display='';}}}const rdTipEl=$xeTable.$refs.refDragTipElem;if(rdTipEl){rdTipEl.style.display='block';rdTipEl.style.top=`${Math.min(wrapperEl.clientHeight-wrapperEl.scrollTop-rdTipEl.clientHeight,evnt.clientY-wrapperRect.y)}px`;rdTipEl.style.left=`${Math.min(wrapperEl.clientWidth-wrapperEl.scrollLeft-rdTipEl.clientWidth-16,evnt.clientX-wrapperRect.x)}px`;rdTipEl.setAttribute('drag-status',showLine?prevDragToChild?'sub':'normal':'disabled');}}function hideDropTip($xeTable){const rdTipEl=$xeTable.$refs.refDragTipElem;const rdLineEl=$xeTable.$refs.refDragRowLineElem;const cdLineEl=$xeTable.$refs.refDragColLineElem;if(rdTipEl){rdTipEl.style.display='';}if(rdLineEl){rdLineEl.style.display='';}if(cdLineEl){cdLineEl.style.display='';}}function clearRowDragData($xeTable){const $xeGantt=$xeTable.$xeGantt;const reactData=$xeTable;const internalData=$xeTable;let wrapperEl=$xeTable.$refs.refElem;const dtClss=['.vxe-body--row'];if($xeGantt){const ganttContainerElem=$xeGantt.$refs.refGanttContainerElem;if(ganttContainerElem){wrapperEl=ganttContainerElem;}dtClss.push('.vxe-gantt-view--body-row','.vxe-gantt-view--chart-row');}hideDropTip($xeTable);clearRowDropOrigin($xeTable);clearRowAnimate(wrapperEl,dtClss);internalData.prevDragToChild=false;reactData.dragRow=null;reactData.dragCol=null;}function clearColDragData($xeTable){const reactData=$xeTable;const internalData=$xeTable;const el=$xeTable.$refs.refElem;hideDropTip($xeTable);clearColDropOrigin($xeTable);clearColAnimate(el,['.vxe-table--column']);internalData.prevDragToChild=false;reactData.dragRow=null;reactData.dragCol=null;}/**
|
|
7839
|
+
*/const calcCellHeight=$xeTable=>{const props=$xeTable;const reactData=$xeTable;const internalData=$xeTable;const{treeConfig}=props;const{tableData,isAllOverflow,scrollYLoad,scrollXLoad}=reactData;const{fullAllDataRowIdData}=internalData;const el=$xeTable.$refs.refElem;if(!el||!el.clientWidth){return;}const treeOpts=$xeTable.computeTreeOpts;const defaultRowHeight=$xeTable.computeDefaultRowHeight;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 height=calcCellAutoHeight($xeTable,rowid,rowRest,el);rowRest.height=Math.max(defaultRowHeight,height);}el.removeAttribute('data-calc-row');});reactData.calcCellHeightFlag++;}};function getOrderField($xeTable,column){const reactData=$xeTable;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;};}function handleTargetEnterEvent($xeTable,isClear){const internalData=$xeTable;const $tooltip=$xeTable.$refs.refTooltip;clearTimeout(internalData.tooltipTimeout);if(isClear){$xeTable.closeTooltip();}else{if($tooltip&&$tooltip.setActived){$tooltip.setActived(true);}}}function clearCrossTableDragStatus($xeTable){const crossTableDragRowInfo=getCrossTableDragRowInfo($xeTable);crossTableDragRowObj=null;crossTableDragRowInfo.row=null;}function clearDragStatus($xeTable){const reactData=$xeTable;const{dragRow,dragCol}=reactData;if(dragRow||dragCol){clearColDropOrigin($xeTable);clearRowDropOrigin($xeTable);hideDropTip($xeTable);clearCrossTableDragStatus($xeTable);reactData.dragRow=null;reactData.dragCol=null;}}function handleRowDragEndClearStatus($xeTable){clearRowDragData($xeTable);clearCrossTableDragStatus($xeTable);handleRecalculateStyle($xeTable,false,true,true);}function handleColDragEndClearStatus($xeTable){clearColDragData($xeTable);clearCrossTableDragStatus($xeTable);handleRecalculateStyle($xeTable,true,true,true);}function clearRowDropOrigin($xeTable){const el=$xeTable.$el;if(el){const clss='row--drag-origin';external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(el.querySelectorAll(`.${clss}`),elem=>{elem.draggable=false;removeClass(elem,clss);});}}function updateRowDropOrigin($xeTable,row){const el=$xeTable.$el;if(el){const clss='row--drag-origin';const rowid=getRowid($xeTable,row);external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(el.querySelectorAll(`[rowid="${rowid}"]`),elem=>{addClass(elem,clss);});}}function updateRowDropTipContent($xeTable,tdEl){const reactData=$xeTable;const props=$xeTable;const{dragConfig}=props;const{dragRow}=reactData;const rowDragOpts=$xeTable.computeRowDragOpts;const{tooltipMethod}=rowDragOpts;const rTooltipMethod=tooltipMethod||(dragConfig?dragConfig.rowTooltipMethod:null);let tipContent='';if(rTooltipMethod){const rtParams={$table:$xeTable,row:dragRow};tipContent=`${rTooltipMethod(rtParams)||''}`;}else{tipContent=methods_getI18n('vxe.table.dragTip',[tdEl.textContent||'']);}reactData.dragTipText=tipContent;}function updateColDropOrigin($xeTable,column){const el=$xeTable.$el;if(el){const colQuerys=[];external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree([column],item=>{colQuerys.push(`[colid="${item.id}"]`);});const clss='col--drag-origin';external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(el.querySelectorAll(colQuerys.join(',')),elem=>{addClass(elem,clss);});}}function clearColDropOrigin($xeTable){const el=$xeTable.$el;if(el){const clss='col--drag-origin';external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(el.querySelectorAll(`.${clss}`),elem=>{elem.draggable=false;removeClass(elem,clss);});}}function updateColDropTipContent($xeTable,tdEl){const reactData=$xeTable;const{dragCol}=reactData;const columnDragOpts=$xeTable.computeColumnDragOpts;const{tooltipMethod}=columnDragOpts;let tipContent='';if(tooltipMethod){const dtParams={$table:$xeTable,column:dragCol};tipContent=`${tooltipMethod(dtParams)||''}`;}else{tipContent=methods_getI18n('vxe.table.dragTip',[tdEl.textContent||'']);}reactData.dragTipText=tipContent;}function showDropTip($xeTable,evnt,trEl,thEl,showLine,dragPos){const $xeGantt=$xeTable.$xeGantt;const reactData=$xeTable;const internalData=$xeTable;let wrapperEl=$xeTable.$refs.refElem;if($xeGantt&&trEl){const ganttContainerElem=$xeGantt.$refs.refGanttContainerElem;if(ganttContainerElem){wrapperEl=ganttContainerElem;}}if(!wrapperEl){return;}const{overflowX,scrollbarWidth,overflowY,scrollbarHeight}=reactData;const{prevDragToChild}=internalData;const wrapperRect=wrapperEl.getBoundingClientRect();const osbWidth=overflowY?scrollbarWidth:0;const osbHeight=overflowX?scrollbarHeight:0;const tableWrapperWidth=wrapperEl.clientWidth;const tableWrapperHeight=wrapperEl.clientHeight;if(trEl){const rdLineEl=$xeTable.$refs.refDragRowLineElem;if(rdLineEl){if(showLine){const scrollbarYToLeft=$xeTable.computeScrollbarYToLeft;const trRect=trEl.getBoundingClientRect();let trHeight=trEl.clientHeight;const offsetTop=Math.max(1,trRect.y-wrapperRect.y);if(offsetTop+trHeight>tableWrapperHeight-osbHeight){trHeight=tableWrapperHeight-offsetTop-osbHeight;}rdLineEl.style.display='block';rdLineEl.style.left=`${scrollbarYToLeft?osbWidth:0}px`;rdLineEl.style.top=`${offsetTop}px`;rdLineEl.style.height=`${trHeight}px`;rdLineEl.style.width=`${tableWrapperWidth-osbWidth}px`;rdLineEl.setAttribute('drag-pos',dragPos);rdLineEl.setAttribute('drag-to-child',prevDragToChild?'y':'n');}else{rdLineEl.style.display='';}}}else if(thEl){const cdLineEl=$xeTable.$refs.refDragColLineElem;if(cdLineEl){if(showLine){const scrollbarXToTop=$xeTable.computeScrollbarXToTop;const leftContainerElem=$xeTable.$refs.refLeftContainer;const leftContainerWidth=leftContainerElem?leftContainerElem.clientWidth:0;const rightContainerElem=$xeTable.$refs.refRightContainer;const rightContainerWidth=rightContainerElem?rightContainerElem.clientWidth:0;const thRect=thEl.getBoundingClientRect();let thWidth=thEl.clientWidth;const offsetTop=Math.max(0,thRect.y-wrapperRect.y);const startX=leftContainerWidth;let offsetLeft=thRect.x-wrapperRect.x;if(offsetLeft<startX){thWidth-=startX-offsetLeft;offsetLeft=startX;}const endX=tableWrapperWidth-rightContainerWidth-(rightContainerWidth?0:osbWidth);if(offsetLeft+thWidth>endX){thWidth=endX-offsetLeft;}cdLineEl.style.display='block';cdLineEl.style.top=`${offsetTop}px`;cdLineEl.style.left=`${offsetLeft}px`;cdLineEl.style.width=`${thWidth}px`;if(prevDragToChild){cdLineEl.style.height=`${thRect.height}px`;}else{cdLineEl.style.height=`${tableWrapperHeight-offsetTop-(scrollbarXToTop?0:osbHeight)}px`;}cdLineEl.setAttribute('drag-pos',dragPos);cdLineEl.setAttribute('drag-to-child',prevDragToChild?'y':'n');}else{cdLineEl.style.display='';}}}const rdTipEl=$xeTable.$refs.refDragTipElem;if(rdTipEl){rdTipEl.style.display='block';rdTipEl.style.top=`${Math.min(wrapperEl.clientHeight-wrapperEl.scrollTop-rdTipEl.clientHeight,evnt.clientY-wrapperRect.y)}px`;rdTipEl.style.left=`${Math.min(wrapperEl.clientWidth-wrapperEl.scrollLeft-rdTipEl.clientWidth-16,evnt.clientX-wrapperRect.x)}px`;rdTipEl.setAttribute('drag-status',showLine?prevDragToChild?'sub':'normal':'disabled');}}function hideDropTip($xeTable){const rdTipEl=$xeTable.$refs.refDragTipElem;const rdLineEl=$xeTable.$refs.refDragRowLineElem;const cdLineEl=$xeTable.$refs.refDragColLineElem;if(rdTipEl){rdTipEl.style.display='';}if(rdLineEl){rdLineEl.style.display='';}if(cdLineEl){cdLineEl.style.display='';}}function clearRowDragData($xeTable){const $xeGantt=$xeTable.$xeGantt;const reactData=$xeTable;const internalData=$xeTable;let wrapperEl=$xeTable.$refs.refElem;const dtClss=['.vxe-body--row'];if($xeGantt){const ganttContainerElem=$xeGantt.$refs.refGanttContainerElem;if(ganttContainerElem){wrapperEl=ganttContainerElem;}dtClss.push('.vxe-gantt-view--body-row','.vxe-gantt-view--chart-row');}hideDropTip($xeTable);clearRowDropOrigin($xeTable);clearRowAnimate(wrapperEl,dtClss);internalData.prevDragToChild=false;reactData.dragRow=null;reactData.dragCol=null;}function clearColDragData($xeTable){const reactData=$xeTable;const internalData=$xeTable;const el=$xeTable.$refs.refElem;hideDropTip($xeTable);clearColDropOrigin($xeTable);clearColAnimate(el,['.vxe-table--column']);internalData.prevDragToChild=false;reactData.dragRow=null;reactData.dragCol=null;}/**
|
|
7822
7840
|
* 处理显示 tooltip
|
|
7823
7841
|
* @param {Event} evnt 事件
|
|
7824
7842
|
* @param {Row} row 行对象
|
|
@@ -7826,8 +7844,9 @@ remainList.forEach(column=>{const width=Math.max(meanWidth,minCellWidth);column.
|
|
|
7826
7844
|
function computeScrollLoad($xeTable){const reactData=$xeTable;const internalData=$xeTable;return $xeTable.$nextTick().then(()=>{const{scrollXLoad,scrollYLoad}=reactData;const{scrollXStore,scrollYStore}=internalData;const virtualYOpts=$xeTable.computeVirtualYOpts;const virtualXOpts=$xeTable.computeVirtualXOpts;// 计算 X 逻辑
|
|
7827
7845
|
if(scrollXLoad){const{toVisibleIndex:toXVisibleIndex,visibleSize:visibleXSize}=handleVirtualXVisible($xeTable);const offsetXSize=Math.max(0,virtualXOpts.oSize?external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(virtualXOpts.oSize):0);scrollXStore.preloadSize=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(virtualXOpts.preSize);scrollXStore.offsetSize=offsetXSize;scrollXStore.visibleSize=visibleXSize;scrollXStore.endIndex=Math.max(scrollXStore.startIndex+scrollXStore.visibleSize+offsetXSize,scrollXStore.endIndex);scrollXStore.visibleStartIndex=Math.max(scrollXStore.startIndex,toXVisibleIndex);scrollXStore.visibleEndIndex=Math.min(scrollXStore.endIndex,toXVisibleIndex+visibleXSize);$xeTable.updateScrollXData().then(()=>{loadScrollXData($xeTable);});}else{$xeTable.updateScrollXSpace();}// 计算 Y 逻辑
|
|
7828
7846
|
const rowHeight=computeRowHeight($xeTable);scrollYStore.rowHeight=rowHeight;// 已废弃
|
|
7829
|
-
reactData.rowHeight=rowHeight;const{toVisibleIndex:toYVisibleIndex,visibleSize:visibleYSize}=handleVirtualYVisible($xeTable);if(scrollYLoad){const offsetYSize=Math.max(0,virtualYOpts.oSize?external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(virtualYOpts.oSize):0);scrollYStore.preloadSize=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(virtualYOpts.preSize);scrollYStore.offsetSize=offsetYSize;scrollYStore.visibleSize=visibleYSize;scrollYStore.endIndex=Math.max(scrollYStore.startIndex+visibleYSize+offsetYSize,scrollYStore.endIndex);scrollYStore.visibleStartIndex=Math.max(scrollYStore.startIndex,toYVisibleIndex);scrollYStore.visibleEndIndex=Math.min(scrollYStore.endIndex,toYVisibleIndex+visibleYSize);$xeTable.updateScrollYData().then(()=>{loadScrollYData($xeTable);});}else{$xeTable.updateScrollYSpace();}});}function calcScrollbar($xeTable){const reactData=$xeTable;const internalData=$xeTable;const{scrollXWidth,scrollYHeight}=reactData;const{elemStore}=internalData;const scrollbarOpts=$xeTable.computeScrollbarOpts;const el=$xeTable.$refs.refElem;if(!el||!el.clientWidth){return;}const bodyWrapperElem=getRefElem(elemStore['main-body-wrapper']);const headerTableElem=getRefElem(elemStore['main-header-table']);const footerTableElem=getRefElem(elemStore['main-footer-table']);const xHandleEl=$xeTable.$refs.refScrollXHandleElem;const yHandleEl=$xeTable.$refs.refScrollYHandleElem;let overflowY=false;let overflowX=false;if(bodyWrapperElem){overflowY=scrollYHeight>bodyWrapperElem.clientHeight;if(yHandleEl){reactData.scrollbarWidth=scrollbarOpts.width||yHandleEl.offsetWidth-yHandleEl.clientWidth||14;}reactData.overflowY=overflowY;overflowX=scrollXWidth>bodyWrapperElem.clientWidth;if(xHandleEl){reactData.scrollbarHeight=scrollbarOpts.height||xHandleEl.offsetHeight-xHandleEl.clientHeight||14;}reactData.overflowX=overflowX;const hHeight=headerTableElem?headerTableElem.clientHeight:0;const fHeight=footerTableElem?footerTableElem.clientHeight:0;internalData.tableHeight=bodyWrapperElem.offsetHeight;internalData.tHeaderHeight=hHeight;internalData.tFooterHeight=fHeight;reactData.overflowX=overflowX;reactData.parentHeight=Math.max(hHeight+fHeight+20,$xeTable.getParentHeight());}if(overflowX){$xeTable.checkScrolling();}}function handleRecalculateStyle($xeTable,reFull,reWidth,reHeight){const internalData=$xeTable;const el=$xeTable.$refs.refElem;
|
|
7830
|
-
if(reWidth){calcCellWidth($xeTable);}if(reFull){autoCellWidth($xeTable);}if(reHeight){calcCellHeight($xeTable);}updateStyle($xeTable);calcScrollbar($xeTable);if(reFull){updateRowOffsetTop($xeTable);}updateRowExpandStyle($xeTable);if(reFull){updateTreeLineStyle($xeTable);}if(reFull){return computeScrollLoad($xeTable);}});}function handleLazyRecalculate($xeTable,reFull,reWidth,reHeight){const reactData=$xeTable;const internalData=$xeTable;return new Promise(resolve=>{const{customStore}=reactData;const{rceTimeout,rceRunTime}=internalData;const $xeGanttView=internalData.xeGanttView;const resizeOpts=$xeTable.computeResizeOpts;
|
|
7847
|
+
reactData.rowHeight=rowHeight;const{toVisibleIndex:toYVisibleIndex,visibleSize:visibleYSize}=handleVirtualYVisible($xeTable);if(scrollYLoad){const offsetYSize=Math.max(0,virtualYOpts.oSize?external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(virtualYOpts.oSize):0);scrollYStore.preloadSize=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(virtualYOpts.preSize);scrollYStore.offsetSize=offsetYSize;scrollYStore.visibleSize=visibleYSize;scrollYStore.endIndex=Math.max(scrollYStore.startIndex+visibleYSize+offsetYSize,scrollYStore.endIndex);scrollYStore.visibleStartIndex=Math.max(scrollYStore.startIndex,toYVisibleIndex);scrollYStore.visibleEndIndex=Math.min(scrollYStore.endIndex,toYVisibleIndex+visibleYSize);$xeTable.updateScrollYData().then(()=>{loadScrollYData($xeTable);});}else{$xeTable.updateScrollYSpace();}});}function calcScrollbar($xeTable){const reactData=$xeTable;const internalData=$xeTable;const{scrollXWidth,scrollYHeight}=reactData;const{elemStore}=internalData;const scrollbarOpts=$xeTable.computeScrollbarOpts;const el=$xeTable.$refs.refElem;if(!el||!el.clientWidth){return;}const bodyWrapperElem=getRefElem(elemStore['main-body-wrapper']);const headerTableElem=getRefElem(elemStore['main-header-table']);const footerTableElem=getRefElem(elemStore['main-footer-table']);const xHandleEl=$xeTable.$refs.refScrollXHandleElem;const yHandleEl=$xeTable.$refs.refScrollYHandleElem;let overflowY=false;let overflowX=false;if(bodyWrapperElem){overflowY=scrollYHeight>bodyWrapperElem.clientHeight;if(yHandleEl){reactData.scrollbarWidth=scrollbarOpts.width||yHandleEl.offsetWidth-yHandleEl.clientWidth||14;}reactData.overflowY=overflowY;overflowX=scrollXWidth>bodyWrapperElem.clientWidth;if(xHandleEl){reactData.scrollbarHeight=scrollbarOpts.height||xHandleEl.offsetHeight-xHandleEl.clientHeight||14;}reactData.overflowX=overflowX;const hHeight=headerTableElem?headerTableElem.clientHeight:0;const fHeight=footerTableElem?footerTableElem.clientHeight:0;internalData.tableHeight=bodyWrapperElem.offsetHeight;internalData.tHeaderHeight=hHeight;internalData.tFooterHeight=fHeight;reactData.overflowX=overflowX;reactData.parentHeight=Math.max(hHeight+fHeight+20,$xeTable.getParentHeight());}if(overflowX){$xeTable.checkScrolling();}}function handleRecalculateStyle($xeTable,reFull,reWidth,reHeight){const internalData=$xeTable;const el=$xeTable.$refs.refElem;if(!el||!el.clientWidth){return $xeTable.$nextTick();}const varEl=$xeTable.$refs.refVarElem;if(varEl){const[defEl,mediumEl,smallEl,miniEl]=varEl.children;calcVarRowHeightConfig($xeTable,'default',defEl);calcVarRowHeightConfig($xeTable,'medium',mediumEl);calcVarRowHeightConfig($xeTable,'small',smallEl);calcVarRowHeightConfig($xeTable,'mini',miniEl);}if(reWidth){calcCellWidth($xeTable);}if(reFull){autoCellWidth($xeTable);}calcScrollbar($xeTable);updateStyle($xeTable);updateRowExpandStyle($xeTable);if(reFull){updateTreeLineStyle($xeTable);}internalData.rceRunTime=Date.now();return computeScrollLoad($xeTable).then(()=>{// 初始化时需要在列计算之后再执行优化运算,达到最优显示效果
|
|
7848
|
+
if(reWidth){calcCellWidth($xeTable);}if(reFull){autoCellWidth($xeTable);}if(reHeight){calcCellHeight($xeTable);}updateStyle($xeTable);calcScrollbar($xeTable);if(reFull){updateRowOffsetTop($xeTable);}updateRowExpandStyle($xeTable);if(reFull){updateTreeLineStyle($xeTable);}internalData.rceRunTime=Date.now();if(reFull){return computeScrollLoad($xeTable);}});}const minRunDelay=50;function handleLazyRecalculate($xeTable,reFull,reWidth,reHeight){const reactData=$xeTable;const internalData=$xeTable;return new Promise(resolve=>{const{customStore}=reactData;const{rceTimeout,rceRunTime}=internalData;const $xeGanttView=internalData.xeGanttView;const resizeOpts=$xeTable.computeResizeOpts;let rceDelay=internalData.rceDelay;// 如果在500毫秒内频繁执行,则执行次数减缓
|
|
7849
|
+
if(rceRunTime&&rceRunTime>Date.now()-500){rceDelay+=50;}else{rceDelay=0;}internalData.rceDelay=rceDelay;const refreshDelay=resizeOpts.refreshDelay||30;const reDelay=rceDelay+refreshDelay;const el=$xeTable.$refs.refElem;if(el&&el.clientWidth){autoCellWidth($xeTable);updateRowExpandStyle($xeTable);}if(customStore.visible&&$xeTable.handleCustomStyle){$xeTable.handleCustomStyle();}if(rceTimeout){clearTimeout(rceTimeout);if(rceRunTime&&rceRunTime+minRunDelay<Date.now()){resolve(handleRecalculateStyle($xeTable,reFull,reWidth,reHeight));}else{$xeTable.$nextTick(()=>{resolve();});}}else{resolve(handleRecalculateStyle($xeTable,reFull,reWidth,reHeight));}if($xeGanttView&&$xeGanttView.handleLazyRecalculate){$xeGanttView.handleLazyRecalculate();}internalData.rceTimeout=setTimeout(()=>{internalData.rceTimeout=undefined;handleRecalculateStyle($xeTable,reFull,reWidth,reHeight);},reDelay);});}function handleResizeEvent($xeTable){handleLazyRecalculate($xeTable,true,true,true);}function handleUpdateAggValues($xeTable){const reactData=$xeTable;const internalData=$xeTable;const{visibleColumn}=internalData;const aggCols=[];visibleColumn.forEach(column=>{if(column.aggFunc){aggCols.push(column);}});reactData.aggHandleAggColumns=aggCols;}function handleUpdateRowGroup($xeTable,groupFields){const reactData=$xeTable;const aggGroupFields=[];const aggGroupConfs=[];if(groupFields){(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(groupFields)?groupFields:[groupFields]).forEach(field=>{aggGroupFields.push(field);aggGroupConfs.push({field});});}reactData.rowGroupList=aggGroupConfs;reactData.aggHandleFields=aggGroupFields;handleUpdateAggValues($xeTable);}function handleeGroupSummary($xeTable,aggList){const internalData=$xeTable;const{fullColumnFieldData}=internalData;const aggregateOpts=$xeTable.computeAggregateOpts;const aggFuncColumns=$xeTable.computeAggFuncColumns;const{mapChildrenField}=aggregateOpts;const aggCalcMethod=aggregateOpts.calcValuesMethod||aggregateOpts.countMethod||aggregateOpts.aggregateMethod;if(mapChildrenField){external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().lastEach(aggList,aggRow=>{let count=0;external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(aggRow[mapChildrenField],row=>{if(row.isAggregate){count+=row.childCount||0;}else{count++;}});aggRow.childCount=count;});if($xeTable.handlePivotTableAggData){$xeTable.handlePivotTableAggData(aggList);}else{external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().lastEach(aggList,aggRow=>{const aggDtObj={};const aggData=aggRow.aggData;const groupField=aggRow.groupField;const groupContent=aggRow.groupContent;const childList=mapChildrenField?aggRow[mapChildrenField]||[]:[];const childCount=aggRow.childCount;const colRest=fullColumnFieldData[groupField]||{};aggFuncColumns.forEach(column=>{const{field}=column;const currAggData=aggData?aggData[field]:null;const ctParams={$table:$xeTable,groupField,groupColumn:colRest?colRest.column:null,column,groupValue:groupContent,childList,childCount,aggValue:currAggData?currAggData.value:0,/**
|
|
7831
7850
|
* 已废弃
|
|
7832
7851
|
* @deprecated
|
|
7833
7852
|
*/children:childList,/**
|
|
@@ -7844,7 +7863,7 @@ if(!treeOpts.rowField){errLog('vxe.error.reqProp',['tree-config.rowField']);}if(
|
|
|
7844
7863
|
// warnLog('vxe.error.errConflicts', ['tree-config.transform', `row.${treeOpts.children}`])
|
|
7845
7864
|
// }
|
|
7846
7865
|
// })
|
|
7847
|
-
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($xeTable,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($xeTable,fullData);// 全量数据
|
|
7866
|
+
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($xeTable,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={};internalData.fullCellStoreMaps={};const sYLoad=updateScrollYStatus($xeTable,fullData);// 全量数据
|
|
7848
7867
|
internalData.tableFullData=fullData;internalData.tableFullTreeData=isRGroup?[]:treeData;internalData.tableFullGroupData=isRGroup?treeData:[];// 缓存数据
|
|
7849
7868
|
$xeTable.cacheRowMap(isReset);// 原始数据
|
|
7850
7869
|
internalData.tableSynchData=datas;if(isReset){internalData.isResizeCellHeight=false;}// 克隆原数据,用于显示编辑状态,与编辑值做对比
|
|
@@ -7893,7 +7912,7 @@ tableFullColumn.forEach(column=>{if(column.visible){if(column.fixed==='left'){le
|
|
|
7893
7912
|
// }
|
|
7894
7913
|
if(props.spanMethod){warnLog('vxe.error.scrollErrProp',['span-method']);}if(props.footerSpanMethod){warnLog('vxe.error.scrollErrProp',['footer-span-method']);}if(isReset){const{visibleSize}=handleVirtualXVisible($xeTable);scrollXStore.startIndex=0;scrollXStore.endIndex=visibleSize;scrollXStore.visibleSize=visibleSize;scrollXStore.visibleStartIndex=0;scrollXStore.visibleEndIndex=visibleSize;}}// 如果列被显示/隐藏,则清除合并状态
|
|
7895
7914
|
// 如果列被设置为固定,则清除合并状态
|
|
7896
|
-
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($xeTable);handleUpdateAggValues($xeTable);if(isReset){return $xeTable.updateFooter().then(()=>{return $xeTable.recalculate();}).then(()=>{$xeTable.updateCellAreas();return $xeTable.recalculate();});}return $xeTable.updateFooter();}function initColumnHierarchy($xeTable){const internalData=$xeTable;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;}function
|
|
7915
|
+
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($xeTable);handleUpdateAggValues($xeTable);if(isReset){return $xeTable.updateFooter().then(()=>{return $xeTable.recalculate();}).then(()=>{$xeTable.updateCellAreas();return $xeTable.recalculate();});}return $xeTable.updateFooter();}function initColumnHierarchy($xeTable){const internalData=$xeTable;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;}function buildColumnInfo($xeTable){const props=$xeTable;const $xeToolbar=$xeTable.$refs.$xeToolbar;const reactData=$xeTable;const internalData=$xeTable;const{scrollXLoad,scrollYLoad,expandColumn}=reactData;const expandOpts=$xeTable.computeExpandOpts;cacheColumnMap($xeTable);parseColumns($xeTable,true).then(()=>{if(reactData.scrollXLoad){loadScrollXData($xeTable);}});$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 $xeTable.$nextTick().then(()=>{if($xeToolbar){$xeToolbar.syncUpdate({collectColumn:internalData.collectColumn,$table:$xeTable});}if($xeTable.handleUpdateCustomColumn){$xeTable.handleUpdateCustomColumn();}const columnOpts=$xeTable.computeColumnOpts;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($xeTable,false,true,true);});}function handleInitColumn($xeTable,collectColumn){const reactData=$xeTable;const internalData=$xeTable;internalData.collectColumn=collectColumn;const tFullColumn=getColumnList(collectColumn);internalData.tableFullColumn=tFullColumn;reactData.updateColFlag++;reactData.isColLoading=true;initColumnHierarchy($xeTable);return Promise.resolve(restoreCustomStorage($xeTable)).then(()=>{return buildColumnInfo($xeTable);});}/**
|
|
7897
7916
|
* 纵向 Y 可视渲染处理
|
|
7898
7917
|
*/function loadScrollYData($xeTable){const reactData=$xeTable;const internalData=$xeTable;const{isAllOverflow,isScrollYBig}=reactData;const{mergeBodyList,mergeBodyRowMaps,scrollYStore}=internalData;const{preloadSize,startIndex,endIndex,offsetSize}=scrollYStore;const autoOffsetYSize=isAllOverflow?offsetSize:offsetSize+1;const{toVisibleIndex,visibleSize}=handleVirtualYVisible($xeTable);const offsetItem={startIndex:Math.max(0,isScrollYBig?toVisibleIndex-1:toVisibleIndex-1-offsetSize-preloadSize),endIndex:isScrollYBig?toVisibleIndex+visibleSize:toVisibleIndex+visibleSize+autoOffsetYSize+preloadSize};scrollYStore.visibleStartIndex=toVisibleIndex-1;scrollYStore.visibleEndIndex=toVisibleIndex+visibleSize+1;calculateMergerOffsetIndex(mergeBodyList,mergeBodyRowMaps,offsetItem,'row');const{startIndex:offsetStartIndex,endIndex:offsetEndIndex}=offsetItem;if(toVisibleIndex<=startIndex||toVisibleIndex>=endIndex-visibleSize-1){if(startIndex!==offsetStartIndex||endIndex!==offsetEndIndex){scrollYStore.startIndex=offsetStartIndex;scrollYStore.endIndex=offsetEndIndex;$xeTable.updateScrollYData();}}}const createGetRowCacheProp=prop=>{return function(row){const $xeTable=this;const internalData=$xeTable;const{fullAllDataRowIdData}=internalData;if(row){const rowid=getRowid($xeTable,row);const rowRest=fullAllDataRowIdData[rowid];if(rowRest){return rowRest[prop];}}return-1;};};const createGetColumnCacheProp=prop=>{return function(column){const $xeTable=this;const internalData=$xeTable;const{fullColumnIdData}=internalData;if(column){const colRest=fullColumnIdData[column.id];if(colRest){return colRest[prop];}}return-1;};};function lazyScrollXData($xeTable){const internalData=$xeTable;const{lxTimeout,lxRunTime,scrollXStore}=internalData;const{visibleSize}=scrollXStore;const fpsTime=visibleSize>26?26:visibleSize>16?14:6;if(lxTimeout){clearTimeout(lxTimeout);}if(!lxRunTime||lxRunTime+fpsTime<Date.now()){internalData.lxRunTime=Date.now();loadScrollXData($xeTable);}internalData.lxTimeout=setTimeout(()=>{internalData.lxTimeout=undefined;internalData.lxRunTime=undefined;loadScrollXData($xeTable);},fpsTime);}function lazyScrollYData($xeTable){const internalData=$xeTable;const{lyTimeout,lyRunTime,scrollYStore}=internalData;const{visibleSize}=scrollYStore;const fpsTime=visibleSize>30?32:visibleSize>20?18:8;if(lyTimeout){clearTimeout(lyTimeout);}if(!lyRunTime||lyRunTime+fpsTime<Date.now()){internalData.lyRunTime=Date.now();loadScrollYData($xeTable);}internalData.lyTimeout=setTimeout(()=>{internalData.lyTimeout=undefined;internalData.lyRunTime=undefined;loadScrollYData($xeTable);},fpsTime);}function handleSyncScroll($xeTable,isRollX,isRollY){const reactData=$xeTable;const internalData=$xeTable;const{scrollXLoad,scrollYLoad,isAllOverflow}=reactData;internalData.lcsRunTime=Date.now();internalData.lcsTimeout=undefined;internalData.intoRunScroll=false;internalData.inVirtualScroll=false;internalData.inWheelScroll=false;internalData.inHeaderScroll=false;internalData.inBodyScroll=false;internalData.inFooterScroll=false;reactData.lazScrollLoading=false;internalData.scrollRenderType='';let xRest=null;let yRest=null;if(!isAllOverflow){calcCellHeight($xeTable);updateRowOffsetTop($xeTable);}if(isRollX&&scrollXLoad){xRest=$xeTable.updateScrollXData();}if(isRollY&&scrollYLoad){yRest=$xeTable.updateScrollYData().then(()=>{if(!isAllOverflow){calcCellHeight($xeTable);updateRowOffsetTop($xeTable);}return $xeTable.updateScrollYSpace();});}updateRowExpandStyle($xeTable);return Promise.all([xRest,yRest,scrollXLoad||scrollYLoad?$xeTable.updateCellAreas():null]);}function checkLastSyncScroll($xeTable,isRollX,isRollY){const reactData=$xeTable;const internalData=$xeTable;const{lcsTimeout}=internalData;reactData.lazScrollLoading=true;if(lcsTimeout){clearTimeout(lcsTimeout);}internalData.lcsTimeout=setTimeout(()=>{handleSyncScroll($xeTable,isRollX,isRollY).then(()=>{if(reactData.scrollXLoad||reactData.scrollYLoad){$xeTable.$nextTick(()=>{updateRowExpandStyle($xeTable);if(!internalData.lcsTimeout){handleSyncScroll($xeTable,isRollX,isRollY);}});}});},240);}const getWheelSpeed=lastScrollTime=>{let multiple=1;const currTime=Date.now();if(lastScrollTime+25>currTime){multiple=1.18;}else if(lastScrollTime+30>currTime){multiple=1.15;}else if(lastScrollTime+40>currTime){multiple=1.12;}else if(lastScrollTime+55>currTime){multiple=1.09;}else if(lastScrollTime+75>currTime){multiple=1.06;}else if(lastScrollTime+100>currTime){multiple=1.03;}return multiple;};const syncGanttScrollTop=($xeTable,scrollTop)=>{const internalData=$xeTable;const $xeGanttView=internalData.xeGanttView;if($xeGanttView){const ganttInternalData=$xeGanttView.internalData;const{elemStore:ganttElemStore}=ganttInternalData;const ganttBodyScrollElem=getRefElem(ganttElemStore['main-body-scroll']);if(ganttBodyScrollElem){ganttBodyScrollElem.scrollTop=scrollTop;}}};function updateHeight($xeTable){const reactData=$xeTable;const internalData=$xeTable;internalData.customHeight=calcTableHeight($xeTable,'height');internalData.customMinHeight=calcTableHeight($xeTable,'minHeight');internalData.customMaxHeight=calcTableHeight($xeTable,'maxHeight');// 如果启用虚拟滚动,纠正高度
|
|
7899
7918
|
if(reactData.scrollYLoad&&!(internalData.customHeight||internalData.customMinHeight||internalData.customMaxHeight)){internalData.customHeight=300;}}/**
|
|
@@ -8027,7 +8046,7 @@ if(eqEmptyValue(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_x
|
|
|
8027
8046
|
* 如果还额外传了 field 则清空指定单元格内容
|
|
8028
8047
|
* @param {Array/Row} rows 行数据
|
|
8029
8048
|
* @param {String} field 字段名
|
|
8030
|
-
*/clearData(rows,field){const $xeTable=this;const internalData=$xeTable;const{tableFullData,visibleColumn}=internalData;if(!arguments.length){rows=tableFullData;}else if(rows&&!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(rows)){rows=[rows];}if(field){rows.forEach(row=>external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(row,field,null));}else{rows.forEach(row=>{visibleColumn.forEach(column=>{if(column.field){setCellValue(row,column,null);}});});}return $xeTable.$nextTick();},getCellElement(row,fieldOrColumn){const $xeTable=this;const internalData=$xeTable;const{elemStore}=internalData;const column=handleFieldOrColumn($xeTable,fieldOrColumn);if(!column){return null;}const rowid=getRowid($xeTable,row);const bodyScrollElem=getRefElem(elemStore['main-body-scroll']);const leftScrollElem=getRefElem(elemStore['left-body-scroll']);const rightScrollElem=getRefElem(elemStore['right-body-scroll']);let bodyElem;if(column){if(column.fixed){if(column.fixed==='left'){if(leftScrollElem){bodyElem=leftScrollElem;}}else{if(rightScrollElem){bodyElem=rightScrollElem;}}}if(!bodyElem){bodyElem=bodyScrollElem;}if(bodyElem){return bodyElem.querySelector(`.vxe-body--row[rowid="${rowid}"] .${column.id}`);}}return null;},getCellLabel(row,fieldOrColumn){const $xeTable=this;const props=$xeTable;const internalData=$xeTable;const column=handleFieldOrColumn($xeTable,fieldOrColumn);if(!column){return null;}const{editConfig}=props;const{formatter,editRender,cellRender}=column;// formatter > tableCellFormatter
|
|
8049
|
+
*/clearData(rows,field){const $xeTable=this;const internalData=$xeTable;const{tableFullData,visibleColumn}=internalData;if(!arguments.length){rows=tableFullData;}else if(rows&&!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(rows)){rows=[rows];}if(field){rows.forEach(row=>external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(row,field,null));}else{rows.forEach(row=>{visibleColumn.forEach(column=>{if(column.field){setCellValue(row,column,null);}});});}return $xeTable.$nextTick();},effectCellData(row,column,options){const $xeTable=this;const internalData=$xeTable;const{fullCellStoreMaps}=internalData;const editOpts=$xeTable.computeEditOpts;const{key,isChanged,setValue,getResult}=options;const rowid=getRowid($xeTable,row);const colid=column.id;let rowStore=fullCellStoreMaps[rowid];const cellValue=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row,column.field);const restParams={$table:$xeTable,row,rowid,column,colid,cellValue,oldValue:null};if(editOpts.cache===false&&key==='render_table_cell'){const rest=restParams;rest.cellResult=getResult?getResult(restParams):cellValue;return rest;}if(!rowStore){rowStore={};fullCellStoreMaps[rowid]=rowStore;}let cellStore=rowStore[colid];if(!cellStore){cellStore={value:undefined,result:{}};rowStore[colid]=cellStore;}const restData=rowStore[colid];const oldValue=restData.value;restParams.oldValue=oldValue;if(isChanged?!isChanged(restParams):oldValue!==cellValue){restData.value=setValue?setValue(restParams):cellValue;restData.result={};}const storeData=restData.result;if(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isUndefined(storeData[key])){storeData[key]=getResult?getResult(restParams):cellValue;}const cellResult=storeData[key];const rest=restParams;rest.cellResult=cellResult;return rest;},getCellElement(row,fieldOrColumn){const $xeTable=this;const internalData=$xeTable;const{elemStore}=internalData;const column=handleFieldOrColumn($xeTable,fieldOrColumn);if(!column){return null;}const rowid=getRowid($xeTable,row);const bodyScrollElem=getRefElem(elemStore['main-body-scroll']);const leftScrollElem=getRefElem(elemStore['left-body-scroll']);const rightScrollElem=getRefElem(elemStore['right-body-scroll']);let bodyElem;if(column){if(column.fixed){if(column.fixed==='left'){if(leftScrollElem){bodyElem=leftScrollElem;}}else{if(rightScrollElem){bodyElem=rightScrollElem;}}}if(!bodyElem){bodyElem=bodyScrollElem;}if(bodyElem){return bodyElem.querySelector(`.vxe-body--row[rowid="${rowid}"] .${column.id}`);}}return null;},getCellLabel(row,fieldOrColumn){const $xeTable=this;const props=$xeTable;const internalData=$xeTable;const column=handleFieldOrColumn($xeTable,fieldOrColumn);if(!column){return null;}const{editConfig}=props;const{formatter,editRender,cellRender}=column;// formatter > tableCellFormatter
|
|
8031
8050
|
const renderOpts=formatter?null:editConfig&&isEnableConf(editRender)?editRender:isEnableConf(cellRender)?cellRender:null;const compConf=renderOpts?methods_renderer.get(renderOpts.name):null;const tcFormatter=compConf?compConf.tableCellFormatter:null;const cellValue=getCellValue(row,column);let cellLabel=cellValue;if(formatter||tcFormatter){let formatData;const{fullAllDataRowIdData}=internalData;const rowid=getRowid($xeTable,row);const colid=column.id;const rowRest=fullAllDataRowIdData[rowid];if(rowRest){formatData=rowRest.formatData;if(!formatData){formatData=fullAllDataRowIdData[rowid].formatData={};}if(rowRest&&formatData[colid]){if(formatData[colid].value===cellValue){return formatData[colid].label;}}}const formatParams={$table:$xeTable,cellValue,row,rowIndex:$xeTable.getRowIndex(row),column,columnIndex:$xeTable.getColumnIndex(column)};if(formatter){if(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(formatter)){const gFormatOpts=methods_formats.get(formatter);const tcFormatMethod=gFormatOpts?gFormatOpts.tableCellFormatMethod||gFormatOpts.cellFormatMethod:null;cellLabel=tcFormatMethod?tcFormatMethod(formatParams):'';}else if(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(formatter)){const gFormatOpts=methods_formats.get(formatter[0]);const tcFormatMethod=gFormatOpts?gFormatOpts.tableCellFormatMethod||gFormatOpts.cellFormatMethod:null;cellLabel=tcFormatMethod?tcFormatMethod(formatParams,...formatter.slice(1)):'';}else{cellLabel=formatter(formatParams);}}else if(renderOpts&&tcFormatter){cellLabel=tcFormatter(renderOpts,formatParams);}if(formatData){formatData[colid]={value:cellValue,label:cellLabel};}}return cellLabel;},updateCellLabel(row,fieldOrColumn){const $xeTable=this;const internalData=$xeTable;const column=handleFieldOrColumn($xeTable,fieldOrColumn);if(!column){return null;}const{fullAllDataRowIdData}=internalData;const rowid=getRowid($xeTable,row);if(rowid){const colid=column.id;const rowid=getRowid($xeTable,row);const rowRest=fullAllDataRowIdData[rowid];if(rowRest){const formatData=rowRest.formatData;if(formatData){delete formatData[colid];}}}return $xeTable.getFooterCellLabel(row,column);},clearFormatterCache(isUpdate){const $xeTable=this;const reactData=$xeTable;const internalData=$xeTable;const{tableData,tableColumn}=reactData;const{fullAllDataRowIdData}=internalData;external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(fullAllDataRowIdData,rowRest=>{if(rowRest.formatData){rowRest.formatData=undefined;}});if(isUpdate){tableData.forEach(row=>{tableColumn.forEach(column=>{$xeTable.getCellLabel(row,column);});});}return $xeTable.$nextTick();},getHeaderCellLabel(fieldOrColumn){const $xeTable=this;const internalData=$xeTable;const column=handleFieldOrColumn($xeTable,fieldOrColumn);if(!column){return null;}const{headerFormatter}=column;const _columnIndex=$xeTable.getVTColumnIndex(column);let cellLabel=column.getTitle();if(headerFormatter){let formatData;const{headerFullDataColData}=internalData;const colid=column.id;let colRest=headerFullDataColData[colid];if(!colRest){colRest=headerFullDataColData[colid]={};}const formatObj=colRest.formatObj;if(formatObj&&formatObj.value===cellLabel){return formatObj.label;}const headFormatParams={$table:$xeTable,cellTitle:cellLabel,cellValue:cellLabel,column,_columnIndex,columnIndex:$xeTable.getColumnIndex(column)};if(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(headerFormatter)){const gFormatOpts=methods_formats.get(headerFormatter);const fcFormatMethod=gFormatOpts?gFormatOpts.tableHeaderCellFormatMethod:null;cellLabel=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toValueString(fcFormatMethod?fcFormatMethod(headFormatParams):'');}else if(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(headerFormatter)){const gFormatOpts=methods_formats.get(headerFormatter[0]);const fcFormatMethod=gFormatOpts?gFormatOpts.tableHeaderCellFormatMethod:null;cellLabel=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toValueString(fcFormatMethod?fcFormatMethod(headFormatParams,...headerFormatter.slice(1)):'');}else{cellLabel=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toValueString(headerFormatter(headFormatParams));}if(formatData){colRest.formatObj={value:cellLabel,label:cellLabel};}}return cellLabel;},updateHeaderCellLabel(fieldOrColumn){const $xeTable=this;const internalData=$xeTable;const column=handleFieldOrColumn($xeTable,fieldOrColumn);if(!column){return'';}const{headerFullDataColData}=internalData;const colid=column.id;const colRest=headerFullDataColData[colid];if(colRest){colRest.formatObj=undefined;}return $xeTable.getHeaderCellLabel(column);},clearHeaderFormatterCache(isUpdate){const $xeTable=this;const reactData=$xeTable;const internalData=$xeTable;const{tableColumn}=reactData;const{headerFullDataColData}=internalData;external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(headerFullDataColData,colRest=>{if(colRest.formatObj){colRest.formatObj=undefined;}});if(isUpdate){tableColumn.forEach(column=>{$xeTable.getHeaderCellLabel(column);});}return $xeTable.$nextTick();},getFooterCellLabel(row,fieldOrColumn){const $xeTable=this;const reactData=$xeTable;const internalData=$xeTable;const column=handleFieldOrColumn($xeTable,fieldOrColumn);if(!column){return null;}const{footerFormatter}=column;const _columnIndex=$xeTable.getVTColumnIndex(column);let itemValue='';// 兼容老模式
|
|
8032
8051
|
if(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(row)){itemValue=row[_columnIndex];}else{itemValue=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row,column.field);}let cellLabel=itemValue;if(footerFormatter){let formatData;const{footerTableData}=reactData;const{footerFullDataRowData}=internalData;const colid=column.id;const $rowIndex=footerTableData.indexOf(row);let rowRest=null;if($rowIndex>-1){rowRest=footerFullDataRowData[$rowIndex];if(!rowRest){rowRest=footerFullDataRowData[$rowIndex]={};}formatData=rowRest.formatData;if(!formatData){formatData=footerFullDataRowData[$rowIndex].formatData={};}if(rowRest&&formatData[colid]){if(formatData[colid].value===itemValue){return formatData[colid].label;}}}const footerFormatParams={$table:$xeTable,cellValue:itemValue,itemValue,row,items:row,$rowIndex,column,_columnIndex,columnIndex:$xeTable.getColumnIndex(column)};if(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(footerFormatter)){const gFormatOpts=methods_formats.get(footerFormatter);const fcFormatMethod=gFormatOpts?gFormatOpts.tableFooterCellFormatMethod:null;cellLabel=fcFormatMethod?fcFormatMethod(footerFormatParams):'';}else if(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(footerFormatter)){const gFormatOpts=methods_formats.get(footerFormatter[0]);const fcFormatMethod=gFormatOpts?gFormatOpts.tableFooterCellFormatMethod:null;cellLabel=fcFormatMethod?fcFormatMethod(footerFormatParams,...footerFormatter.slice(1)):'';}else{cellLabel=footerFormatter(footerFormatParams);}if(formatData){formatData[colid]={value:itemValue,label:cellLabel};}}return cellLabel;},updateFooterCellLabel(row,fieldOrColumn){const $xeTable=this;const reactData=$xeTable;const internalData=$xeTable;const column=handleFieldOrColumn($xeTable,fieldOrColumn);if(!column){return null;}const{footerTableData}=reactData;const{footerFullDataRowData}=internalData;const colid=column.id;const $rowIndex=footerTableData.indexOf(row);const rowRest=footerFullDataRowData[$rowIndex];if(rowRest){const formatData=rowRest.formatData;if(formatData){delete formatData[colid];}}return $xeTable.getFooterCellLabel(row,column);},clearFooterFormatterCache(isUpdate){const $xeTable=this;const reactData=$xeTable;const internalData=$xeTable;const{tableData,tableColumn}=reactData;const{footerFullDataRowData}=internalData;external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(footerFullDataRowData,rowRest=>{if(rowRest.formatData){rowRest.formatData=undefined;}});if(isUpdate){tableData.forEach(row=>{tableColumn.forEach(column=>{$xeTable.getFooterCellLabel(row,column);});});}return $xeTable.$nextTick();},/**
|
|
8033
8052
|
* 检查是否为临时行数据
|
|
@@ -8106,10 +8125,24 @@ if(!targetColumn.fixed&&isMaxFixedColumn){if(core_.VxeUI.modal){core_.VxeUI.moda
|
|
|
8106
8125
|
* 手动重置列的显示隐藏、列宽拖动的状态;
|
|
8107
8126
|
* 如果为 true 则重置所有状态
|
|
8108
8127
|
* 如果已关联工具栏,则会同步更新
|
|
8109
|
-
*/resetColumn(options){warnLog('vxe.error.delFunc',['resetColumn','resetCustom']);return this.resetCustom(options);}
|
|
8128
|
+
*/resetColumn(options){warnLog('vxe.error.delFunc',['resetColumn','resetCustom']);return this.resetCustom(options);},/**
|
|
8129
|
+
* @private
|
|
8130
|
+
*/handleCustom(){const $xeTable=this;const props=$xeTable;const{mouseConfig}=props;if(mouseConfig){if($xeTable.clearSelected){$xeTable.clearSelected();}if($xeTable.clearCellAreas){$xeTable.clearCellAreas();$xeTable.clearCopyCellArea();}}$xeTable.analyColumnWidth();return $xeTable.refreshColumn(true);},/**
|
|
8110
8131
|
* 还原自定义列操作状态
|
|
8111
|
-
*/restoreCustomStorage(){const $xeTable=this;const props=$xeTable;const{customConfig}=props;const tableId=$xeTable.computeTableId;const customOpts=$xeTable.computeCustomOpts;const{storage,restoreStore,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 isCustomAggGroup=hangleStorageDefaultValue(storageOpts.aggGroup,isAllCustom);const isCustomSort=hangleStorageDefaultValue(storageOpts.sort,isAllCustom);if(storage&&(customConfig?isEnableConf(customOpts):customOpts.enabled)&&(isCustomResizable||isCustomVisible||isCustomFixed||isCustomAggGroup||isCustomSort)){if(!tableId){errLog('vxe.error.reqProp',['id']);return;}const storeData=getCustomStorageMap(tableId);if(restoreStore){return Promise.resolve(restoreStore({$table:$xeTable,id:tableId,type:'restore',storeData})).then(storeData=>{if(!storeData){return;}return handleCustomRestore($xeTable,storeData);}).catch(e=>e);}else{return handleCustomRestore($xeTable,storeData);}}}
|
|
8112
|
-
|
|
8132
|
+
*/restoreCustomStorage(){const $xeTable=this;const props=$xeTable;const{customConfig}=props;const tableId=$xeTable.computeTableId;const customOpts=$xeTable.computeCustomOpts;const{storage,restoreStore,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 isCustomAggGroup=hangleStorageDefaultValue(storageOpts.aggGroup,isAllCustom);const isCustomSort=hangleStorageDefaultValue(storageOpts.sort,isAllCustom);if(storage&&(customConfig?isEnableConf(customOpts):customOpts.enabled)&&(isCustomResizable||isCustomVisible||isCustomFixed||isCustomAggGroup||isCustomSort)){if(!tableId){errLog('vxe.error.reqProp',['id']);return;}const storeData=getCustomStorageMap(tableId);if(restoreStore){return Promise.resolve(restoreStore({$table:$xeTable,id:tableId,type:'restore',storeData})).then(storeData=>{if(!storeData){return;}return handleCustomRestore($xeTable,storeData);}).catch(e=>e);}else{return handleCustomRestore($xeTable,storeData);}}},/**
|
|
8133
|
+
* 用于 custom-config,用于手动恢复自定义列设置信息,恢复表格重置为初始状态
|
|
8134
|
+
* @param storeData
|
|
8135
|
+
* @returns
|
|
8136
|
+
*/setCustomStoreData(storeData){const $xeTable=this;const reactData=$xeTable;const internalData=$xeTable;if(!storeData){return $xeTable.$nextTick();}const customOpts=$xeTable.computeCustomOpts;const{checkMethod}=customOpts;// 重置状态
|
|
8137
|
+
clearTableAllStatus($xeTable);// 恢复列
|
|
8138
|
+
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($xeTable);return Promise.resolve(handleCustomRestore($xeTable,storeData)).then(()=>{return buildColumnInfo($xeTable);}).then(()=>{// 恢复数据聚合分组
|
|
8139
|
+
const{isRowGroupStatus,rowGroupList}=reactData;if(isRowGroupStatus&&!!$xeTable.handlePivotTableAggData){const rowGroupFields=$xeTable.computeRowGroupFields;if(rowGroupFields?rowGroupFields.length:rowGroupList.length){if(rowGroupFields&&rowGroupFields.length){$xeTable.setRowGroups(rowGroupFields);}else{$xeTable.clearRowGroups();}}else{$xeTable.handleUpdateAggData();}}});},/**
|
|
8140
|
+
* 用于 custom-config,用于获取自定义列设置信息,用于自定义保持
|
|
8141
|
+
* @returns
|
|
8142
|
+
*/getCustomStoreData(){const $xeTable=this;const props=$xeTable;const reactData=$xeTable;const internalData=$xeTable;const{id}=props;const customOpts=$xeTable.computeCustomOpts;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);}// 只支持一级
|
|
8143
|
+
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;},/**
|
|
8144
|
+
* @private
|
|
8145
|
+
*/saveCustomStore(type){const $xeTable=this;const props=$xeTable;const reactData=$xeTable;const{customConfig}=props;const tableId=$xeTable.computeTableId;const customOpts=$xeTable.computeCustomOpts;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'){reactData.isCustomStatus=true;}if(storage&&(customConfig?isEnableConf(customOpts):customOpts.enabled)&&(isCustomResizable||isCustomVisible||isCustomFixed||isCustomSort||isCustomAggGroup||isCustomAggFunc)){if(!tableId){errLog('vxe.error.reqProp',['id']);return this.$nextTick();}const storeData=type==='reset'?{resizableData:{},sortData:{},visibleData:{},fixedData:{},aggGroupData:{},aggFuncData:{}}:this.getCustomStoreData();if(updateStore){return updateStore({$table:$xeTable,id:tableId,type,storeData});}else{setCustomStorageMap(tableId,type==='reset'?null:storeData);}}return this.$nextTick();},handleUpdateDataQueue(){this.upDataFlag++;},handleRefreshColumnQueue(){this.reColumnFlag++;},handleFilterOptions(column){const $xeTable=this;const reactData=$xeTable;if(column){const{filterStore}=reactData;const{filterRender,filters}=column;const filterOptions=filters||[];const compConf=isEnableConf(filterRender)?methods_renderer.get(filterRender.name):null;const frMethod=column.filterRecoverMethod||(compConf?compConf.tableFilterRecoverMethod||compConf.filterRecoverMethod:null);filterStore.column=column;// 复原状态
|
|
8113
8146
|
filterOptions.forEach(option=>{const{_checked,checked}=option;option._checked=checked;if(!checked&&_checked!==checked){if(frMethod){frMethod({option,column,$table:$xeTable});}}});$xeTable.checkFilterOptions();}},/**
|
|
8114
8147
|
* 刷新列配置
|
|
8115
8148
|
*/refreshColumn(initSort){const $xeTable=this;if(initSort){handleUpdateColumn($xeTable);}return parseColumns($xeTable,true).then(()=>{return this.refreshScroll();}).then(()=>{return handleLazyRecalculate($xeTable,false,true,true);});},/**
|
|
@@ -8118,8 +8151,12 @@ filterOptions.forEach(option=>{const{_checked,checked}=option;option._checked=ch
|
|
|
8118
8151
|
const maxInterval=getColReMaxWidth(cellParams);// 列之间的最大间距
|
|
8119
8152
|
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;}}}}// 处理拖动事件
|
|
8120
8153
|
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);// 最大宽
|
|
8121
|
-
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=methods_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($xeTable,evnt,resizeParams);}removeClass(tableEl,'col-drag--resize');};updateEvent(evnt);if($xeTable.closeMenu){$xeTable.closeMenu();}},handleColResizeDblclickEvent(evnt,params){const $xeTable=this;const reactData=$xeTable;const internalData=$xeTable;const resizableOpts=$xeTable.computeResizableOpts;const{isDblclickAutoWidth}=resizableOpts;const el=$xeTable.$refs.refElem;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($xeTable,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($xeTable,evnt,resizeParams);}}}
|
|
8122
|
-
|
|
8154
|
+
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=methods_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($xeTable,evnt,resizeParams);}removeClass(tableEl,'col-drag--resize');};updateEvent(evnt);if($xeTable.closeMenu){$xeTable.closeMenu();}},handleColResizeDblclickEvent(evnt,params){const $xeTable=this;const reactData=$xeTable;const internalData=$xeTable;const resizableOpts=$xeTable.computeResizableOpts;const{isDblclickAutoWidth}=resizableOpts;const el=$xeTable.$refs.refElem;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($xeTable,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($xeTable,evnt,resizeParams);}}},/**
|
|
8155
|
+
* @private
|
|
8156
|
+
*/handleRowResizeMousedownEvent(evnt,params){const $xeTable=this;const props=$xeTable;const reactData=$xeTable;const internalData=$xeTable;evnt.stopPropagation();evnt.preventDefault();const $xeGantt=$xeTable.$xeGantt;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=$xeTable.computeScrollbarYToLeft;const resizableOpts=$xeTable.computeResizableOpts;const rowOpts=$xeTable.computeRowOpts;const cellOpts=$xeTable.computeCellOpts;let tableEl=$xeTable.$refs.refElem;if($xeGantt){const ganttContainerElem=$xeGantt.$refs.refGanttContainerElem;if(ganttContainerElem){tableEl=ganttContainerElem;}}const resizeBarElem=$xeTable.$refs.refRowResizeBar;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=$xeTable.computeDefaultRowHeight;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;// 处理拖动事件
|
|
8157
|
+
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=methods_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($xeTable,evnt,resizeParams);updateRowOffsetTop($xeTable);}}removeClass(tableEl,'row-drag--resize');};updateEvent(evnt);},/**
|
|
8158
|
+
* @private
|
|
8159
|
+
*/handleRowResizeDblclickEvent(evnt,params){const $xeTable=this;const reactData=$xeTable;const internalData=$xeTable;const resizableOpts=$xeTable.computeResizableOpts;const{isDblclickAutoHeight}=resizableOpts;const el=$xeTable.$refs.refElem;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($xeTable,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($xeTable,evnt,resizeParams);}};if(actived.row||actived.column){$xeTable.clearEdit().then(handleRsHeight);}else{handleRsHeight();}}},setRowHeightConf(heightConf){const $xeTable=this;const reactData=$xeTable;const internalData=$xeTable;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 $xeTable.$nextTick().then(()=>{updateRowOffsetTop($xeTable);return{status};});},getRowHeightConf(isFull){const $xeTable=this;const internalData=$xeTable;const{fullAllDataRowIdData,afterFullData}=internalData;const{handleGetRowId}=createHandleGetRowId($xeTable);const rowOpts=$xeTable.computeRowOpts;const cellOpts=$xeTable.computeCellOpts;const defaultRowHeight=$xeTable.computeDefaultRowHeight;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 $xeTable=this;const reactData=$xeTable;const internalData=$xeTable;const{fullAllDataRowIdData}=internalData;const rows=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(rowOrId)?rowOrId:[rowOrId];const el=$xeTable.$refs.refElem;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($xeTable,rowid,rowRest,el);}el.removeAttribute('data-calc-row');});reactData.calcCellHeightFlag++;}return $xeTable.$nextTick();},setRowHeight(rowOrId,height){const $xeTable=this;const reactData=$xeTable;const internalData=$xeTable;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=$xeTable.$refs.refTableBody;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 $xeTable.$nextTick();},getRowHeight(rowOrId){const $xeTable=this;const internalData=$xeTable;const{fullAllDataRowIdData}=internalData;const rowOpts=$xeTable.computeRowOpts;const cellOpts=$xeTable.computeCellOpts;const defaultRowHeight=$xeTable.computeDefaultRowHeight;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;},/**
|
|
8123
8160
|
* 刷新滚动操作,手动同步滚动相关位置(对于某些特殊的操作,比如滚动条错位、固定列不同步)
|
|
8124
8161
|
*/refreshScroll(){const $xeTable=this;const internalData=$xeTable;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=$xeTable.$refs.refScrollXHandleElem;const yHandleEl=$xeTable.$refs.refScrollYHandleElem;return new Promise(resolve=>{// 还原滚动条位置
|
|
8125
8162
|
if(lastScrollLeft||lastScrollTop){return restoreScrollLocation($xeTable,lastScrollLeft,lastScrollTop).then(()=>{// 存在滚动行为未结束情况
|
|
@@ -26459,7 +26496,40 @@ render_renderer.mixin({
|
|
|
26459
26496
|
renderTableEdit: nativeSelectEditRender,
|
|
26460
26497
|
renderTableDefault: nativeSelectEditRender,
|
|
26461
26498
|
renderTableCell(h, renderOpts, params) {
|
|
26462
|
-
|
|
26499
|
+
const {
|
|
26500
|
+
options,
|
|
26501
|
+
optionGroups
|
|
26502
|
+
} = renderOpts;
|
|
26503
|
+
const {
|
|
26504
|
+
$table,
|
|
26505
|
+
row,
|
|
26506
|
+
column
|
|
26507
|
+
} = params;
|
|
26508
|
+
const opSize = options ? options.length : null;
|
|
26509
|
+
const ogSize = optionGroups ? optionGroups.length : null;
|
|
26510
|
+
const {
|
|
26511
|
+
cellResult
|
|
26512
|
+
} = $table.effectCellData(row, column, {
|
|
26513
|
+
key: 'render_table_cell',
|
|
26514
|
+
isChanged({
|
|
26515
|
+
oldValue,
|
|
26516
|
+
cellValue
|
|
26517
|
+
}) {
|
|
26518
|
+
return oldValue && oldValue[0] === cellValue && oldValue[1] === opSize && oldValue[2] === ogSize;
|
|
26519
|
+
},
|
|
26520
|
+
setValue({
|
|
26521
|
+
cellValue
|
|
26522
|
+
}) {
|
|
26523
|
+
return [cellValue, opSize, ogSize];
|
|
26524
|
+
},
|
|
26525
|
+
getResult({
|
|
26526
|
+
cellValue
|
|
26527
|
+
}) {
|
|
26528
|
+
return handleSelectCellValue(cellValue, renderOpts);
|
|
26529
|
+
}
|
|
26530
|
+
});
|
|
26531
|
+
// const cellResult = getSelectCellValue(renderOpts, params)
|
|
26532
|
+
return getCellLabelVNs(h, renderOpts, params, cellResult);
|
|
26463
26533
|
},
|
|
26464
26534
|
renderTableFilter(h, renderOpts, params) {
|
|
26465
26535
|
const {
|
|
@@ -26596,20 +26666,28 @@ render_renderer.mixin({
|
|
|
26596
26666
|
tableAutoFocus: 'input',
|
|
26597
26667
|
renderTableEdit: defaultEditRender,
|
|
26598
26668
|
renderTableCell(h, renderOpts, params) {
|
|
26669
|
+
const props = renderOpts.props || {};
|
|
26599
26670
|
const {
|
|
26600
|
-
|
|
26601
|
-
} = renderOpts;
|
|
26602
|
-
const {
|
|
26671
|
+
$table,
|
|
26603
26672
|
row,
|
|
26604
26673
|
column
|
|
26605
26674
|
} = params;
|
|
26606
|
-
|
|
26607
|
-
|
|
26608
|
-
|
|
26609
|
-
|
|
26675
|
+
const {
|
|
26676
|
+
cellResult
|
|
26677
|
+
} = $table.effectCellData(row, column, {
|
|
26678
|
+
key: 'render_table_cell',
|
|
26679
|
+
getResult({
|
|
26680
|
+
cellValue
|
|
26681
|
+
}) {
|
|
26682
|
+
if (cellValue) {
|
|
26683
|
+
if (props.type !== 'time') {
|
|
26684
|
+
return getLabelFormatDate(cellValue, props);
|
|
26685
|
+
}
|
|
26686
|
+
}
|
|
26687
|
+
return cellValue;
|
|
26610
26688
|
}
|
|
26611
|
-
}
|
|
26612
|
-
return getCellLabelVNs(h, renderOpts, params,
|
|
26689
|
+
});
|
|
26690
|
+
return getCellLabelVNs(h, renderOpts, params, cellResult);
|
|
26613
26691
|
},
|
|
26614
26692
|
tableCellFormatter: handleFormatDatePicker,
|
|
26615
26693
|
renderTableDefault: defaultEditRender,
|
|
@@ -26667,6 +26745,46 @@ render_renderer.mixin({
|
|
|
26667
26745
|
}, seOs)
|
|
26668
26746
|
})];
|
|
26669
26747
|
},
|
|
26748
|
+
renderTableDefault(h, renderOpts, params) {
|
|
26749
|
+
const {
|
|
26750
|
+
startField,
|
|
26751
|
+
endField
|
|
26752
|
+
} = renderOpts;
|
|
26753
|
+
const {
|
|
26754
|
+
row,
|
|
26755
|
+
column
|
|
26756
|
+
} = params;
|
|
26757
|
+
const {
|
|
26758
|
+
model
|
|
26759
|
+
} = column;
|
|
26760
|
+
const cellValue = getCellValue(row, column);
|
|
26761
|
+
const seProps = {};
|
|
26762
|
+
const seOs = {};
|
|
26763
|
+
if (startField && endField) {
|
|
26764
|
+
seProps.startValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, startField);
|
|
26765
|
+
seProps.endValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, endField);
|
|
26766
|
+
seOs['update:startValue'] = value => {
|
|
26767
|
+
if (startField) {
|
|
26768
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(row, startField, value);
|
|
26769
|
+
}
|
|
26770
|
+
};
|
|
26771
|
+
seOs['update:endValue'] = value => {
|
|
26772
|
+
if (endField) {
|
|
26773
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(row, endField, value);
|
|
26774
|
+
}
|
|
26775
|
+
};
|
|
26776
|
+
}
|
|
26777
|
+
return [h(getDefaultComponent(renderOpts), {
|
|
26778
|
+
props: getCellEditProps(renderOpts, params, cellValue, seProps),
|
|
26779
|
+
on: getComponentOns(renderOpts, params, {
|
|
26780
|
+
model(cellValue) {
|
|
26781
|
+
model.update = true;
|
|
26782
|
+
model.value = cellValue;
|
|
26783
|
+
setCellValue(row, column, cellValue);
|
|
26784
|
+
}
|
|
26785
|
+
}, seOs)
|
|
26786
|
+
})];
|
|
26787
|
+
},
|
|
26670
26788
|
renderTableCell(h, renderOpts, params) {
|
|
26671
26789
|
const {
|
|
26672
26790
|
startField,
|
|
@@ -26703,6 +26821,7 @@ render_renderer.mixin({
|
|
|
26703
26821
|
},
|
|
26704
26822
|
VxeTextarea: {
|
|
26705
26823
|
tableAutoFocus: 'textarea',
|
|
26824
|
+
renderTableDefault: defaultEditRender,
|
|
26706
26825
|
renderTableEdit: defaultEditRender
|
|
26707
26826
|
},
|
|
26708
26827
|
VxeButton: {
|
|
@@ -26727,7 +26846,40 @@ render_renderer.mixin({
|
|
|
26727
26846
|
renderTableEdit: defaultSelectEditRender,
|
|
26728
26847
|
renderTableDefault: defaultSelectEditRender,
|
|
26729
26848
|
renderTableCell(h, renderOpts, params) {
|
|
26730
|
-
|
|
26849
|
+
const {
|
|
26850
|
+
options,
|
|
26851
|
+
optionGroups
|
|
26852
|
+
} = renderOpts;
|
|
26853
|
+
const {
|
|
26854
|
+
$table,
|
|
26855
|
+
row,
|
|
26856
|
+
column
|
|
26857
|
+
} = params;
|
|
26858
|
+
const opSize = options ? options.length : null;
|
|
26859
|
+
const ogSize = optionGroups ? optionGroups.length : null;
|
|
26860
|
+
const {
|
|
26861
|
+
cellResult
|
|
26862
|
+
} = $table.effectCellData(row, column, {
|
|
26863
|
+
key: 'render_table_cell',
|
|
26864
|
+
isChanged({
|
|
26865
|
+
oldValue,
|
|
26866
|
+
cellValue
|
|
26867
|
+
}) {
|
|
26868
|
+
return oldValue && oldValue[0] === cellValue && oldValue[1] === opSize && oldValue[2] === ogSize;
|
|
26869
|
+
},
|
|
26870
|
+
setValue({
|
|
26871
|
+
cellValue
|
|
26872
|
+
}) {
|
|
26873
|
+
return [cellValue, opSize, ogSize];
|
|
26874
|
+
},
|
|
26875
|
+
getResult({
|
|
26876
|
+
cellValue
|
|
26877
|
+
}) {
|
|
26878
|
+
return handleSelectCellValue(cellValue, renderOpts);
|
|
26879
|
+
}
|
|
26880
|
+
});
|
|
26881
|
+
// const cellResult = getSelectCellValue(renderOpts, params)
|
|
26882
|
+
return getCellLabelVNs(h, renderOpts, params, cellResult);
|
|
26731
26883
|
},
|
|
26732
26884
|
createTableFilterOptions: defaultFilterOptions,
|
|
26733
26885
|
renderTableFilter(h, renderOpts, params) {
|
|
@@ -26836,7 +26988,40 @@ render_renderer.mixin({
|
|
|
26836
26988
|
},
|
|
26837
26989
|
FormatSelect: {
|
|
26838
26990
|
renderTableDefault(h, renderOpts, params) {
|
|
26839
|
-
|
|
26991
|
+
const {
|
|
26992
|
+
options,
|
|
26993
|
+
optionGroups
|
|
26994
|
+
} = renderOpts;
|
|
26995
|
+
const {
|
|
26996
|
+
$table,
|
|
26997
|
+
row,
|
|
26998
|
+
column
|
|
26999
|
+
} = params;
|
|
27000
|
+
const opSize = options ? options.length : null;
|
|
27001
|
+
const ogSize = optionGroups ? optionGroups.length : null;
|
|
27002
|
+
const {
|
|
27003
|
+
cellResult
|
|
27004
|
+
} = $table.effectCellData(row, column, {
|
|
27005
|
+
key: 'render_table_cell',
|
|
27006
|
+
isChanged({
|
|
27007
|
+
oldValue,
|
|
27008
|
+
cellValue
|
|
27009
|
+
}) {
|
|
27010
|
+
return oldValue && oldValue[0] === cellValue && oldValue[1] === opSize && oldValue[2] === ogSize;
|
|
27011
|
+
},
|
|
27012
|
+
setValue({
|
|
27013
|
+
cellValue
|
|
27014
|
+
}) {
|
|
27015
|
+
return [cellValue, opSize, ogSize];
|
|
27016
|
+
},
|
|
27017
|
+
getResult({
|
|
27018
|
+
cellValue
|
|
27019
|
+
}) {
|
|
27020
|
+
return handleSelectCellValue(cellValue, renderOpts);
|
|
27021
|
+
}
|
|
27022
|
+
});
|
|
27023
|
+
// const cellResult = getSelectCellValue(renderOpts, params)
|
|
27024
|
+
return getCellLabelVNs(h, renderOpts, params, cellResult);
|
|
26840
27025
|
},
|
|
26841
27026
|
tableCellFormatter: handleFormatSelect,
|
|
26842
27027
|
tableCellCopyMethod: handleFormatSelect,
|
|
@@ -26848,18 +27033,40 @@ render_renderer.mixin({
|
|
|
26848
27033
|
tableAutoFocus: 'input',
|
|
26849
27034
|
renderTableEdit: defaultTableOrTreeSelectEditRender,
|
|
26850
27035
|
renderTableCell(h, renderOpts, params) {
|
|
26851
|
-
|
|
26852
|
-
|
|
26853
|
-
|
|
26854
|
-
|
|
26855
|
-
|
|
26856
|
-
|
|
26857
|
-
|
|
26858
|
-
|
|
26859
|
-
|
|
26860
|
-
|
|
26861
|
-
|
|
26862
|
-
|
|
27036
|
+
const {
|
|
27037
|
+
options,
|
|
27038
|
+
optionGroups
|
|
27039
|
+
} = renderOpts;
|
|
27040
|
+
const {
|
|
27041
|
+
$table,
|
|
27042
|
+
row,
|
|
27043
|
+
column
|
|
27044
|
+
} = params;
|
|
27045
|
+
const opSize = options ? options.length : null;
|
|
27046
|
+
const ogSize = optionGroups ? optionGroups.length : null;
|
|
27047
|
+
const {
|
|
27048
|
+
cellResult
|
|
27049
|
+
} = $table.effectCellData(row, column, {
|
|
27050
|
+
key: 'render_table_cell',
|
|
27051
|
+
isChanged({
|
|
27052
|
+
oldValue,
|
|
27053
|
+
cellValue
|
|
27054
|
+
}) {
|
|
27055
|
+
return oldValue && oldValue[0] === cellValue && oldValue[1] === opSize && oldValue[2] === ogSize;
|
|
27056
|
+
},
|
|
27057
|
+
setValue({
|
|
27058
|
+
cellValue
|
|
27059
|
+
}) {
|
|
27060
|
+
return [cellValue, opSize, ogSize];
|
|
27061
|
+
},
|
|
27062
|
+
getResult({
|
|
27063
|
+
cellValue
|
|
27064
|
+
}) {
|
|
27065
|
+
return handleTreeSelectCellValue(cellValue, renderOpts);
|
|
27066
|
+
}
|
|
27067
|
+
});
|
|
27068
|
+
// const cellResult = getTreeSelectCellValue(renderOpts, params)
|
|
27069
|
+
return getCellLabelVNs(h, renderOpts, params, cellResult);
|
|
26863
27070
|
},
|
|
26864
27071
|
tableCellFormatter: handleFormatTreeSelect,
|
|
26865
27072
|
tableCellCopyMethod: handleFormatTreeSelect,
|
|
@@ -26877,7 +27084,84 @@ render_renderer.mixin({
|
|
|
26877
27084
|
},
|
|
26878
27085
|
FormatTreeSelect: {
|
|
26879
27086
|
renderTableDefault(h, renderOpts, params) {
|
|
26880
|
-
|
|
27087
|
+
const {
|
|
27088
|
+
options,
|
|
27089
|
+
optionGroups
|
|
27090
|
+
} = renderOpts;
|
|
27091
|
+
const {
|
|
27092
|
+
$table,
|
|
27093
|
+
row,
|
|
27094
|
+
column
|
|
27095
|
+
} = params;
|
|
27096
|
+
const opSize = options ? options.length : null;
|
|
27097
|
+
const ogSize = optionGroups ? optionGroups.length : null;
|
|
27098
|
+
const {
|
|
27099
|
+
cellResult
|
|
27100
|
+
} = $table.effectCellData(row, column, {
|
|
27101
|
+
key: 'render_table_cell',
|
|
27102
|
+
isChanged({
|
|
27103
|
+
oldValue,
|
|
27104
|
+
cellValue
|
|
27105
|
+
}) {
|
|
27106
|
+
return oldValue && oldValue[0] === cellValue && oldValue[1] === opSize && oldValue[2] === ogSize;
|
|
27107
|
+
},
|
|
27108
|
+
setValue({
|
|
27109
|
+
cellValue
|
|
27110
|
+
}) {
|
|
27111
|
+
return [cellValue, opSize, ogSize];
|
|
27112
|
+
},
|
|
27113
|
+
getResult({
|
|
27114
|
+
cellValue
|
|
27115
|
+
}) {
|
|
27116
|
+
return handleTreeSelectCellValue(cellValue, renderOpts);
|
|
27117
|
+
}
|
|
27118
|
+
});
|
|
27119
|
+
// const cellResult = getTreeSelectCellValue(renderOpts, params)
|
|
27120
|
+
return getCellLabelVNs(h, renderOpts, params, cellResult);
|
|
27121
|
+
},
|
|
27122
|
+
tableCellFormatter: handleFormatTreeSelect,
|
|
27123
|
+
tableCellCopyMethod: handleFormatTreeSelect,
|
|
27124
|
+
tableCellPasteMethod: handleSetTreeSelectValue,
|
|
27125
|
+
tableExportMethod: handleExportTreeSelectMethod
|
|
27126
|
+
},
|
|
27127
|
+
VxeTableSelect: {
|
|
27128
|
+
tableAutoFocus: 'input',
|
|
27129
|
+
renderTableEdit: defaultTableOrTreeSelectEditRender,
|
|
27130
|
+
renderTableCell(h, renderOpts, params) {
|
|
27131
|
+
const {
|
|
27132
|
+
options,
|
|
27133
|
+
optionGroups
|
|
27134
|
+
} = renderOpts;
|
|
27135
|
+
const {
|
|
27136
|
+
$table,
|
|
27137
|
+
row,
|
|
27138
|
+
column
|
|
27139
|
+
} = params;
|
|
27140
|
+
const opSize = options ? options.length : null;
|
|
27141
|
+
const ogSize = optionGroups ? optionGroups.length : null;
|
|
27142
|
+
const {
|
|
27143
|
+
cellResult
|
|
27144
|
+
} = $table.effectCellData(row, column, {
|
|
27145
|
+
key: 'render_table_cell',
|
|
27146
|
+
isChanged({
|
|
27147
|
+
oldValue,
|
|
27148
|
+
cellValue
|
|
27149
|
+
}) {
|
|
27150
|
+
return oldValue && oldValue[0] === cellValue && oldValue[1] === opSize && oldValue[2] === ogSize;
|
|
27151
|
+
},
|
|
27152
|
+
setValue({
|
|
27153
|
+
cellValue
|
|
27154
|
+
}) {
|
|
27155
|
+
return [cellValue, opSize, ogSize];
|
|
27156
|
+
},
|
|
27157
|
+
getResult({
|
|
27158
|
+
cellValue
|
|
27159
|
+
}) {
|
|
27160
|
+
return handleTreeSelectCellValue(cellValue, renderOpts);
|
|
27161
|
+
}
|
|
27162
|
+
});
|
|
27163
|
+
// const cellResult = getTreeSelectCellValue(renderOpts, params)
|
|
27164
|
+
return getCellLabelVNs(h, renderOpts, params, cellResult);
|
|
26881
27165
|
},
|
|
26882
27166
|
tableCellFormatter: handleFormatTreeSelect,
|
|
26883
27167
|
tableCellCopyMethod: handleFormatTreeSelect,
|