vxe-table 3.21.18 → 3.21.20

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.
@@ -780,16 +780,28 @@ export default {
780
780
  const props = $xeTable;
781
781
  const internalData = $xeTable;
782
782
  const { keepSource, treeConfig } = props;
783
- const { tableFullData } = internalData;
783
+ const { tableFullData, tableFullTreeData } = internalData;
784
784
  const treeOpts = $xeTable.computeTreeOpts;
785
+ const updateRecords = [];
785
786
  if (keepSource) {
786
787
  syncActivedCell($xeTable);
787
788
  if (treeConfig) {
788
- return XEUtils.filterTree(tableFullData, row => $xeTable.isUpdateByRow(row), treeOpts);
789
+ const childrenField = treeOpts.children || treeOpts.childrenField;
790
+ XEUtils.eachTree(tableFullTreeData, row => {
791
+ if ($xeTable.isUpdateByRow(row)) {
792
+ updateRecords.push(row);
793
+ }
794
+ }, { children: childrenField });
795
+ }
796
+ else {
797
+ tableFullData.forEach((row) => {
798
+ if ($xeTable.isUpdateByRow(row)) {
799
+ updateRecords.push(row);
800
+ }
801
+ });
789
802
  }
790
- return tableFullData.filter((row) => $xeTable.isUpdateByRow(row));
791
803
  }
792
- return [];
804
+ return updateRecords;
793
805
  },
794
806
  /**
795
807
  * 处理激活编辑
@@ -17,16 +17,20 @@ const maxYHeight = 5e6;
17
17
  const maxXWidth = 5e6;
18
18
  const sourceType = 'table';
19
19
  let crossTableDragRowObj = null;
20
- function eqCellValue(row1, row2, field) {
21
- const val1 = XEUtils.get(row1, field);
22
- const val2 = XEUtils.get(row2, field);
20
+ function eqCellValue(newRow, oldRow, field) {
21
+ const val1 = XEUtils.get(newRow, field);
22
+ const val2 = XEUtils.get(oldRow, field);
23
+ let result = false;
23
24
  if (eqEmptyValue(val1) && eqEmptyValue(val2)) {
24
- return true;
25
+ result = true;
25
26
  }
26
- if (XEUtils.isString(val1) || XEUtils.isNumber(val1)) {
27
- return ('' + val1) === ('' + val2);
27
+ else if (XEUtils.isString(val1) || XEUtils.isNumber(val1)) {
28
+ result = ('' + val1) === ('' + val2);
28
29
  }
29
- return XEUtils.isEqual(val1, val2);
30
+ else {
31
+ result = XEUtils.isEqual(val1, val2);
32
+ }
33
+ return { newValue: val1, oldValue: val2, result };
30
34
  }
31
35
  function hangleStorageDefaultValue(value, isAll) {
32
36
  return XEUtils.isBoolean(value) ? value : isAll;
@@ -2558,7 +2562,7 @@ function getOrderField($xeTable, column) {
2558
2562
  cellValue = $xeTable.getCellLabel(row, column);
2559
2563
  }
2560
2564
  if (!sortType || sortType === 'auto') {
2561
- return isNaN(cellValue) ? cellValue : XEUtils.toNumber(cellValue);
2565
+ return eqEmptyValue(cellValue) || isNaN(cellValue) ? cellValue : XEUtils.toNumber(cellValue);
2562
2566
  }
2563
2567
  else if (sortType === 'number') {
2564
2568
  return XEUtils.toNumber(cellValue);
@@ -2577,7 +2581,7 @@ function getOrderField($xeTable, column) {
2577
2581
  cellValue = $xeTable.getCellLabel(row, column);
2578
2582
  }
2579
2583
  if (!sortType || sortType === 'auto') {
2580
- return isNaN(cellValue) ? cellValue : XEUtils.toNumber(cellValue);
2584
+ return eqEmptyValue(cellValue) || isNaN(cellValue) ? cellValue : XEUtils.toNumber(cellValue);
2581
2585
  }
2582
2586
  else if (sortType === 'number') {
2583
2587
  return XEUtils.toNumber(cellValue);
@@ -5815,18 +5819,60 @@ const tableMethods = {
5815
5819
  }
5816
5820
  const row = rowRest.row;
5817
5821
  const oRow = sourceDataRowIdData[rowid];
5818
- if (oRow) {
5819
- if (arguments.length > 1) {
5820
- return !eqCellValue(oRow, row, field);
5822
+ if (!oRow) {
5823
+ return false;
5824
+ }
5825
+ if (arguments.length > 1) {
5826
+ return !eqCellValue(oRow, row, field).result;
5827
+ }
5828
+ for (let i = 0; i < keepFields.length; i++) {
5829
+ if (!eqCellValue(oRow, row, keepFields[i]).result) {
5830
+ return true;
5831
+ }
5832
+ }
5833
+ }
5834
+ return false;
5835
+ },
5836
+ getUpdateCells() {
5837
+ const $xeTable = this;
5838
+ const props = $xeTable;
5839
+ const internalData = $xeTable;
5840
+ const { keepSource, treeConfig } = props;
5841
+ const { tableFullData, tableFullTreeData, fullDataRowIdData, sourceDataRowIdData, fullColumnFieldData } = internalData;
5842
+ const treeOpts = $xeTable.computeTreeOpts;
5843
+ const keepFields = $xeTable.computeKeepFields;
5844
+ const cellList = [];
5845
+ if (keepSource) {
5846
+ const { handleGetRowId } = createHandleGetRowId($xeTable);
5847
+ const handleCell = (item) => {
5848
+ const rowid = handleGetRowId(item);
5849
+ const rowRest = fullDataRowIdData[rowid];
5850
+ // 新增的数据不需要检测
5851
+ if (!rowRest) {
5852
+ return;
5853
+ }
5854
+ const row = rowRest.row;
5855
+ const oRow = sourceDataRowIdData[rowid];
5856
+ if (!oRow) {
5857
+ return;
5821
5858
  }
5822
5859
  for (let i = 0; i < keepFields.length; i++) {
5823
- if (!eqCellValue(oRow, row, keepFields[i])) {
5824
- return true;
5860
+ const field = keepFields[i];
5861
+ const { result, newValue, oldValue } = eqCellValue(oRow, row, field);
5862
+ if (!result) {
5863
+ const column = fullColumnFieldData[field] ? fullColumnFieldData[field].column : null;
5864
+ cellList.push({ row, rowid, column, field, newValue, oldValue });
5825
5865
  }
5826
5866
  }
5867
+ };
5868
+ if (treeConfig) {
5869
+ XEUtils.eachTree(tableFullTreeData, handleCell, treeOpts);
5870
+ }
5871
+ else {
5872
+ tableFullData.forEach(handleCell);
5827
5873
  }
5828
5874
  }
5829
- return false;
5875
+ return cellList;
5830
5876
  },
5831
5877
  /**
5832
5878
  * 获取表格的可视列,也可以指定索引获取列
@@ -1921,8 +1921,7 @@ export default {
1921
1921
  }
1922
1922
  if ((props.showOverflow === true || props.showOverflow === 'tooltip') ||
1923
1923
  (props.showHeaderOverflow === true || props.showHeaderOverflow === 'tooltip') ||
1924
- (props.showFooterOverflow === true || props.showFooterOverflow === 'tooltip') ||
1925
- props.tooltipConfig || props.editRules) {
1924
+ (props.showFooterOverflow === true || props.showFooterOverflow === 'tooltip')) {
1926
1925
  if (!VxeUITooltipComponent) {
1927
1926
  if (props.showOverflow === true) {
1928
1927
  errLog('vxe.error.errProp', ['show-overflow=true', 'show-overflow=title']);
package/es/ui/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { VxeUI } from '@vxe-ui/core';
2
2
  import { getFuncText } from './src/utils';
3
- export const version = "3.21.18";
3
+ export const version = "3.21.20";
4
4
  VxeUI.version = version;
5
5
  VxeUI.tableVersion = version;
6
6
  VxeUI.setConfig({
package/es/ui/src/log.js CHANGED
@@ -1,13 +1,14 @@
1
1
  import { VxeUI } from '@vxe-ui/core';
2
2
  const { log } = VxeUI;
3
- const tableVersion = `table v${"3.21.18"}`;
3
+ const tableVersion = `table v${"3.21.20"}`;
4
4
  export function createComponentLog(name) {
5
5
  const uiVersion = VxeUI.uiVersion ? `ui v${VxeUI.uiVersion}` : '';
6
6
  const ganttVersion = VxeUI.ganttVersion ? `gantt v${VxeUI.ganttVersion}` : '';
7
7
  const designVersion = VxeUI.designVersion ? `design v${VxeUI.designVersion}` : '';
8
+ const versionInfo = [uiVersion, tableVersion, ganttVersion, designVersion].join(' ');
8
9
  return {
9
- warnLog: log.create('warn', uiVersion + tableVersion + ganttVersion + designVersion + '] [' + name),
10
- errLog: log.create('error', uiVersion + tableVersion + ganttVersion + designVersion + '] [' + name)
10
+ warnLog: log.create('warn', versionInfo + '] [' + name),
11
+ errLog: log.create('error', versionInfo + '] [' + name)
11
12
  };
12
13
  }
13
14
  export const warnLog = log.create('warn', tableVersion);
package/lib/index.umd.js CHANGED
@@ -3311,7 +3311,7 @@ function getClass(property, params) {
3311
3311
  /* unused harmony import specifier */ var VxeUI;
3312
3312
 
3313
3313
 
3314
- const version = "3.21.18";
3314
+ const version = "3.21.20";
3315
3315
  core_.VxeUI.version = version;
3316
3316
  core_.VxeUI.tableVersion = version;
3317
3317
  core_.VxeUI.setConfig({
@@ -4074,14 +4074,15 @@ function wheelScrollTopTo(diffNum, cb) {
4074
4074
  const {
4075
4075
  log: log_log
4076
4076
  } = core_.VxeUI;
4077
- const tableVersion = `table v${"3.21.18"}`;
4077
+ const tableVersion = `table v${"3.21.20"}`;
4078
4078
  function createComponentLog(name) {
4079
4079
  const uiVersion = core_.VxeUI.uiVersion ? `ui v${core_.VxeUI.uiVersion}` : '';
4080
4080
  const ganttVersion = core_.VxeUI.ganttVersion ? `gantt v${core_.VxeUI.ganttVersion}` : '';
4081
4081
  const designVersion = core_.VxeUI.designVersion ? `design v${core_.VxeUI.designVersion}` : '';
4082
+ const versionInfo = [uiVersion, tableVersion, ganttVersion, designVersion].join(' ');
4082
4083
  return {
4083
- warnLog: log_log.create('warn', uiVersion + tableVersion + ganttVersion + designVersion + '] [' + name),
4084
- errLog: log_log.create('error', uiVersion + tableVersion + ganttVersion + designVersion + '] [' + name)
4084
+ warnLog: log_log.create('warn', versionInfo + '] [' + name),
4085
+ errLog: log_log.create('error', versionInfo + '] [' + name)
4085
4086
  };
4086
4087
  }
4087
4088
  const warnLog = log_log.create('warn', tableVersion);
@@ -7725,7 +7726,7 @@ function getCrossTableDragRowInfo($xeTable) {
7725
7726
  return crossTableDragRowInfo;
7726
7727
  }
7727
7728
  ;// ./packages/table/src/methods.ts
7728
- const{warnLog: methods_warnLog,errLog: methods_errLog}=createComponentLog('table');const{getConfig: methods_getConfig,getI18n: methods_getI18n,renderer: methods_renderer,formats: methods_formats,interceptor: methods_interceptor,createEvent,globalEvents: methods_globalEvents,GLOBAL_EVENT_KEYS}=core_.VxeUI;const browseObj=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().browse();const supportMaxRow=5e6;const customStorageKey='VXE_CUSTOM_STORE';const maxYHeight=5e6;const maxXWidth=5e6;const sourceType='table';let crossTableDragRowObj=null;function 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);}function hangleStorageDefaultValue(value,isAll){return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(value)?value:isAll;}function getNextSortOrder($xeTable,column){const sortOpts=$xeTable.computeSortOpts;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=methods_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=methods_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=($xeTable,keyMaps)=>{const internalData=$xeTable;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;};function handleReserveRow($xeTable,reserveRowMap){const internalData=$xeTable;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]&&reserveList.indexOf(fullDataRowIdData[rowid].row)===-1){reserveList.push(fullDataRowIdData[rowid].row);}});return reserveList;}function handleVirtualXVisible($xeTable){const reactData=$xeTable;const internalData=$xeTable;const{isScrollXBig,scrollXWidth}=reactData;const{elemStore,visibleColumn,fullColumnIdData}=internalData;const leftFixedWidth=$xeTable.computeLeftFixedWidth;const rightFixedWidth=$xeTable.computeRightFixedWidth;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(6,visibleSize)};}return{toVisibleIndex:0,visibleSize:6};}function handleCustomRestore($xeTable,storeData){const props=$xeTable;const reactData=$xeTable;const internalData=$xeTable;const{aggregateConfig,rowGroupConfig}=props;const{collectColumn}=internalData;const customOpts=$xeTable.computeCustomOpts;const{storage,storeOptions}=customOpts;const isAllCustom=storage===true;const storageOpts=Object.assign({},isAllCustom?{}:storage||{},storeOptions);const isCustomResizable=hangleStorageDefaultValue(storageOpts.resizable,isAllCustom);const isCustomVisible=hangleStorageDefaultValue(storageOpts.visible,isAllCustom);const isCustomFixed=hangleStorageDefaultValue(storageOpts.fixed,isAllCustom);const isCustomSort=hangleStorageDefaultValue(storageOpts.sort,isAllCustom);const isCustomAggGroup=hangleStorageDefaultValue(storageOpts.aggGroup,isAllCustom);const isCustomAggFunc=hangleStorageDefaultValue(storageOpts.aggFunc,isAllCustom);let{resizableData,sortData,visibleData,fixedData,aggGroupData,aggFuncData}=storeData;// 处理还原
7729
+ const{warnLog: methods_warnLog,errLog: methods_errLog}=createComponentLog('table');const{getConfig: methods_getConfig,getI18n: methods_getI18n,renderer: methods_renderer,formats: methods_formats,interceptor: methods_interceptor,createEvent,globalEvents: methods_globalEvents,GLOBAL_EVENT_KEYS}=core_.VxeUI;const browseObj=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().browse();const supportMaxRow=5e6;const customStorageKey='VXE_CUSTOM_STORE';const maxYHeight=5e6;const maxXWidth=5e6;const sourceType='table';let crossTableDragRowObj=null;function eqCellValue(newRow,oldRow,field){const val1=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(newRow,field);const val2=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(oldRow,field);let result=false;if(eqEmptyValue(val1)&&eqEmptyValue(val2)){result=true;}else 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)){result=''+val1===''+val2;}else{result=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isEqual(val1,val2);}return{newValue:val1,oldValue:val2,result};}function hangleStorageDefaultValue(value,isAll){return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(value)?value:isAll;}function getNextSortOrder($xeTable,column){const sortOpts=$xeTable.computeSortOpts;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=methods_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=methods_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=($xeTable,keyMaps)=>{const internalData=$xeTable;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;};function handleReserveRow($xeTable,reserveRowMap){const internalData=$xeTable;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]&&reserveList.indexOf(fullDataRowIdData[rowid].row)===-1){reserveList.push(fullDataRowIdData[rowid].row);}});return reserveList;}function handleVirtualXVisible($xeTable){const reactData=$xeTable;const internalData=$xeTable;const{isScrollXBig,scrollXWidth}=reactData;const{elemStore,visibleColumn,fullColumnIdData}=internalData;const leftFixedWidth=$xeTable.computeLeftFixedWidth;const rightFixedWidth=$xeTable.computeRightFixedWidth;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(6,visibleSize)};}return{toVisibleIndex:0,visibleSize:6};}function handleCustomRestore($xeTable,storeData){const props=$xeTable;const reactData=$xeTable;const internalData=$xeTable;const{aggregateConfig,rowGroupConfig}=props;const{collectColumn}=internalData;const customOpts=$xeTable.computeCustomOpts;const{storage,storeOptions}=customOpts;const isAllCustom=storage===true;const storageOpts=Object.assign({},isAllCustom?{}:storage||{},storeOptions);const isCustomResizable=hangleStorageDefaultValue(storageOpts.resizable,isAllCustom);const isCustomVisible=hangleStorageDefaultValue(storageOpts.visible,isAllCustom);const isCustomFixed=hangleStorageDefaultValue(storageOpts.fixed,isAllCustom);const isCustomSort=hangleStorageDefaultValue(storageOpts.sort,isAllCustom);const isCustomAggGroup=hangleStorageDefaultValue(storageOpts.aggGroup,isAllCustom);const isCustomAggFunc=hangleStorageDefaultValue(storageOpts.aggFunc,isAllCustom);let{resizableData,sortData,visibleData,fixedData,aggGroupData,aggFuncData}=storeData;// 处理还原
7729
7730
  if(isCustomResizable&&resizableData||isCustomSort&&sortData||isCustomVisible&&visibleData||isCustomFixed&&fixedData||isCustomAggGroup&&aggGroupData||isCustomAggFunc&&aggFuncData){const sortColMaps={};if(isCustomSort&&sortData){// 转换兼容老版本数据,即将废弃兼容
7730
7731
  if(!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(sortData)){const sortRests=[];external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(sortData,(index,colKey)=>{sortRests.push({key:colKey,index});});sortData=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().orderBy(sortRests,{field:'index',order:'asc'}).map(item=>({k:item.key}));}let colNum=1;external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(sortData,(sObj,index,sOjs,path,pSObj)=>{sortColMaps[sObj.k]={key:sObj.k,sNum:colNum++,pKey:pSObj?pSObj.k:null};},{children:'c'});}const colKeyMaps={};const allCols=[];const aggGroupConfs=[];external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(collectColumn,(column,index,items,path,parentColumn)=>{const colKey=column.getKey();// 支持一级
7731
7732
  if(!parentColumn){if(isCustomFixed&&fixedData&&fixedData[colKey]!==undefined){column.fixed=fixedData[colKey];}}if(isCustomResizable&&resizableData&&external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(resizableData[colKey])){column.resizeWidth=resizableData[colKey];}if(isCustomVisible&&visibleData&&external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(visibleData[colKey])){column.visible=visibleData[colKey];}if(isCustomAggFunc&&aggFuncData&&(aggregateConfig||rowGroupConfig)&&aggFuncData[colKey]){column.aggFunc=aggFuncData[colKey];}if(isCustomAggGroup&&aggGroupData&&aggGroupData[colKey]){aggGroupConfs.push({field:column.field});}colKeyMaps[colKey]=column;allCols.push(column);});if((aggregateConfig||rowGroupConfig)&&aggGroupConfs.length){const groupRest=handleGroupData($xeTable,internalData.tableFullData,aggGroupConfs);internalData.tableFullTreeData=[];internalData.tableFullGroupData=groupRest.treeData;reactData.isRowGroupStatus=true;reactData.rowGroupList=aggGroupConfs;$xeTable.cacheRowMap(false);}// 如果自定义了顺序
@@ -7876,7 +7877,7 @@ remainList.forEach(column=>{const width=Math.max(meanWidth,minCellWidth);column.
7876
7877
  * 计算自适应行高
7877
7878
  */const calcCellAutoHeight=($xeTable,rowid,rowRest,wrapperEl)=>{const internalData=$xeTable;const{fullCellHeightMaps}=internalData;let chRest=fullCellHeightMaps[rowid];if(!chRest){chRest={};fullCellHeightMaps[rowid]=chRest;}const wrapperElemList=wrapperEl.querySelectorAll(`.vxe-cell--wrapper[rowid="${rowRest.rowid}"]`);let firstCellStyle=null;let topBottomPadding=0;let changeCH=false;for(let i=0;i<wrapperElemList.length;i++){const wrapperElem=wrapperElemList[i];const cellElem=wrapperElem.parentElement;const cellStyle=cellElem.style;const orHeight=cellStyle.height;const colid=wrapperElem.getAttribute('colid')||'';cellStyle.height='';if(!firstCellStyle){firstCellStyle=getComputedStyle(cellElem);topBottomPadding=firstCellStyle?Math.ceil(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(firstCellStyle.paddingTop)+external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(firstCellStyle.paddingBottom)):0;}const cellHeight=wrapperElem?wrapperElem.clientHeight:0;const colHeight=Math.ceil(cellHeight+topBottomPadding);if(chRest[colid]!==colHeight){changeCH=true;chRest[colid]=colHeight;}cellStyle.height=orHeight;}const cellMaxHeight=getRowMaxHeight(chRest,changeCH);return cellMaxHeight;};/**
7878
7879
  * 自适应行高
7879
- */const calcCellHeight=$xeTable=>{const props=$xeTable;const reactData=$xeTable;const internalData=$xeTable;const{treeConfig}=props;const{tableData,isAllOverflow,scrollYLoad,scrollXLoad}=reactData;const{fullAllDataRowIdData}=internalData;const el=$xeTable.$refs.refElem;if(!el||!el.clientWidth){return;}const treeOpts=$xeTable.computeTreeOpts;const defaultRowHeight=$xeTable.computeDefaultRowHeight;if(!isAllOverflow&&(scrollYLoad||scrollXLoad||treeConfig&&treeOpts.showLine)){const{handleGetRowId}=createHandleGetRowId($xeTable);el.setAttribute('data-calc-row','Y');tableData.forEach(row=>{const rowid=handleGetRowId(row);const rowRest=fullAllDataRowIdData[rowid];if(rowRest){const height=calcCellAutoHeight($xeTable,rowid,rowRest,el);rowRest.height=Math.max(defaultRowHeight,height);}el.removeAttribute('data-calc-row');});reactData.calcCellHeightFlag++;}};function getOrderField($xeTable,column){const reactData=$xeTable;const{isRowGroupStatus}=reactData;const{sortBy,sortType,aggFunc}=column;return isRowGroupStatus&&aggFunc?row=>{if(row.isAggregate){const aggData=row.aggData;const currAggData=aggData?aggData[column.field]:null;return currAggData?currAggData.value:null;}let cellValue;if(sortBy){cellValue=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(sortBy)?sortBy({row,column}):external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row,sortBy);}else{cellValue=$xeTable.getCellLabel(row,column);}if(!sortType||sortType==='auto'){return isNaN(cellValue)?cellValue:external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellValue);}else if(sortType==='number'){return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellValue);}else if(sortType==='string'){return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toValueString(cellValue);}return cellValue;}:row=>{let cellValue;if(sortBy){cellValue=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(sortBy)?sortBy({row,column}):external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row,sortBy);}else{cellValue=$xeTable.getCellLabel(row,column);}if(!sortType||sortType==='auto'){return isNaN(cellValue)?cellValue:external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellValue);}else if(sortType==='number'){return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellValue);}else if(sortType==='string'){return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toValueString(cellValue);}return cellValue;};}function handleTargetEnterEvent($xeTable,isClear){const internalData=$xeTable;const $tooltip=$xeTable.$refs.refTooltip;clearTimeout(internalData.tooltipTimeout);if(isClear){$xeTable.closeTooltip();}else{if($tooltip&&$tooltip.setActived){$tooltip.setActived(true);}}}function clearCrossTableDragStatus($xeTable){const crossTableDragRowInfo=getCrossTableDragRowInfo($xeTable);crossTableDragRowObj=null;crossTableDragRowInfo.row=null;}function clearDragStatus($xeTable){const reactData=$xeTable;const{dragRow,dragCol}=reactData;if(dragRow||dragCol){clearColDropOrigin($xeTable);clearRowDropOrigin($xeTable);hideDropTip($xeTable);clearCrossTableDragStatus($xeTable);reactData.dragRow=null;reactData.dragCol=null;}}function handleRowDragEndClearStatus($xeTable){clearRowDragData($xeTable);clearCrossTableDragStatus($xeTable);handleRecalculateStyle($xeTable,false,true,true);}function handleColDragEndClearStatus($xeTable){clearColDragData($xeTable);clearCrossTableDragStatus($xeTable);handleRecalculateStyle($xeTable,true,true,true);}function clearRowDropOrigin($xeTable){const el=$xeTable.$el;if(el){const clss='row--drag-origin';external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(el.querySelectorAll(`.${clss}`),elem=>{elem.draggable=false;removeClass(elem,clss);});}}function updateRowDropOrigin($xeTable,row){const el=$xeTable.$el;if(el){const clss='row--drag-origin';const rowid=getRowid($xeTable,row);external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(el.querySelectorAll(`[rowid="${rowid}"]`),elem=>{addClass(elem,clss);});}}function updateRowDropTipContent($xeTable,tdEl){const reactData=$xeTable;const props=$xeTable;const{dragConfig}=props;const{dragRow}=reactData;const rowDragOpts=$xeTable.computeRowDragOpts;const{tooltipMethod}=rowDragOpts;const rTooltipMethod=tooltipMethod||(dragConfig?dragConfig.rowTooltipMethod:null);let tipContent='';if(rTooltipMethod){const rtParams={$table:$xeTable,row:dragRow};tipContent=`${rTooltipMethod(rtParams)||''}`;}else{tipContent=methods_getI18n('vxe.table.dragTip',[tdEl.textContent||'']);}reactData.dragTipText=tipContent;}function updateColDropOrigin($xeTable,column){const el=$xeTable.$el;if(el){const colQuerys=[];external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree([column],item=>{colQuerys.push(`[colid="${item.id}"]`);});const clss='col--drag-origin';external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(el.querySelectorAll(colQuerys.join(',')),elem=>{addClass(elem,clss);});}}function clearColDropOrigin($xeTable){const el=$xeTable.$el;if(el){const clss='col--drag-origin';external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(el.querySelectorAll(`.${clss}`),elem=>{elem.draggable=false;removeClass(elem,clss);});}}function updateColDropTipContent($xeTable,tdEl){const reactData=$xeTable;const{dragCol}=reactData;const columnDragOpts=$xeTable.computeColumnDragOpts;const{tooltipMethod}=columnDragOpts;let tipContent='';if(tooltipMethod){const dtParams={$table:$xeTable,column:dragCol};tipContent=`${tooltipMethod(dtParams)||''}`;}else{tipContent=methods_getI18n('vxe.table.dragTip',[tdEl.textContent||'']);}reactData.dragTipText=tipContent;}function showDropTip($xeTable,evnt,trEl,thEl,showLine,dragPos){const $xeGantt=$xeTable.$xeGantt;const reactData=$xeTable;const internalData=$xeTable;let wrapperEl=$xeTable.$refs.refElem;if($xeGantt&&trEl){const ganttContainerElem=$xeGantt.$refs.refGanttContainerElem;if(ganttContainerElem){wrapperEl=ganttContainerElem;}}if(!wrapperEl){return;}const{overflowX,scrollbarWidth,overflowY,scrollbarHeight}=reactData;const{prevDragToChild}=internalData;const wrapperRect=wrapperEl.getBoundingClientRect();const osbWidth=overflowY?scrollbarWidth:0;const osbHeight=overflowX?scrollbarHeight:0;const tableWrapperWidth=wrapperEl.clientWidth;const tableWrapperHeight=wrapperEl.clientHeight;if(trEl){const rdLineEl=$xeTable.$refs.refDragRowLineElem;if(rdLineEl){if(showLine){const scrollbarYToLeft=$xeTable.computeScrollbarYToLeft;const trRect=trEl.getBoundingClientRect();let trHeight=trEl.clientHeight;const offsetTop=Math.max(1,trRect.y-wrapperRect.y);if(offsetTop+trHeight>tableWrapperHeight-osbHeight){trHeight=tableWrapperHeight-offsetTop-osbHeight;}rdLineEl.style.display='block';rdLineEl.style.left=`${scrollbarYToLeft?osbWidth:0}px`;rdLineEl.style.top=`${offsetTop}px`;rdLineEl.style.height=`${trHeight}px`;rdLineEl.style.width=`${tableWrapperWidth-osbWidth}px`;rdLineEl.setAttribute('drag-pos',dragPos);rdLineEl.setAttribute('drag-to-child',prevDragToChild?'y':'n');}else{rdLineEl.style.display='';}}}else if(thEl){const cdLineEl=$xeTable.$refs.refDragColLineElem;if(cdLineEl){if(showLine){const scrollbarXToTop=$xeTable.computeScrollbarXToTop;const leftContainerElem=$xeTable.$refs.refLeftContainer;const leftContainerWidth=leftContainerElem?leftContainerElem.clientWidth:0;const rightContainerElem=$xeTable.$refs.refRightContainer;const rightContainerWidth=rightContainerElem?rightContainerElem.clientWidth:0;const thRect=thEl.getBoundingClientRect();let thWidth=thEl.clientWidth;const offsetTop=Math.max(0,thRect.y-wrapperRect.y);const startX=leftContainerWidth;let offsetLeft=thRect.x-wrapperRect.x;if(offsetLeft<startX){thWidth-=startX-offsetLeft;offsetLeft=startX;}const endX=tableWrapperWidth-rightContainerWidth-(rightContainerWidth?0:osbWidth);if(offsetLeft+thWidth>endX){thWidth=endX-offsetLeft;}cdLineEl.style.display='block';cdLineEl.style.top=`${offsetTop}px`;cdLineEl.style.left=`${offsetLeft}px`;cdLineEl.style.width=`${thWidth}px`;if(prevDragToChild){cdLineEl.style.height=`${thRect.height}px`;}else{cdLineEl.style.height=`${tableWrapperHeight-offsetTop-(scrollbarXToTop?0:osbHeight)}px`;}cdLineEl.setAttribute('drag-pos',dragPos);cdLineEl.setAttribute('drag-to-child',prevDragToChild?'y':'n');}else{cdLineEl.style.display='';}}}const rdTipEl=$xeTable.$refs.refDragTipElem;if(rdTipEl){rdTipEl.style.display='block';rdTipEl.style.top=`${Math.min(wrapperEl.clientHeight-wrapperEl.scrollTop-rdTipEl.clientHeight,evnt.clientY-wrapperRect.y)}px`;rdTipEl.style.left=`${Math.min(wrapperEl.clientWidth-wrapperEl.scrollLeft-rdTipEl.clientWidth-16,evnt.clientX-wrapperRect.x)}px`;rdTipEl.setAttribute('drag-status',showLine?prevDragToChild?'sub':'normal':'disabled');}}function hideDropTip($xeTable){const rdTipEl=$xeTable.$refs.refDragTipElem;const rdLineEl=$xeTable.$refs.refDragRowLineElem;const cdLineEl=$xeTable.$refs.refDragColLineElem;if(rdTipEl){rdTipEl.style.display='';}if(rdLineEl){rdLineEl.style.display='';}if(cdLineEl){cdLineEl.style.display='';}}function clearRowDragData($xeTable){const $xeGantt=$xeTable.$xeGantt;const reactData=$xeTable;const internalData=$xeTable;let wrapperEl=$xeTable.$refs.refElem;const dtClss=['.vxe-body--row'];if($xeGantt){const ganttContainerElem=$xeGantt.$refs.refGanttContainerElem;if(ganttContainerElem){wrapperEl=ganttContainerElem;}dtClss.push('.vxe-gantt-view--body-row','.vxe-gantt-view--chart-row');}hideDropTip($xeTable);clearRowDropOrigin($xeTable);clearRowAnimate(wrapperEl,dtClss);internalData.prevDragToChild=false;reactData.dragRow=null;reactData.dragCol=null;}function clearColDragData($xeTable){const reactData=$xeTable;const internalData=$xeTable;const el=$xeTable.$refs.refElem;hideDropTip($xeTable);clearColDropOrigin($xeTable);clearColAnimate(el,['.vxe-table--column']);internalData.prevDragToChild=false;reactData.dragRow=null;reactData.dragCol=null;}/**
7880
+ */const calcCellHeight=$xeTable=>{const props=$xeTable;const reactData=$xeTable;const internalData=$xeTable;const{treeConfig}=props;const{tableData,isAllOverflow,scrollYLoad,scrollXLoad}=reactData;const{fullAllDataRowIdData}=internalData;const el=$xeTable.$refs.refElem;if(!el||!el.clientWidth){return;}const treeOpts=$xeTable.computeTreeOpts;const defaultRowHeight=$xeTable.computeDefaultRowHeight;if(!isAllOverflow&&(scrollYLoad||scrollXLoad||treeConfig&&treeOpts.showLine)){const{handleGetRowId}=createHandleGetRowId($xeTable);el.setAttribute('data-calc-row','Y');tableData.forEach(row=>{const rowid=handleGetRowId(row);const rowRest=fullAllDataRowIdData[rowid];if(rowRest){const height=calcCellAutoHeight($xeTable,rowid,rowRest,el);rowRest.height=Math.max(defaultRowHeight,height);}el.removeAttribute('data-calc-row');});reactData.calcCellHeightFlag++;}};function getOrderField($xeTable,column){const reactData=$xeTable;const{isRowGroupStatus}=reactData;const{sortBy,sortType,aggFunc}=column;return isRowGroupStatus&&aggFunc?row=>{if(row.isAggregate){const aggData=row.aggData;const currAggData=aggData?aggData[column.field]:null;return currAggData?currAggData.value:null;}let cellValue;if(sortBy){cellValue=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(sortBy)?sortBy({row,column}):external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row,sortBy);}else{cellValue=$xeTable.getCellLabel(row,column);}if(!sortType||sortType==='auto'){return eqEmptyValue(cellValue)||isNaN(cellValue)?cellValue:external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellValue);}else if(sortType==='number'){return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellValue);}else if(sortType==='string'){return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toValueString(cellValue);}return cellValue;}:row=>{let cellValue;if(sortBy){cellValue=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(sortBy)?sortBy({row,column}):external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row,sortBy);}else{cellValue=$xeTable.getCellLabel(row,column);}if(!sortType||sortType==='auto'){return eqEmptyValue(cellValue)||isNaN(cellValue)?cellValue:external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellValue);}else if(sortType==='number'){return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellValue);}else if(sortType==='string'){return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toValueString(cellValue);}return cellValue;};}function handleTargetEnterEvent($xeTable,isClear){const internalData=$xeTable;const $tooltip=$xeTable.$refs.refTooltip;clearTimeout(internalData.tooltipTimeout);if(isClear){$xeTable.closeTooltip();}else{if($tooltip&&$tooltip.setActived){$tooltip.setActived(true);}}}function clearCrossTableDragStatus($xeTable){const crossTableDragRowInfo=getCrossTableDragRowInfo($xeTable);crossTableDragRowObj=null;crossTableDragRowInfo.row=null;}function clearDragStatus($xeTable){const reactData=$xeTable;const{dragRow,dragCol}=reactData;if(dragRow||dragCol){clearColDropOrigin($xeTable);clearRowDropOrigin($xeTable);hideDropTip($xeTable);clearCrossTableDragStatus($xeTable);reactData.dragRow=null;reactData.dragCol=null;}}function handleRowDragEndClearStatus($xeTable){clearRowDragData($xeTable);clearCrossTableDragStatus($xeTable);handleRecalculateStyle($xeTable,false,true,true);}function handleColDragEndClearStatus($xeTable){clearColDragData($xeTable);clearCrossTableDragStatus($xeTable);handleRecalculateStyle($xeTable,true,true,true);}function clearRowDropOrigin($xeTable){const el=$xeTable.$el;if(el){const clss='row--drag-origin';external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(el.querySelectorAll(`.${clss}`),elem=>{elem.draggable=false;removeClass(elem,clss);});}}function updateRowDropOrigin($xeTable,row){const el=$xeTable.$el;if(el){const clss='row--drag-origin';const rowid=getRowid($xeTable,row);external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(el.querySelectorAll(`[rowid="${rowid}"]`),elem=>{addClass(elem,clss);});}}function updateRowDropTipContent($xeTable,tdEl){const reactData=$xeTable;const props=$xeTable;const{dragConfig}=props;const{dragRow}=reactData;const rowDragOpts=$xeTable.computeRowDragOpts;const{tooltipMethod}=rowDragOpts;const rTooltipMethod=tooltipMethod||(dragConfig?dragConfig.rowTooltipMethod:null);let tipContent='';if(rTooltipMethod){const rtParams={$table:$xeTable,row:dragRow};tipContent=`${rTooltipMethod(rtParams)||''}`;}else{tipContent=methods_getI18n('vxe.table.dragTip',[tdEl.textContent||'']);}reactData.dragTipText=tipContent;}function updateColDropOrigin($xeTable,column){const el=$xeTable.$el;if(el){const colQuerys=[];external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree([column],item=>{colQuerys.push(`[colid="${item.id}"]`);});const clss='col--drag-origin';external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(el.querySelectorAll(colQuerys.join(',')),elem=>{addClass(elem,clss);});}}function clearColDropOrigin($xeTable){const el=$xeTable.$el;if(el){const clss='col--drag-origin';external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(el.querySelectorAll(`.${clss}`),elem=>{elem.draggable=false;removeClass(elem,clss);});}}function updateColDropTipContent($xeTable,tdEl){const reactData=$xeTable;const{dragCol}=reactData;const columnDragOpts=$xeTable.computeColumnDragOpts;const{tooltipMethod}=columnDragOpts;let tipContent='';if(tooltipMethod){const dtParams={$table:$xeTable,column:dragCol};tipContent=`${tooltipMethod(dtParams)||''}`;}else{tipContent=methods_getI18n('vxe.table.dragTip',[tdEl.textContent||'']);}reactData.dragTipText=tipContent;}function showDropTip($xeTable,evnt,trEl,thEl,showLine,dragPos){const $xeGantt=$xeTable.$xeGantt;const reactData=$xeTable;const internalData=$xeTable;let wrapperEl=$xeTable.$refs.refElem;if($xeGantt&&trEl){const ganttContainerElem=$xeGantt.$refs.refGanttContainerElem;if(ganttContainerElem){wrapperEl=ganttContainerElem;}}if(!wrapperEl){return;}const{overflowX,scrollbarWidth,overflowY,scrollbarHeight}=reactData;const{prevDragToChild}=internalData;const wrapperRect=wrapperEl.getBoundingClientRect();const osbWidth=overflowY?scrollbarWidth:0;const osbHeight=overflowX?scrollbarHeight:0;const tableWrapperWidth=wrapperEl.clientWidth;const tableWrapperHeight=wrapperEl.clientHeight;if(trEl){const rdLineEl=$xeTable.$refs.refDragRowLineElem;if(rdLineEl){if(showLine){const scrollbarYToLeft=$xeTable.computeScrollbarYToLeft;const trRect=trEl.getBoundingClientRect();let trHeight=trEl.clientHeight;const offsetTop=Math.max(1,trRect.y-wrapperRect.y);if(offsetTop+trHeight>tableWrapperHeight-osbHeight){trHeight=tableWrapperHeight-offsetTop-osbHeight;}rdLineEl.style.display='block';rdLineEl.style.left=`${scrollbarYToLeft?osbWidth:0}px`;rdLineEl.style.top=`${offsetTop}px`;rdLineEl.style.height=`${trHeight}px`;rdLineEl.style.width=`${tableWrapperWidth-osbWidth}px`;rdLineEl.setAttribute('drag-pos',dragPos);rdLineEl.setAttribute('drag-to-child',prevDragToChild?'y':'n');}else{rdLineEl.style.display='';}}}else if(thEl){const cdLineEl=$xeTable.$refs.refDragColLineElem;if(cdLineEl){if(showLine){const scrollbarXToTop=$xeTable.computeScrollbarXToTop;const leftContainerElem=$xeTable.$refs.refLeftContainer;const leftContainerWidth=leftContainerElem?leftContainerElem.clientWidth:0;const rightContainerElem=$xeTable.$refs.refRightContainer;const rightContainerWidth=rightContainerElem?rightContainerElem.clientWidth:0;const thRect=thEl.getBoundingClientRect();let thWidth=thEl.clientWidth;const offsetTop=Math.max(0,thRect.y-wrapperRect.y);const startX=leftContainerWidth;let offsetLeft=thRect.x-wrapperRect.x;if(offsetLeft<startX){thWidth-=startX-offsetLeft;offsetLeft=startX;}const endX=tableWrapperWidth-rightContainerWidth-(rightContainerWidth?0:osbWidth);if(offsetLeft+thWidth>endX){thWidth=endX-offsetLeft;}cdLineEl.style.display='block';cdLineEl.style.top=`${offsetTop}px`;cdLineEl.style.left=`${offsetLeft}px`;cdLineEl.style.width=`${thWidth}px`;if(prevDragToChild){cdLineEl.style.height=`${thRect.height}px`;}else{cdLineEl.style.height=`${tableWrapperHeight-offsetTop-(scrollbarXToTop?0:osbHeight)}px`;}cdLineEl.setAttribute('drag-pos',dragPos);cdLineEl.setAttribute('drag-to-child',prevDragToChild?'y':'n');}else{cdLineEl.style.display='';}}}const rdTipEl=$xeTable.$refs.refDragTipElem;if(rdTipEl){rdTipEl.style.display='block';rdTipEl.style.top=`${Math.min(wrapperEl.clientHeight-wrapperEl.scrollTop-rdTipEl.clientHeight,evnt.clientY-wrapperRect.y)}px`;rdTipEl.style.left=`${Math.min(wrapperEl.clientWidth-wrapperEl.scrollLeft-rdTipEl.clientWidth-16,evnt.clientX-wrapperRect.x)}px`;rdTipEl.setAttribute('drag-status',showLine?prevDragToChild?'sub':'normal':'disabled');}}function hideDropTip($xeTable){const rdTipEl=$xeTable.$refs.refDragTipElem;const rdLineEl=$xeTable.$refs.refDragRowLineElem;const cdLineEl=$xeTable.$refs.refDragColLineElem;if(rdTipEl){rdTipEl.style.display='';}if(rdLineEl){rdLineEl.style.display='';}if(cdLineEl){cdLineEl.style.display='';}}function clearRowDragData($xeTable){const $xeGantt=$xeTable.$xeGantt;const reactData=$xeTable;const internalData=$xeTable;let wrapperEl=$xeTable.$refs.refElem;const dtClss=['.vxe-body--row'];if($xeGantt){const ganttContainerElem=$xeGantt.$refs.refGanttContainerElem;if(ganttContainerElem){wrapperEl=ganttContainerElem;}dtClss.push('.vxe-gantt-view--body-row','.vxe-gantt-view--chart-row');}hideDropTip($xeTable);clearRowDropOrigin($xeTable);clearRowAnimate(wrapperEl,dtClss);internalData.prevDragToChild=false;reactData.dragRow=null;reactData.dragCol=null;}function clearColDragData($xeTable){const reactData=$xeTable;const internalData=$xeTable;const el=$xeTable.$refs.refElem;hideDropTip($xeTable);clearColDropOrigin($xeTable);clearColAnimate(el,['.vxe-table--column']);internalData.prevDragToChild=false;reactData.dragRow=null;reactData.dragCol=null;}/**
7880
7881
  * 处理显示 tooltip
7881
7882
  * @param {Event} evnt 事件
7882
7883
  * @param {Row} row 行对象
@@ -8101,7 +8102,8 @@ if(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_defau
8101
8102
  */removeInsertRow(){const $xeTable=this;const internalData=$xeTable;const{insertRowMaps}=internalData;return $xeTable.remove(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().values(insertRowMaps));},/**
8102
8103
  * 检查行或列数据是否发生改变
8103
8104
  */isUpdateByRow(rowOrId,field){const $xeTable=this;const props=$xeTable;const internalData=$xeTable;const{keepSource,editConfig}=props;const{fullDataRowIdData,sourceDataRowIdData}=internalData;const keepFields=$xeTable.computeKeepFields;if(keepSource&&editConfig){const rowid=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(rowOrId)||external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(rowOrId)?rowOrId:getRowid($xeTable,rowOrId);const rowRest=fullDataRowIdData[rowid];// 新增的数据不需要检测
8104
- if(!rowRest){return false;}const row=rowRest.row;const oRow=sourceDataRowIdData[rowid];if(oRow){if(arguments.length>1){return!eqCellValue(oRow,row,field);}for(let i=0;i<keepFields.length;i++){if(!eqCellValue(oRow,row,keepFields[i])){return true;}}}}return false;},/**
8105
+ if(!rowRest){return false;}const row=rowRest.row;const oRow=sourceDataRowIdData[rowid];if(!oRow){return false;}if(arguments.length>1){return!eqCellValue(oRow,row,field).result;}for(let i=0;i<keepFields.length;i++){if(!eqCellValue(oRow,row,keepFields[i]).result){return true;}}}return false;},getUpdateCells(){const $xeTable=this;const props=$xeTable;const internalData=$xeTable;const{keepSource,treeConfig}=props;const{tableFullData,tableFullTreeData,fullDataRowIdData,sourceDataRowIdData,fullColumnFieldData}=internalData;const treeOpts=$xeTable.computeTreeOpts;const keepFields=$xeTable.computeKeepFields;const cellList=[];if(keepSource){const{handleGetRowId}=createHandleGetRowId($xeTable);const handleCell=item=>{const rowid=handleGetRowId(item);const rowRest=fullDataRowIdData[rowid];// 新增的数据不需要检测
8106
+ if(!rowRest){return;}const row=rowRest.row;const oRow=sourceDataRowIdData[rowid];if(!oRow){return;}for(let i=0;i<keepFields.length;i++){const field=keepFields[i];const{result,newValue,oldValue}=eqCellValue(oRow,row,field);if(!result){const column=fullColumnFieldData[field]?fullColumnFieldData[field].column:null;cellList.push({row,rowid,column,field,newValue,oldValue});}}};if(treeConfig){external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(tableFullTreeData,handleCell,treeOpts);}else{tableFullData.forEach(handleCell);}}return cellList;},/**
8105
8107
  * 获取表格的可视列,也可以指定索引获取列
8106
8108
  * @param {Number} columnIndex 索引
8107
8109
  */getColumns(columnIndex){const $xeTable=this;const internalData=$xeTable;const{visibleColumn}=internalData;return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isUndefined(columnIndex)?visibleColumn.slice(0):visibleColumn[columnIndex];},/**
@@ -15726,17 +15728,31 @@ function handleEditCell($xeTable, row, fieldOrColumn, options) {
15726
15728
  treeConfig
15727
15729
  } = props;
15728
15730
  const {
15729
- tableFullData
15731
+ tableFullData,
15732
+ tableFullTreeData
15730
15733
  } = internalData;
15731
15734
  const treeOpts = $xeTable.computeTreeOpts;
15735
+ const updateRecords = [];
15732
15736
  if (keepSource) {
15733
15737
  syncActivedCell($xeTable);
15734
15738
  if (treeConfig) {
15735
- return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().filterTree(tableFullData, row => $xeTable.isUpdateByRow(row), treeOpts);
15739
+ const childrenField = treeOpts.children || treeOpts.childrenField;
15740
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(tableFullTreeData, row => {
15741
+ if ($xeTable.isUpdateByRow(row)) {
15742
+ updateRecords.push(row);
15743
+ }
15744
+ }, {
15745
+ children: childrenField
15746
+ });
15747
+ } else {
15748
+ tableFullData.forEach(row => {
15749
+ if ($xeTable.isUpdateByRow(row)) {
15750
+ updateRecords.push(row);
15751
+ }
15752
+ });
15736
15753
  }
15737
- return tableFullData.filter(row => $xeTable.isUpdateByRow(row));
15738
15754
  }
15739
- return [];
15755
+ return updateRecords;
15740
15756
  },
15741
15757
  /**
15742
15758
  * 处理激活编辑
@@ -22169,7 +22185,7 @@ function renderBody(h, $xeTable) {
22169
22185
  table_errLog('vxe.error.reqComp', ['vxe-loading']);
22170
22186
  }
22171
22187
  }
22172
- if (props.showOverflow === true || props.showOverflow === 'tooltip' || props.showHeaderOverflow === true || props.showHeaderOverflow === 'tooltip' || props.showFooterOverflow === true || props.showFooterOverflow === 'tooltip' || props.tooltipConfig || props.editRules) {
22188
+ if (props.showOverflow === true || props.showOverflow === 'tooltip' || props.showHeaderOverflow === true || props.showHeaderOverflow === 'tooltip' || props.showFooterOverflow === true || props.showFooterOverflow === 'tooltip') {
22173
22189
  if (!VxeUITooltipComponent) {
22174
22190
  if (props.showOverflow === true) {
22175
22191
  table_errLog('vxe.error.errProp', ['show-overflow=true', 'show-overflow=title']);