vxe-table 4.16.0-beta.2 → 4.16.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/style.css +1 -1
- package/es/table/module/custom/hook.js +10 -3
- package/es/table/module/custom/panel.js +139 -126
- package/es/table/module/keyboard/hook.js +2 -2
- package/es/table/src/table.js +50 -13
- package/es/table/src/util.js +1 -0
- package/es/toolbar/src/toolbar.js +26 -24
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/index.umd.js +81 -46
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/module/custom/hook.js +12 -3
- package/lib/table/module/custom/hook.min.js +1 -1
- package/lib/table/module/custom/panel.js +23 -9
- package/lib/table/module/custom/panel.min.js +1 -1
- package/lib/table/module/keyboard/hook.js +2 -2
- package/lib/table/module/keyboard/hook.min.js +1 -1
- package/lib/table/src/table.js +15 -13
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +1 -0
- package/lib/table/src/util.min.js +1 -1
- package/lib/toolbar/src/toolbar.js +27 -17
- package/lib/toolbar/src/toolbar.min.js +1 -1
- package/lib/ui/index.js +1 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/package.json +1 -1
- package/packages/table/module/custom/hook.ts +10 -3
- package/packages/table/module/custom/panel.ts +150 -135
- package/packages/table/module/keyboard/hook.ts +2 -2
- package/packages/table/src/table.ts +50 -13
- package/packages/table/src/util.ts +2 -0
- package/packages/toolbar/src/toolbar.ts +27 -25
- /package/es/{iconfont.1755245648660.ttf → iconfont.1755566168906.ttf} +0 -0
- /package/es/{iconfont.1755245648660.woff → iconfont.1755566168906.woff} +0 -0
- /package/es/{iconfont.1755245648660.woff2 → iconfont.1755566168906.woff2} +0 -0
- /package/lib/{iconfont.1755245648660.ttf → iconfont.1755566168906.ttf} +0 -0
- /package/lib/{iconfont.1755245648660.woff → iconfont.1755566168906.woff} +0 -0
- /package/lib/{iconfont.1755245648660.woff2 → iconfont.1755566168906.woff2} +0 -0
package/lib/index.umd.js
CHANGED
|
@@ -3138,7 +3138,7 @@ function eqEmptyValue(cellValue) {
|
|
|
3138
3138
|
;// ./packages/ui/index.ts
|
|
3139
3139
|
|
|
3140
3140
|
|
|
3141
|
-
const version = "4.16.0-beta.
|
|
3141
|
+
const version = "4.16.0-beta.4";
|
|
3142
3142
|
core_.VxeUI.version = version;
|
|
3143
3143
|
core_.VxeUI.tableVersion = version;
|
|
3144
3144
|
core_.VxeUI.setConfig({
|
|
@@ -3639,7 +3639,7 @@ var esnext_iterator_some = __webpack_require__(7550);
|
|
|
3639
3639
|
const {
|
|
3640
3640
|
log: log_log
|
|
3641
3641
|
} = core_.VxeUI;
|
|
3642
|
-
const log_version = `table v${"4.16.0-beta.
|
|
3642
|
+
const log_version = `table v${"4.16.0-beta.4"}`;
|
|
3643
3643
|
const warnLog = log_log.create('warn', log_version);
|
|
3644
3644
|
const errLog = log_log.create('error', log_version);
|
|
3645
3645
|
;// ./packages/table/src/columnInfo.ts
|
|
@@ -4159,6 +4159,7 @@ function createInternalData() {
|
|
|
4159
4159
|
tBodyHeight: 0,
|
|
4160
4160
|
// 表尾高度
|
|
4161
4161
|
tFooterHeight: 0,
|
|
4162
|
+
teleportToWrapperElem: null,
|
|
4162
4163
|
inited: false,
|
|
4163
4164
|
tooltipTimeout: null,
|
|
4164
4165
|
initStatus: false,
|
|
@@ -8855,6 +8856,16 @@ const {
|
|
|
8855
8856
|
getIcon: panel_getIcon,
|
|
8856
8857
|
renderEmptyElement: panel_renderEmptyElement
|
|
8857
8858
|
} = core_.VxeUI;
|
|
8859
|
+
function panel_createInternalData() {
|
|
8860
|
+
return {
|
|
8861
|
+
// teleportTo: undefined,
|
|
8862
|
+
// prevDragCol: undefined,
|
|
8863
|
+
// prevDragGroupField: undefined,
|
|
8864
|
+
// prevDragAggFnColid: undefined,
|
|
8865
|
+
// prevDragToChild: false,
|
|
8866
|
+
// prevDragPos: null
|
|
8867
|
+
};
|
|
8868
|
+
}
|
|
8858
8869
|
/* harmony default export */ var panel = (defineVxeComponent({
|
|
8859
8870
|
name: 'TableCustomPanel',
|
|
8860
8871
|
props: {
|
|
@@ -8894,13 +8905,7 @@ const {
|
|
|
8894
8905
|
dragAggFnCol: null,
|
|
8895
8906
|
dragTipText: ''
|
|
8896
8907
|
});
|
|
8897
|
-
|
|
8898
|
-
// prevDragCol: undefined,
|
|
8899
|
-
// prevDragGroupField: undefined,
|
|
8900
|
-
// prevDragAggFnColid: undefined,
|
|
8901
|
-
// prevDragToChild: false,
|
|
8902
|
-
// prevDragPos: null
|
|
8903
|
-
};
|
|
8908
|
+
let customPanelInternalData = panel_createInternalData();
|
|
8904
8909
|
const refMaps = {
|
|
8905
8910
|
refElem,
|
|
8906
8911
|
refBodyWrapperElem,
|
|
@@ -9466,6 +9471,9 @@ const {
|
|
|
9466
9471
|
isCustomStatus,
|
|
9467
9472
|
customColumnList
|
|
9468
9473
|
} = tableReactData;
|
|
9474
|
+
const {
|
|
9475
|
+
teleportToWrapperElem
|
|
9476
|
+
} = tableInternalData;
|
|
9469
9477
|
const customOpts = computeCustomOpts.value;
|
|
9470
9478
|
const {
|
|
9471
9479
|
immediate
|
|
@@ -9599,7 +9607,10 @@ const {
|
|
|
9599
9607
|
}) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)()]) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)()]));
|
|
9600
9608
|
}
|
|
9601
9609
|
});
|
|
9602
|
-
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(
|
|
9610
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(external_commonjs_vue_commonjs2_vue_root_Vue_.Teleport, {
|
|
9611
|
+
to: teleportToWrapperElem,
|
|
9612
|
+
disabled: !($xeGantt && teleportToWrapperElem)
|
|
9613
|
+
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
9603
9614
|
ref: refElem,
|
|
9604
9615
|
key: 'simple',
|
|
9605
9616
|
class: ['vxe-table-custom-wrapper', `placement--${placement}`, {
|
|
@@ -9672,7 +9683,7 @@ const {
|
|
|
9672
9683
|
status: 'primary',
|
|
9673
9684
|
content: customOpts.confirmButtonText || panel_getI18n('vxe.table.customConfirm'),
|
|
9674
9685
|
onClick: confirmCustomEvent
|
|
9675
|
-
}) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)()])]) : null]), renderDragTip()])] : []);
|
|
9686
|
+
}) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)()])]) : null]), renderDragTip()])] : [])]);
|
|
9676
9687
|
};
|
|
9677
9688
|
const renderPopupPanel = () => {
|
|
9678
9689
|
const $xeGrid = $xeTable.xeGrid;
|
|
@@ -10017,6 +10028,9 @@ const {
|
|
|
10017
10028
|
getComputeMaps: () => computeMaps,
|
|
10018
10029
|
renderVN
|
|
10019
10030
|
};
|
|
10031
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.onUnmounted)(() => {
|
|
10032
|
+
customPanelInternalData = panel_createInternalData();
|
|
10033
|
+
});
|
|
10020
10034
|
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.provide)('$xeTableCustomPanel', $xeTableCustomPanel);
|
|
10021
10035
|
return $xeTableCustomPanel;
|
|
10022
10036
|
},
|
|
@@ -15444,8 +15458,8 @@ keyboard_hook_hooks.add('tableKeyboardModule', {
|
|
|
15444
15458
|
const checkboxOpts = computeCheckboxOpts.value;
|
|
15445
15459
|
const mouseOpts = computeMouseOpts.value;
|
|
15446
15460
|
const editOpts = computeEditOpts.value;
|
|
15447
|
-
if (mouseConfig && mouseOpts.area && $xeTable.
|
|
15448
|
-
return $xeTable.
|
|
15461
|
+
if (mouseConfig && mouseOpts.area && $xeTable.triggerCellAreaModnEvent) {
|
|
15462
|
+
return $xeTable.triggerCellAreaModnEvent(evnt, params);
|
|
15449
15463
|
} else {
|
|
15450
15464
|
if (checkboxConfig && checkboxOpts.range) {
|
|
15451
15465
|
handleCheckboxRangeEvent(evnt, params);
|
|
@@ -16422,11 +16436,20 @@ core_.VxeUI.hooks.add('tableCustomModule', {
|
|
|
16422
16436
|
const {
|
|
16423
16437
|
customStore
|
|
16424
16438
|
} = reactData;
|
|
16425
|
-
|
|
16439
|
+
let wrapperEl = refElem.value;
|
|
16426
16440
|
// 判断面板不能大于表格高度
|
|
16427
16441
|
let tableHeight = 0;
|
|
16428
|
-
if (
|
|
16429
|
-
|
|
16442
|
+
if ($xeGantt) {
|
|
16443
|
+
const {
|
|
16444
|
+
refGanttContainerElem
|
|
16445
|
+
} = $xeGantt.getRefMaps();
|
|
16446
|
+
const ganttContainerElem = refGanttContainerElem.value;
|
|
16447
|
+
if (ganttContainerElem) {
|
|
16448
|
+
wrapperEl = ganttContainerElem;
|
|
16449
|
+
}
|
|
16450
|
+
}
|
|
16451
|
+
if (wrapperEl) {
|
|
16452
|
+
tableHeight = wrapperEl.clientHeight - 28;
|
|
16430
16453
|
}
|
|
16431
16454
|
customStore.maxHeight = Math.max(88, tableHeight);
|
|
16432
16455
|
};
|
|
@@ -18287,7 +18310,7 @@ if(scrollXLoad||scrollYLoad||isAllOverflow){if(expandColumn&&expandOpts.mode!=='
|
|
|
18287
18310
|
tableElem.style.paddingRight=osbWidth&&fixedType&&(browseObj.firefox||browseObj.safari)?`${osbWidth}px`:'';}const emptyBlockElem=getRefElem(elemStore[`${name}-${layout}-emptyBlock`]);if(emptyBlockElem){emptyBlockElem.style.width=tWidth?`${tWidth}px`:'';}}else if(layout==='footer'){let renderColumnList=tableColumn;let isOptimizeMode=false;// 如果是使用优化模式
|
|
18288
18311
|
if(scrollXLoad&&allColumnFooterOverflow){if(spanMethod||footerSpanMethod){// 如果不支持优化模式
|
|
18289
18312
|
}else{isOptimizeMode=true;}}if(!isOptimizeMode||!isColLoading&&(fixedType||!overflowX)){renderColumnList=visibleColumn;}if(fixedType){if(isOptimizeMode){renderColumnList=fixedColumn||[];}}const tWidth=renderColumnList.reduce((previous,column)=>previous+column.renderWidth,0);if(fixedType){if(isOptimizeMode){if(wrapperElem){wrapperElem.style.width=tWidth?`${tWidth}px`:'';}}else{if(wrapperElem){wrapperElem.style.width=scrollXWidth?`${scrollXWidth}px`:'';}}}if(currScrollElem){currScrollElem.style.height=`${tFooterHeight}px`;// 如果是固定列
|
|
18290
|
-
if(fixedWrapperElem){if(wrapperElem){wrapperElem.style.top=`${customHeight>0?customHeight-tFooterHeight-osbHeight:tableHeight+tHeaderHeight}px`;}}}if(tableElem){tableElem.style.width=tWidth?`${tWidth}px`:'';}}});});if(currentRow){$xeTable.setCurrentRow(currentRow);}if(mouseConfig&&mouseOpts.selected&&editStore.selected.row&&editStore.selected.column){$xeTable.addCellSelectedClass();}if($xeGanttView){$xeGanttView.handleUpdateStyle();}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();};const checkValidate=type=>{if($xeTable.triggerValidate){return $xeTable.triggerValidate(type);}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();};/**
|
|
18313
|
+
if(fixedWrapperElem){if(wrapperElem){wrapperElem.style.top=`${customHeight>0?customHeight-tFooterHeight-osbHeight:tableHeight+tHeaderHeight}px`;}}}if(tableElem){tableElem.style.width=tWidth?`${tWidth}px`:'';}}});});if(currentRow){$xeTable.setCurrentRow(currentRow);}if(mouseConfig&&mouseOpts.selected&&editStore.selected.row&&editStore.selected.column){$xeTable.addCellSelectedClass();}if($xeGanttView&&$xeGanttView.handleUpdateStyle){$xeGanttView.handleUpdateStyle();}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();};const checkValidate=type=>{if($xeTable.triggerValidate){return $xeTable.triggerValidate(type);}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();};/**
|
|
18291
18314
|
* 当单元格发生改变时
|
|
18292
18315
|
* 如果存在规则,则校验
|
|
18293
18316
|
*/const handleChangeCell=(evnt,params)=>{checkValidate('blur').catch(e=>e).then(()=>{$xeTable.handleEdit(params,evnt).then(()=>checkValidate('change')).catch(e=>e);});};const handleDefaultSort=()=>{const{sortConfig}=props;if(sortConfig){const sortOpts=computeSortOpts.value;let{defaultSort}=sortOpts;if(defaultSort){if(!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(defaultSort)){defaultSort=[defaultSort];}if(defaultSort.length){(sortConfig.multiple?defaultSort:defaultSort.slice(0,1)).forEach((item,index)=>{const{field,order}=item;if(field&&order){const column=$xeTable.getColumnByField(field);if(column&&column.sortable){column.order=order;column.sortTime=Date.now()+index;}}});if(!sortOpts.remote){$xeTable.handleTableData(true).then(updateStyle);}}}}};/**
|
|
@@ -18346,7 +18369,7 @@ const computeScrollLoad=()=>{return (0,external_commonjs_vue_commonjs2_vue_root_
|
|
|
18346
18369
|
if(scrollXLoad){const{toVisibleIndex:toXVisibleIndex,visibleSize:visibleXSize}=handleVirtualXVisible();const offsetXSize=Math.max(0,virtualXOpts.oSize?external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(virtualXOpts.oSize):0);scrollXStore.preloadSize=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(virtualXOpts.preSize);scrollXStore.offsetSize=offsetXSize;scrollXStore.visibleSize=visibleXSize;scrollXStore.endIndex=Math.max(scrollXStore.startIndex+scrollXStore.visibleSize+offsetXSize,scrollXStore.endIndex);scrollXStore.visibleStartIndex=Math.max(scrollXStore.startIndex,toXVisibleIndex);scrollXStore.visibleEndIndex=Math.min(scrollXStore.endIndex,toXVisibleIndex+visibleXSize);$xeTable.updateScrollXData().then(()=>{loadScrollXData();});}else{$xeTable.updateScrollXSpace();}// 计算 Y 逻辑
|
|
18347
18370
|
const rowHeight=computeRowHeight();scrollYStore.rowHeight=rowHeight;// 已废弃
|
|
18348
18371
|
reactData.rowHeight=rowHeight;const{toVisibleIndex:toYVisibleIndex,visibleSize:visibleYSize}=handleVirtualYVisible();if(scrollYLoad){const offsetYSize=Math.max(0,virtualYOpts.oSize?external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(virtualYOpts.oSize):0);scrollYStore.preloadSize=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(virtualYOpts.preSize);scrollYStore.offsetSize=offsetYSize;scrollYStore.visibleSize=visibleYSize;scrollYStore.endIndex=Math.max(scrollYStore.startIndex+visibleYSize+offsetYSize,scrollYStore.endIndex);scrollYStore.visibleStartIndex=Math.max(scrollYStore.startIndex,toYVisibleIndex);scrollYStore.visibleEndIndex=Math.min(scrollYStore.endIndex,toYVisibleIndex+visibleYSize);$xeTable.updateScrollYData().then(()=>{loadScrollYData();});}else{$xeTable.updateScrollYSpace();}});};const calcScrollbar=()=>{const{scrollXWidth,scrollYHeight}=reactData;const{elemStore}=internalData;const scrollbarOpts=computeScrollbarOpts.value;const bodyWrapperElem=getRefElem(elemStore['main-body-wrapper']);const headerTableElem=getRefElem(elemStore['main-header-table']);const footerTableElem=getRefElem(elemStore['main-footer-table']);const xHandleEl=refScrollXHandleElem.value;const yHandleEl=refScrollYHandleElem.value;let overflowY=false;let overflowX=false;if(bodyWrapperElem){overflowY=scrollYHeight>bodyWrapperElem.clientHeight;if(yHandleEl){reactData.scrollbarWidth=scrollbarOpts.width||yHandleEl.offsetWidth-yHandleEl.clientWidth||14;}reactData.overflowY=overflowY;overflowX=scrollXWidth>bodyWrapperElem.clientWidth;if(xHandleEl){reactData.scrollbarHeight=scrollbarOpts.height||xHandleEl.offsetHeight-xHandleEl.clientHeight||14;}const hHeight=headerTableElem?headerTableElem.clientHeight:0;const fHeight=footerTableElem?footerTableElem.clientHeight:0;internalData.tableHeight=bodyWrapperElem.offsetHeight;internalData.tHeaderHeight=hHeight;internalData.tFooterHeight=fHeight;reactData.overflowX=overflowX;reactData.parentHeight=Math.max(hHeight+fHeight+20,$xeTable.getParentHeight());}if(overflowX){$xeTable.checkScrolling();}};const handleRecalculateStyle=(reFull,reWidth,reHeight)=>{const el=refElem.value;internalData.rceRunTime=Date.now();if(!el||!el.clientWidth){return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();}const varEl=refVarElem.value;if(varEl){const[defEl,mediumEl,smallEl,miniEl]=varEl.children;calcVarRowHeightConfig('default',defEl);calcVarRowHeightConfig('medium',mediumEl);calcVarRowHeightConfig('small',smallEl);calcVarRowHeightConfig('mini',miniEl);}if(reWidth){calcCellWidth();}if(reFull){autoCellWidth();}calcScrollbar();updateStyle();updateRowExpandStyle();return computeScrollLoad().then(()=>{// 初始化时需要在列计算之后再执行优化运算,达到最优显示效果
|
|
18349
|
-
if(reWidth){calcCellWidth();}if(reFull){autoCellWidth();}if(reHeight){calcCellHeight();}updateStyle();calcScrollbar();if(reFull){updateRowOffsetTop();}updateRowExpandStyle();if(reFull){return computeScrollLoad();}});};const handleLazyRecalculate=(reFull,reWidth,reHeight)=>{return new Promise(resolve=>{const $xeGanttView=internalData.xeGanttView;const{rceTimeout,rceRunTime}=internalData;const resizeOpts=computeResizeOpts.value;const refreshDelay=resizeOpts.refreshDelay||20;const el=refElem.value;if(el&&el.clientWidth){autoCellWidth();updateRowExpandStyle();}if(rceTimeout){clearTimeout(rceTimeout);if(rceRunTime&&rceRunTime+(refreshDelay-5)<Date.now()){resolve(handleRecalculateStyle(reFull,reWidth,reHeight));}else{(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(()=>{resolve();});}}else{resolve(handleRecalculateStyle(reFull,reWidth,reHeight));}if($xeGanttView){$xeGanttView.handleLazyRecalculate();}internalData.rceTimeout=setTimeout(()=>{internalData.rceTimeout=undefined;handleRecalculateStyle(reFull,reWidth,reHeight);},refreshDelay);});};const handleResizeEvent=()=>{handleLazyRecalculate(true,true,true);};const handleUpdateAggValues=()=>{const{visibleColumn}=internalData;const aggCols=[];visibleColumn.forEach(column=>{if(column.aggFunc){aggCols.push(column);}});reactData.aggHandleAggColumns=aggCols;};const handleUpdateRowGroup=groupFields=>{const aggGroupFields=[];const aggGroupConfs=[];if(groupFields){(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(groupFields)?groupFields:[groupFields]).forEach(field=>{aggGroupFields.push(field);aggGroupConfs.push({field});});}reactData.rowGroupList=aggGroupConfs;reactData.aggHandleFields=aggGroupFields;handleUpdateAggValues();};const handleeGroupSummary=aggList=>{const aggregateOpts=computeAggregateOpts.value;const{mapChildrenField}=aggregateOpts;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.handlePivotTableAggregateData){$xeTable.handlePivotTableAggregateData(aggList);}}};const updateGroupData=()=>{const{aggregateConfig,rowGroupConfig}=props;const{isRowGroupStatus}=reactData;const{tableFullGroupData}=internalData;const aggregateOpts=computeAggregateOpts.value;const{mapChildrenField}=aggregateOpts;if((aggregateConfig||rowGroupConfig)&&isRowGroupStatus){const aggList=[];external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(tableFullGroupData,row=>{if(row.isAggregate){aggList.push(row);}},{children:mapChildrenField});handleeGroupSummary(aggList);}};const handleGroupData=(list,rowGroups)=>{let fullData=list;let treeData=list;if(rowGroups){const aggregateOpts=computeAggregateOpts.value;const{rowField,parentField,childrenField,mapChildrenField}=aggregateOpts;const checkboxOpts=computeCheckboxOpts.value;const{checkField}=checkboxOpts;const indeterminateField=checkboxOpts.indeterminateField||checkboxOpts.halfField;const rgItem=rowGroups[0];if(rgItem&&rowField&&parentField&&childrenField&&mapChildrenField){fullData=[];treeData=[];const groupField=rgItem.field;const groupColumn=$xeTable.getColumnByField(groupField);const groupMaps={};const aggList=[];const rowkey=getRowkey($xeTable);list.forEach(row=>{const cellValue=groupColumn?$xeTable.getCellLabel(row,groupColumn):external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row,groupField);const groupValue=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(cellValue)?'':cellValue;let childList=groupMaps[groupValue];if(!childList){childList=[];groupMaps[groupValue]=childList;}if(row.isAggregate){row.isAggregate=undefined;}childList.push(row);});external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().objectEach(groupMaps,(childList,groupValue)=>{const{fullData:childFullData,treeData:childTreeData}=handleGroupData(childList,rowGroups.slice(1));const aggRow={isAggregate:true,aggData:{},groupContent:groupValue,groupField,childCount:0,[rowField]:getRowUniqueId(),[parentField]:null,[rowkey]:getRowUniqueId(),[childrenField]:childTreeData,[mapChildrenField]:childTreeData};if(checkField){aggRow[checkField]=false;}if(indeterminateField){aggRow[indeterminateField]=false;}aggList.push(aggRow);treeData.push(aggRow);fullData.push(aggRow);if(childFullData.length){fullData.push(...childFullData);}});handleeGroupSummary(aggList);}}return{treeData,fullData};};/**
|
|
18372
|
+
if(reWidth){calcCellWidth();}if(reFull){autoCellWidth();}if(reHeight){calcCellHeight();}updateStyle();calcScrollbar();if(reFull){updateRowOffsetTop();}updateRowExpandStyle();if(reFull){return computeScrollLoad();}});};const handleLazyRecalculate=(reFull,reWidth,reHeight)=>{return new Promise(resolve=>{const $xeGanttView=internalData.xeGanttView;const{rceTimeout,rceRunTime}=internalData;const resizeOpts=computeResizeOpts.value;const refreshDelay=resizeOpts.refreshDelay||20;const el=refElem.value;if(el&&el.clientWidth){autoCellWidth();updateRowExpandStyle();}if(rceTimeout){clearTimeout(rceTimeout);if(rceRunTime&&rceRunTime+(refreshDelay-5)<Date.now()){resolve(handleRecalculateStyle(reFull,reWidth,reHeight));}else{(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(()=>{resolve();});}}else{resolve(handleRecalculateStyle(reFull,reWidth,reHeight));}if($xeGanttView&&$xeGanttView.handleLazyRecalculate){$xeGanttView.handleLazyRecalculate();}internalData.rceTimeout=setTimeout(()=>{internalData.rceTimeout=undefined;handleRecalculateStyle(reFull,reWidth,reHeight);},refreshDelay);});};const handleResizeEvent=()=>{handleLazyRecalculate(true,true,true);};const handleUpdateAggValues=()=>{const{visibleColumn}=internalData;const aggCols=[];visibleColumn.forEach(column=>{if(column.aggFunc){aggCols.push(column);}});reactData.aggHandleAggColumns=aggCols;};const handleUpdateRowGroup=groupFields=>{const aggGroupFields=[];const aggGroupConfs=[];if(groupFields){(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(groupFields)?groupFields:[groupFields]).forEach(field=>{aggGroupFields.push(field);aggGroupConfs.push({field});});}reactData.rowGroupList=aggGroupConfs;reactData.aggHandleFields=aggGroupFields;handleUpdateAggValues();};const handleeGroupSummary=aggList=>{const aggregateOpts=computeAggregateOpts.value;const{mapChildrenField}=aggregateOpts;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.handlePivotTableAggregateData){$xeTable.handlePivotTableAggregateData(aggList);}}};const updateGroupData=()=>{const{aggregateConfig,rowGroupConfig}=props;const{isRowGroupStatus}=reactData;const{tableFullGroupData}=internalData;const aggregateOpts=computeAggregateOpts.value;const{mapChildrenField}=aggregateOpts;if((aggregateConfig||rowGroupConfig)&&isRowGroupStatus){const aggList=[];external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(tableFullGroupData,row=>{if(row.isAggregate){aggList.push(row);}},{children:mapChildrenField});handleeGroupSummary(aggList);}};const handleGroupData=(list,rowGroups)=>{let fullData=list;let treeData=list;if(rowGroups){const aggregateOpts=computeAggregateOpts.value;const{rowField,parentField,childrenField,mapChildrenField}=aggregateOpts;const checkboxOpts=computeCheckboxOpts.value;const{checkField}=checkboxOpts;const indeterminateField=checkboxOpts.indeterminateField||checkboxOpts.halfField;const rgItem=rowGroups[0];if(rgItem&&rowField&&parentField&&childrenField&&mapChildrenField){fullData=[];treeData=[];const groupField=rgItem.field;const groupColumn=$xeTable.getColumnByField(groupField);const groupMaps={};const aggList=[];const rowkey=getRowkey($xeTable);list.forEach(row=>{const cellValue=groupColumn?$xeTable.getCellLabel(row,groupColumn):external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row,groupField);const groupValue=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(cellValue)?'':cellValue;let childList=groupMaps[groupValue];if(!childList){childList=[];groupMaps[groupValue]=childList;}if(row.isAggregate){row.isAggregate=undefined;}childList.push(row);});external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().objectEach(groupMaps,(childList,groupValue)=>{const{fullData:childFullData,treeData:childTreeData}=handleGroupData(childList,rowGroups.slice(1));const aggRow={isAggregate:true,aggData:{},groupContent:groupValue,groupField,childCount:0,[rowField]:getRowUniqueId(),[parentField]:null,[rowkey]:getRowUniqueId(),[childrenField]:childTreeData,[mapChildrenField]:childTreeData};if(checkField){aggRow[checkField]=false;}if(indeterminateField){aggRow[indeterminateField]=false;}aggList.push(aggRow);treeData.push(aggRow);fullData.push(aggRow);if(childFullData.length){fullData.push(...childFullData);}});handleeGroupSummary(aggList);}}return{treeData,fullData};};/**
|
|
18350
18373
|
* 加载表格数据
|
|
18351
18374
|
* @param {Array} datas 数据
|
|
18352
18375
|
*/const loadTableData=(datas,isReset)=>{const{keepSource,treeConfig,rowGroupConfig,aggregateConfig}=props;const{rowGroupList,scrollYLoad:oldScrollYLoad}=reactData;const{scrollYStore,scrollXStore,lastScrollLeft,lastScrollTop}=internalData;const rowOpts=computeRowOpts.value;const treeOpts=computeTreeOpts.value;const expandOpts=computeExpandOpts.value;const{transform}=treeOpts;const childrenField=treeOpts.children||treeOpts.childrenField;let treeData=[];let fullData=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.reactive)(datas?datas.slice(0):[]);// 转为响应式数据
|
|
@@ -18404,7 +18427,7 @@ if(props.spanMethod){warnLog('vxe.error.scrollErrProp',['span-method']);}if(prop
|
|
|
18404
18427
|
// 如果列被设置为固定,则清除合并状态
|
|
18405
18428
|
if(visibleColumn.length!==internalData.visibleColumn.length||!internalData.visibleColumn.every((column,index)=>column===visibleColumn[index])){$xeTable.clearMergeCells();$xeTable.clearMergeFooterItems();}visibleColumn.forEach((column,index)=>{const colid=column.id;const colRest=fullColumnIdData[colid];if(colRest){colRest._index=index;}});handleTableColumn();handleUpdateAggValues();if(isReset){updateColumnOffsetLeft();return $xeTable.updateFooter().then(()=>{return $xeTable.recalculate();}).then(()=>{$xeTable.updateCellAreas();return $xeTable.recalculate();});}return $xeTable.updateFooter();};const initColumnHierarchy=()=>{const{collectColumn}=internalData;const fullColIdData={};const fullColFieldData={};let sortIndex=1;external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(collectColumn,(column,index,items,path,parentColumn)=>{const{id:colid,field}=column;const parentId=parentColumn?parentColumn.id:null;const rest={$index:-1,_index:-1,column,colid,index,items,parent:parentColumn||null,width:0,oLeft:0};column.parentId=parentId;column.defaultParentId=parentId;column.sortNumber=sortIndex;column.renderSortNumber=sortIndex;sortIndex++;if(field){if(fullColFieldData[field]){errLog('vxe.error.colRepet',['field',field]);}fullColFieldData[field]=rest;}fullColIdData[colid]=rest;});internalData.fullColumnIdData=fullColIdData;internalData.fullColumnFieldData=fullColFieldData;};const handleInitColumn=collectColumn=>{const expandOpts=computeExpandOpts.value;internalData.collectColumn=collectColumn;const tableFullColumn=getColumnList(collectColumn);internalData.tableFullColumn=tableFullColumn;reactData.isColLoading=true;initColumnHierarchy();return Promise.resolve(restoreCustomStorage()).then(()=>{const{scrollXLoad,scrollYLoad,expandColumn}=reactData;cacheColumnMap();parseColumns(true).then(()=>{if(reactData.scrollXLoad){loadScrollXData();}});$xeTable.clearMergeCells();$xeTable.clearMergeFooterItems();$xeTable.handleTableData(true);$xeTable.handleAggregateSummaryData();if((scrollXLoad||scrollYLoad)&&expandColumn&&expandOpts.mode!=='fixed'){warnLog('vxe.error.scrollErrProp',['column.type=expand']);}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(()=>{if($xeToolbar){$xeToolbar.syncUpdate({collectColumn:internalData.collectColumn,$table:$xeTable});}if($xeTable.handleUpdateCustomColumn){$xeTable.handleUpdateCustomColumn();}reactData.isColLoading=false;return handleLazyRecalculate(false,true,true);});});};const updateScrollXStatus=fullColumn=>{const virtualXOpts=computeVirtualXOpts.value;const allCols=fullColumn||internalData.tableFullColumn;// 如果gt为0,则总是启用
|
|
18406
18429
|
const scrollXLoad=!!virtualXOpts.enabled&&virtualXOpts.gt>-1&&(virtualXOpts.gt===0||virtualXOpts.gt<allCols.length);reactData.scrollXLoad=scrollXLoad;return scrollXLoad;};const updateScrollYStatus=fullData=>{const{treeConfig}=props;const $xeGanttView=internalData.xeGanttView;const virtualYOpts=computeVirtualYOpts.value;const treeOpts=computeTreeOpts.value;const{transform}=treeOpts;const allList=fullData||internalData.tableFullData;// 如果gt为0,则总是启用
|
|
18407
|
-
const scrollYLoad=(transform||!treeConfig)&&!!virtualYOpts.enabled&&virtualYOpts.gt>-1&&(virtualYOpts.gt===0||virtualYOpts.gt<allList.length);reactData.scrollYLoad=scrollYLoad;if($xeGanttView){$xeGanttView.
|
|
18430
|
+
const scrollYLoad=(transform||!treeConfig)&&!!virtualYOpts.enabled&&virtualYOpts.gt>-1&&(virtualYOpts.gt===0||virtualYOpts.gt<allList.length);reactData.scrollYLoad=scrollYLoad;if($xeGanttView&&$xeGanttView.handleUpdateSYStatus){$xeGanttView.handleUpdateSYStatus(scrollYLoad);}return scrollYLoad;};/**
|
|
18408
18431
|
* 展开与收起树节点
|
|
18409
18432
|
* @param rows
|
|
18410
18433
|
* @param expanded
|
|
@@ -18558,8 +18581,10 @@ if(!rowRest){return false;}const row=rowRest.row;const oRow=sourceDataRowIdData[
|
|
|
18558
18581
|
const currTableData=isFull?transform?tableFullTreeData:tableFullData:transform?tableFullTreeData:afterFullData;rowList=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().filterTree(currTableData,row=>external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row,checkField),{children:transform?mapChildrenField:childrenField});}else{const currTableData=isFull?tableFullData:afterFullData;rowList=currTableData.filter(row=>external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row,checkField));}}else{const currMaps=isFull||treeConfig&&!transform?fullDataRowIdData:afterFullRowMaps;external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(selectCheckboxMaps,(row,rowid)=>{if(currMaps[rowid]){rowList.push(fullDataRowIdData[rowid].row);}});}}return rowList;},/**
|
|
18559
18582
|
* 只对 tree-config 有效,获取行的子级
|
|
18560
18583
|
*/getTreeRowChildren(rowOrRowid){const{treeConfig}=props;const{fullAllDataRowIdData}=internalData;const treeOpts=computeTreeOpts.value;const{transform,mapChildrenField}=treeOpts;const childrenField=treeOpts.children||treeOpts.childrenField;if(rowOrRowid&&treeConfig){let rowid;if(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(rowOrRowid)){rowid=rowOrRowid;}else{rowid=getRowid($xeTable,rowOrRowid);}if(rowid){const rest=fullAllDataRowIdData[rowid];const row=rest?rest.row:null;if(row){return row[transform?mapChildrenField:childrenField]||[];}}}return[];},/**
|
|
18584
|
+
* 只对 tree-config 有效,用于树形结构,获取指定行的层级
|
|
18585
|
+
*/getTreeRowLevel(rowOrRowid){const{treeConfig}=props;const{fullAllDataRowIdData}=internalData;if(rowOrRowid&&treeConfig){let rowid;if(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(rowOrRowid)){rowid=rowOrRowid;}else{rowid=getRowid($xeTable,rowOrRowid);}if(rowid){const rest=fullAllDataRowIdData[rowid];if(rest){return rest.level;}}}return-1;},/**
|
|
18561
18586
|
* 只对 tree-config 有效,获取行的父级
|
|
18562
|
-
*/getTreeParentRow(rowOrRowid){const{treeConfig}=props;const{fullAllDataRowIdData}=internalData;if(rowOrRowid&&treeConfig){let rowid;if(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(rowOrRowid)){rowid=rowOrRowid;}else{rowid=getRowid($xeTable,rowOrRowid);}if(rowid){const rest=fullAllDataRowIdData[rowid];return rest
|
|
18587
|
+
*/getTreeParentRow(rowOrRowid){const{treeConfig}=props;const{fullAllDataRowIdData}=internalData;if(rowOrRowid&&treeConfig){let rowid;if(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(rowOrRowid)){rowid=rowOrRowid;}else{rowid=getRowid($xeTable,rowOrRowid);}if(rowid){const rest=fullAllDataRowIdData[rowid];if(rest){return rest.parent;}}}return null;},getParentRow(rowOrRowid){warnLog('vxe.error.delFunc',['getParentRow','getTreeParentRow']);return $xeTable.getTreeParentRow(rowOrRowid);},/**
|
|
18563
18588
|
* 根据行的唯一主键获取行
|
|
18564
18589
|
* @param {String/Number} rowid 行主键
|
|
18565
18590
|
*/getRowById(cellValue){const{fullAllDataRowIdData}=internalData;const rowid=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(cellValue)?'':encodeURIComponent(cellValue||'');return fullAllDataRowIdData[rowid]?fullAllDataRowIdData[rowid].row:null;},/**
|
|
@@ -18628,7 +18653,7 @@ const indeterminateField=checkboxOpts.indeterminateField||checkboxOpts.halfField
|
|
|
18628
18653
|
* 用于当前行,设置某一行为高亮状态
|
|
18629
18654
|
* @param {Row} row 行对象
|
|
18630
18655
|
*/setCurrentRow(row){const $xeGanttView=internalData.xeGanttView;const rowOpts=computeRowOpts.value;const el=refElem.value;tableMethods.clearCurrentRow();// tableMethods.clearCurrentColumn()
|
|
18631
|
-
reactData.currentRow=row;if(rowOpts.isCurrent||props.highlightCurrentRow){if(el){external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(el.querySelectorAll(`[rowid="${getRowid($xeTable,row)}"]`),elem=>addClass(elem,'row--current'));}}if($xeGanttView){$xeGanttView.handleUpdateCurrentRow(row);}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();},isCheckedByRadioRow(row){const{selectRadioRow}=reactData;if(row&&selectRadioRow){return $xeTable.eqRow(selectRadioRow,row);}return false;},isCheckedByRadioRowKey(key){const{selectRadioRow}=reactData;if(selectRadioRow){return key===getRowid($xeTable,selectRadioRow);}return false;},/**
|
|
18656
|
+
reactData.currentRow=row;if(rowOpts.isCurrent||props.highlightCurrentRow){if(el){external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(el.querySelectorAll(`[rowid="${getRowid($xeTable,row)}"]`),elem=>addClass(elem,'row--current'));}}if($xeGanttView&&$xeGanttView.handleUpdateCurrentRow){$xeGanttView.handleUpdateCurrentRow(row);}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();},isCheckedByRadioRow(row){const{selectRadioRow}=reactData;if(row&&selectRadioRow){return $xeTable.eqRow(selectRadioRow,row);}return false;},isCheckedByRadioRowKey(key){const{selectRadioRow}=reactData;if(selectRadioRow){return key===getRowid($xeTable,selectRadioRow);}return false;},/**
|
|
18632
18657
|
* 用于单选行,设置某一行为选中状态
|
|
18633
18658
|
* @param {Row} row 行对象
|
|
18634
18659
|
*/setRadioRow(row){return handleCheckedRadioRow(row,true);},/**
|
|
@@ -18636,7 +18661,7 @@ reactData.currentRow=row;if(rowOpts.isCurrent||props.highlightCurrentRow){if(el)
|
|
|
18636
18661
|
* @param key 行主键
|
|
18637
18662
|
*/setRadioRowKey(rowid){const{fullAllDataRowIdData}=internalData;const rowRest=fullAllDataRowIdData[rowid];if(rowRest){return handleCheckedRadioRow(rowRest.row,true);}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();},/**
|
|
18638
18663
|
* 用于当前行,手动清空当前高亮的状态
|
|
18639
|
-
*/clearCurrentRow(){const $xeGanttView=internalData.xeGanttView;const el=refElem.value;reactData.currentRow=null;internalData.hoverRow=null;if(el){external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(el.querySelectorAll('.row--current'),elem=>removeClass(elem,'row--current'));}if($xeGanttView){$xeGanttView.handleUpdateCurrentRow();}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();},/**
|
|
18664
|
+
*/clearCurrentRow(){const $xeGanttView=internalData.xeGanttView;const el=refElem.value;reactData.currentRow=null;internalData.hoverRow=null;if(el){external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(el.querySelectorAll('.row--current'),elem=>removeClass(elem,'row--current'));}if($xeGanttView&&$xeGanttView.handleUpdateCurrentRow){$xeGanttView.handleUpdateCurrentRow();}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();},/**
|
|
18640
18665
|
* 用于单选行,手动清空用户的选择
|
|
18641
18666
|
*/clearRadioRow(){reactData.selectRadioRow=null;return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();},/**
|
|
18642
18667
|
* 用于当前行,获取当前行的数据
|
|
@@ -18832,7 +18857,7 @@ if(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_defau
|
|
|
18832
18857
|
if(eqEmptyValue(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(record,rowkey))){external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(record,rowkey,getRowUniqueId());}return record;});},handleTableData(force){const{scrollYLoad}=reactData;const{scrollYStore,fullDataRowIdData}=internalData;const $xeGanttView=internalData.xeGanttView;let fullList=internalData.afterFullData;// 是否进行数据处理
|
|
18833
18858
|
if(force){// 更新数据,处理筛选和排序
|
|
18834
18859
|
updateAfterFullData();// 如果为虚拟树,将树结构拍平
|
|
18835
|
-
fullList=handleVirtualTreeToList();}const tableData=scrollYLoad?fullList.slice(scrollYStore.startIndex,scrollYStore.endIndex):fullList.slice(0);const visibleDataRowIdMaps={};tableData.forEach((row,$index)=>{const rowid=getRowid($xeTable,row);const rest=fullDataRowIdData[rowid];if(rest){rest.$index=$index;}visibleDataRowIdMaps[rowid]=row;});reactData.tableData=tableData;internalData.visibleDataRowIdData=visibleDataRowIdMaps;if($xeGanttView){$xeGanttView.updateViewData();}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();},/**
|
|
18860
|
+
fullList=handleVirtualTreeToList();}const tableData=scrollYLoad?fullList.slice(scrollYStore.startIndex,scrollYStore.endIndex):fullList.slice(0);const visibleDataRowIdMaps={};tableData.forEach((row,$index)=>{const rowid=getRowid($xeTable,row);const rest=fullDataRowIdData[rowid];if(rest){rest.$index=$index;}visibleDataRowIdMaps[rowid]=row;});reactData.tableData=tableData;internalData.visibleDataRowIdData=visibleDataRowIdMaps;if($xeGanttView&&$xeGanttView.updateViewData){$xeGanttView.updateViewData();}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();},/**
|
|
18836
18861
|
* 更新数据行的 Map
|
|
18837
18862
|
*/cacheRowMap(isReset){const{treeConfig}=props;const{isRowGroupStatus}=reactData;const{currKeyField,fullAllDataRowIdData,tableFullData,tableFullTreeData,tableFullGroupData,treeExpandedMaps}=internalData;const fullAllDataRowIdMaps=isReset?{}:{...fullAllDataRowIdData};// 存在已删除数据
|
|
18838
18863
|
const fullDataRowIdMaps={};const idMaps={};const{handleUpdateRowId}=createHandleUpdateRowId($xeTable);const handleRowCache=(row,index,items,currIndex,parentRow,rowid,level,seq)=>{let rowRest=fullAllDataRowIdMaps[rowid];if(idMaps[rowid]){errLog('vxe.error.repeatKey',[currKeyField,rowid]);}if(!rowRest){rowRest={row,rowid,seq,index:-1,_index:-1,$index:-1,treeIndex:index,_tIndex:-1,items,parent:parentRow,level,height:0,resizeHeight:0,oTop:0,expandHeight:0};fullDataRowIdMaps[rowid]=rowRest;fullAllDataRowIdMaps[rowid]=rowRest;}rowRest.treeLoaded=false;rowRest.expandLoaded=false;rowRest.row=row;rowRest.items=items;rowRest.parent=parentRow;rowRest.level=level;rowRest.index=currIndex;rowRest.treeIndex=index;idMaps[rowid]=true;fullDataRowIdMaps[rowid]=rowRest;fullAllDataRowIdMaps[rowid]=rowRest;};if(treeConfig){const treeOpts=computeTreeOpts.value;const{lazy}=treeOpts;const childrenField=treeOpts.children||treeOpts.childrenField;const hasChildField=treeOpts.hasChild||treeOpts.hasChildField;external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(tableFullTreeData,(row,index,items,path,parentRow,nodes)=>{const rowid=handleUpdateRowId(row);if(treeConfig&&lazy){if(row[hasChildField]&&row[childrenField]===undefined){row[childrenField]=null;}if(treeExpandedMaps[rowid]){if(!row[childrenField]||!row[childrenField].length){delete treeExpandedMaps[rowid];}}}handleRowCache(row,index,items,parentRow?-1:index,parentRow,rowid,nodes.length-1,toTreePathSeq(path));},{children:childrenField});}else if(isRowGroupStatus){const aggregateOpts=computeAggregateOpts.value;const{mapChildrenField}=aggregateOpts;external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(tableFullGroupData,(row,index,items,path,parentRow,nodes)=>{const rowid=handleUpdateRowId(row);handleRowCache(row,index,items,parentRow?-1:index,parentRow,rowid,nodes.length-1,toTreePathSeq(path));},{children:mapChildrenField});}else{tableFullData.forEach((row,index,items)=>{handleRowCache(row,index,items,index,null,handleUpdateRowId(row),0,index+1);});}internalData.fullDataRowIdData=fullDataRowIdMaps;internalData.fullAllDataRowIdData=fullAllDataRowIdMaps;reactData.treeExpandedFlag++;},cacheSourceMap(fullData){const{treeConfig}=props;const treeOpts=computeTreeOpts.value;const sourceData=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().clone(fullData,true);const{handleUpdateRowId}=createHandleUpdateRowId($xeTable);const sourceRowIdData={};const handleSourceRow=row=>{const rowid=handleUpdateRowId(row);sourceRowIdData[rowid]=row;};// 源数据缓存
|
|
@@ -18965,17 +18990,17 @@ if(isRollX){evnt.preventDefault();internalData.inWheelScroll=true;if(browseObj.f
|
|
|
18965
18990
|
* 对于某些特定的场景可能会用到,比如定位到某一节点
|
|
18966
18991
|
* @param {Row} row 行对象
|
|
18967
18992
|
*/scrollToTreeRow(row){const{treeConfig}=props;const{isRowGroupStatus}=reactData;const{tableFullData}=internalData;const rests=[];if(treeConfig||isRowGroupStatus){const aggregateOpts=computeAggregateOpts.value;const treeOpts=computeTreeOpts.value;const childrenField=treeOpts.children||treeOpts.childrenField;const matchObj=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findTree(tableFullData,item=>$xeTable.eqRow(item,row),{children:isRowGroupStatus?aggregateOpts.mapChildrenField:childrenField});if(matchObj){const nodes=matchObj.nodes;nodes.forEach((row,index)=>{if(index<nodes.length-1&&!$xeTable.isTreeExpandByRow(row)){rests.push($xeTable.setTreeExpand(row,true));}});}}return Promise.all(rests).then(()=>rowToVisible($xeTable,row));},updateScrollYStatus,// 更新横向 X 可视渲染上下剩余空间大小
|
|
18968
|
-
updateScrollXSpace(){const{scrollXLoad,overflowX,scrollXWidth}=reactData;const{visibleColumn,scrollXStore,elemStore,fullColumnIdData}=internalData;const mouseOpts=computeMouseOpts.value;const tableBody=refTableBody.value;const tableBodyElem=tableBody?tableBody.$el:null;if(tableBodyElem){const bodyScrollElem=getRefElem(elemStore['main-body-scroll']);const bodyTableElem=getRefElem(elemStore['main-body-table']);const headerTableElem=getRefElem(elemStore['main-header-table']);const footerTableElem=getRefElem(elemStore['main-footer-table']);let xSpaceLeft=0;const firstColumn=visibleColumn[scrollXStore.startIndex];if(firstColumn){const colRest=fullColumnIdData[firstColumn.id]||{};xSpaceLeft=colRest.oLeft;}let clientWidth=0;if(bodyScrollElem){clientWidth=bodyScrollElem.clientWidth;}// 虚拟渲染
|
|
18993
|
+
updateScrollXSpace(){const{scrollXLoad,overflowX,scrollXWidth}=reactData;const{visibleColumn,scrollXStore,elemStore,fullColumnIdData}=internalData;const $xeGanttView=internalData.xeGanttView;const mouseOpts=computeMouseOpts.value;const tableBody=refTableBody.value;const tableBodyElem=tableBody?tableBody.$el:null;if(tableBodyElem){const bodyScrollElem=getRefElem(elemStore['main-body-scroll']);const bodyTableElem=getRefElem(elemStore['main-body-table']);const headerTableElem=getRefElem(elemStore['main-header-table']);const footerTableElem=getRefElem(elemStore['main-footer-table']);let xSpaceLeft=0;const firstColumn=visibleColumn[scrollXStore.startIndex];if(firstColumn){const colRest=fullColumnIdData[firstColumn.id]||{};xSpaceLeft=colRest.oLeft;}let clientWidth=0;if(bodyScrollElem){clientWidth=bodyScrollElem.clientWidth;}// 虚拟渲染
|
|
18969
18994
|
let isScrollXBig=false;let ySpaceWidth=scrollXWidth;if(scrollXWidth>maxXWidth){// 触右
|
|
18970
|
-
if(bodyScrollElem&&bodyTableElem&&bodyScrollElem.scrollLeft+clientWidth>=maxXWidth){xSpaceLeft=maxXWidth-bodyTableElem.clientWidth;}else{xSpaceLeft=(maxXWidth-clientWidth)*(xSpaceLeft/(scrollXWidth-clientWidth));}ySpaceWidth=maxXWidth;isScrollXBig=true;}if(!(scrollXLoad&&overflowX)){xSpaceLeft=0;}if(headerTableElem){headerTableElem.style.transform=headerTableElem.getAttribute('xvm')?`translate(${xSpaceLeft}px, 0px)`:'';}if(bodyTableElem){bodyTableElem.style.transform=`translate(${xSpaceLeft}px, ${reactData.scrollYTop||0}px)`;}if(footerTableElem){footerTableElem.style.transform=footerTableElem.getAttribute('xvm')?`translate(${xSpaceLeft}px, 0px)`:'';}const containerList=['main'];containerList.forEach(name=>{const layoutList=['header','body','footer'];layoutList.forEach(layout=>{const xSpaceElem=getRefElem(elemStore[`${name}-${layout}-xSpace`]);if(xSpaceElem){xSpaceElem.style.width=scrollXLoad?`${ySpaceWidth}px`:'';}});});reactData.scrollXLeft=xSpaceLeft;reactData.scrollXWidth=ySpaceWidth;reactData.isScrollXBig=isScrollXBig;const scrollXSpaceEl=refScrollXSpaceElem.value;if(scrollXSpaceEl){scrollXSpaceEl.style.width=`${ySpaceWidth}px`;}calcScrollbar();if(isScrollXBig&&mouseOpts.area){errLog('vxe.error.notProp',['mouse-config.area']);}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(()=>{updateStyle();});}},// 更新纵向 Y 可视渲染上下剩余空间大小
|
|
18995
|
+
if(bodyScrollElem&&bodyTableElem&&bodyScrollElem.scrollLeft+clientWidth>=maxXWidth){xSpaceLeft=maxXWidth-bodyTableElem.clientWidth;}else{xSpaceLeft=(maxXWidth-clientWidth)*(xSpaceLeft/(scrollXWidth-clientWidth));}ySpaceWidth=maxXWidth;isScrollXBig=true;}if(!(scrollXLoad&&overflowX)){xSpaceLeft=0;}if(headerTableElem){headerTableElem.style.transform=headerTableElem.getAttribute('xvm')?`translate(${xSpaceLeft}px, 0px)`:'';}if(bodyTableElem){bodyTableElem.style.transform=`translate(${xSpaceLeft}px, ${reactData.scrollYTop||0}px)`;}if(footerTableElem){footerTableElem.style.transform=footerTableElem.getAttribute('xvm')?`translate(${xSpaceLeft}px, 0px)`:'';}const containerList=['main'];containerList.forEach(name=>{const layoutList=['header','body','footer'];layoutList.forEach(layout=>{const xSpaceElem=getRefElem(elemStore[`${name}-${layout}-xSpace`]);if(xSpaceElem){xSpaceElem.style.width=scrollXLoad?`${ySpaceWidth}px`:'';}});});reactData.scrollXLeft=xSpaceLeft;reactData.scrollXWidth=ySpaceWidth;reactData.isScrollXBig=isScrollXBig;const scrollXSpaceEl=refScrollXSpaceElem.value;if(scrollXSpaceEl){scrollXSpaceEl.style.width=`${ySpaceWidth}px`;}calcScrollbar();if(isScrollXBig&&mouseOpts.area){errLog('vxe.error.notProp',['mouse-config.area']);}if($xeGanttView&&$xeGanttView.handleUpdateSXSpace){$xeGanttView.handleUpdateSXSpace();}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(()=>{updateStyle();});}},// 更新纵向 Y 可视渲染上下剩余空间大小
|
|
18971
18996
|
updateScrollYSpace(){const{isAllOverflow,overflowY,scrollYLoad,expandColumn}=reactData;const{scrollYStore,elemStore,isResizeCellHeight,afterFullData,fullAllDataRowIdData,rowExpandedMaps}=internalData;const $xeGanttView=internalData.xeGanttView;const{startIndex}=scrollYStore;const mouseOpts=computeMouseOpts.value;const expandOpts=computeExpandOpts.value;const rowOpts=computeRowOpts.value;const cellOpts=computeCellOpts.value;const defaultRowHeight=computeDefaultRowHeight.value;const bodyScrollElem=getRefElem(elemStore['main-body-scroll']);const bodyTableElem=getRefElem(elemStore['main-body-table']);const leftBodyTableElem=getRefElem(elemStore['left-body-table']);const rightbodyTableElem=getRefElem(elemStore['right-body-table']);const containerList=['main','left','right'];let ySpaceTop=0;let scrollYHeight=0;let isScrollYBig=false;if(scrollYLoad){const isCustomCellHeight=isResizeCellHeight||cellOpts.height||rowOpts.height;if(!isCustomCellHeight&&!expandColumn&&isAllOverflow){scrollYHeight=afterFullData.length*defaultRowHeight;if(scrollYHeight>maxYHeight){isScrollYBig=true;}ySpaceTop=Math.max(0,startIndex*defaultRowHeight);}else{const firstRow=afterFullData[startIndex];let rowid=getRowid($xeTable,firstRow);let rowRest=fullAllDataRowIdData[rowid]||{};ySpaceTop=rowRest.oTop||0;const lastRow=afterFullData[afterFullData.length-1];rowid=getRowid($xeTable,lastRow);rowRest=fullAllDataRowIdData[rowid]||{};scrollYHeight=(rowRest.oTop||0)+(rowRest.resizeHeight||cellOpts.height||rowOpts.height||rowRest.height||defaultRowHeight);// 是否展开行
|
|
18972
18997
|
if(expandColumn&&rowExpandedMaps[rowid]){scrollYHeight+=rowRest.expandHeight||expandOpts.height||0;}if(scrollYHeight>maxYHeight){isScrollYBig=true;}}}else{if(bodyTableElem){scrollYHeight=bodyTableElem.clientHeight;}}let clientHeight=0;if(bodyScrollElem){clientHeight=bodyScrollElem.clientHeight;}// 虚拟渲染
|
|
18973
18998
|
let ySpaceHeight=scrollYHeight;let scrollYTop=ySpaceTop;if(isScrollYBig){// 触底
|
|
18974
|
-
if(bodyScrollElem&&bodyTableElem&&bodyScrollElem.scrollTop+clientHeight>=maxYHeight){scrollYTop=maxYHeight-bodyTableElem.clientHeight;}else{scrollYTop=(maxYHeight-clientHeight)*(ySpaceTop/(scrollYHeight-clientHeight));}ySpaceHeight=maxYHeight;}if(!(scrollYLoad&&overflowY)){scrollYTop=0;}if(leftBodyTableElem){leftBodyTableElem.style.transform=`translate(0px, ${scrollYTop}px)`;}if(bodyTableElem){bodyTableElem.style.transform=`translate(${reactData.scrollXLeft||0}px, ${scrollYTop}px)`;}if(rightbodyTableElem){rightbodyTableElem.style.transform=`translate(0px, ${scrollYTop}px)`;}containerList.forEach(name=>{const layoutList=['header','body','footer'];layoutList.forEach(layout=>{const ySpaceElem=getRefElem(elemStore[`${name}-${layout}-ySpace`]);if(ySpaceElem){ySpaceElem.style.height=ySpaceHeight?`${ySpaceHeight}px`:'';}});});const scrollYSpaceEl=refScrollYSpaceElem.value;if(scrollYSpaceEl){scrollYSpaceEl.style.height=ySpaceHeight?`${ySpaceHeight}px`:'';}const rowExpandYSpaceEl=refRowExpandYSpaceElem.value;if(rowExpandYSpaceEl){rowExpandYSpaceEl.style.height=ySpaceHeight?`${ySpaceHeight}px`:'';}reactData.scrollYTop=scrollYTop;reactData.scrollYHeight=scrollYHeight;reactData.isScrollYBig=isScrollYBig;calcScrollbar();if(isScrollYBig&&mouseOpts.area){errLog('vxe.error.notProp',['mouse-config.area']);}if($xeGanttView){$xeGanttView.
|
|
18999
|
+
if(bodyScrollElem&&bodyTableElem&&bodyScrollElem.scrollTop+clientHeight>=maxYHeight){scrollYTop=maxYHeight-bodyTableElem.clientHeight;}else{scrollYTop=(maxYHeight-clientHeight)*(ySpaceTop/(scrollYHeight-clientHeight));}ySpaceHeight=maxYHeight;}if(!(scrollYLoad&&overflowY)){scrollYTop=0;}if(leftBodyTableElem){leftBodyTableElem.style.transform=`translate(0px, ${scrollYTop}px)`;}if(bodyTableElem){bodyTableElem.style.transform=`translate(${reactData.scrollXLeft||0}px, ${scrollYTop}px)`;}if(rightbodyTableElem){rightbodyTableElem.style.transform=`translate(0px, ${scrollYTop}px)`;}containerList.forEach(name=>{const layoutList=['header','body','footer'];layoutList.forEach(layout=>{const ySpaceElem=getRefElem(elemStore[`${name}-${layout}-ySpace`]);if(ySpaceElem){ySpaceElem.style.height=ySpaceHeight?`${ySpaceHeight}px`:'';}});});const scrollYSpaceEl=refScrollYSpaceElem.value;if(scrollYSpaceEl){scrollYSpaceEl.style.height=ySpaceHeight?`${ySpaceHeight}px`:'';}const rowExpandYSpaceEl=refRowExpandYSpaceElem.value;if(rowExpandYSpaceEl){rowExpandYSpaceEl.style.height=ySpaceHeight?`${ySpaceHeight}px`:'';}reactData.scrollYTop=scrollYTop;reactData.scrollYHeight=scrollYHeight;reactData.isScrollYBig=isScrollYBig;calcScrollbar();if(isScrollYBig&&mouseOpts.area){errLog('vxe.error.notProp',['mouse-config.area']);}if($xeGanttView&&$xeGanttView.handleUpdateSYSpace){$xeGanttView.handleUpdateSYSpace();}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(()=>{updateStyle();});},updateScrollXData(){const{isAllOverflow}=reactData;handleTableColumn();$xeTable.updateScrollXSpace();return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(()=>{handleTableColumn();$xeTable.updateScrollXSpace();if(!isAllOverflow){$xeTable.updateScrollYSpace();}});},updateScrollYData(){$xeTable.handleTableData();$xeTable.updateScrollYSpace();return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(()=>{$xeTable.handleTableData();$xeTable.updateScrollYSpace();});},/**
|
|
18975
19000
|
* 处理固定列的显示状态
|
|
18976
19001
|
*/checkScrolling(){const{elemStore}=internalData;const bodyScrollElem=getRefElem(elemStore['main-body-scroll']);const leftContainerElem=refLeftContainer.value;const rightContainerElem=refRightContainer.value;const xHandleEl=refScrollXHandleElem.value;const bodtTargetEl=xHandleEl||bodyScrollElem;if(bodtTargetEl){if(leftContainerElem){if(bodtTargetEl.scrollLeft>0){addClass(leftContainerElem,'scrolling--middle');}else{removeClass(leftContainerElem,'scrolling--middle');}}if(rightContainerElem){if(bodtTargetEl.clientWidth<bodtTargetEl.scrollWidth-Math.ceil(bodtTargetEl.scrollLeft)){addClass(rightContainerElem,'scrolling--middle');}else{removeClass(rightContainerElem,'scrolling--middle');}}}},handleUpdateAggData(){return loadTableData(internalData.tableSynchData,true);},updateZindex(){if(props.zIndex){internalData.tZindex=props.zIndex;}else if(internalData.tZindex<getLastZIndex()){internalData.tZindex=nextZIndex();}},handleCheckedCheckboxRow,/**
|
|
18977
19002
|
* 行 hover 事件
|
|
18978
|
-
*/triggerHoverEvent(evnt,{row}){tablePrivateMethods.setHoverRow(row);},setHoverRow(row){const $xeGanttView=internalData.xeGanttView;const rowid=getRowid($xeTable,row);const el=refElem.value;tablePrivateMethods.clearHoverRow();if(el){external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(el.querySelectorAll(`.vxe-body--row[rowid="${rowid}"]`),elem=>addClass(elem,'row--hover'));}internalData.hoverRow=row;if($xeGanttView){$xeGanttView.handleUpdateHoverRow(row);}},clearHoverRow(){const $xeGanttView=internalData.xeGanttView;const el=refElem.value;if(el){external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(el.querySelectorAll('.vxe-body--row.row--hover'),elem=>removeClass(elem,'row--hover'));}internalData.hoverRow=null;if($xeGanttView){$xeGanttView.handleUpdateHoverRow();}},/**
|
|
19003
|
+
*/triggerHoverEvent(evnt,{row}){tablePrivateMethods.setHoverRow(row);},setHoverRow(row){const $xeGanttView=internalData.xeGanttView;const rowid=getRowid($xeTable,row);const el=refElem.value;tablePrivateMethods.clearHoverRow();if(el){external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(el.querySelectorAll(`.vxe-body--row[rowid="${rowid}"]`),elem=>addClass(elem,'row--hover'));}internalData.hoverRow=row;if($xeGanttView&&$xeGanttView.handleUpdateHoverRow){$xeGanttView.handleUpdateHoverRow(row);}},clearHoverRow(){const $xeGanttView=internalData.xeGanttView;const el=refElem.value;if(el){external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(el.querySelectorAll('.vxe-body--row.row--hover'),elem=>removeClass(elem,'row--hover'));}internalData.hoverRow=null;if($xeGanttView&&$xeGanttView.handleUpdateHoverRow){$xeGanttView.handleUpdateHoverRow();}},/**
|
|
18979
19004
|
* 已废弃,被 getCellElement 替换
|
|
18980
19005
|
* @deprecated
|
|
18981
19006
|
*/getCell(row,column){return tableMethods.getCellElement(row,column);},findRowIndexOf(list,row){return row?external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findIndexOf(list,item=>$xeTable.eqRow(item,row)):-1;},eqRow(row1,row2){if(row1&&row2){if(row1===row2){return true;}return getRowid($xeTable,row1)===getRowid($xeTable,row2);}return false;},handleConnectGanttView($ganttView){if($ganttView&&$ganttView.connectUpdate){$ganttView.connectUpdate({$table:$xeTable});internalData.xeGanttView=$ganttView;}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();}};// 检测对应模块是否安装
|
|
@@ -19028,14 +19053,14 @@ if(bodyScrollElem&&bodyTableElem&&bodyScrollElem.scrollTop+clientHeight>=maxYHei
|
|
|
19028
19053
|
// warnLog('vxe.error.checkProp', ['checkbox-config.checkField'])
|
|
19029
19054
|
// }
|
|
19030
19055
|
if((scrollXLoad||scrollYLoad)&&expandColumn&&expandOpts.mode!=='fixed'){warnLog('vxe.error.scrollErrProp',['column.type=expand']);}return tableMethods.recalculate();});});const staticColumnFlag=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)(0);(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(()=>reactData.staticColumns.length,()=>{staticColumnFlag.value++;});(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(()=>reactData.staticColumns,()=>{staticColumnFlag.value++;});(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(staticColumnFlag,()=>{(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(()=>handleInitColumn(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().clone(reactData.staticColumns)));});const tableColumnFlag=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)(0);(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(()=>reactData.tableColumn.length,()=>{tableColumnFlag.value++;});(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(()=>reactData.tableColumn,()=>{tableColumnFlag.value++;});(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(tableColumnFlag,()=>{tablePrivateMethods.analyColumnWidth();});(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(()=>reactData.upDataFlag,()=>{(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(()=>{tableMethods.updateData();});});(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(()=>reactData.reColumnFlag,()=>{(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(()=>{tableMethods.refreshColumn();});});const reLayoutFlag=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)(0);(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(computeSize,()=>{reLayoutFlag.value++;});(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(()=>props.showHeader,()=>{reLayoutFlag.value++;});(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(()=>props.showFooter,()=>{reLayoutFlag.value++;});(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(()=>reactData.overflowX,()=>{reLayoutFlag.value++;});(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(()=>reactData.overflowY,()=>{reLayoutFlag.value++;});(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(()=>props.height,()=>{reLayoutFlag.value++;});(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(()=>props.maxHeight,()=>{reLayoutFlag.value++;});(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(computeScrollbarXToTop,()=>{reLayoutFlag.value++;});(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(computeScrollbarYToLeft,()=>{reLayoutFlag.value++;});(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(()=>core_.VxeUI.getLanguage(),()=>{reLayoutFlag.value++;});(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(reLayoutFlag,()=>{$xeTable.recalculate(true);});const footFlag=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)(0);(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(()=>props.footerData?props.footerData.length:-1,()=>{footFlag.value++;});(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(()=>props.footerData,()=>{footFlag.value++;});(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(footFlag,()=>{$xeTable.updateFooter();});(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(()=>props.syncResize,value=>{if(value){handleUpdateResize();(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(()=>{handleUpdateResize();setTimeout(()=>handleUpdateResize());});}});const mergeCellFlag=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)(0);(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(()=>props.mergeCells?props.mergeCells.length:-1,()=>{mergeCellFlag.value++;});(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(()=>props.mergeCells,()=>{mergeCellFlag.value++;});(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(mergeCellFlag,()=>{handleUpdateMergeBodyCells(props.mergeCells||[]);});const mergeFooterItemFlag=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)(0);(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(()=>props.mergeFooterItems?props.mergeFooterItems.length:-1,()=>{mergeFooterItemFlag.value++;});(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(()=>props.mergeFooterItems,()=>{mergeFooterItemFlag.value++;});(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(mergeFooterItemFlag,()=>{handleUpdateMergeFooterCells(props.mergeFooterItems||[]);});(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(computeRowGroupFields,val=>{handleUpdateRowGroup(val);});(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(computeRowField,()=>{const{inited,tableFullData}=internalData;// 行主键被改变,重载表格
|
|
19031
|
-
if(inited){handleKeyField();reactData.tableData=[];(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(()=>{$xeTable.reloadData(tableFullData);});}});if($xeTabs){(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(()=>$xeTabs?$xeTabs.reactData.resizeFlag:null,()=>{handleGlobalResizeEvent();});}handleKeyField();table_hooks.forEach(options=>{const{setupTable}=options;if(setupTable){const hookRest=setupTable($xeTable);if(hookRest&&external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isObject(hookRest)){Object.assign($xeTable,hookRest);}}});tablePrivateMethods.preventEvent(null,'created',{$table:$xeTable});let resizeObserver;(0,external_commonjs_vue_commonjs2_vue_root_Vue_.onActivated)(()=>{tableMethods.recalculate().then(()=>tableMethods.refreshScroll());tablePrivateMethods.preventEvent(null,'activated',{$table:$xeTable});});(0,external_commonjs_vue_commonjs2_vue_root_Vue_.onDeactivated)(()=>{internalData.isActivated=false;tablePrivateMethods.preventEvent(null,'deactivated',{$table:$xeTable});});(0,external_commonjs_vue_commonjs2_vue_root_Vue_.onMounted)(()=>{const columnOpts=computeColumnOpts.value;const rowOpts=computeRowOpts.value;const customOpts=computeCustomOpts.value;const aggregateOpts=computeAggregateOpts.value;const virtualYOpts=computeVirtualYOpts.value;const{groupFields}=aggregateOpts;if(columnOpts.drag||rowOpts.drag||customOpts.allowSort){initTpImg();}handleUpdateRowGroup(groupFields);(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(()=>{const{data,exportConfig,importConfig,treeConfig,showOverflow,highlightCurrentRow,highlightCurrentColumn}=props;const{scrollXStore,scrollYStore}=internalData;const editOpts=computeEditOpts.value;const treeOpts=computeTreeOpts.value;const radioOpts=computeRadioOpts.value;const checkboxOpts=computeCheckboxOpts.value;const expandOpts=computeExpandOpts.value;const rowOpts=computeRowOpts.value;const customOpts=computeCustomOpts.value;const mouseOpts=computeMouseOpts.value;const exportOpts=computeExportOpts.value;const importOpts=computeImportOpts.value;const currentRowOpts=computeCurrentRowOpts.value;const currentColumnOpts=computeCurrentColumnOpts.value;const keyboardOpts=computeKeyboardOpts.value;const aggregateOpts=computeAggregateOpts.value;if(props.rowId){warnLog('vxe.error.delProp',['row-id','row-config.keyField']);}if(props.rowKey){warnLog('vxe.error.delProp',['row-key','row-config.useKey']);}if(props.columnKey){warnLog('vxe.error.delProp',['column-id','column-config.useKey']);}if(!(props.rowId||rowOpts.keyField)&&(checkboxOpts.reserve||checkboxOpts.checkRowKeys||radioOpts.reserve||radioOpts.checkRowKey||expandOpts.expandRowKeys||treeOpts.expandRowKeys)){warnLog('vxe.error.reqProp',['row-config.keyField']);}if(props.editConfig&&(editOpts.showStatus||editOpts.showUpdateStatus||editOpts.showInsertStatus)&&!props.keepSource){warnLog('vxe.error.reqProp',['keep-source']);}if(treeConfig&&(treeOpts.showLine||treeOpts.line)&&!showOverflow){warnLog('vxe.error.reqProp',['show-overflow']);}if(treeConfig&&!treeOpts.transform&&props.stripe){warnLog('vxe.error.noTree',['stripe']);}if(props.showFooter&&!(props.footerMethod||props.footerData)){warnLog('vxe.error.reqProp',['footer-data | footer-method']);}if(rowOpts.height){warnLog('vxe.error.delProp',['row-config.height','cell-config.height']);}if(props.highlightCurrentRow){warnLog('vxe.error.delProp',['highlight-current-row','row-config.isCurrent']);}if(props.highlightHoverRow){warnLog('vxe.error.delProp',['highlight-hover-row','row-config.isHover']);}if(props.highlightCurrentColumn){warnLog('vxe.error.delProp',['highlight-current-column','column-config.isCurrent']);}if(props.highlightHoverColumn){warnLog('vxe.error.delProp',['highlight-hover-column','column-config.isHover']);}if(props.resizable){warnLog('vxe.error.delProp',['resizable','column-config.resizable']);}// if (props.scrollY) {
|
|
19056
|
+
if(inited){handleKeyField();reactData.tableData=[];(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(()=>{$xeTable.reloadData(tableFullData);});}});if($xeTabs){(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(()=>$xeTabs?$xeTabs.reactData.resizeFlag:null,()=>{handleGlobalResizeEvent();});}handleKeyField();table_hooks.forEach(options=>{const{setupTable}=options;if(setupTable){const hookRest=setupTable($xeTable);if(hookRest&&external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isObject(hookRest)){Object.assign($xeTable,hookRest);}}});tablePrivateMethods.preventEvent(null,'created',{$table:$xeTable});let resizeObserver;(0,external_commonjs_vue_commonjs2_vue_root_Vue_.onActivated)(()=>{tableMethods.recalculate().then(()=>tableMethods.refreshScroll());tablePrivateMethods.preventEvent(null,'activated',{$table:$xeTable});});(0,external_commonjs_vue_commonjs2_vue_root_Vue_.onDeactivated)(()=>{internalData.isActivated=false;tablePrivateMethods.preventEvent(null,'deactivated',{$table:$xeTable});});(0,external_commonjs_vue_commonjs2_vue_root_Vue_.onMounted)(()=>{const $xeGantt=$xeTable.xeGantt;const columnOpts=computeColumnOpts.value;const rowOpts=computeRowOpts.value;const customOpts=computeCustomOpts.value;const aggregateOpts=computeAggregateOpts.value;const virtualYOpts=computeVirtualYOpts.value;const{groupFields}=aggregateOpts;if($xeGantt){const{refClassifyWrapperElem}=$xeGantt.getRefMaps();const classifyWrapperEl=refClassifyWrapperElem.value;if(classifyWrapperEl){internalData.teleportToWrapperElem=classifyWrapperEl;}}if(columnOpts.drag||rowOpts.drag||customOpts.allowSort){initTpImg();}handleUpdateRowGroup(groupFields);(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(()=>{const{data,exportConfig,importConfig,treeConfig,showOverflow,highlightCurrentRow,highlightCurrentColumn}=props;const{scrollXStore,scrollYStore}=internalData;const editOpts=computeEditOpts.value;const treeOpts=computeTreeOpts.value;const radioOpts=computeRadioOpts.value;const checkboxOpts=computeCheckboxOpts.value;const expandOpts=computeExpandOpts.value;const rowOpts=computeRowOpts.value;const customOpts=computeCustomOpts.value;const mouseOpts=computeMouseOpts.value;const exportOpts=computeExportOpts.value;const importOpts=computeImportOpts.value;const currentRowOpts=computeCurrentRowOpts.value;const currentColumnOpts=computeCurrentColumnOpts.value;const keyboardOpts=computeKeyboardOpts.value;const aggregateOpts=computeAggregateOpts.value;if(props.rowId){warnLog('vxe.error.delProp',['row-id','row-config.keyField']);}if(props.rowKey){warnLog('vxe.error.delProp',['row-key','row-config.useKey']);}if(props.columnKey){warnLog('vxe.error.delProp',['column-id','column-config.useKey']);}if(!(props.rowId||rowOpts.keyField)&&(checkboxOpts.reserve||checkboxOpts.checkRowKeys||radioOpts.reserve||radioOpts.checkRowKey||expandOpts.expandRowKeys||treeOpts.expandRowKeys)){warnLog('vxe.error.reqProp',['row-config.keyField']);}if(props.editConfig&&(editOpts.showStatus||editOpts.showUpdateStatus||editOpts.showInsertStatus)&&!props.keepSource){warnLog('vxe.error.reqProp',['keep-source']);}if(treeConfig&&(treeOpts.showLine||treeOpts.line)&&!showOverflow){warnLog('vxe.error.reqProp',['show-overflow']);}if(treeConfig&&!treeOpts.transform&&props.stripe){warnLog('vxe.error.noTree',['stripe']);}if(props.showFooter&&!(props.footerMethod||props.footerData)){warnLog('vxe.error.reqProp',['footer-data | footer-method']);}if(rowOpts.height){warnLog('vxe.error.delProp',['row-config.height','cell-config.height']);}if(props.highlightCurrentRow){warnLog('vxe.error.delProp',['highlight-current-row','row-config.isCurrent']);}if(props.highlightHoverRow){warnLog('vxe.error.delProp',['highlight-hover-row','row-config.isHover']);}if(props.highlightCurrentColumn){warnLog('vxe.error.delProp',['highlight-current-column','column-config.isCurrent']);}if(props.highlightHoverColumn){warnLog('vxe.error.delProp',['highlight-hover-column','column-config.isHover']);}if(props.resizable){warnLog('vxe.error.delProp',['resizable','column-config.resizable']);}// if (props.scrollY) {
|
|
19032
19057
|
// warnLog('vxe.error.delProp', ['scroll-y', 'virtual-y-config'])
|
|
19033
19058
|
// }
|
|
19034
19059
|
// if (props.scrollX) {
|
|
19035
19060
|
// warnLog('vxe.error.delProp', ['scroll-x', 'virtual-x-config'])
|
|
19036
19061
|
// }
|
|
19037
19062
|
// 检查导入导出类型,如果自定义导入导出方法,则不校验类型
|
|
19038
|
-
if(importConfig&&importOpts.types&&!importOpts.importMethod&&!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().includeArrays(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().keys(importOpts._typeMaps),importOpts.types)){warnLog('vxe.error.errProp',[`export-config.types=${importOpts.types.join(',')}`,importOpts.types.filter(type=>external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().includes(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().keys(importOpts._typeMaps),type)).join(',')||external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().keys(importOpts._typeMaps).join(',')]);}if(exportConfig&&exportOpts.types&&!exportOpts.exportMethod&&!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().includeArrays(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().keys(exportOpts._typeMaps),exportOpts.types)){warnLog('vxe.error.errProp',[`export-config.types=${exportOpts.types.join(',')}`,exportOpts.types.filter(type=>external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().includes(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().keys(exportOpts._typeMaps),type)).join(',')||external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().keys(exportOpts._typeMaps).join(',')]);}if(!props.id){if((props.customConfig?isEnableConf(customOpts):customOpts.enabled)&&customOpts.storage){errLog('vxe.error.reqProp',['id']);}}if(props.treeConfig&&checkboxOpts.range){errLog('vxe.error.noTree',['checkbox-config.range']);}if(rowOpts.height&&!props.showOverflow){warnLog('vxe.error.notProp',['table.show-overflow']);}if(!$xeTable.
|
|
19063
|
+
if(importConfig&&importOpts.types&&!importOpts.importMethod&&!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().includeArrays(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().keys(importOpts._typeMaps),importOpts.types)){warnLog('vxe.error.errProp',[`export-config.types=${importOpts.types.join(',')}`,importOpts.types.filter(type=>external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().includes(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().keys(importOpts._typeMaps),type)).join(',')||external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().keys(importOpts._typeMaps).join(',')]);}if(exportConfig&&exportOpts.types&&!exportOpts.exportMethod&&!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().includeArrays(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().keys(exportOpts._typeMaps),exportOpts.types)){warnLog('vxe.error.errProp',[`export-config.types=${exportOpts.types.join(',')}`,exportOpts.types.filter(type=>external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().includes(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().keys(exportOpts._typeMaps),type)).join(',')||external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().keys(exportOpts._typeMaps).join(',')]);}if(!props.id){if((props.customConfig?isEnableConf(customOpts):customOpts.enabled)&&customOpts.storage){errLog('vxe.error.reqProp',['id']);}}if(props.treeConfig&&checkboxOpts.range){errLog('vxe.error.noTree',['checkbox-config.range']);}if(rowOpts.height&&!props.showOverflow){warnLog('vxe.error.notProp',['table.show-overflow']);}if(!$xeTable.triggerCellAreaModnEvent){if(props.areaConfig){warnLog('vxe.error.notProp',['area-config']);}if(props.clipConfig){warnLog('vxe.error.notProp',['clip-config']);}if(props.fnrConfig){warnLog('vxe.error.notProp',['fnr-config']);}if(mouseOpts.area){errLog('vxe.error.notProp',['mouse-config.area']);return;}}if(!$xeTable.handlePivotTableAggregateData){if(customOpts.allowGroup){errLog('vxe.error.notProp',['custom-config.allowGroup']);return;}if(customOpts.allowValues){errLog('vxe.error.notProp',['custom-config.allowValues']);return;}}if(treeConfig&&rowOpts.drag&&!treeOpts.transform){errLog('vxe.error.notSupportProp',['column-config.drag','tree-config.transform=false','tree-config.transform=true']);}if(props.dragConfig){warnLog('vxe.error.delProp',['drag-config','row-drag-config']);}if(props.rowGroupConfig){warnLog('vxe.error.delProp',['row-group-config','aggregate-config']);}if(aggregateOpts.countFields){warnLog('vxe.error.delProp',['row-group-config.countFields','column.agg-func']);}if(aggregateOpts.aggregateMethod){warnLog('vxe.error.delProp',['row-group-config.aggregateMethod','aggregate-config.calcValuesMethod']);}if(aggregateOpts.countMethod){warnLog('vxe.error.delProp',['aggregate-config.countMethod','aggregate-config.calcValuesMethod']);}if(props.treeConfig&&treeOpts.children){warnLog('vxe.error.delProp',['tree-config.children','tree-config.childrenField']);}if(props.treeConfig&&treeOpts.line){warnLog('vxe.error.delProp',['tree-config.line','tree-config.showLine']);}if(mouseOpts.area&&mouseOpts.selected){warnLog('vxe.error.errConflicts',['mouse-config.area','mouse-config.selected']);}if(mouseOpts.area&&props.treeConfig&&!treeOpts.transform){errLog('vxe.error.noTree',['mouse-config.area']);}if(props.editConfig&&editOpts.activeMethod){warnLog('vxe.error.delProp',['edit-config.activeMethod','edit-config.beforeEditMethod']);}if(props.treeConfig&&checkboxOpts.isShiftKey){errLog('vxe.error.errConflicts',['tree-config','checkbox-config.isShiftKey']);}if(checkboxOpts.halfField){warnLog('vxe.error.delProp',['checkbox-config.halfField','checkbox-config.indeterminateField']);}if(rowOpts.currentMethod){warnLog('vxe.error.delProp',['row-config.currentMethod','current-row-config.beforeSelectMethod']);}if(columnOpts.currentMethod){warnLog('vxe.error.delProp',['row-config.currentMethod','current-column-config.beforeSelectMethod']);}if((rowOpts.isCurrent||highlightCurrentRow)&&props.keyboardConfig&&keyboardOpts.isArrow&&!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(currentRowOpts.isFollowSelected)){warnLog('vxe.error.notConflictProp',['row-config.isCurrent','current-row-config.isFollowSelected']);}if((columnOpts.isCurrent||highlightCurrentColumn)&&props.keyboardConfig&&keyboardOpts.isArrow&&!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(currentColumnOpts.isFollowSelected)){warnLog('vxe.error.notConflictProp',['column-config.isCurrent','current-column-config.isFollowSelected']);}// 如果不支持虚拟滚动
|
|
19039
19064
|
// if (props.spanMethod) {
|
|
19040
19065
|
// if (virtualXOpts.enabled) {
|
|
19041
19066
|
// warnLog('vxe.error.notConflictProp', ['span-method', 'virtual-x-config.enabled=false'])
|
|
@@ -19119,6 +19144,9 @@ function toolbar_createInternalData() {
|
|
|
19119
19144
|
const xID = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().uniqueId();
|
|
19120
19145
|
// 使用已安装的组件,如果未安装则不渲染
|
|
19121
19146
|
const VxeUIButtonComponent = core_.VxeUI.getComponent('VxeButton');
|
|
19147
|
+
const $xeGrid = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xeGrid', null);
|
|
19148
|
+
const $xeGantt = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xeGantt', null);
|
|
19149
|
+
const $xeGGWrapper = $xeGrid || $xeGantt;
|
|
19122
19150
|
const {
|
|
19123
19151
|
computeSize
|
|
19124
19152
|
} = toolbar_useFns.useSize(props);
|
|
@@ -19141,7 +19169,6 @@ function toolbar_createInternalData() {
|
|
|
19141
19169
|
getRefMaps: () => refMaps
|
|
19142
19170
|
};
|
|
19143
19171
|
let toolbarMethods = {};
|
|
19144
|
-
const $xeGrid = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xeGrid', null);
|
|
19145
19172
|
const computeRefreshOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
19146
19173
|
return Object.assign({}, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().clone(toolbar_getConfig().toolbar.refresh, true), props.refreshOptions, props.refresh);
|
|
19147
19174
|
});
|
|
@@ -19252,11 +19279,11 @@ function toolbar_createInternalData() {
|
|
|
19252
19279
|
} catch (e) {
|
|
19253
19280
|
reactData.isRefresh = false;
|
|
19254
19281
|
}
|
|
19255
|
-
} else if ($
|
|
19282
|
+
} else if ($xeGGWrapper) {
|
|
19256
19283
|
reactData.isRefresh = true;
|
|
19257
|
-
$
|
|
19284
|
+
$xeGGWrapper.triggerToolbarCommitEvent({
|
|
19258
19285
|
code: refreshOpts.code || 'reload'
|
|
19259
|
-
}, $event).catch(
|
|
19286
|
+
}, $event).catch(() => {}).then(() => {
|
|
19260
19287
|
reactData.isRefresh = false;
|
|
19261
19288
|
});
|
|
19262
19289
|
}
|
|
@@ -19265,8 +19292,8 @@ function toolbar_createInternalData() {
|
|
|
19265
19292
|
const zoomEvent = ({
|
|
19266
19293
|
$event
|
|
19267
19294
|
}) => {
|
|
19268
|
-
if ($
|
|
19269
|
-
$
|
|
19295
|
+
if ($xeGGWrapper) {
|
|
19296
|
+
$xeGGWrapper.triggerZoomEvent($event);
|
|
19270
19297
|
} else {
|
|
19271
19298
|
warnLog('vxe.error.notProp', ['zoom']);
|
|
19272
19299
|
}
|
|
@@ -19384,8 +19411,8 @@ function toolbar_createInternalData() {
|
|
|
19384
19411
|
} = item;
|
|
19385
19412
|
if (code) {
|
|
19386
19413
|
handleDefaultCodeEvent(eventParams, item, () => {
|
|
19387
|
-
if ($
|
|
19388
|
-
$
|
|
19414
|
+
if ($xeGGWrapper) {
|
|
19415
|
+
$xeGGWrapper.triggerToolbarBtnEvent(item, $event);
|
|
19389
19416
|
} else {
|
|
19390
19417
|
const gCommandOpts = toolbar_commands.get(code);
|
|
19391
19418
|
const params = {
|
|
@@ -19393,7 +19420,7 @@ function toolbar_createInternalData() {
|
|
|
19393
19420
|
button: item,
|
|
19394
19421
|
$table: $table,
|
|
19395
19422
|
$grid: $xeGrid,
|
|
19396
|
-
$gantt:
|
|
19423
|
+
$gantt: $xeGantt,
|
|
19397
19424
|
$event
|
|
19398
19425
|
};
|
|
19399
19426
|
if (gCommandOpts) {
|
|
@@ -19422,8 +19449,8 @@ function toolbar_createInternalData() {
|
|
|
19422
19449
|
} = item;
|
|
19423
19450
|
if (code) {
|
|
19424
19451
|
handleDefaultCodeEvent(eventParams, item, () => {
|
|
19425
|
-
if ($
|
|
19426
|
-
$
|
|
19452
|
+
if ($xeGGWrapper) {
|
|
19453
|
+
$xeGGWrapper.triggerToolbarTolEvent(item, $event);
|
|
19427
19454
|
} else {
|
|
19428
19455
|
const gCommandOpts = toolbar_commands.get(code);
|
|
19429
19456
|
const params = {
|
|
@@ -19432,7 +19459,7 @@ function toolbar_createInternalData() {
|
|
|
19432
19459
|
tool: item,
|
|
19433
19460
|
$table: $table,
|
|
19434
19461
|
$grid: $xeGrid,
|
|
19435
|
-
$gantt:
|
|
19462
|
+
$gantt: $xeGantt,
|
|
19436
19463
|
$event
|
|
19437
19464
|
};
|
|
19438
19465
|
if (gCommandOpts) {
|
|
@@ -19512,6 +19539,7 @@ function toolbar_createInternalData() {
|
|
|
19512
19539
|
btnVNs.push(...getSlotVNs(buttonPrefixSlot({
|
|
19513
19540
|
buttons: buttons || [],
|
|
19514
19541
|
$grid: $xeGrid,
|
|
19542
|
+
$gantt: $xeGantt,
|
|
19515
19543
|
$table: $table
|
|
19516
19544
|
})));
|
|
19517
19545
|
}
|
|
@@ -19527,6 +19555,7 @@ function toolbar_createInternalData() {
|
|
|
19527
19555
|
const toolbarButtonClassName = compConf.toolbarButtonClassName;
|
|
19528
19556
|
const params = {
|
|
19529
19557
|
$grid: $xeGrid,
|
|
19558
|
+
$gantt: $xeGantt,
|
|
19530
19559
|
$table: $table,
|
|
19531
19560
|
button: item
|
|
19532
19561
|
};
|
|
@@ -19568,6 +19597,7 @@ function toolbar_createInternalData() {
|
|
|
19568
19597
|
btnVNs.push(...getSlotVNs(buttonSuffixSlot({
|
|
19569
19598
|
buttons: buttons || [],
|
|
19570
19599
|
$grid: $xeGrid,
|
|
19600
|
+
$gantt: $xeGantt,
|
|
19571
19601
|
$table: $table
|
|
19572
19602
|
})));
|
|
19573
19603
|
}
|
|
@@ -19591,6 +19621,7 @@ function toolbar_createInternalData() {
|
|
|
19591
19621
|
btnVNs.push(...getSlotVNs(toolPrefixSlot({
|
|
19592
19622
|
tools: tools || [],
|
|
19593
19623
|
$grid: $xeGrid,
|
|
19624
|
+
$gantt: $xeGantt,
|
|
19594
19625
|
$table: $table
|
|
19595
19626
|
})));
|
|
19596
19627
|
}
|
|
@@ -19607,6 +19638,7 @@ function toolbar_createInternalData() {
|
|
|
19607
19638
|
const toolbarToolClassName = compConf.toolbarToolClassName;
|
|
19608
19639
|
const params = {
|
|
19609
19640
|
$grid: $xeGrid,
|
|
19641
|
+
$gantt: $xeGantt,
|
|
19610
19642
|
$table: $table,
|
|
19611
19643
|
tool: item
|
|
19612
19644
|
};
|
|
@@ -19648,6 +19680,7 @@ function toolbar_createInternalData() {
|
|
|
19648
19680
|
btnVNs.push(...getSlotVNs(toolSuffixSlot({
|
|
19649
19681
|
tools: tools || [],
|
|
19650
19682
|
$grid: $xeGrid,
|
|
19683
|
+
$gantt: $xeGantt,
|
|
19651
19684
|
$table: $table
|
|
19652
19685
|
})));
|
|
19653
19686
|
}
|
|
@@ -19695,11 +19728,11 @@ function toolbar_createInternalData() {
|
|
|
19695
19728
|
};
|
|
19696
19729
|
const renderToolZoom = () => {
|
|
19697
19730
|
const zoomOpts = computeZoomOpts.value;
|
|
19698
|
-
return $
|
|
19731
|
+
return $xeGGWrapper && VxeUIButtonComponent ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(VxeUIButtonComponent, {
|
|
19699
19732
|
key: 'zoom',
|
|
19700
19733
|
circle: true,
|
|
19701
|
-
icon: $
|
|
19702
|
-
title: toolbar_getI18n(`vxe.toolbar.zoom${$
|
|
19734
|
+
icon: $xeGGWrapper.isMaximized() ? zoomOpts.iconOut || toolbar_getIcon().TOOLBAR_TOOLS_MINIMIZE : zoomOpts.iconIn || toolbar_getIcon().TOOLBAR_TOOLS_FULLSCREEN,
|
|
19735
|
+
title: toolbar_getI18n(`vxe.toolbar.zoom${$xeGGWrapper.isMaximized() ? 'Out' : 'In'}`),
|
|
19703
19736
|
onClick: zoomEvent
|
|
19704
19737
|
}) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)();
|
|
19705
19738
|
};
|
|
@@ -19755,21 +19788,23 @@ function toolbar_createInternalData() {
|
|
|
19755
19788
|
class: 'vxe-buttons--wrapper'
|
|
19756
19789
|
}, buttonsSlot ? buttonsSlot({
|
|
19757
19790
|
$grid: $xeGrid,
|
|
19791
|
+
$gantt: $xeGantt,
|
|
19758
19792
|
$table: $table
|
|
19759
19793
|
}) : renderLeftBtns()), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
19760
19794
|
class: 'vxe-tools--wrapper'
|
|
19761
19795
|
}, toolsSlot ? toolsSlot({
|
|
19762
19796
|
$grid: $xeGrid,
|
|
19797
|
+
$gantt: $xeGantt,
|
|
19763
19798
|
$table: $table
|
|
19764
19799
|
}) : renderRightTools()), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
19765
19800
|
class: 'vxe-tools--operate'
|
|
19766
|
-
}, [props.import ? renderToolImport() : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)(), props.export ? renderToolExport() : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)(), props.print ? renderToolPrint() : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)(), refresh ? renderToolRefresh() : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)(), zoom && $
|
|
19801
|
+
}, [props.import ? renderToolImport() : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)(), props.export ? renderToolExport() : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)(), props.print ? renderToolPrint() : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)(), refresh ? renderToolRefresh() : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)(), zoom && $xeGGWrapper ? renderToolZoom() : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)(), custom ? renderToolCustom() : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)()])]);
|
|
19767
19802
|
};
|
|
19768
19803
|
$xeToolbar.renderVN = renderVN;
|
|
19769
19804
|
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => {
|
|
19770
19805
|
const refreshOpts = computeRefreshOpts.value;
|
|
19771
19806
|
const queryMethod = refreshOpts.queryMethod || refreshOpts.query;
|
|
19772
|
-
if (props.refresh && !$
|
|
19807
|
+
if (props.refresh && !$xeGGWrapper && !queryMethod) {
|
|
19773
19808
|
warnLog('vxe.error.notFunc', ['queryMethod']);
|
|
19774
19809
|
}
|
|
19775
19810
|
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isPlainObject(props.custom)) {
|