vxe-table 4.14.10 → 4.14.12
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/src/table.js +32 -7
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/index.umd.js +9 -5
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/src/table.js +7 -3
- package/lib/table/src/table.min.js +1 -1
- package/lib/ui/index.js +1 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/package.json +1 -1
- package/packages/table/src/table.ts +32 -7
- /package/es/{iconfont.1754358163461.ttf → iconfont.1754381597724.ttf} +0 -0
- /package/es/{iconfont.1754358163461.woff → iconfont.1754381597724.woff} +0 -0
- /package/es/{iconfont.1754358163461.woff2 → iconfont.1754381597724.woff2} +0 -0
- /package/lib/{iconfont.1754358163461.ttf → iconfont.1754381597724.ttf} +0 -0
- /package/lib/{iconfont.1754358163461.woff → iconfont.1754381597724.woff} +0 -0
- /package/lib/{iconfont.1754358163461.woff2 → iconfont.1754381597724.woff2} +0 -0
package/es/table/src/table.js
CHANGED
|
@@ -473,18 +473,38 @@ export default defineVxeComponent({
|
|
|
473
473
|
return virtualYOpts;
|
|
474
474
|
});
|
|
475
475
|
const computeVirtualXOpts = computed(() => {
|
|
476
|
-
const { virtualXConfig } = props;
|
|
476
|
+
const { virtualXConfig, scrollX } = props;
|
|
477
|
+
const globalVirtualXConfig = getConfig().table.virtualXConfig;
|
|
478
|
+
const globalScrollX = getConfig().table.scrollX;
|
|
477
479
|
if (virtualXConfig) {
|
|
478
|
-
return Object.assign({},
|
|
480
|
+
return Object.assign({}, globalVirtualXConfig, virtualXConfig);
|
|
479
481
|
}
|
|
480
|
-
|
|
482
|
+
if (scrollX) {
|
|
483
|
+
// 已废弃,保留兼容
|
|
484
|
+
return Object.assign({}, globalScrollX, scrollX);
|
|
485
|
+
}
|
|
486
|
+
if (globalVirtualXConfig) {
|
|
487
|
+
return Object.assign({}, globalVirtualXConfig, virtualXConfig);
|
|
488
|
+
}
|
|
489
|
+
// 已废弃,保留兼容
|
|
490
|
+
return Object.assign({}, globalScrollX, scrollX);
|
|
481
491
|
});
|
|
482
492
|
const computeVirtualYOpts = computed(() => {
|
|
483
|
-
const { virtualYConfig } = props;
|
|
493
|
+
const { virtualYConfig, scrollY } = props;
|
|
494
|
+
const globalVirtualYConfig = getConfig().table.virtualYConfig;
|
|
495
|
+
const globalScrollY = getConfig().table.scrollY;
|
|
484
496
|
if (virtualYConfig) {
|
|
485
|
-
return Object.assign({},
|
|
497
|
+
return Object.assign({}, globalVirtualYConfig, virtualYConfig);
|
|
498
|
+
}
|
|
499
|
+
if (scrollY) {
|
|
500
|
+
// 已废弃,保留兼容
|
|
501
|
+
return Object.assign({}, globalScrollY, scrollY);
|
|
486
502
|
}
|
|
487
|
-
|
|
503
|
+
if (globalVirtualYConfig) {
|
|
504
|
+
return Object.assign({}, globalVirtualYConfig, virtualYConfig);
|
|
505
|
+
}
|
|
506
|
+
// 已废弃,保留兼容
|
|
507
|
+
return Object.assign({}, globalScrollY, scrollY);
|
|
488
508
|
});
|
|
489
509
|
const computeScrollbarOpts = computed(() => {
|
|
490
510
|
return Object.assign({}, getConfig().table.scrollbarConfig, props.scrollbarConfig);
|
|
@@ -7773,12 +7793,16 @@ export default defineVxeComponent({
|
|
|
7773
7793
|
cacheRowMap(isReset) {
|
|
7774
7794
|
const { treeConfig } = props;
|
|
7775
7795
|
const { isRowGroupStatus } = reactData;
|
|
7776
|
-
const { fullAllDataRowIdData, tableFullData, tableFullTreeData, tableFullGroupData, treeExpandedMaps } = internalData;
|
|
7796
|
+
const { currKeyField, fullAllDataRowIdData, tableFullData, tableFullTreeData, tableFullGroupData, treeExpandedMaps } = internalData;
|
|
7777
7797
|
const fullAllDataRowIdMaps = isReset ? {} : Object.assign({}, fullAllDataRowIdData); // 存在已删除数据
|
|
7778
7798
|
const fullDataRowIdMaps = {};
|
|
7799
|
+
const idMaps = {};
|
|
7779
7800
|
const { handleUpdateRowId } = createHandleUpdateRowId($xeTable);
|
|
7780
7801
|
const handleRowCache = (row, index, items, currIndex, parentRow, rowid, level, seq) => {
|
|
7781
7802
|
let rowRest = fullAllDataRowIdMaps[rowid];
|
|
7803
|
+
if (idMaps[rowid]) {
|
|
7804
|
+
errLog('vxe.error.repeatKey', [currKeyField, rowid]);
|
|
7805
|
+
}
|
|
7782
7806
|
if (!rowRest) {
|
|
7783
7807
|
rowRest = { row, rowid, seq, index: -1, _index: -1, $index: -1, treeIndex: index, items, parent: parentRow, level, height: 0, resizeHeight: 0, oTop: 0, expandHeight: 0 };
|
|
7784
7808
|
fullDataRowIdMaps[rowid] = rowRest;
|
|
@@ -7792,6 +7816,7 @@ export default defineVxeComponent({
|
|
|
7792
7816
|
rowRest.level = level;
|
|
7793
7817
|
rowRest.index = currIndex;
|
|
7794
7818
|
rowRest.treeIndex = index;
|
|
7819
|
+
idMaps[rowid] = true;
|
|
7795
7820
|
fullDataRowIdMaps[rowid] = rowRest;
|
|
7796
7821
|
fullAllDataRowIdMaps[rowid] = rowRest;
|
|
7797
7822
|
};
|
package/es/ui/index.js
CHANGED
package/es/ui/src/log.js
CHANGED
package/lib/index.umd.js
CHANGED
|
@@ -3233,7 +3233,7 @@ function eqEmptyValue(cellValue) {
|
|
|
3233
3233
|
;// ./packages/ui/index.ts
|
|
3234
3234
|
|
|
3235
3235
|
|
|
3236
|
-
const version = "4.14.
|
|
3236
|
+
const version = "4.14.12";
|
|
3237
3237
|
core_.VxeUI.version = version;
|
|
3238
3238
|
core_.VxeUI.tableVersion = version;
|
|
3239
3239
|
core_.VxeUI.setConfig({
|
|
@@ -3728,7 +3728,7 @@ var es_iterator_some = __webpack_require__(3579);
|
|
|
3728
3728
|
const {
|
|
3729
3729
|
log: log_log
|
|
3730
3730
|
} = core_.VxeUI;
|
|
3731
|
-
const log_version = `table v${"4.14.
|
|
3731
|
+
const log_version = `table v${"4.14.12"}`;
|
|
3732
3732
|
const warnLog = log_log.create('warn', log_version);
|
|
3733
3733
|
const errLog = log_log.create('error', log_version);
|
|
3734
3734
|
;// ./packages/table/src/columnInfo.ts
|
|
@@ -11111,7 +11111,11 @@ removeRowMaps:{},cvCacheMaps:{},inited:false,tooltipTimeout:null,initStatus:fals
|
|
|
11111
11111
|
* @deprecated
|
|
11112
11112
|
*/const computeSXOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const virtualXOpts=computeVirtualXOpts.value;return virtualXOpts;});const computeScrollXThreshold=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const virtualXOpts=computeVirtualXOpts.value;const{threshold}=virtualXOpts;if(threshold){return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(threshold);}return 0;});/**
|
|
11113
11113
|
* @deprecated
|
|
11114
|
-
*/const computeSYOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const virtualYOpts=computeVirtualYOpts.value;return virtualYOpts;});const computeVirtualXOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const{virtualXConfig}=props;if(virtualXConfig){return Object.assign({},table_getConfig().table.virtualXConfig,virtualXConfig);}return Object.assign({},table_getConfig().table.virtualXConfig,table_getConfig().table.scrollX,props.scrollX);});const computeVirtualYOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const{virtualYConfig}=props;if(virtualYConfig){return Object.assign({},table_getConfig().table.virtualYConfig,virtualYConfig);}return Object.assign({},table_getConfig().table.virtualYConfig,table_getConfig().table.scrollY,props.scrollY);});const computeScrollbarOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.scrollbarConfig,props.scrollbarConfig);});const computeScrollbarXToTop=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const scrollbarOpts=computeScrollbarOpts.value;return!!(scrollbarOpts.x&&scrollbarOpts.x.position==='top');});const computeScrollbarYToLeft=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const scrollbarOpts=computeScrollbarOpts.value;return!!(scrollbarOpts.y&&scrollbarOpts.y.position==='left');});const computeScrollYThreshold=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const virtualYOpts=computeVirtualYOpts.value;const{threshold}=virtualYOpts;if(threshold){return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(threshold);}return 0;});const computeRowHeightMaps=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return reactData.rowHeightStore;});const computeDefaultRowHeight=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const vSize=computeSize.value;const rowHeightMaps=computeRowHeightMaps.value;return rowHeightMaps[vSize||'default']||18;});const computeColumnOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.columnConfig,props.columnConfig);});const computeCurrentColumnOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.currentColumnConfig,props.currentColumnConfig);});const computeCellOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const cellOpts=Object.assign({},table_getConfig().table.cellConfig,props.cellConfig);if(cellOpts.height){cellOpts.height=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellOpts.height);}return cellOpts;});const computeHeaderCellOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const headerCellOpts=Object.assign({},table_getConfig().table.headerCellConfig,props.headerCellConfig);const cellOpts=computeCellOpts.value;headerCellOpts.height=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(getCalcHeight(headerCellOpts.height||cellOpts.height));return headerCellOpts;});const computeFooterCellOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const footerCellOpts=Object.assign({},table_getConfig().table.footerCellConfig,props.footerCellConfig);const cellOpts=computeCellOpts.value;footerCellOpts.height=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(getCalcHeight(footerCellOpts.height||cellOpts.height));return footerCellOpts;});const computeRowOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.rowConfig,props.rowConfig);});const computeAggregateOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.aggregateConfig||table_getConfig().table.rowGroupConfig,props.aggregateConfig||props.rowGroupConfig);});const computeRowGroupOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return computeAggregateOpts.value;});const computeCurrentRowOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.currentRowConfig,props.currentRowConfig);});const computeRowDragOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.rowDragConfig,props.rowDragConfig);});const computeColumnDragOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.columnDragConfig,props.columnDragConfig);});const computeResizeOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.resizeConfig,props.resizeConfig);});const computeResizableOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.resizableConfig,props.resizableConfig);});const computeSeqOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({startIndex:0},table_getConfig().table.seqConfig,props.seqConfig);});const computeRadioOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.radioConfig,props.radioConfig);});const computeCheckboxOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.checkboxConfig,props.checkboxConfig);});const computeTooltipOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().tooltip,table_getConfig().table.tooltipConfig,props.tooltipConfig);});const computeTableTipConfig=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const{tooltipStore}=reactData;const tooltipOpts=computeTooltipOpts.value;return Object.assign({},tooltipOpts,tooltipStore.currOpts);});const computeValidTipConfig=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const tooltipOpts=computeTooltipOpts.value;return Object.assign({},tooltipOpts);});const computeEditOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.editConfig,props.editConfig);});const computeSortOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({orders:['asc','desc',null]},table_getConfig().table.sortConfig,props.sortConfig);});const computeFilterOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.filterConfig,props.filterConfig);});const computeMouseOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.mouseConfig,props.mouseConfig);});const computeAreaOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.areaConfig,props.areaConfig);});const computeKeyboardOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.keyboardConfig,props.keyboardConfig);});const computeClipOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.clipConfig,props.clipConfig);});const computeFNROpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.fnrConfig,props.fnrConfig);});const computeMenuOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.menuConfig,props.menuConfig);});const computeLeftFixedWidth=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const{columnStore}=reactData;const{leftList}=columnStore;let leftWidth=0;for(let i=0;i<leftList.length;i++){const column=leftList[i];leftWidth+=column.renderWidth;}return leftWidth;});const computeRightFixedWidth=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const{columnStore}=reactData;const{rightList}=columnStore;let leftWidth=0;for(let i=0;i<rightList.length;i++){const column=rightList[i];leftWidth+=column.renderWidth;}return leftWidth;});const computeHeaderMenu=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const menuOpts=computeMenuOpts.value;const headerOpts=menuOpts.header;return headerOpts&&headerOpts.options?headerOpts.options:[];});const computeBodyMenu=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const menuOpts=computeMenuOpts.value;const bodyOpts=menuOpts.body;return bodyOpts&&bodyOpts.options?bodyOpts.options:[];});const computeFooterMenu=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const menuOpts=computeMenuOpts.value;const footerOpts=menuOpts.footer;return footerOpts&&footerOpts.options?footerOpts.options:[];});const computeIsMenu=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const menuOpts=computeMenuOpts.value;const headerMenu=computeHeaderMenu.value;const bodyMenu=computeBodyMenu.value;const footerMenu=computeFooterMenu.value;return!!(props.menuConfig&&isEnableConf(menuOpts)&&(headerMenu.length||bodyMenu.length||footerMenu.length));});const computeMenuList=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const{ctxMenuStore}=reactData;const rest=[];ctxMenuStore.list.forEach(list=>{list.forEach(item=>{rest.push(item);});});return rest;});const computeExportOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.exportConfig,props.exportConfig);});const computeImportOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.importConfig,props.importConfig);});const computePrintOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.printConfig,props.printConfig);});const computeExpandOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.expandConfig,props.expandConfig);});const computeTreeOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.treeConfig,props.treeConfig);});const computeEmptyOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.emptyRender,props.emptyRender);});const computeLoadingOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.loadingConfig,props.loadingConfig);});const computeCellOffsetWidth=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return props.border?Math.max(2,Math.ceil(reactData.scrollbarWidth/reactData.tableColumn.length)):1;});const computeCustomOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.customConfig,props.customConfig);});const computeTableRowExpandedList=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const{tableData,rowExpandedFlag,expandColumn,rowGroupExpandedFlag,treeExpandedFlag}=reactData;const{visibleDataRowIdData,rowExpandedMaps}=internalData;const expandList=[];if(tableData.length&&expandColumn&&rowExpandedFlag&&rowGroupExpandedFlag&&treeExpandedFlag){external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(rowExpandedMaps,(row,rowid)=>{if(visibleDataRowIdData[rowid]){expandList.push(row);}});}return expandList;});const computeAutoWidthColumnList=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const{visibleColumn}=internalData;const{tableColumn}=reactData;return tableColumn.length||visibleColumn.length?visibleColumn.filter(column=>column.width==='auto'||column.minWidth==='auto'):[];});const computeFixedColumnSize=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const{tableColumn}=reactData;const{collectColumn}=internalData;let fixedSize=0;// 只判断第一层
|
|
11114
|
+
*/const computeSYOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const virtualYOpts=computeVirtualYOpts.value;return virtualYOpts;});const computeVirtualXOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const{virtualXConfig,scrollX}=props;const globalVirtualXConfig=table_getConfig().table.virtualXConfig;const globalScrollX=table_getConfig().table.scrollX;if(virtualXConfig){return Object.assign({},globalVirtualXConfig,virtualXConfig);}if(scrollX){// 已废弃,保留兼容
|
|
11115
|
+
return Object.assign({},globalScrollX,scrollX);}if(globalVirtualXConfig){return Object.assign({},globalVirtualXConfig,virtualXConfig);}// 已废弃,保留兼容
|
|
11116
|
+
return Object.assign({},globalScrollX,scrollX);});const computeVirtualYOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const{virtualYConfig,scrollY}=props;const globalVirtualYConfig=table_getConfig().table.virtualYConfig;const globalScrollY=table_getConfig().table.scrollY;if(virtualYConfig){return Object.assign({},globalVirtualYConfig,virtualYConfig);}if(scrollY){// 已废弃,保留兼容
|
|
11117
|
+
return Object.assign({},globalScrollY,scrollY);}if(globalVirtualYConfig){return Object.assign({},globalVirtualYConfig,virtualYConfig);}// 已废弃,保留兼容
|
|
11118
|
+
return Object.assign({},globalScrollY,scrollY);});const computeScrollbarOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.scrollbarConfig,props.scrollbarConfig);});const computeScrollbarXToTop=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const scrollbarOpts=computeScrollbarOpts.value;return!!(scrollbarOpts.x&&scrollbarOpts.x.position==='top');});const computeScrollbarYToLeft=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const scrollbarOpts=computeScrollbarOpts.value;return!!(scrollbarOpts.y&&scrollbarOpts.y.position==='left');});const computeScrollYThreshold=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const virtualYOpts=computeVirtualYOpts.value;const{threshold}=virtualYOpts;if(threshold){return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(threshold);}return 0;});const computeRowHeightMaps=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return reactData.rowHeightStore;});const computeDefaultRowHeight=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const vSize=computeSize.value;const rowHeightMaps=computeRowHeightMaps.value;return rowHeightMaps[vSize||'default']||18;});const computeColumnOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.columnConfig,props.columnConfig);});const computeCurrentColumnOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.currentColumnConfig,props.currentColumnConfig);});const computeCellOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const cellOpts=Object.assign({},table_getConfig().table.cellConfig,props.cellConfig);if(cellOpts.height){cellOpts.height=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellOpts.height);}return cellOpts;});const computeHeaderCellOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const headerCellOpts=Object.assign({},table_getConfig().table.headerCellConfig,props.headerCellConfig);const cellOpts=computeCellOpts.value;headerCellOpts.height=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(getCalcHeight(headerCellOpts.height||cellOpts.height));return headerCellOpts;});const computeFooterCellOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const footerCellOpts=Object.assign({},table_getConfig().table.footerCellConfig,props.footerCellConfig);const cellOpts=computeCellOpts.value;footerCellOpts.height=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(getCalcHeight(footerCellOpts.height||cellOpts.height));return footerCellOpts;});const computeRowOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.rowConfig,props.rowConfig);});const computeAggregateOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.aggregateConfig||table_getConfig().table.rowGroupConfig,props.aggregateConfig||props.rowGroupConfig);});const computeRowGroupOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return computeAggregateOpts.value;});const computeCurrentRowOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.currentRowConfig,props.currentRowConfig);});const computeRowDragOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.rowDragConfig,props.rowDragConfig);});const computeColumnDragOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.columnDragConfig,props.columnDragConfig);});const computeResizeOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.resizeConfig,props.resizeConfig);});const computeResizableOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.resizableConfig,props.resizableConfig);});const computeSeqOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({startIndex:0},table_getConfig().table.seqConfig,props.seqConfig);});const computeRadioOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.radioConfig,props.radioConfig);});const computeCheckboxOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.checkboxConfig,props.checkboxConfig);});const computeTooltipOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().tooltip,table_getConfig().table.tooltipConfig,props.tooltipConfig);});const computeTableTipConfig=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const{tooltipStore}=reactData;const tooltipOpts=computeTooltipOpts.value;return Object.assign({},tooltipOpts,tooltipStore.currOpts);});const computeValidTipConfig=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const tooltipOpts=computeTooltipOpts.value;return Object.assign({},tooltipOpts);});const computeEditOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.editConfig,props.editConfig);});const computeSortOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({orders:['asc','desc',null]},table_getConfig().table.sortConfig,props.sortConfig);});const computeFilterOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.filterConfig,props.filterConfig);});const computeMouseOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.mouseConfig,props.mouseConfig);});const computeAreaOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.areaConfig,props.areaConfig);});const computeKeyboardOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.keyboardConfig,props.keyboardConfig);});const computeClipOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.clipConfig,props.clipConfig);});const computeFNROpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.fnrConfig,props.fnrConfig);});const computeMenuOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.menuConfig,props.menuConfig);});const computeLeftFixedWidth=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const{columnStore}=reactData;const{leftList}=columnStore;let leftWidth=0;for(let i=0;i<leftList.length;i++){const column=leftList[i];leftWidth+=column.renderWidth;}return leftWidth;});const computeRightFixedWidth=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const{columnStore}=reactData;const{rightList}=columnStore;let leftWidth=0;for(let i=0;i<rightList.length;i++){const column=rightList[i];leftWidth+=column.renderWidth;}return leftWidth;});const computeHeaderMenu=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const menuOpts=computeMenuOpts.value;const headerOpts=menuOpts.header;return headerOpts&&headerOpts.options?headerOpts.options:[];});const computeBodyMenu=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const menuOpts=computeMenuOpts.value;const bodyOpts=menuOpts.body;return bodyOpts&&bodyOpts.options?bodyOpts.options:[];});const computeFooterMenu=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const menuOpts=computeMenuOpts.value;const footerOpts=menuOpts.footer;return footerOpts&&footerOpts.options?footerOpts.options:[];});const computeIsMenu=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const menuOpts=computeMenuOpts.value;const headerMenu=computeHeaderMenu.value;const bodyMenu=computeBodyMenu.value;const footerMenu=computeFooterMenu.value;return!!(props.menuConfig&&isEnableConf(menuOpts)&&(headerMenu.length||bodyMenu.length||footerMenu.length));});const computeMenuList=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const{ctxMenuStore}=reactData;const rest=[];ctxMenuStore.list.forEach(list=>{list.forEach(item=>{rest.push(item);});});return rest;});const computeExportOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.exportConfig,props.exportConfig);});const computeImportOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.importConfig,props.importConfig);});const computePrintOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.printConfig,props.printConfig);});const computeExpandOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.expandConfig,props.expandConfig);});const computeTreeOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.treeConfig,props.treeConfig);});const computeEmptyOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.emptyRender,props.emptyRender);});const computeLoadingOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.loadingConfig,props.loadingConfig);});const computeCellOffsetWidth=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return props.border?Math.max(2,Math.ceil(reactData.scrollbarWidth/reactData.tableColumn.length)):1;});const computeCustomOpts=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{return Object.assign({},table_getConfig().table.customConfig,props.customConfig);});const computeTableRowExpandedList=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const{tableData,rowExpandedFlag,expandColumn,rowGroupExpandedFlag,treeExpandedFlag}=reactData;const{visibleDataRowIdData,rowExpandedMaps}=internalData;const expandList=[];if(tableData.length&&expandColumn&&rowExpandedFlag&&rowGroupExpandedFlag&&treeExpandedFlag){external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(rowExpandedMaps,(row,rowid)=>{if(visibleDataRowIdData[rowid]){expandList.push(row);}});}return expandList;});const computeAutoWidthColumnList=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const{visibleColumn}=internalData;const{tableColumn}=reactData;return tableColumn.length||visibleColumn.length?visibleColumn.filter(column=>column.width==='auto'||column.minWidth==='auto'):[];});const computeFixedColumnSize=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const{tableColumn}=reactData;const{collectColumn}=internalData;let fixedSize=0;// 只判断第一层
|
|
11115
11119
|
if(tableColumn.length&&collectColumn.length){collectColumn.forEach(column=>{if(column.renderFixed){fixedSize++;}});}return fixedSize;});const computeIsMaxFixedColumn=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const fixedColumnSize=computeFixedColumnSize.value;const columnOpts=computeColumnOpts.value;const{maxFixedSize}=columnOpts;if(maxFixedSize){return fixedColumnSize>=maxFixedSize;}return false;});const computeTableBorder=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const{border}=props;if(border===true){return'full';}if(border){return border;}return'default';});const computeIsAllCheckboxDisabled=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const{treeConfig}=props;const{tableData}=reactData;const{tableFullData}=internalData;const checkboxOpts=computeCheckboxOpts.value;const{strict,checkMethod}=checkboxOpts;if(strict){if(tableData.length||tableFullData.length){if(checkMethod){if(treeConfig){// 暂时不支持树形结构
|
|
11116
11120
|
}// 如果所有行都被禁用
|
|
11117
11121
|
return tableFullData.every(row=>!checkMethod({$table:$xeTable,row}));}return false;}return true;}return false;});const computeVirtualScrollBars=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const{overflowX,scrollXLoad,overflowY,scrollYLoad}=reactData;return{x:overflowX&&scrollXLoad,y:overflowY&&scrollYLoad};});const computeRowGroupFields=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const rowGroupOpts=computeRowGroupOpts.value;return rowGroupOpts.groupFields;});const computeRowGroupColumns=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(()=>{const{rowGroupList}=reactData;const{fullColumnFieldData}=internalData;const rgColumns=[];rowGroupList.forEach(aggConf=>{const colRest=fullColumnFieldData[aggConf.field];if(colRest){rgColumns.push(colRest.column);}});return rgColumns;});const refMaps={refElem,refTooltip,refValidTooltip,refTableFilter,refTableCustom,refTableMenu,refTableHeader,refTableBody,refTableFooter,refTableLeftHeader,refTableLeftBody,refTableLeftFooter,refTableRightHeader,refTableRightBody,refTableRightFooter,refLeftContainer,refRightContainer,refColResizeBar,refRowResizeBar,refScrollXVirtualElem,refScrollYVirtualElem,refScrollXHandleElem,refScrollYHandleElem,refScrollXSpaceElem,refScrollYSpaceElem};const computeMaps={computeSize,computeTableId,computeValidOpts,computeRowField,computeVirtualXOpts,computeVirtualYOpts,computeScrollbarOpts,computeScrollbarXToTop,computeScrollbarYToLeft,computeColumnOpts,computeCurrentColumnOpts,computeScrollXThreshold,computeScrollYThreshold,computeRowHeightMaps,computeDefaultRowHeight,computeCellOpts,computeHeaderCellOpts,computeFooterCellOpts,computeRowOpts,computeAggregateOpts,computeRowGroupOpts,computeCurrentRowOpts,computeRowDragOpts,computeColumnDragOpts,computeResizeOpts,computeResizableOpts,computeSeqOpts,computeRadioOpts,computeCheckboxOpts,computeTooltipOpts,computeEditOpts,computeSortOpts,computeFilterOpts,computeMouseOpts,computeAreaOpts,computeKeyboardOpts,computeClipOpts,computeFNROpts,computeHeaderMenu,computeBodyMenu,computeFooterMenu,computeIsMenu,computeMenuList,computeMenuOpts,computeExportOpts,computeImportOpts,computePrintOpts,computeExpandOpts,computeTreeOpts,computeEmptyOpts,computeLoadingOpts,computeCellOffsetWidth,computeCustomOpts,computeLeftFixedWidth,computeRightFixedWidth,computeFixedColumnSize,computeIsMaxFixedColumn,computeIsAllCheckboxDisabled,computeVirtualScrollBars,computeRowGroupFields,computeRowGroupColumns,computeSXOpts,computeSYOpts};const $xeTable={xID,props:props,context,reactData,internalData,getRefMaps:()=>refMaps,getComputeMaps:()=>computeMaps,xeGrid:$xeGrid,xegrid:$xeGrid};const eqCellValue=(row1,row2,field)=>{const val1=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row1,field);const val2=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row2,field);if(eqEmptyValue(val1)&&eqEmptyValue(val2)){return true;}if(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(val1)||external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(val1)){return''+val1===''+val2;}return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isEqual(val1,val2);};const handleKeyField=()=>{const keyField=computeRowField.value;internalData.currKeyField=keyField;internalData.isCurrDeepKey=hasDeepKey(keyField);};const hangleStorageDefaultValue=(value,isAll)=>{return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(value)?value:isAll;};const getNextSortOrder=column=>{const sortOpts=computeSortOpts.value;const{orders=[]}=sortOpts;const currOrder=column.order||null;const oIndex=orders.indexOf(currOrder)+1;return orders[oIndex<orders.length?oIndex:0];};const getCustomStorageMap=id=>{const version=table_getConfig().version;const rest=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toStringJSON(localStorage.getItem(customStorageKey)||'');const maps=rest&&rest._v===version?rest:{_v:version};return(id?maps[id]:maps)||{};};const setCustomStorageMap=(id,data)=>{const version=table_getConfig().version;const maps=getCustomStorageMap();maps[id]=data||undefined;maps._v=version;localStorage.setItem(customStorageKey,external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toJSONString(maps));};const getRecoverRowMaps=keyMaps=>{const{fullAllDataRowIdData}=internalData;const restKeys={};external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(keyMaps,(row,rowid)=>{if(fullAllDataRowIdData[rowid]){restKeys[rowid]=row;}});return restKeys;};const handleReserveRow=reserveRowMap=>{const{fullDataRowIdData}=internalData;const reserveList=[];external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(reserveRowMap,(item,rowid)=>{if(fullDataRowIdData[rowid]&&$xeTable.findRowIndexOf(reserveList,fullDataRowIdData[rowid].row)===-1){reserveList.push(fullDataRowIdData[rowid].row);}});return reserveList;};const handleVirtualXVisible=()=>{const{isScrollXBig,scrollXWidth}=reactData;const{elemStore,visibleColumn,fullColumnIdData}=internalData;const leftFixedWidth=computeLeftFixedWidth.value;const rightFixedWidth=computeRightFixedWidth.value;const bodyScrollElem=getRefElem(elemStore['main-body-scroll']);if(bodyScrollElem){const clientWidth=bodyScrollElem.clientWidth;let scrollLeft=bodyScrollElem.scrollLeft;if(isScrollXBig){scrollLeft=Math.ceil((scrollXWidth-clientWidth)*Math.min(1,scrollLeft/(maxXWidth-clientWidth)));}const startLeft=scrollLeft+leftFixedWidth;const endLeft=scrollLeft+clientWidth-rightFixedWidth;let leftIndex=0;let rightIndex=visibleColumn.length;while(leftIndex<rightIndex){const cIndex=Math.floor((leftIndex+rightIndex)/2);const column=visibleColumn[cIndex];const colid=column.id;const colRest=fullColumnIdData[colid]||{};if(colRest.oLeft<=startLeft){leftIndex=cIndex+1;}else{rightIndex=cIndex;}}let visibleSize=0;const toVisibleIndex=leftIndex===visibleColumn.length?leftIndex:Math.max(0,leftIndex<visibleColumn.length?leftIndex-2:0);for(let cIndex=toVisibleIndex,cLen=visibleColumn.length;cIndex<cLen;cIndex++){const column=visibleColumn[cIndex];const colid=column.id;const colRest=fullColumnIdData[colid]||{};visibleSize++;if(colRest.oLeft>endLeft||visibleSize>=60){break;}}return{toVisibleIndex:Math.max(0,toVisibleIndex),visibleSize:Math.max(1,visibleSize)};}return{toVisibleIndex:0,visibleSize:6};};const calcVarRowHeightConfig=(sizeKey,sizeEl)=>{const{rowHeightStore}=reactData;if(sizeEl&&sizeEl.clientHeight){rowHeightStore[sizeKey]=sizeEl.clientHeight;}};const computeRowHeight=()=>{const{isAllOverflow}=reactData;const tableHeader=refTableHeader.value;const tableBody=refTableBody.value;const tableBodyElem=tableBody?tableBody.$el:null;const defaultRowHeight=computeDefaultRowHeight.value;let rowHeight=0;if(isAllOverflow){if(tableBodyElem){const tableHeaderElem=tableHeader?tableHeader.$el:null;let firstTrElem;firstTrElem=tableBodyElem.querySelector('tr');if(!firstTrElem&&tableHeaderElem){firstTrElem=tableHeaderElem.querySelector('tr');}if(firstTrElem){rowHeight=firstTrElem.clientHeight;}}if(!rowHeight){rowHeight=defaultRowHeight;}}else{rowHeight=defaultRowHeight;}// 最低支持 18px 行高
|
|
@@ -11723,8 +11727,8 @@ if(force){// 更新数据,处理筛选和排序
|
|
|
11723
11727
|
updateAfterFullData();// 如果为虚拟树,将树结构拍平
|
|
11724
11728
|
fullList=handleVirtualTreeToList();}const tableData=scrollYLoad?fullList.slice(scrollYStore.startIndex,scrollYStore.endIndex):fullList.slice(0);const visibleDataRowIdMaps={};tableData.forEach((row,$index)=>{const rowid=getRowid($xeTable,row);const rest=fullDataRowIdData[rowid];if(rest){rest.$index=$index;}visibleDataRowIdMaps[rowid]=row;});reactData.tableData=tableData;internalData.visibleDataRowIdData=visibleDataRowIdMaps;return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();},/**
|
|
11725
11729
|
* 更新数据行的 Map
|
|
11726
|
-
*/cacheRowMap(isReset){const{treeConfig}=props;const{isRowGroupStatus}=reactData;const{fullAllDataRowIdData,tableFullData,tableFullTreeData,tableFullGroupData,treeExpandedMaps}=internalData;const fullAllDataRowIdMaps=isReset?{}:{...fullAllDataRowIdData};// 存在已删除数据
|
|
11727
|
-
const fullDataRowIdMaps={};const{handleUpdateRowId}=createHandleUpdateRowId($xeTable);const handleRowCache=(row,index,items,currIndex,parentRow,rowid,level,seq)=>{let rowRest=fullAllDataRowIdMaps[rowid];if(!rowRest){rowRest={row,rowid,seq,index:-1,_index:-1,$index:-1,treeIndex:index,items,parent:parentRow,level,height:0,resizeHeight:0,oTop:0,expandHeight:0};fullDataRowIdMaps[rowid]=rowRest;fullAllDataRowIdMaps[rowid]=rowRest;}rowRest.treeLoaded=false;rowRest.expandLoaded=false;rowRest.row=row;rowRest.items=items;rowRest.parent=parentRow;rowRest.level=level;rowRest.index=currIndex;rowRest.treeIndex=index;fullDataRowIdMaps[rowid]=rowRest;fullAllDataRowIdMaps[rowid]=rowRest;};if(treeConfig){const treeOpts=computeTreeOpts.value;const{lazy}=treeOpts;const childrenField=treeOpts.children||treeOpts.childrenField;const hasChildField=treeOpts.hasChild||treeOpts.hasChildField;external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(tableFullTreeData,(row,index,items,path,parentRow,nodes)=>{const rowid=handleUpdateRowId(row);if(treeConfig&&lazy){if(row[hasChildField]&&row[childrenField]===undefined){row[childrenField]=null;}if(treeExpandedMaps[rowid]){if(!row[childrenField]||!row[childrenField].length){delete treeExpandedMaps[rowid];}}}handleRowCache(row,index,items,parentRow?-1:index,parentRow,rowid,nodes.length-1,toTreePathSeq(path));},{children:childrenField});}else if(isRowGroupStatus){const aggregateOpts=computeAggregateOpts.value;const{mapChildrenField}=aggregateOpts;external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(tableFullGroupData,(row,index,items,path,parentRow,nodes)=>{const rowid=handleUpdateRowId(row);handleRowCache(row,index,items,parentRow?-1:index,parentRow,rowid,nodes.length-1,toTreePathSeq(path));},{children:mapChildrenField});}else{tableFullData.forEach((row,index,items)=>{handleRowCache(row,index,items,index,null,handleUpdateRowId(row),0,index+1);});}internalData.fullDataRowIdData=fullDataRowIdMaps;internalData.fullAllDataRowIdData=fullAllDataRowIdMaps;reactData.treeExpandedFlag++;},cacheSourceMap(fullData){const{treeConfig}=props;const treeOpts=computeTreeOpts.value;const sourceData=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().clone(fullData,true);const{handleUpdateRowId}=createHandleUpdateRowId($xeTable);const sourceRowIdData={};const handleSourceRow=row=>{const rowid=handleUpdateRowId(row);sourceRowIdData[rowid]=row;};// 源数据缓存
|
|
11730
|
+
*/cacheRowMap(isReset){const{treeConfig}=props;const{isRowGroupStatus}=reactData;const{currKeyField,fullAllDataRowIdData,tableFullData,tableFullTreeData,tableFullGroupData,treeExpandedMaps}=internalData;const fullAllDataRowIdMaps=isReset?{}:{...fullAllDataRowIdData};// 存在已删除数据
|
|
11731
|
+
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,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;};// 源数据缓存
|
|
11728
11732
|
if(treeConfig){const childrenField=treeOpts.children||treeOpts.childrenField;external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(sourceData,handleSourceRow,{children:treeOpts.transform?treeOpts.mapChildrenField:childrenField});}else{sourceData.forEach(handleSourceRow);}internalData.sourceDataRowIdData=sourceRowIdData;internalData.tableSourceData=sourceData;},/**
|
|
11729
11733
|
* 指定列宽的列进行拆分
|
|
11730
11734
|
*/analyColumnWidth(){const{tableFullColumn}=internalData;const columnOpts=computeColumnOpts.value;const{width:defaultWidth,minWidth:defaultMinWidth}=columnOpts;const resizeList=[];const pxList=[];const pxMinList=[];const autoMinList=[];const scaleList=[];const scaleMinList=[];const autoList=[];const remainList=[];tableFullColumn.forEach(column=>{if(defaultWidth&&!column.width){column.width=defaultWidth;}if(defaultMinWidth&&!column.minWidth){column.minWidth=defaultMinWidth;}if(column.visible){if(column.resizeWidth){resizeList.push(column);}else if(column.width==='auto'){autoList.push(column);}else if(isPx(column.width)){pxList.push(column);}else if(isScale(column.width)){scaleList.push(column);}else if(isPx(column.minWidth)){pxMinList.push(column);}else if(column.minWidth==='auto'){autoMinList.push(column);}else if(isScale(column.minWidth)){scaleMinList.push(column);}else{remainList.push(column);}}});Object.assign(reactData.columnStore,{resizeList,pxList,pxMinList,autoMinList,scaleList,scaleMinList,autoList,remainList});},handleColResizeMousedownEvent(evnt,fixedType,params){evnt.stopPropagation();evnt.preventDefault();const{column}=params;const{columnStore,overflowX,scrollbarHeight}=reactData;const{elemStore,visibleColumn}=internalData;const{leftList,rightList}=columnStore;const resizableOpts=computeResizableOpts.value;const osbHeight=overflowX?scrollbarHeight:0;const tableEl=refElem.value;const leftContainerElem=refLeftContainer.value;const rightContainerElem=refRightContainer.value;const resizeBarElem=refColResizeBar.value;if(!resizeBarElem){return;}const isLeftFixed=fixedType==='left';const isRightFixed=fixedType==='right';const resizeTipElem=resizeBarElem.firstElementChild;const scrollbarXToTop=computeScrollbarXToTop.value;const{clientX:dragClientX}=evnt;const dragBtnElem=evnt.target;let resizeColumn=column;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 cell=dragBtnElem.parentNode;const cellParams=Object.assign(params,{cell});let dragLeft=0;const bodyScrollElem=getRefElem(elemStore['main-body-scroll']);if(!bodyScrollElem){return;}const tableRect=tableEl.getBoundingClientRect();const rightContainerRect=rightContainerElem?rightContainerElem.getBoundingClientRect():null;const cellRect=cell.getBoundingClientRect();const dragBtnRect=dragBtnElem.getBoundingClientRect();const dragBtnWidth=dragBtnElem.clientWidth;const dragBtnOffsetWidth=Math.floor(dragBtnWidth/2);const dragPosLeft=dragBtnRect.x-tableRect.x+dragBtnOffsetWidth;const minInterval=getColReMinWidth(cellParams)-dragBtnOffsetWidth;// 列之间的最小间距
|