vxe-table 4.13.46 → 4.13.47
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/grid/src/grid.js +1 -1
- package/es/locale/lang/ar-EG.js +9 -0
- package/es/locale/lang/de-DE.js +9 -0
- package/es/locale/lang/en-US.js +9 -0
- package/es/locale/lang/es-ES.js +9 -0
- package/es/locale/lang/fr-FR.js +9 -0
- package/es/locale/lang/hu-HU.js +9 -0
- package/es/locale/lang/hy-AM.js +9 -0
- package/es/locale/lang/id-ID.js +9 -0
- package/es/locale/lang/it-IT.js +9 -0
- package/es/locale/lang/ja-JP.js +9 -0
- package/es/locale/lang/ko-KR.js +9 -0
- package/es/locale/lang/ms-MY.js +9 -0
- package/es/locale/lang/nb-NO.js +9 -0
- package/es/locale/lang/pt-BR.js +9 -0
- package/es/locale/lang/ru-RU.js +9 -0
- package/es/locale/lang/th-TH.js +9 -0
- package/es/locale/lang/ug-CN.js +9 -0
- package/es/locale/lang/uk-UA.js +9 -0
- package/es/locale/lang/uz-UZ.js +9 -0
- package/es/locale/lang/vi-VN.js +9 -0
- package/es/locale/lang/zh-CHT.js +9 -0
- package/es/locale/lang/zh-CN.js +9 -0
- package/es/style.css +1 -1
- package/es/table/module/custom/hook.js +20 -5
- package/es/table/module/custom/panel.js +26 -12
- package/es/table/src/columnInfo.js +1 -0
- package/es/table/src/table.js +44 -5
- package/es/ui/index.js +6 -5
- package/es/ui/src/log.js +1 -1
- package/lib/grid/src/grid.js +1 -1
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.umd.js +73 -35
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/ar-EG.js +9 -0
- package/lib/locale/lang/ar-EG.min.js +1 -1
- package/lib/locale/lang/ar-EG.umd.js +9 -0
- package/lib/locale/lang/de-DE.js +9 -0
- package/lib/locale/lang/de-DE.min.js +1 -1
- package/lib/locale/lang/de-DE.umd.js +9 -0
- package/lib/locale/lang/en-US.js +9 -0
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +9 -0
- package/lib/locale/lang/es-ES.js +9 -0
- package/lib/locale/lang/es-ES.min.js +1 -1
- package/lib/locale/lang/es-ES.umd.js +9 -0
- package/lib/locale/lang/fr-FR.js +9 -0
- package/lib/locale/lang/fr-FR.min.js +1 -1
- package/lib/locale/lang/fr-FR.umd.js +9 -0
- package/lib/locale/lang/hu-HU.js +9 -0
- package/lib/locale/lang/hu-HU.min.js +1 -1
- package/lib/locale/lang/hu-HU.umd.js +9 -0
- package/lib/locale/lang/hy-AM.js +9 -0
- package/lib/locale/lang/hy-AM.min.js +1 -1
- package/lib/locale/lang/hy-AM.umd.js +9 -0
- package/lib/locale/lang/id-ID.js +9 -0
- package/lib/locale/lang/id-ID.min.js +1 -1
- package/lib/locale/lang/id-ID.umd.js +9 -0
- package/lib/locale/lang/it-IT.js +9 -0
- package/lib/locale/lang/it-IT.min.js +1 -1
- package/lib/locale/lang/it-IT.umd.js +9 -0
- package/lib/locale/lang/ja-JP.js +9 -0
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +9 -0
- package/lib/locale/lang/ko-KR.js +9 -0
- package/lib/locale/lang/ko-KR.min.js +1 -1
- package/lib/locale/lang/ko-KR.umd.js +9 -0
- package/lib/locale/lang/ms-MY.js +9 -0
- package/lib/locale/lang/ms-MY.min.js +1 -1
- package/lib/locale/lang/ms-MY.umd.js +9 -0
- package/lib/locale/lang/nb-NO.js +9 -0
- package/lib/locale/lang/nb-NO.min.js +1 -1
- package/lib/locale/lang/nb-NO.umd.js +9 -0
- package/lib/locale/lang/pt-BR.js +9 -0
- package/lib/locale/lang/pt-BR.min.js +1 -1
- package/lib/locale/lang/pt-BR.umd.js +9 -0
- package/lib/locale/lang/ru-RU.js +9 -0
- package/lib/locale/lang/ru-RU.min.js +1 -1
- package/lib/locale/lang/ru-RU.umd.js +9 -0
- package/lib/locale/lang/th-TH.js +9 -0
- package/lib/locale/lang/th-TH.min.js +1 -1
- package/lib/locale/lang/th-TH.umd.js +9 -0
- package/lib/locale/lang/ug-CN.js +9 -0
- package/lib/locale/lang/ug-CN.min.js +1 -1
- package/lib/locale/lang/ug-CN.umd.js +9 -0
- package/lib/locale/lang/uk-UA.js +9 -0
- package/lib/locale/lang/uk-UA.min.js +1 -1
- package/lib/locale/lang/uk-UA.umd.js +9 -0
- package/lib/locale/lang/uz-UZ.js +9 -0
- package/lib/locale/lang/uz-UZ.min.js +1 -1
- package/lib/locale/lang/uz-UZ.umd.js +9 -0
- package/lib/locale/lang/vi-VN.js +9 -0
- package/lib/locale/lang/vi-VN.min.js +1 -1
- package/lib/locale/lang/vi-VN.umd.js +9 -0
- package/lib/locale/lang/zh-CHT.js +9 -0
- package/lib/locale/lang/zh-CHT.min.js +1 -1
- package/lib/locale/lang/zh-CHT.umd.js +9 -0
- package/lib/locale/lang/zh-CN.js +9 -0
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +9 -0
- package/lib/style.css +1 -1
- package/lib/table/module/custom/hook.js +20 -5
- package/lib/table/module/custom/hook.min.js +1 -1
- package/lib/table/module/custom/panel.js +25 -13
- package/lib/table/module/custom/panel.min.js +1 -1
- package/lib/table/src/columnInfo.js +1 -0
- package/lib/table/src/columnInfo.min.js +1 -1
- package/lib/table/src/table.js +10 -10
- package/lib/table/src/table.min.js +1 -1
- package/lib/ui/index.js +6 -5
- 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/grid/src/grid.ts +1 -1
- package/packages/locale/lang/ar-EG.ts +9 -0
- package/packages/locale/lang/de-DE.ts +9 -0
- package/packages/locale/lang/en-US.ts +9 -0
- package/packages/locale/lang/es-ES.ts +9 -0
- package/packages/locale/lang/fr-FR.ts +9 -0
- package/packages/locale/lang/hu-HU.ts +9 -0
- package/packages/locale/lang/hy-AM.ts +9 -0
- package/packages/locale/lang/id-ID.ts +9 -0
- package/packages/locale/lang/it-IT.ts +9 -0
- package/packages/locale/lang/ja-JP.ts +9 -0
- package/packages/locale/lang/ko-KR.ts +9 -0
- package/packages/locale/lang/ms-MY.ts +9 -0
- package/packages/locale/lang/nb-NO.ts +9 -0
- package/packages/locale/lang/pt-BR.ts +9 -0
- package/packages/locale/lang/ru-RU.ts +9 -0
- package/packages/locale/lang/th-TH.ts +9 -0
- package/packages/locale/lang/ug-CN.ts +9 -0
- package/packages/locale/lang/uk-UA.ts +9 -0
- package/packages/locale/lang/uz-UZ.ts +9 -0
- package/packages/locale/lang/vi-VN.ts +9 -0
- package/packages/locale/lang/zh-CHT.ts +9 -0
- package/packages/locale/lang/zh-CN.ts +9 -0
- package/packages/table/module/custom/hook.ts +18 -5
- package/packages/table/module/custom/panel.ts +25 -12
- package/packages/table/src/columnInfo.ts +1 -0
- package/packages/table/src/table.ts +45 -5
- package/packages/ui/index.ts +5 -4
- /package/es/{iconfont.1750660623154.ttf → iconfont.1750732182259.ttf} +0 -0
- /package/es/{iconfont.1750660623154.woff → iconfont.1750732182259.woff} +0 -0
- /package/es/{iconfont.1750660623154.woff2 → iconfont.1750732182259.woff2} +0 -0
- /package/lib/{iconfont.1750660623154.ttf → iconfont.1750732182259.ttf} +0 -0
- /package/lib/{iconfont.1750660623154.woff → iconfont.1750732182259.woff} +0 -0
- /package/lib/{iconfont.1750660623154.woff2 → iconfont.1750732182259.woff2} +0 -0
package/lib/index.umd.js
CHANGED
|
@@ -3138,7 +3138,7 @@ function eqEmptyValue(cellValue) {
|
|
|
3138
3138
|
;// ./packages/ui/index.ts
|
|
3139
3139
|
|
|
3140
3140
|
|
|
3141
|
-
const version = "4.13.
|
|
3141
|
+
const version = "4.13.47";
|
|
3142
3142
|
core_.VxeUI.version = version;
|
|
3143
3143
|
core_.VxeUI.tableVersion = version;
|
|
3144
3144
|
core_.VxeUI.setConfig({
|
|
@@ -3240,6 +3240,7 @@ core_.VxeUI.setConfig({
|
|
|
3240
3240
|
// rowGroup: false,
|
|
3241
3241
|
// aggFunc: false
|
|
3242
3242
|
},
|
|
3243
|
+
// autoAggGroupValues: false,
|
|
3243
3244
|
// checkMethod () {},
|
|
3244
3245
|
modalOptions: {
|
|
3245
3246
|
showMaximize: true,
|
|
@@ -3450,10 +3451,10 @@ core_.VxeUI.setIcon({
|
|
|
3450
3451
|
TABLE_DRAG_DISABLED: iconPrefix + 'no-drop',
|
|
3451
3452
|
TABLE_ROW_GROUP_OPEN: iconPrefix + 'arrow-right rotate90',
|
|
3452
3453
|
TABLE_ROW_GROUP_CLOSE: iconPrefix + 'arrow-right',
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
|
|
3454
|
+
TABLE_AGGREGATE_GROUPING: iconPrefix + 'grouping',
|
|
3455
|
+
TABLE_AGGREGATE_VALUES: iconPrefix + 'values',
|
|
3456
|
+
TABLE_AGGREGATE_SORT: iconPrefix + 'drag-handle',
|
|
3457
|
+
TABLE_AGGREGATE_DELETE: iconPrefix + 'close',
|
|
3457
3458
|
// toolbar
|
|
3458
3459
|
TOOLBAR_TOOLS_REFRESH: iconPrefix + 'repeat',
|
|
3459
3460
|
TOOLBAR_TOOLS_REFRESH_LOADING: iconPrefix + 'repeat roll',
|
|
@@ -3620,7 +3621,7 @@ var esnext_iterator_some = __webpack_require__(7550);
|
|
|
3620
3621
|
const {
|
|
3621
3622
|
log: log_log
|
|
3622
3623
|
} = core_.VxeUI;
|
|
3623
|
-
const log_version = `table v${"4.13.
|
|
3624
|
+
const log_version = `table v${"4.13.47"}`;
|
|
3624
3625
|
const warnLog = log_log.create('warn', log_version);
|
|
3625
3626
|
const errLog = log_log.create('error', log_version);
|
|
3626
3627
|
;// ./packages/table/src/columnInfo.ts
|
|
@@ -3738,6 +3739,7 @@ class ColumnInfo {
|
|
|
3738
3739
|
halfVisible: false,
|
|
3739
3740
|
defaultVisible: visible,
|
|
3740
3741
|
defaultFixed: _vm.fixed,
|
|
3742
|
+
defaultAggFunc: _vm.aggFunc,
|
|
3741
3743
|
checked: false,
|
|
3742
3744
|
halfChecked: false,
|
|
3743
3745
|
disabled: false,
|
|
@@ -8682,12 +8684,14 @@ const {
|
|
|
8682
8684
|
const refDragTipElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
8683
8685
|
const customPanelReactData = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.reactive)({
|
|
8684
8686
|
dragCol: null,
|
|
8685
|
-
|
|
8686
|
-
|
|
8687
|
+
dragGroupField: null,
|
|
8688
|
+
dragAggFnCol: null,
|
|
8687
8689
|
dragTipText: ''
|
|
8688
8690
|
});
|
|
8689
8691
|
const customPanelInternalData = {
|
|
8690
8692
|
// prevDragCol: undefined,
|
|
8693
|
+
// prevDragGroupField: undefined,
|
|
8694
|
+
// prevDragAggFnColid: undefined,
|
|
8691
8695
|
// prevDragToChild: false,
|
|
8692
8696
|
// prevDragPos: null
|
|
8693
8697
|
};
|
|
@@ -8882,8 +8886,8 @@ const {
|
|
|
8882
8886
|
} = customPanelInternalData;
|
|
8883
8887
|
const bodyWrapperRect = bodyWrapperElem.getBoundingClientRect();
|
|
8884
8888
|
const customBodyRect = customBodyElem.getBoundingClientRect();
|
|
8889
|
+
const dragLineEl = refDragLineElem.value;
|
|
8885
8890
|
if (optEl) {
|
|
8886
|
-
const dragLineEl = refDragLineElem.value;
|
|
8887
8891
|
if (dragLineEl) {
|
|
8888
8892
|
if (showLine) {
|
|
8889
8893
|
const optRect = optEl.getBoundingClientRect();
|
|
@@ -8898,6 +8902,10 @@ const {
|
|
|
8898
8902
|
dragLineEl.style.display = '';
|
|
8899
8903
|
}
|
|
8900
8904
|
}
|
|
8905
|
+
} else {
|
|
8906
|
+
if (dragLineEl) {
|
|
8907
|
+
dragLineEl.style.display = 'node';
|
|
8908
|
+
}
|
|
8901
8909
|
}
|
|
8902
8910
|
const dragTipEl = refDragTipElem.value;
|
|
8903
8911
|
if (dragTipEl) {
|
|
@@ -8946,6 +8954,8 @@ const {
|
|
|
8946
8954
|
const column = $xeTable.getColumnById(colid);
|
|
8947
8955
|
trEl.draggable = true;
|
|
8948
8956
|
customPanelReactData.dragCol = column;
|
|
8957
|
+
customPanelReactData.dragGroupField = null;
|
|
8958
|
+
customPanelReactData.dragAggFnCol = null;
|
|
8949
8959
|
updateColDropTipContent();
|
|
8950
8960
|
addClass(trEl, 'active--drag-origin');
|
|
8951
8961
|
};
|
|
@@ -8957,14 +8967,16 @@ const {
|
|
|
8957
8967
|
hideDropTip();
|
|
8958
8968
|
trEl.draggable = false;
|
|
8959
8969
|
customPanelReactData.dragCol = null;
|
|
8970
|
+
customPanelReactData.dragGroupField = null;
|
|
8971
|
+
customPanelReactData.dragAggFnCol = null;
|
|
8960
8972
|
removeClass(trEl, 'active--drag-origin');
|
|
8961
8973
|
};
|
|
8962
8974
|
const sortDragstartEvent = evnt => {
|
|
8963
8975
|
if (evnt.dataTransfer) {
|
|
8964
8976
|
evnt.dataTransfer.setDragImage(getTpImg(), 0, 0);
|
|
8965
8977
|
}
|
|
8966
|
-
customPanelInternalData.
|
|
8967
|
-
customPanelInternalData.
|
|
8978
|
+
customPanelInternalData.prevDragGroupField = null;
|
|
8979
|
+
customPanelInternalData.prevDragAggFnColid = null;
|
|
8968
8980
|
};
|
|
8969
8981
|
const sortDragendEvent = evnt => {
|
|
8970
8982
|
const {
|
|
@@ -8993,13 +9005,13 @@ const {
|
|
|
8993
9005
|
} = customPanelReactData;
|
|
8994
9006
|
const {
|
|
8995
9007
|
prevDragCol,
|
|
8996
|
-
|
|
8997
|
-
|
|
9008
|
+
prevDragGroupField,
|
|
9009
|
+
prevDragAggFnColid,
|
|
8998
9010
|
prevDragPos,
|
|
8999
9011
|
prevDragToChild
|
|
9000
9012
|
} = customPanelInternalData;
|
|
9001
9013
|
const dragOffsetIndex = prevDragPos === 'bottom' ? 1 : 0;
|
|
9002
|
-
if (
|
|
9014
|
+
if (prevDragGroupField || prevDragAggFnColid) {
|
|
9003
9015
|
if ($xeTable.handlePivotTableAggregatePanelDragendEvent) {
|
|
9004
9016
|
$xeTable.handlePivotTableAggregatePanelDragendEvent(evnt);
|
|
9005
9017
|
}
|
|
@@ -9159,8 +9171,10 @@ const {
|
|
|
9159
9171
|
}
|
|
9160
9172
|
hideDropTip();
|
|
9161
9173
|
customPanelReactData.dragCol = null;
|
|
9162
|
-
|
|
9163
|
-
|
|
9174
|
+
customPanelReactData.dragGroupField = null;
|
|
9175
|
+
customPanelReactData.dragAggFnCol = null;
|
|
9176
|
+
customPanelInternalData.prevDragGroupField = null;
|
|
9177
|
+
customPanelInternalData.prevDragAggFnColid = null;
|
|
9164
9178
|
trEl.draggable = false;
|
|
9165
9179
|
trEl.removeAttribute('drag-pos');
|
|
9166
9180
|
removeClass(trEl, 'active--drag-target');
|
|
@@ -9183,14 +9197,14 @@ const {
|
|
|
9183
9197
|
const {
|
|
9184
9198
|
dragCol
|
|
9185
9199
|
} = customPanelReactData;
|
|
9186
|
-
customPanelInternalData.
|
|
9187
|
-
customPanelInternalData.
|
|
9200
|
+
customPanelInternalData.prevDragGroupField = null;
|
|
9201
|
+
customPanelInternalData.prevDragAggFnColid = null;
|
|
9188
9202
|
// 是否移入有效列
|
|
9189
9203
|
if (column && (isCrossDrag || column.level === 1)) {
|
|
9190
9204
|
evnt.preventDefault();
|
|
9191
9205
|
const offsetY = evnt.clientY - optEl.getBoundingClientRect().y;
|
|
9192
9206
|
const dragPos = offsetY < optEl.clientHeight / 2 ? 'top' : 'bottom';
|
|
9193
|
-
if (dragCol && dragCol.id === column.id || !isCrossDrag && column.level > 1 || !immediate && column.level > 1 || column.renderFixed) {
|
|
9207
|
+
if (!dragCol || dragCol && dragCol.id === column.id || !isCrossDrag && column.level > 1 || !immediate && column.level > 1 || column.renderFixed) {
|
|
9194
9208
|
showDropTip(evnt, optEl, false, dragPos);
|
|
9195
9209
|
return;
|
|
9196
9210
|
}
|
|
@@ -10914,7 +10928,7 @@ focused:{row:null,column:null}},// 存放 tooltip 相关信息
|
|
|
10914
10928
|
tooltipStore:{row:null,column:null,content:null,visible:false,currOpts:{}},// 存放数据校验相关信息
|
|
10915
10929
|
validStore:{visible:false},validErrorMaps:{},// 导入相关信息
|
|
10916
10930
|
importStore:{inited:false,file:null,type:'',modeList:[],typeList:[],filename:'',visible:false},importParams:{mode:'',types:null,message:true},// 导出相关信息
|
|
10917
|
-
exportStore:{inited:false,name:'',modeList:[],typeList:[],columns:[],isPrint:false,hasFooter:false,hasMerge:false,hasTree:false,hasColgroup:false,visible:false},exportParams:{filename:'',sheetName:'',mode:'',type:'',isColgroup:false,isMerge:false,isAllExpand:false,useStyle:false,original:false,message:true,isHeader:false,isTitle:false,isFooter:false},visiblwRowsFlag:1,isRowGroupStatus:false,rowGroupList:[],aggHandleFields:[],rowGroupExpandedFlag:1,rowExpandedFlag:1,treeExpandedFlag:1,updateCheckboxFlag:1,pendingRowFlag:1,insertRowFlag:1,removeRowFlag:1,mergeBodyFlag:1,mergeFootFlag:1,rowHeightStore:{large:52,default:48,medium:44,small:40,mini:36},scrollVMLoading:false,scrollYHeight:0,scrollYTop:0,isScrollYBig:false,scrollXLeft:0,scrollXWidth:0,isScrollXBig:false,rowExpandHeightFlag:1,calcCellHeightFlag:1,resizeHeightFlag:1,resizeWidthFlag:1,isCustomStatus:false,isDragRowMove:false,dragRow:null,isDragColMove:false,dragCol:null,dragTipText:'',isDragResize:false,isRowLoading:false,isColLoading:false});const internalData={tZindex:0,currKeyField:'',isCurrDeepKey:false,elemStore:{},// 存放横向 X 虚拟滚动相关的信息
|
|
10931
|
+
exportStore:{inited:false,name:'',modeList:[],typeList:[],columns:[],isPrint:false,hasFooter:false,hasMerge:false,hasTree:false,hasColgroup:false,visible:false},exportParams:{filename:'',sheetName:'',mode:'',type:'',isColgroup:false,isMerge:false,isAllExpand:false,useStyle:false,original:false,message:true,isHeader:false,isTitle:false,isFooter:false},visiblwRowsFlag:1,isRowGroupStatus:false,rowGroupList:[],aggHandleFields:[],aggHandleAggColumns:[],rowGroupExpandedFlag:1,rowExpandedFlag:1,treeExpandedFlag:1,updateCheckboxFlag:1,pendingRowFlag:1,insertRowFlag:1,removeRowFlag:1,mergeBodyFlag:1,mergeFootFlag:1,rowHeightStore:{large:52,default:48,medium:44,small:40,mini:36},scrollVMLoading:false,scrollYHeight:0,scrollYTop:0,isScrollYBig:false,scrollXLeft:0,scrollXWidth:0,isScrollXBig:false,rowExpandHeightFlag:1,calcCellHeightFlag:1,resizeHeightFlag:1,resizeWidthFlag:1,isCustomStatus:false,isDragRowMove:false,dragRow:null,isDragColMove:false,dragCol:null,dragTipText:'',isDragResize:false,isRowLoading:false,isColLoading:false});const internalData={tZindex:0,currKeyField:'',isCurrDeepKey:false,elemStore:{},// 存放横向 X 虚拟滚动相关的信息
|
|
10918
10932
|
scrollXStore:{preloadSize:0,offsetSize:0,visibleSize:0,visibleStartIndex:0,visibleEndIndex:0,startIndex:0,endIndex:0},// 存放纵向 Y 虚拟滚动相关信息
|
|
10919
10933
|
scrollYStore:{preloadSize:0,offsetSize:0,visibleSize:0,visibleStartIndex:0,visibleEndIndex:0,startIndex:0,endIndex:0},// 表格宽度
|
|
10920
10934
|
tableWidth:0,// 表格高度
|
|
@@ -10964,7 +10978,7 @@ if(resizableData||sortData||visibleData||fixedData){external_root_XEUtils_common
|
|
|
10964
10978
|
if(!parentColumn){if(fixedData&&fixedData[colKey]!==undefined){column.fixed=fixedData[colKey];}if(sortData&&external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(sortData[colKey])){hasCustomSort=true;column.renderSortNumber=sortData[colKey];}}if(resizableData&&external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(resizableData[colKey])){column.resizeWidth=resizableData[colKey];}if(visibleData&&external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(visibleData[colKey])){column.visible=visibleData[colKey];}});// 如果自定义了顺序
|
|
10965
10979
|
if(hasCustomSort){collectColumn=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().orderBy(collectColumn,'renderSortNumber');internalData.collectColumn=collectColumn;internalData.tableFullColumn=getColumnList(collectColumn);}reactData.isCustomStatus=true;}else{reactData.isCustomStatus=false;}};/**
|
|
10966
10980
|
* 还原自定义列操作状态
|
|
10967
|
-
*/const restoreCustomStorage=()=>{const{customConfig}=props;const tableId=computeTableId.value;const customOpts=computeCustomOpts.value;const{storage,restoreStore,storeOptions}=customOpts;const isAllCustom=storage===true;const storageOpts=isAllCustom?{}:Object.assign({},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);if(storage&&(customConfig?isEnableConf(customOpts):customOpts.enabled)&&(isCustomResizable||isCustomVisible||isCustomFixed||isCustomSort)){if(!tableId){errLog('vxe.error.reqProp',['id']);return;}const storeData=getCustomStorageMap(tableId);if(restoreStore){return Promise.resolve(restoreStore({$table:$xeTable,id:tableId,type:'restore',storeData})).then(storeData=>{if(!storeData){return;}return handleCustomRestore(storeData);}).catch(e=>e);}else{return handleCustomRestore(storeData);}}};/**
|
|
10981
|
+
*/const restoreCustomStorage=()=>{const{customConfig}=props;const tableId=computeTableId.value;const customOpts=computeCustomOpts.value;const{storage,restoreStore,storeOptions}=customOpts;const isAllCustom=storage===true;const storageOpts=isAllCustom?{}:Object.assign({},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 isCustomAggFunc=hangleStorageDefaultValue(storageOpts.aggFunc,isAllCustom);if(storage&&(customConfig?isEnableConf(customOpts):customOpts.enabled)&&(isCustomResizable||isCustomVisible||isCustomFixed||isCustomSort||isCustomAggFunc)){if(!tableId){errLog('vxe.error.reqProp',['id']);return;}const storeData=getCustomStorageMap(tableId);if(restoreStore){return Promise.resolve(restoreStore({$table:$xeTable,id:tableId,type:'restore',storeData})).then(storeData=>{if(!storeData){return;}return handleCustomRestore(storeData);}).catch(e=>e);}else{return handleCustomRestore(storeData);}}};/**
|
|
10968
10982
|
* 更新数据列的 Map
|
|
10969
10983
|
* 牺牲数据组装的耗时,用来换取使用过程中的流畅
|
|
10970
10984
|
*/const cacheColumnMap=()=>{const{tableFullColumn,collectColumn}=internalData;const fullColumnIdData=internalData.fullColumnIdData={};const fullColumnFieldData=internalData.fullColumnFieldData={};const mouseOpts=computeMouseOpts.value;const expandOpts=computeExpandOpts.value;const columnOpts=computeColumnOpts.value;const columnDragOpts=computeColumnDragOpts.value;const virtualYOpts=computeVirtualYOpts.value;const{isCrossDrag,isSelfToChildDrag}=columnDragOpts;const customOpts=computeCustomOpts.value;const{storage}=customOpts;const rowOpts=computeRowOpts.value;const isGroup=collectColumn.some(hasChildrenList);let isAllOverflow=!!props.showOverflow;let rowGroupColumn;let expandColumn;let treeNodeColumn;let checkboxColumn;let radioColumn;let htmlColumn;let hasFixed;const handleFunc=(column,index,items,path,parentColumn)=>{const{id:colid,field,fixed,type,treeNode,rowGroupNode}=column;const rest={$index:-1,_index:-1,column,colid,index,items,parent:parentColumn||null,width:0,oLeft:0};if(field){if(fullColumnFieldData[field]){errLog('vxe.error.colRepet',['field',field]);}fullColumnFieldData[field]=rest;}else{if(storage&&!type||columnOpts.drag&&(isCrossDrag||isSelfToChildDrag)){errLog('vxe.error.reqProp',[`${column.getTitle()||type||''} -> column.field=?`]);}}if(!hasFixed&&fixed){hasFixed=fixed;}if(!htmlColumn&&type==='html'){htmlColumn=column;}if(treeNode){if(treeNodeColumn){warnLog('vxe.error.colRepet',['tree-node',treeNode]);}if(!treeNodeColumn){treeNodeColumn=column;}}if(rowGroupNode){if(treeNodeColumn){warnLog('vxe.error.colRepet',['row-group-node',rowGroupNode]);}if(!rowGroupColumn){rowGroupColumn=column;}}if(type==='expand'){if(expandColumn){warnLog('vxe.error.colRepet',['type',type]);}if(!expandColumn){expandColumn=column;}}if(type==='checkbox'){if(checkboxColumn){warnLog('vxe.error.colRepet',['type',type]);}if(!checkboxColumn){checkboxColumn=column;}}else if(type==='radio'){if(radioColumn){warnLog('vxe.error.colRepet',['type',type]);}if(!radioColumn){radioColumn=column;}}if(isAllOverflow&&column.showOverflow===false){isAllOverflow=false;}if(fullColumnIdData[colid]){errLog('vxe.error.colRepet',['colId',colid]);}fullColumnIdData[colid]=rest;};if(isGroup){external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(collectColumn,(column,index,items,path,parentColumn,nodes)=>{column.level=nodes.length;handleFunc(column,index,items,path,parentColumn);});}else{tableFullColumn.forEach(handleFunc);}if(expandColumn&&expandOpts.mode!=='fixed'&&virtualYOpts.enabled){warnLog('vxe.error.notConflictProp',['column.type="expand','virtual-y-config.enabled=false']);}if(expandColumn&&expandOpts.mode!=='fixed'&&mouseOpts.area){errLog('vxe.error.errConflicts',['mouse-config.area','column.type=expand']);}if(htmlColumn){if(!columnOpts.useKey){errLog('vxe.error.reqProp',['column-config.useKey & column.type=html']);}if(!rowOpts.useKey){errLog('vxe.error.reqProp',['row-config.useKey & column.type=html']);}}reactData.isGroup=isGroup;reactData.rowGroupColumn=rowGroupColumn;reactData.treeNodeColumn=treeNodeColumn;reactData.expandColumn=expandColumn;reactData.isAllOverflow=isAllOverflow;};const updateHeight=()=>{internalData.customHeight=calcTableHeight('height');internalData.customMinHeight=calcTableHeight('minHeight');internalData.customMaxHeight=calcTableHeight('maxHeight');// 如果启用虚拟滚动,默认高度
|
|
@@ -11080,7 +11094,7 @@ const computeScrollLoad=()=>{return (0,external_commonjs_vue_commonjs2_vue_root_
|
|
|
11080
11094
|
if(scrollXLoad){const{toVisibleIndex:toXVisibleIndex,visibleSize:visibleXSize}=handleVirtualXVisible();const offsetXSize=Math.max(0,virtualXOpts.oSize?external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(virtualXOpts.oSize):0);scrollXStore.preloadSize=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(virtualXOpts.preSize);scrollXStore.offsetSize=offsetXSize;scrollXStore.visibleSize=visibleXSize;scrollXStore.endIndex=Math.max(scrollXStore.startIndex+scrollXStore.visibleSize+offsetXSize,scrollXStore.endIndex);scrollXStore.visibleStartIndex=Math.max(scrollXStore.startIndex,toXVisibleIndex);scrollXStore.visibleEndIndex=Math.min(scrollXStore.endIndex,toXVisibleIndex+visibleXSize);$xeTable.updateScrollXData().then(()=>{loadScrollXData();});}else{$xeTable.updateScrollXSpace();}// 计算 Y 逻辑
|
|
11081
11095
|
const rowHeight=computeRowHeight();scrollYStore.rowHeight=rowHeight;// 已废弃
|
|
11082
11096
|
reactData.rowHeight=rowHeight;const{toVisibleIndex:toYVisibleIndex,visibleSize:visibleYSize}=handleVirtualYVisible();if(scrollYLoad){const offsetYSize=Math.max(0,virtualYOpts.oSize?external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(virtualYOpts.oSize):0);scrollYStore.preloadSize=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(virtualYOpts.preSize);scrollYStore.offsetSize=offsetYSize;scrollYStore.visibleSize=visibleYSize;scrollYStore.endIndex=Math.max(scrollYStore.startIndex+visibleYSize+offsetYSize,scrollYStore.endIndex);scrollYStore.visibleStartIndex=Math.max(scrollYStore.startIndex,toYVisibleIndex);scrollYStore.visibleEndIndex=Math.min(scrollYStore.endIndex,toYVisibleIndex+visibleYSize);$xeTable.updateScrollYData().then(()=>{loadScrollYData();});}else{$xeTable.updateScrollYSpace();}});};const calcScrollbar=()=>{const{scrollXWidth,scrollYHeight}=reactData;const{elemStore}=internalData;const scrollbarOpts=computeScrollbarOpts.value;const bodyWrapperElem=getRefElem(elemStore['main-body-wrapper']);const headerTableElem=getRefElem(elemStore['main-header-table']);const footerTableElem=getRefElem(elemStore['main-footer-table']);const xHandleEl=refScrollXHandleElem.value;const yHandleEl=refScrollYHandleElem.value;let overflowY=false;let overflowX=false;if(bodyWrapperElem){overflowY=scrollYHeight>bodyWrapperElem.clientHeight;if(yHandleEl){reactData.scrollbarWidth=scrollbarOpts.width||yHandleEl.offsetWidth-yHandleEl.clientWidth||14;}reactData.overflowY=overflowY;overflowX=scrollXWidth>bodyWrapperElem.clientWidth;if(xHandleEl){reactData.scrollbarHeight=scrollbarOpts.height||xHandleEl.offsetHeight-xHandleEl.clientHeight||14;}const headerHeight=headerTableElem?headerTableElem.clientHeight:0;const footerHeight=footerTableElem?footerTableElem.clientHeight:0;internalData.tableHeight=bodyWrapperElem.offsetHeight;internalData.headerHeight=headerHeight;internalData.footerHeight=footerHeight;reactData.overflowX=overflowX;reactData.parentHeight=Math.max(internalData.headerHeight+footerHeight+20,$xeTable.getParentHeight());}if(overflowX){$xeTable.checkScrolling();}};const handleRecalculateLayout=reFull=>{const el=refElem.value;internalData.rceRunTime=Date.now();if(!el||!el.clientWidth){return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();}const varEl=refVarElem.value;if(varEl){const[defEl,mediumEl,smallEl,miniEl]=varEl.children;calcVarRowHeightConfig('default',defEl);calcVarRowHeightConfig('medium',mediumEl);calcVarRowHeightConfig('small',smallEl);calcVarRowHeightConfig('mini',miniEl);}calcCellWidth();autoCellWidth();calcScrollbar();updateStyle();updateRowExpandStyle();return computeScrollLoad().then(()=>{// 初始化时需要在列计算之后再执行优化运算,达到最优显示效果
|
|
11083
|
-
calcCellWidth();if(reFull){autoCellWidth();}calcScrollbar();updateStyle();if(reFull){updateRowOffsetTop();}updateRowExpandStyle();if(reFull){return computeScrollLoad();}});};const handleUpdateRowGroup=groupFields=>{const aggFields=[];const aggConfs=[];if(groupFields){(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(groupFields)?groupFields:[groupFields]).forEach(field=>{aggFields.push(field);aggConfs.push({field});});}reactData.rowGroupList=aggConfs;reactData.aggHandleFields=aggFields;};const handleeGroupSummary=aggList=>{const aggregateOpts=computeAggregateOpts.value;const{mapChildrenField}=aggregateOpts;if(mapChildrenField){external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().lastEach(aggList,aggRow=>{let count=0;external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(aggRow[mapChildrenField],row=>{if(row.isAggregate){count+=row.childCount||0;}else{count++;}});aggRow.childCount=count;});if($xeTable.handlePivotTableAggregateData){$xeTable.handlePivotTableAggregateData(aggList);}}};const updateGroupData=()=>{const{aggregateConfig,rowGroupConfig}=props;const{isRowGroupStatus}=reactData;const{tableFullGroupData}=internalData;const aggregateOpts=computeAggregateOpts.value;const{mapChildrenField}=aggregateOpts;if((aggregateConfig||rowGroupConfig)&&isRowGroupStatus){const aggList=[];external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(tableFullGroupData,row=>{if(row.isAggregate){aggList.push(row);}},{children:mapChildrenField});handleeGroupSummary(aggList);}};const handleGroupData=(list,rowGroups)=>{let fullData=list;let treeData=list;if(rowGroups){const aggregateOpts=computeAggregateOpts.value;const{rowField,parentField,childrenField,mapChildrenField}=aggregateOpts;const checkboxOpts=computeCheckboxOpts.value;const{checkField}=checkboxOpts;const indeterminateField=checkboxOpts.indeterminateField||checkboxOpts.halfField;const rgItem=rowGroups[0];if(rgItem&&rowField&&parentField&&childrenField&&mapChildrenField){fullData=[];treeData=[];const groupField=rgItem.field;const groupColumn=$xeTable.getColumnByField(groupField);const groupMaps={};const aggList=[];const rowkey=getRowkey($xeTable);list.forEach(row=>{const cellValue=groupColumn?$xeTable.getCellLabel(row,groupColumn):external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row,groupField);const groupValue=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(cellValue)?'':cellValue;let childList=groupMaps[groupValue];if(!childList){childList=[];groupMaps[groupValue]=childList;}if(row.isAggregate){row.isAggregate=undefined;}childList.push(row);});external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().objectEach(groupMaps,(childList,groupValue)=>{const{fullData:childFullData,treeData:childTreeData}=handleGroupData(childList,rowGroups.slice(1));const aggRow={isAggregate:true,aggData:{},groupContent:groupValue,groupField,childCount:0,[rowField]:getRowUniqueId(),[parentField]:null,[rowkey]:getRowUniqueId(),[childrenField]:childTreeData,[mapChildrenField]:childTreeData};if(checkField){aggRow[checkField]=false;}if(indeterminateField){aggRow[indeterminateField]=false;}aggList.push(aggRow);treeData.push(aggRow);fullData.push(aggRow);if(childFullData.length){fullData.push(...childFullData);}});handleeGroupSummary(aggList);}}return{treeData,fullData};};/**
|
|
11097
|
+
calcCellWidth();if(reFull){autoCellWidth();}calcScrollbar();updateStyle();if(reFull){updateRowOffsetTop();}updateRowExpandStyle();if(reFull){return computeScrollLoad();}});};const handleUpdateAggValues=()=>{const{visibleColumn}=internalData;const aggCols=[];visibleColumn.forEach(column=>{if(column.aggFunc){aggCols.push(column);}});reactData.aggHandleAggColumns=aggCols;};const handleUpdateRowGroup=groupFields=>{const aggFields=[];const aggConfs=[];if(groupFields){(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(groupFields)?groupFields:[groupFields]).forEach(field=>{aggFields.push(field);aggConfs.push({field});});}reactData.rowGroupList=aggConfs;reactData.aggHandleFields=aggFields;handleUpdateAggValues();};const handleeGroupSummary=aggList=>{const aggregateOpts=computeAggregateOpts.value;const{mapChildrenField}=aggregateOpts;if(mapChildrenField){external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().lastEach(aggList,aggRow=>{let count=0;external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(aggRow[mapChildrenField],row=>{if(row.isAggregate){count+=row.childCount||0;}else{count++;}});aggRow.childCount=count;});if($xeTable.handlePivotTableAggregateData){$xeTable.handlePivotTableAggregateData(aggList);}}};const updateGroupData=()=>{const{aggregateConfig,rowGroupConfig}=props;const{isRowGroupStatus}=reactData;const{tableFullGroupData}=internalData;const aggregateOpts=computeAggregateOpts.value;const{mapChildrenField}=aggregateOpts;if((aggregateConfig||rowGroupConfig)&&isRowGroupStatus){const aggList=[];external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(tableFullGroupData,row=>{if(row.isAggregate){aggList.push(row);}},{children:mapChildrenField});handleeGroupSummary(aggList);}};const handleGroupData=(list,rowGroups)=>{let fullData=list;let treeData=list;if(rowGroups){const aggregateOpts=computeAggregateOpts.value;const{rowField,parentField,childrenField,mapChildrenField}=aggregateOpts;const checkboxOpts=computeCheckboxOpts.value;const{checkField}=checkboxOpts;const indeterminateField=checkboxOpts.indeterminateField||checkboxOpts.halfField;const rgItem=rowGroups[0];if(rgItem&&rowField&&parentField&&childrenField&&mapChildrenField){fullData=[];treeData=[];const groupField=rgItem.field;const groupColumn=$xeTable.getColumnByField(groupField);const groupMaps={};const aggList=[];const rowkey=getRowkey($xeTable);list.forEach(row=>{const cellValue=groupColumn?$xeTable.getCellLabel(row,groupColumn):external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row,groupField);const groupValue=external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(cellValue)?'':cellValue;let childList=groupMaps[groupValue];if(!childList){childList=[];groupMaps[groupValue]=childList;}if(row.isAggregate){row.isAggregate=undefined;}childList.push(row);});external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().objectEach(groupMaps,(childList,groupValue)=>{const{fullData:childFullData,treeData:childTreeData}=handleGroupData(childList,rowGroups.slice(1));const aggRow={isAggregate:true,aggData:{},groupContent:groupValue,groupField,childCount:0,[rowField]:getRowUniqueId(),[parentField]:null,[rowkey]:getRowUniqueId(),[childrenField]:childTreeData,[mapChildrenField]:childTreeData};if(checkField){aggRow[checkField]=false;}if(indeterminateField){aggRow[indeterminateField]=false;}aggList.push(aggRow);treeData.push(aggRow);fullData.push(aggRow);if(childFullData.length){fullData.push(...childFullData);}});handleeGroupSummary(aggList);}}return{treeData,fullData};};/**
|
|
11084
11098
|
* 加载表格数据
|
|
11085
11099
|
* @param {Array} datas 数据
|
|
11086
11100
|
*/const loadTableData=(datas,isReset)=>{const{keepSource,treeConfig,rowGroupConfig,aggregateConfig}=props;const{rowGroupList,scrollYLoad:oldScrollYLoad}=reactData;const{scrollYStore,scrollXStore,lastScrollLeft,lastScrollTop}=internalData;const rowOpts=computeRowOpts.value;const treeOpts=computeTreeOpts.value;const expandOpts=computeExpandOpts.value;const{transform}=treeOpts;const childrenField=treeOpts.children||treeOpts.childrenField;let treeData=[];let fullData=(0,external_commonjs_vue_commonjs2_vue_root_Vue_.reactive)(datas?datas.slice(0):[]);// 转为响应式数据
|
|
@@ -11138,7 +11152,7 @@ tableFullColumn.forEach(column=>{if(column.visible){if(column.fixed==='left'){le
|
|
|
11138
11152
|
// }
|
|
11139
11153
|
if(props.spanMethod){warnLog('vxe.error.scrollErrProp',['span-method']);}if(props.footerSpanMethod){warnLog('vxe.error.scrollErrProp',['footer-span-method']);}if(isReset){const{visibleSize}=handleVirtualXVisible();scrollXStore.startIndex=0;scrollXStore.endIndex=visibleSize;scrollXStore.visibleSize=visibleSize;scrollXStore.visibleStartIndex=0;scrollXStore.visibleEndIndex=visibleSize;}}// 如果列被显示/隐藏,则清除合并状态
|
|
11140
11154
|
// 如果列被设置为固定,则清除合并状态
|
|
11141
|
-
if(visibleColumn.length!==internalData.visibleColumn.length||!internalData.visibleColumn.every((column,index)=>column===visibleColumn[index])){$xeTable.clearMergeCells();$xeTable.clearMergeFooterItems();}visibleColumn.forEach((column,index)=>{const colid=column.id;const colRest=fullColumnIdData[colid];if(colRest){colRest._index=index;}});handleTableColumn();if(isReset){updateColumnOffsetLeft();return $xeTable.updateFooter().then(()=>{return $xeTable.recalculate();}).then(()=>{$xeTable.updateCellAreas();return $xeTable.recalculate();});}return $xeTable.updateFooter();};const initColumnSort=()=>{const{collectColumn}=internalData;collectColumn.forEach((column,index)=>{const sortIndex=index+1;column.sortNumber=sortIndex;column.renderSortNumber=sortIndex;});};const handleColumn=collectColumn=>{const expandOpts=computeExpandOpts.value;internalData.collectColumn=collectColumn;const tableFullColumn=getColumnList(collectColumn);internalData.tableFullColumn=tableFullColumn;reactData.isColLoading=true;reactData.isDragColMove=false;initColumnSort();return Promise.resolve(restoreCustomStorage()).then(()=>{const{scrollXLoad,scrollYLoad,expandColumn}=reactData;cacheColumnMap();parseColumns(true).then(()=>{if(reactData.scrollXLoad){loadScrollXData();}});$xeTable.clearMergeCells();$xeTable.clearMergeFooterItems();$xeTable.handleTableData(true);$xeTable.handleAggregateSummaryData();if((scrollXLoad||scrollYLoad)&&expandColumn&&expandOpts.mode!=='fixed'){warnLog('vxe.error.scrollErrProp',['column.type=expand']);}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(()=>{if($xeToolbar){$xeToolbar.syncUpdate({collectColumn:internalData.collectColumn,$table:$xeTable});}if($xeTable.handleUpdateCustomColumn){$xeTable.handleUpdateCustomColumn();}reactData.isColLoading=false;return $xeTable.recalculate();});});};const updateScrollXStatus=fullColumn=>{const virtualXOpts=computeVirtualXOpts.value;const allCols=fullColumn||internalData.tableFullColumn;// 如果gt为0,则总是启用
|
|
11155
|
+
if(visibleColumn.length!==internalData.visibleColumn.length||!internalData.visibleColumn.every((column,index)=>column===visibleColumn[index])){$xeTable.clearMergeCells();$xeTable.clearMergeFooterItems();}visibleColumn.forEach((column,index)=>{const colid=column.id;const colRest=fullColumnIdData[colid];if(colRest){colRest._index=index;}});handleTableColumn();handleUpdateAggValues();if(isReset){updateColumnOffsetLeft();return $xeTable.updateFooter().then(()=>{return $xeTable.recalculate();}).then(()=>{$xeTable.updateCellAreas();return $xeTable.recalculate();});}return $xeTable.updateFooter();};const initColumnSort=()=>{const{collectColumn}=internalData;collectColumn.forEach((column,index)=>{const sortIndex=index+1;column.sortNumber=sortIndex;column.renderSortNumber=sortIndex;});};const handleColumn=collectColumn=>{const expandOpts=computeExpandOpts.value;internalData.collectColumn=collectColumn;const tableFullColumn=getColumnList(collectColumn);internalData.tableFullColumn=tableFullColumn;reactData.isColLoading=true;reactData.isDragColMove=false;initColumnSort();return Promise.resolve(restoreCustomStorage()).then(()=>{const{scrollXLoad,scrollYLoad,expandColumn}=reactData;cacheColumnMap();parseColumns(true).then(()=>{if(reactData.scrollXLoad){loadScrollXData();}});$xeTable.clearMergeCells();$xeTable.clearMergeFooterItems();$xeTable.handleTableData(true);$xeTable.handleAggregateSummaryData();if((scrollXLoad||scrollYLoad)&&expandColumn&&expandOpts.mode!=='fixed'){warnLog('vxe.error.scrollErrProp',['column.type=expand']);}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(()=>{if($xeToolbar){$xeToolbar.syncUpdate({collectColumn:internalData.collectColumn,$table:$xeTable});}if($xeTable.handleUpdateCustomColumn){$xeTable.handleUpdateCustomColumn();}reactData.isColLoading=false;return $xeTable.recalculate();});});};const updateScrollXStatus=fullColumn=>{const virtualXOpts=computeVirtualXOpts.value;const allCols=fullColumn||internalData.tableFullColumn;// 如果gt为0,则总是启用
|
|
11142
11156
|
const scrollXLoad=!!virtualXOpts.enabled&&virtualXOpts.gt>-1&&(virtualXOpts.gt===0||virtualXOpts.gt<allCols.length);reactData.scrollXLoad=scrollXLoad;return scrollXLoad;};const updateScrollYStatus=fullData=>{const{treeConfig}=props;const virtualYOpts=computeVirtualYOpts.value;const treeOpts=computeTreeOpts.value;const{transform}=treeOpts;const allList=fullData||internalData.tableFullData;// 如果gt为0,则总是启用
|
|
11143
11157
|
const scrollYLoad=(transform||!treeConfig)&&!!virtualYOpts.enabled&&virtualYOpts.gt>-1&&(virtualYOpts.gt===0||virtualYOpts.gt<allList.length);reactData.scrollYLoad=scrollYLoad;return scrollYLoad;};/**
|
|
11144
11158
|
* 展开与收起树节点
|
|
@@ -11476,8 +11490,8 @@ if(transform){return handleVirtualTreeExpand(rows,expanded);}else{return handleB
|
|
|
11476
11490
|
* 获取所有被合并的表尾
|
|
11477
11491
|
*/getMergeFooterItems(){return internalData.mergeFooterList.slice(0);},/**
|
|
11478
11492
|
* 清除所有表尾合并
|
|
11479
|
-
*/clearMergeFooterItems(){internalData.mergeFooterList=[];internalData.mergeFooterMaps={};internalData.mergeFooterCellMaps={};reactData.mergeFootFlag++;return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(()=>{return updateStyle();});},updateCellAreas(){const{mouseConfig}=props;const mouseOpts=computeMouseOpts.value;if(mouseConfig&&mouseOpts.area&&$xeTable.handleRecalculateCellAreaEvent){return $xeTable.handleRecalculateCellAreaEvent();}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();},getCustomStoreData(){const{id}=props;const customOpts=computeCustomOpts.value;const{collectColumn}=internalData;const{storage,checkMethod,storeOptions}=customOpts;const isAllCustom=storage===true;const storageOpts=isAllCustom?{}:Object.assign({},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 resizableData={};const sortData={};const visibleData={};const fixedData={};const storeData={resizableData:undefined,sortData:undefined,visibleData:undefined,fixedData:undefined};if(!id){if(storage){errLog('vxe.error.reqProp',['id']);}return storeData;}let hasResizable=0;let hasSort=0;let hasFixed=0;let hasVisible=0;external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(collectColumn,(column,index,items,path,parentColumn)=>{const colKey=column.getKey();if(!colKey){errLog('vxe.error.reqProp',[`${column.getTitle()||column.type||''} -> column.field=?`]);return;}// 只支持一级
|
|
11480
|
-
if(!parentColumn){if(isCustomSort){hasSort=1;sortData[colKey]=column.renderSortNumber;}if(isCustomFixed&&column.fixed!==column.defaultFixed){hasFixed=1;fixedData[colKey]=column.fixed;}}if(isCustomResizable&&column.resizeWidth){hasResizable=1;resizableData[colKey]=column.renderWidth;}if(isCustomVisible&&(!checkMethod||checkMethod({$table:$xeTable,column}))){if(!column.visible&&column.defaultVisible){hasVisible=1;visibleData[colKey]=false;}else if(column.visible&&!column.defaultVisible){hasVisible=1;visibleData[colKey]=true;}}});if(hasResizable){storeData.resizableData=resizableData;}if(hasSort){storeData.sortData=sortData;}if(hasFixed){storeData.fixedData=fixedData;}if(hasVisible){storeData.visibleData=visibleData;}return storeData;},focus(){internalData.isActivated=true;return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();},blur(){internalData.isActivated=false;return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();},/**
|
|
11493
|
+
*/clearMergeFooterItems(){internalData.mergeFooterList=[];internalData.mergeFooterMaps={};internalData.mergeFooterCellMaps={};reactData.mergeFootFlag++;return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(()=>{return updateStyle();});},updateCellAreas(){const{mouseConfig}=props;const mouseOpts=computeMouseOpts.value;if(mouseConfig&&mouseOpts.area&&$xeTable.handleRecalculateCellAreaEvent){return $xeTable.handleRecalculateCellAreaEvent();}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();},getCustomStoreData(){const{id}=props;const customOpts=computeCustomOpts.value;const{collectColumn}=internalData;const{storage,checkMethod,storeOptions}=customOpts;const isAllCustom=storage===true;const storageOpts=isAllCustom?{}:Object.assign({},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 isCustomAggFunc=hangleStorageDefaultValue(storageOpts.aggFunc,isAllCustom);const resizableData={};const sortData={};const visibleData={};const fixedData={};const aggFuncData={};const storeData={resizableData:undefined,sortData:undefined,visibleData:undefined,fixedData:undefined,aggFuncData:undefined};if(!id){if(storage){errLog('vxe.error.reqProp',['id']);}return storeData;}let hasResizable=0;let hasSort=0;let hasFixed=0;let hasVisible=0;let hasAggFunc=0;external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(collectColumn,(column,index,items,path,parentColumn)=>{const colKey=column.getKey();if(!colKey){errLog('vxe.error.reqProp',[`${column.getTitle()||column.type||''} -> column.field=?`]);return;}// 只支持一级
|
|
11494
|
+
if(!parentColumn){if(isCustomSort){hasSort=1;sortData[colKey]=column.renderSortNumber;}if(isCustomFixed&&column.fixed!==column.defaultFixed){hasFixed=1;fixedData[colKey]=column.fixed;}}if(isCustomResizable&&column.resizeWidth){hasResizable=1;resizableData[colKey]=column.renderWidth;}if(isCustomVisible&&(!checkMethod||checkMethod({$table:$xeTable,column}))){if(!column.visible&&column.defaultVisible){hasVisible=1;visibleData[colKey]=false;}else if(column.visible&&!column.defaultVisible){hasVisible=1;visibleData[colKey]=true;}}if(isCustomAggFunc&&column.aggFunc!==column.defaultAggFunc){hasAggFunc=1;aggFuncData[colKey]=column.aggFunc;}});if(hasResizable){storeData.resizableData=resizableData;}if(hasSort){storeData.sortData=sortData;}if(hasFixed){storeData.fixedData=fixedData;}if(hasVisible){storeData.visibleData=visibleData;}if(hasAggFunc){storeData.aggFuncData=aggFuncData;}return storeData;},focus(){internalData.isActivated=true;return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();},blur(){internalData.isActivated=false;return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();},/**
|
|
11481
11495
|
* 连接工具栏
|
|
11482
11496
|
* @param $toolbar
|
|
11483
11497
|
*/connect($toolbar){if($toolbar){$xeToolbar=$toolbar;$xeToolbar.syncUpdate({collectColumn:internalData.collectColumn,$table:$xeTable});}else{errLog('vxe.error.barUnableLink');}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();}};/**
|
|
@@ -11577,8 +11591,8 @@ if(treeConfig){const childrenField=treeOpts.children||treeOpts.childrenField;ext
|
|
|
11577
11591
|
*/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;// 列之间的最小间距
|
|
11578
11592
|
const dragMinLeft=isRightFixed?0:cellRect.x-tableRect.x+dragBtnWidth+minInterval;const dragMaxLeft=cellRect.x-tableRect.x+cell.clientWidth-minInterval;let fixedLeftRemainWidth=0;let fixedRightRemainWidth=0;if(isLeftFixed||isRightFixed){let isMach=false;const fixedColumn=isLeftFixed?leftList:rightList;for(let i=0;i<fixedColumn.length;i++){const item=fixedColumn[i];if(isMach){fixedLeftRemainWidth+=item.renderWidth;}else{isMach=item.id===resizeColumn.id;if(!isMach){fixedRightRemainWidth+=item.renderWidth;}}}}// 处理拖动事件
|
|
11579
11593
|
const updateEvent=evnt=>{evnt.stopPropagation();evnt.preventDefault();const tableHeight=tableEl.clientHeight;const offsetX=evnt.clientX-dragClientX;let left=dragPosLeft+offsetX;if(isLeftFixed){if(rightContainerRect){left=Math.min(left,rightContainerRect.x-tableRect.x-fixedLeftRemainWidth-minInterval);}}else if(isRightFixed){if(leftContainerElem){left=Math.max(left,leftContainerElem.clientWidth+fixedRightRemainWidth+minInterval);}left=Math.min(left,dragMaxLeft);}dragLeft=Math.max(left,dragMinLeft);const resizeBarLeft=Math.max(1,dragLeft);resizeBarElem.style.left=`${resizeBarLeft}px`;resizeBarElem.style.top=`${scrollbarXToTop?osbHeight:0}px`;resizeBarElem.style.height=`${scrollbarXToTop?tableHeight-osbHeight:tableHeight}px`;if(resizableOpts.showDragTip&&resizeTipElem){resizeTipElem.textContent=table_getI18n('vxe.table.resizeColTip',[Math.floor(resizeColumn.renderWidth+(isRightFixed?dragPosLeft-dragLeft:dragLeft-dragPosLeft))]);const tableWrapperWidth=tableEl.clientWidth;const resizeBarWidth=resizeBarElem.clientWidth;const resizeTipWidth=resizeTipElem.clientWidth;const resizeTipHeight=resizeTipElem.clientHeight;let resizeTipLeft=-resizeTipWidth;if(resizeBarLeft<resizeTipWidth+resizeBarWidth){resizeTipLeft=0;}else if(resizeBarLeft>tableWrapperWidth){resizeTipLeft+=tableWrapperWidth-resizeBarLeft;}resizeTipElem.style.left=`${resizeTipLeft}px`;resizeTipElem.style.top=`${Math.min(tableHeight-resizeTipHeight,Math.max(0,evnt.clientY-tableRect.y-resizeTipHeight/2))}px`;}reactData.isDragResize=true;};reactData.isDragResize=true;addClass(tableEl,'col-drag--resize');resizeBarElem.style.display='block';document.onmousemove=updateEvent;document.onmouseup=function(evnt){document.onmousemove=null;document.onmouseup=null;resizeBarElem.style.display='none';internalData._lastResizeTime=Date.now();setTimeout(()=>{reactData.isDragResize=false;},50);const resizeWidth=resizeColumn.renderWidth+(isRightFixed?dragPosLeft-dragLeft:dragLeft-dragPosLeft);const resizeParams={...params,resizeWidth,resizeColumn};if(resizableOpts.dragMode==='fixed'){visibleColumn.forEach(item=>{if(item.id!==resizeColumn.id){if(!item.resizeWidth){item.resizeWidth=item.renderWidth;}}});}if($xeTable.handleColResizeCellAreaEvent){$xeTable.handleColResizeCellAreaEvent(evnt,resizeParams);}else{resizeColumn.resizeWidth=resizeWidth;handleUpdateColResize(evnt,resizeParams);}removeClass(tableEl,'col-drag--resize');};updateEvent(evnt);if($xeTable.closeMenu){$xeTable.closeMenu();}},handleColResizeDblclickEvent(evnt,params){const resizableOpts=computeResizableOpts.value;const{isDblclickAutoWidth}=resizableOpts;const el=refElem.value;if(isDblclickAutoWidth&&el){evnt.stopPropagation();evnt.preventDefault();const{fullColumnIdData}=internalData;const{column}=params;let resizeColumn=column;if(column.children&&column.children.length){external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(column.children,childColumn=>{resizeColumn=childColumn;});}const colid=resizeColumn.id;const colRest=fullColumnIdData[colid];const dragBtnElem=evnt.target;const cell=dragBtnElem.parentNode;const cellParams=Object.assign(params,{cell});const colMinWidth=getColReMinWidth(cellParams);el.setAttribute('data-calc-col','Y');let resizeWidth=calcColumnAutoWidth(resizeColumn,el);el.removeAttribute('data-calc-col');if(colRest){resizeWidth=Math.max(resizeWidth,colRest.width);}resizeWidth=Math.max(colMinWidth,resizeWidth);const resizeParams={...params,resizeWidth,resizeColumn};reactData.isDragResize=false;internalData._lastResizeTime=Date.now();if($xeTable.handleColResizeDblclickCellAreaEvent){$xeTable.handleColResizeDblclickCellAreaEvent(evnt,resizeParams);}else{resizeColumn.resizeWidth=resizeWidth;handleUpdateColResize(evnt,resizeParams);}}},handleRowResizeMousedownEvent(evnt,params){evnt.stopPropagation();evnt.preventDefault();const{row}=params;const{overflowX,scrollbarWidth,overflowY,scrollbarHeight}=reactData;const{elemStore,fullAllDataRowIdData}=internalData;const osbWidth=overflowY?scrollbarWidth:0;const osbHeight=overflowX?scrollbarHeight:0;const scrollbarYToLeft=computeScrollbarYToLeft.value;const resizableOpts=computeResizableOpts.value;const rowOpts=computeRowOpts.value;const cellOpts=computeCellOpts.value;const tableEl=refElem.value;const resizeBarElem=refRowResizeBar.value;if(!resizeBarElem){return;}const{clientY:dragClientY}=evnt;const resizeTipElem=resizeBarElem.firstElementChild;const dragBtnElem=evnt.currentTarget;const tdEl=dragBtnElem.parentNode;const trEl=tdEl.parentNode;const bodyScrollElem=getRefElem(elemStore['main-body-scroll']);if(!bodyScrollElem){return;}const rowid=getRowid($xeTable,row);const rowRest=fullAllDataRowIdData[rowid];if(!rowRest){return;}const defaultRowHeight=computeDefaultRowHeight.value;const currCellHeight=rowRest.resizeHeight||cellOpts.height||rowOpts.height||rowRest.height||defaultRowHeight;const tableRect=tableEl.getBoundingClientRect();const trRect=trEl.getBoundingClientRect();const targetOffsetY=dragClientY-trRect.y-trEl.clientHeight;let resizeHeight=currCellHeight;const cellEl=tdEl.querySelector('.vxe-cell');let cellMinHeight=0;if(cellEl){const cellStyle=getComputedStyle(cellEl);cellMinHeight=Math.max(1,Math.ceil(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellStyle.paddingTop)+external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellStyle.paddingBottom)));}const minTop=trRect.y-tableRect.y+cellMinHeight;// 处理拖动事件
|
|
11580
|
-
const updateEvent=evnt=>{evnt.stopPropagation();evnt.preventDefault();const rtWidth=tableEl.clientWidth-osbWidth;const tableHeight=tableEl.clientHeight-osbHeight;let dragTop=evnt.clientY-tableRect.y-targetOffsetY;if(dragTop<minTop){dragTop=minTop;}else{resizeHeight=Math.max(cellMinHeight,currCellHeight+evnt.clientY-dragClientY);}resizeBarElem.style.left=`${scrollbarYToLeft?osbWidth:0}px`;resizeBarElem.style.top=`${dragTop}px`;resizeBarElem.style.width=`${rtWidth}px`;if(resizableOpts.showDragTip&&resizeTipElem){resizeTipElem.textContent=table_getI18n('vxe.table.resizeRowTip',[resizeHeight]);const resizeTipWidth=resizeTipElem.clientWidth;const resizeTipHeight=resizeTipElem.clientHeight;let resizeBarLeft=Math.max(2,evnt.clientX-tableRect.x);let resizeBarTop=0;if(resizeBarLeft+resizeTipWidth>=rtWidth-2){resizeBarLeft=rtWidth-resizeTipWidth-2;}if(dragTop+resizeTipHeight>=tableHeight){resizeBarTop=tableHeight-(dragTop+resizeTipHeight);}resizeTipElem.style.left=`${resizeBarLeft}px`;resizeTipElem.style.top=`${resizeBarTop}px`;}reactData.isDragResize=true;};reactData.isDragResize=true;addClass(tableEl,'row-drag--resize');resizeBarElem.style.display='block';document.onmousemove=updateEvent;document.onmouseup=function(evnt){document.onmousemove=null;document.onmouseup=null;resizeBarElem.style.display='none';internalData._lastResizeTime=Date.now();setTimeout(()=>{reactData.isDragResize=false;},50);if(resizeHeight!==currCellHeight){const resizeParams={...params,resizeHeight,resizeRow:row};internalData.isResizeCellHeight=true;if($xeTable.handleRowResizeCellAreaEvent){$xeTable.handleRowResizeCellAreaEvent(evnt,resizeParams);}else{rowRest.resizeHeight=resizeHeight;handleUpdateRowResize(evnt,resizeParams);updateRowOffsetTop();}}removeClass(tableEl,'row-drag--resize');};updateEvent(evnt);},handleRowResizeDblclickEvent(evnt,params){const resizableOpts=computeResizableOpts.value;const{isDblclickAutoHeight}=resizableOpts;const el=refElem.value;if(isDblclickAutoHeight&&el){evnt.stopPropagation();evnt.preventDefault();const{editStore}=reactData;const{fullAllDataRowIdData}=internalData;const{actived}=editStore;const{row}=params;const rowid=getRowid($xeTable,row);const rowRest=fullAllDataRowIdData[rowid];if(!rowRest){return;}const handleRsHeight=()=>{el.setAttribute('data-calc-row','Y');const resizeHeight=calcCellAutoHeight(rowRest,el);el.removeAttribute('data-calc-row');const resizeParams={...params,resizeHeight,resizeRow:row};reactData.isDragResize=false;internalData._lastResizeTime=Date.now();if($xeTable.handleRowResizeDblclickCellAreaEvent){$xeTable.handleRowResizeDblclickCellAreaEvent(evnt,resizeParams);}else{rowRest.resizeHeight=resizeHeight;handleUpdateRowResize(evnt,resizeParams);}};if(actived.row||actived.column){$xeTable.clearEdit().then(handleRsHeight);}else{handleRsHeight();}}},saveCustomStore(type){const{customConfig}=props;const tableId=computeTableId.value;const customOpts=computeCustomOpts.value;const{updateStore,storage,storeOptions}=customOpts;const isAllCustom=storage===true;const storageOpts=isAllCustom?{}:Object.assign({},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);if(type!=='reset'){// fix:修复拖动列宽,重置按钮无法点击的问题
|
|
11581
|
-
reactData.isCustomStatus=true;}if(storage&&(customConfig?isEnableConf(customOpts):customOpts.enabled)&&(isCustomResizable||isCustomVisible||isCustomFixed||isCustomSort)){if(!tableId){errLog('vxe.error.reqProp',['id']);return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();}const storeData=type==='reset'?{resizableData:{},sortData:{},visibleData:{},fixedData:{}}:tableMethods.getCustomStoreData();if(updateStore){return updateStore({$table:$xeTable,id:tableId,type,storeData});}else{setCustomStorageMap(tableId,type==='reset'?null:storeData);}}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();},handleCustom(){const{mouseConfig}=props;if(mouseConfig){if($xeTable.clearSelected){$xeTable.clearSelected();}if($xeTable.clearCellAreas){$xeTable.clearCellAreas();$xeTable.clearCopyCellArea();}}tablePrivateMethods.analyColumnWidth();return tableMethods.refreshColumn(true);},handleUpdateDataQueue(){reactData.upDataFlag++;},handleRefreshColumnQueue(){reactData.reColumnFlag++;},preventEvent(evnt,type,args,next,end){let evntList=table_interceptor.get(type);// 兼容老版本
|
|
11594
|
+
const updateEvent=evnt=>{evnt.stopPropagation();evnt.preventDefault();const rtWidth=tableEl.clientWidth-osbWidth;const tableHeight=tableEl.clientHeight-osbHeight;let dragTop=evnt.clientY-tableRect.y-targetOffsetY;if(dragTop<minTop){dragTop=minTop;}else{resizeHeight=Math.max(cellMinHeight,currCellHeight+evnt.clientY-dragClientY);}resizeBarElem.style.left=`${scrollbarYToLeft?osbWidth:0}px`;resizeBarElem.style.top=`${dragTop}px`;resizeBarElem.style.width=`${rtWidth}px`;if(resizableOpts.showDragTip&&resizeTipElem){resizeTipElem.textContent=table_getI18n('vxe.table.resizeRowTip',[resizeHeight]);const resizeTipWidth=resizeTipElem.clientWidth;const resizeTipHeight=resizeTipElem.clientHeight;let resizeBarLeft=Math.max(2,evnt.clientX-tableRect.x);let resizeBarTop=0;if(resizeBarLeft+resizeTipWidth>=rtWidth-2){resizeBarLeft=rtWidth-resizeTipWidth-2;}if(dragTop+resizeTipHeight>=tableHeight){resizeBarTop=tableHeight-(dragTop+resizeTipHeight);}resizeTipElem.style.left=`${resizeBarLeft}px`;resizeTipElem.style.top=`${resizeBarTop}px`;}reactData.isDragResize=true;};reactData.isDragResize=true;addClass(tableEl,'row-drag--resize');resizeBarElem.style.display='block';document.onmousemove=updateEvent;document.onmouseup=function(evnt){document.onmousemove=null;document.onmouseup=null;resizeBarElem.style.display='none';internalData._lastResizeTime=Date.now();setTimeout(()=>{reactData.isDragResize=false;},50);if(resizeHeight!==currCellHeight){const resizeParams={...params,resizeHeight,resizeRow:row};internalData.isResizeCellHeight=true;if($xeTable.handleRowResizeCellAreaEvent){$xeTable.handleRowResizeCellAreaEvent(evnt,resizeParams);}else{rowRest.resizeHeight=resizeHeight;handleUpdateRowResize(evnt,resizeParams);updateRowOffsetTop();}}removeClass(tableEl,'row-drag--resize');};updateEvent(evnt);},handleRowResizeDblclickEvent(evnt,params){const resizableOpts=computeResizableOpts.value;const{isDblclickAutoHeight}=resizableOpts;const el=refElem.value;if(isDblclickAutoHeight&&el){evnt.stopPropagation();evnt.preventDefault();const{editStore}=reactData;const{fullAllDataRowIdData}=internalData;const{actived}=editStore;const{row}=params;const rowid=getRowid($xeTable,row);const rowRest=fullAllDataRowIdData[rowid];if(!rowRest){return;}const handleRsHeight=()=>{el.setAttribute('data-calc-row','Y');const resizeHeight=calcCellAutoHeight(rowRest,el);el.removeAttribute('data-calc-row');const resizeParams={...params,resizeHeight,resizeRow:row};reactData.isDragResize=false;internalData._lastResizeTime=Date.now();if($xeTable.handleRowResizeDblclickCellAreaEvent){$xeTable.handleRowResizeDblclickCellAreaEvent(evnt,resizeParams);}else{rowRest.resizeHeight=resizeHeight;handleUpdateRowResize(evnt,resizeParams);}};if(actived.row||actived.column){$xeTable.clearEdit().then(handleRsHeight);}else{handleRsHeight();}}},saveCustomStore(type){const{customConfig}=props;const tableId=computeTableId.value;const customOpts=computeCustomOpts.value;const{updateStore,storage,storeOptions}=customOpts;const isAllCustom=storage===true;const storageOpts=isAllCustom?{}:Object.assign({},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 isCustomAggFunc=hangleStorageDefaultValue(storageOpts.aggFunc,isAllCustom);if(type!=='reset'){// fix:修复拖动列宽,重置按钮无法点击的问题
|
|
11595
|
+
reactData.isCustomStatus=true;}if(storage&&(customConfig?isEnableConf(customOpts):customOpts.enabled)&&(isCustomResizable||isCustomVisible||isCustomFixed||isCustomSort||isCustomAggFunc)){if(!tableId){errLog('vxe.error.reqProp',['id']);return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();}const storeData=type==='reset'?{resizableData:{},sortData:{},visibleData:{},fixedData:{}}:tableMethods.getCustomStoreData();if(updateStore){return updateStore({$table:$xeTable,id:tableId,type,storeData});}else{setCustomStorageMap(tableId,type==='reset'?null:storeData);}}return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();},handleCustom(){const{mouseConfig}=props;if(mouseConfig){if($xeTable.clearSelected){$xeTable.clearSelected();}if($xeTable.clearCellAreas){$xeTable.clearCellAreas();$xeTable.clearCopyCellArea();}}tablePrivateMethods.analyColumnWidth();return tableMethods.refreshColumn(true);},handleUpdateDataQueue(){reactData.upDataFlag++;},handleRefreshColumnQueue(){reactData.reColumnFlag++;},preventEvent(evnt,type,args,next,end){let evntList=table_interceptor.get(type);// 兼容老版本
|
|
11582
11596
|
if(!evntList.length&&type==='event.clearEdit'){evntList=table_interceptor.get('event.clearActived');if(evntList.length){warnLog('vxe.error.delEvent',['event.clearActived','event.clearEdit']);}}// 兼容老版本
|
|
11583
11597
|
let rest=null;let isStop=false;for(let i=0;i<evntList.length;i++){const func=evntList[i];const fnRest=func(Object.assign({$grid:$xeGrid,$table:$xeTable,$event:evnt},args));if(fnRest===false){isStop=true;break;}else if(fnRest&&fnRest.status===false){rest=fnRest.result;isStop=true;break;}}if(!isStop){if(next){rest=next();}}if(end){end();}return rest;},updateCheckboxStatus(){const{treeConfig}=props;const{isRowGroupStatus}=reactData;const{afterTreeFullData,afterGroupFullData,selectCheckboxMaps,treeIndeterminateRowMaps}=internalData;const aggregateOpts=computeAggregateOpts.value;const treeOpts=computeTreeOpts.value;const childrenField=treeOpts.children||treeOpts.childrenField;const checkboxOpts=computeCheckboxOpts.value;const{checkField,checkStrictly,checkMethod}=checkboxOpts;if(checkStrictly){return;}if(isRowGroupStatus||treeConfig){const{handleGetRowId}=createHandleGetRowId($xeTable);const childRowMaps={};const childRowList=[];if(isRowGroupStatus){// 行分组
|
|
11584
11598
|
const mapChildrenField=aggregateOpts.mapChildrenField;if(mapChildrenField){external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(afterGroupFullData,row=>{const rowid=handleGetRowId(row);const childList=row[mapChildrenField];if(childList&&childList.length&&!childRowMaps[rowid]){childRowMaps[rowid]=1;childRowList.unshift([row,rowid,childList]);}},{children:mapChildrenField});}}else if(treeConfig){// 树结构
|
|
@@ -11695,7 +11709,7 @@ if(expandColumn&&rowExpandedMaps[rowid]){scrollYHeight+=rowRest.expandHeight||ex
|
|
|
11695
11709
|
let ySpaceHeight=scrollYHeight;let scrollYTop=ySpaceTop;if(isScrollYBig){// 触底
|
|
11696
11710
|
if(bodyScrollElem&&bodyTableElem&&bodyScrollElem.scrollTop+clientHeight>=maxYHeight){scrollYTop=maxYHeight-bodyTableElem.clientHeight;}else{scrollYTop=(maxYHeight-clientHeight)*(ySpaceTop/(scrollYHeight-clientHeight));}ySpaceHeight=maxYHeight;}if(!(scrollYLoad&&overflowY)){scrollYTop=0;}if(leftBodyTableElem){leftBodyTableElem.style.transform=`translate(0px, ${scrollYTop}px)`;}if(bodyTableElem){bodyTableElem.style.transform=`translate(${reactData.scrollXLeft||0}px, ${scrollYTop}px)`;}if(rightbodyTableElem){rightbodyTableElem.style.transform=`translate(0px, ${scrollYTop}px)`;}containerList.forEach(name=>{const layoutList=['header','body','footer'];layoutList.forEach(layout=>{const ySpaceElem=getRefElem(elemStore[`${name}-${layout}-ySpace`]);if(ySpaceElem){ySpaceElem.style.height=ySpaceHeight?`${ySpaceHeight}px`:'';}});});const scrollYSpaceEl=refScrollYSpaceElem.value;if(scrollYSpaceEl){scrollYSpaceEl.style.height=ySpaceHeight?`${ySpaceHeight}px`:'';}const rowExpandYSpaceEl=refRowExpandYSpaceElem.value;if(rowExpandYSpaceEl){rowExpandYSpaceEl.style.height=ySpaceHeight?`${ySpaceHeight}px`:'';}reactData.scrollYTop=scrollYTop;reactData.scrollYHeight=scrollYHeight;reactData.isScrollYBig=isScrollYBig;if(isScrollYBig&&mouseOpts.area){errLog('vxe.error.notProp',['mouse-config.area']);}calcScrollbar();return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(()=>{updateStyle();});},updateScrollXData(){const{isAllOverflow}=reactData;handleTableColumn();$xeTable.updateScrollXSpace();return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(()=>{handleTableColumn();$xeTable.updateScrollXSpace();if(!isAllOverflow){$xeTable.updateScrollYSpace();}});},updateScrollYData(){$xeTable.handleTableData();$xeTable.updateScrollYSpace();return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(()=>{$xeTable.handleTableData();$xeTable.updateScrollYSpace();});},/**
|
|
11697
11711
|
* 处理固定列的显示状态
|
|
11698
|
-
*/checkScrolling(){const{elemStore}=internalData;const bodyScrollElem=getRefElem(elemStore['main-body-scroll']);const leftContainerElem=refLeftContainer.value;const rightContainerElem=refRightContainer.value;const xHandleEl=refScrollXHandleElem.value;const bodtTargetEl=xHandleEl||bodyScrollElem;if(bodtTargetEl){if(leftContainerElem){if(bodtTargetEl.scrollLeft>0){addClass(leftContainerElem,'scrolling--middle');}else{removeClass(leftContainerElem,'scrolling--middle');}}if(rightContainerElem){if(bodtTargetEl.clientWidth<bodtTargetEl.scrollWidth-Math.ceil(bodtTargetEl.scrollLeft)){addClass(rightContainerElem,'scrolling--middle');}else{removeClass(rightContainerElem,'scrolling--middle');}}}},updateZindex(){if(props.zIndex){internalData.tZindex=props.zIndex;}else if(internalData.tZindex<getLastZIndex()){internalData.tZindex=nextZIndex();}},handleCheckedCheckboxRow,/**
|
|
11712
|
+
*/checkScrolling(){const{elemStore}=internalData;const bodyScrollElem=getRefElem(elemStore['main-body-scroll']);const leftContainerElem=refLeftContainer.value;const rightContainerElem=refRightContainer.value;const xHandleEl=refScrollXHandleElem.value;const bodtTargetEl=xHandleEl||bodyScrollElem;if(bodtTargetEl){if(leftContainerElem){if(bodtTargetEl.scrollLeft>0){addClass(leftContainerElem,'scrolling--middle');}else{removeClass(leftContainerElem,'scrolling--middle');}}if(rightContainerElem){if(bodtTargetEl.clientWidth<bodtTargetEl.scrollWidth-Math.ceil(bodtTargetEl.scrollLeft)){addClass(rightContainerElem,'scrolling--middle');}else{removeClass(rightContainerElem,'scrolling--middle');}}}},handleUpdateAggData(){return loadTableData(internalData.tableSynchData,true);},updateZindex(){if(props.zIndex){internalData.tZindex=props.zIndex;}else if(internalData.tZindex<getLastZIndex()){internalData.tZindex=nextZIndex();}},handleCheckedCheckboxRow,/**
|
|
11699
11713
|
* 行 hover 事件
|
|
11700
11714
|
*/triggerHoverEvent(evnt,{row}){tablePrivateMethods.setHoverRow(row);},setHoverRow(row){const rowid=getRowid($xeTable,row);const el=refElem.value;tablePrivateMethods.clearHoverRow();if(el){external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(el.querySelectorAll(`.vxe-body--row[rowid="${rowid}"]`),elem=>addClass(elem,'row--hover'));}internalData.hoverRow=row;},clearHoverRow(){const el=refElem.value;if(el){external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(el.querySelectorAll('.vxe-body--row.row--hover'),elem=>removeClass(elem,'row--hover'));}internalData.hoverRow=null;},/**
|
|
11701
11715
|
* 已废弃,被 getCellElement 替换
|
|
@@ -11757,7 +11771,7 @@ if(inited){handleKeyField();reactData.tableData=[];(0,external_commonjs_vue_comm
|
|
|
11757
11771
|
// warnLog('vxe.error.delProp', ['scroll-x', 'virtual-x-config'])
|
|
11758
11772
|
// }
|
|
11759
11773
|
// 检查导入导出类型,如果自定义导入导出方法,则不校验类型
|
|
11760
|
-
if(importConfig&&importOpts.types&&!importOpts.importMethod&&!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().includeArrays(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().keys(importOpts._typeMaps),importOpts.types)){warnLog('vxe.error.errProp',[`export-config.types=${importOpts.types.join(',')}`,importOpts.types.filter(type=>external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().includes(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().keys(importOpts._typeMaps),type)).join(',')||external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().keys(importOpts._typeMaps).join(',')]);}if(exportConfig&&exportOpts.types&&!exportOpts.exportMethod&&!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().includeArrays(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().keys(exportOpts._typeMaps),exportOpts.types)){warnLog('vxe.error.errProp',[`export-config.types=${exportOpts.types.join(',')}`,exportOpts.types.filter(type=>external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().includes(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().keys(exportOpts._typeMaps),type)).join(',')||external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().keys(exportOpts._typeMaps).join(',')]);}if(!props.id){if((props.customConfig?isEnableConf(customOpts):customOpts.enabled)&&customOpts.storage){errLog('vxe.error.reqProp',['id']);}}if(props.treeConfig&&checkboxOpts.range){errLog('vxe.error.noTree',['checkbox-config.range']);}if(rowOpts.height&&!props.showOverflow){warnLog('vxe.error.notProp',['table.show-overflow']);}if(!$xeTable.triggerCellAreaMousedownEvent){if(props.areaConfig){warnLog('vxe.error.notProp',['area-config']);}if(props.clipConfig){warnLog('vxe.error.notProp',['clip-config']);}if(props.fnrConfig){warnLog('vxe.error.notProp',['fnr-config']);}if(mouseOpts.area){errLog('vxe.error.notProp',['mouse-config.area']);return;}}if(treeConfig&&rowOpts.drag&&!treeOpts.transform){errLog('vxe.error.notSupportProp',['column-config.drag','tree-config.transform=false','tree-config.transform=true']);}if(props.dragConfig){warnLog('vxe.error.delProp',['drag-config','row-drag-config']);}if(props.rowGroupConfig){warnLog('vxe.error.delProp',['row-group-config','aggregate-config']);}if(aggregateOpts.countFields){warnLog('vxe.error.delProp',['row-group-config.countFields','column.agg-func']);}if(aggregateOpts.
|
|
11774
|
+
if(importConfig&&importOpts.types&&!importOpts.importMethod&&!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().includeArrays(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().keys(importOpts._typeMaps),importOpts.types)){warnLog('vxe.error.errProp',[`export-config.types=${importOpts.types.join(',')}`,importOpts.types.filter(type=>external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().includes(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().keys(importOpts._typeMaps),type)).join(',')||external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().keys(importOpts._typeMaps).join(',')]);}if(exportConfig&&exportOpts.types&&!exportOpts.exportMethod&&!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().includeArrays(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().keys(exportOpts._typeMaps),exportOpts.types)){warnLog('vxe.error.errProp',[`export-config.types=${exportOpts.types.join(',')}`,exportOpts.types.filter(type=>external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().includes(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().keys(exportOpts._typeMaps),type)).join(',')||external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().keys(exportOpts._typeMaps).join(',')]);}if(!props.id){if((props.customConfig?isEnableConf(customOpts):customOpts.enabled)&&customOpts.storage){errLog('vxe.error.reqProp',['id']);}}if(props.treeConfig&&checkboxOpts.range){errLog('vxe.error.noTree',['checkbox-config.range']);}if(rowOpts.height&&!props.showOverflow){warnLog('vxe.error.notProp',['table.show-overflow']);}if(!$xeTable.triggerCellAreaMousedownEvent){if(props.areaConfig){warnLog('vxe.error.notProp',['area-config']);}if(props.clipConfig){warnLog('vxe.error.notProp',['clip-config']);}if(props.fnrConfig){warnLog('vxe.error.notProp',['fnr-config']);}if(mouseOpts.area){errLog('vxe.error.notProp',['mouse-config.area']);return;}}if(!$xeTable.handlePivotTableAggregateData){if(customOpts.allowGroup){errLog('vxe.error.notProp',['custom-config.allowGroup']);return;}if(customOpts.allowValues){errLog('vxe.error.notProp',['custom-config.allowValues']);return;}}if(treeConfig&&rowOpts.drag&&!treeOpts.transform){errLog('vxe.error.notSupportProp',['column-config.drag','tree-config.transform=false','tree-config.transform=true']);}if(props.dragConfig){warnLog('vxe.error.delProp',['drag-config','row-drag-config']);}if(props.rowGroupConfig){warnLog('vxe.error.delProp',['row-group-config','aggregate-config']);}if(aggregateOpts.countFields){warnLog('vxe.error.delProp',['row-group-config.countFields','column.agg-func']);}if(aggregateOpts.aggregateMethod){warnLog('vxe.error.delProp',['row-group-config.aggregateMethod','aggregate-config.countMethod']);}if(props.treeConfig&&treeOpts.children){warnLog('vxe.error.delProp',['tree-config.children','tree-config.childrenField']);}if(props.treeConfig&&treeOpts.line){warnLog('vxe.error.delProp',['tree-config.line','tree-config.showLine']);}if(mouseOpts.area&&mouseOpts.selected){warnLog('vxe.error.errConflicts',['mouse-config.area','mouse-config.selected']);}if(mouseOpts.area&&props.treeConfig&&!treeOpts.transform){errLog('vxe.error.noTree',['mouse-config.area']);}if(props.editConfig&&editOpts.activeMethod){warnLog('vxe.error.delProp',['edit-config.activeMethod','edit-config.beforeEditMethod']);}if(props.treeConfig&&checkboxOpts.isShiftKey){errLog('vxe.error.errConflicts',['tree-config','checkbox-config.isShiftKey']);}if(checkboxOpts.halfField){warnLog('vxe.error.delProp',['checkbox-config.halfField','checkbox-config.indeterminateField']);}if(rowOpts.currentMethod){warnLog('vxe.error.delProp',['row-config.currentMethod','current-row-config.beforeSelectMethod']);}if(columnOpts.currentMethod){warnLog('vxe.error.delProp',['row-config.currentMethod','current-column-config.beforeSelectMethod']);}if((rowOpts.isCurrent||highlightCurrentRow)&&props.keyboardConfig&&keyboardOpts.isArrow&&!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(currentRowOpts.isFollowSelected)){warnLog('vxe.error.notConflictProp',['row-config.isCurrent','current-row-config.isFollowSelected']);}if((columnOpts.isCurrent||highlightCurrentColumn)&&props.keyboardConfig&&keyboardOpts.isArrow&&!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(currentColumnOpts.isFollowSelected)){warnLog('vxe.error.notConflictProp',['column-config.isCurrent','current-column-config.isFollowSelected']);}// 如果不支持虚拟滚动
|
|
11761
11775
|
// if (props.spanMethod) {
|
|
11762
11776
|
// if (virtualXOpts.enabled) {
|
|
11763
11777
|
// warnLog('vxe.error.notConflictProp', ['span-method', 'virtual-x-config.enabled=false'])
|
|
@@ -12562,7 +12576,7 @@ const {
|
|
|
12562
12576
|
renderEmptyElement: grid_renderEmptyElement
|
|
12563
12577
|
} = core_.VxeUI;
|
|
12564
12578
|
const tableComponentPropKeys = Object.keys(src_props);
|
|
12565
|
-
const tableComponentMethodKeys = ['clearAll', 'syncData', 'updateData', 'loadData', 'reloadData', 'reloadRow', 'loadColumn', 'reloadColumn', 'getRowNode', 'getColumnNode', 'getRowIndex', 'getVTRowIndex', 'getVMRowIndex', 'getColumnIndex', 'getVTColumnIndex', 'getVMColumnIndex', 'setRow', 'createData', 'createRow', 'revertData', 'clearData', 'isRemoveByRow', 'isInsertByRow', 'isUpdateByRow', 'getColumns', 'getColumnById', 'getColumnByField', 'getTableColumn', 'getFullColumns', 'getData', 'getCheckboxRecords', 'getParentRow', 'getTreeRowChildren', 'getTreeParentRow', 'getRowSeq', 'getRowById', 'getRowid', 'getTableData', 'getFullData', 'setColumnFixed', 'clearColumnFixed', 'setColumnWidth', 'getColumnWidth', 'setRowHeightConf', 'getRowHeightConf', 'setRowHeight', 'getRowHeight', 'hideColumn', 'showColumn', 'resetColumn', 'refreshColumn', 'refreshScroll', 'recalculate', 'closeTooltip', 'isAllCheckboxChecked', 'isAllCheckboxIndeterminate', 'getCheckboxIndeterminateRecords', 'setCheckboxRow', 'setCheckboxRowKey', 'isCheckedByCheckboxRow', 'isCheckedByCheckboxRowKey', 'isIndeterminateByCheckboxRow', 'isIndeterminateByCheckboxRowKey', 'toggleCheckboxRow', 'setAllCheckboxRow', 'getRadioReserveRecord', 'clearRadioReserve', 'getCheckboxReserveRecords', 'clearCheckboxReserve', 'toggleAllCheckboxRow', 'clearCheckboxRow', 'setCurrentRow', 'isCheckedByRadioRow', 'isCheckedByRadioRowKey', 'setRadioRow', 'setRadioRowKey', 'clearCurrentRow', 'clearRadioRow', 'getCurrentRecord', 'getRadioRecord', 'getCurrentColumn', 'setCurrentColumn', 'clearCurrentColumn', 'setPendingRow', 'togglePendingRow', 'hasPendingByRow', 'isPendingByRow', 'getPendingRecords', 'clearPendingRow', 'sort', 'setSort', 'clearSort', 'clearSortByEvent', 'isSort', 'getSortColumns', 'closeFilter', 'isFilter', 'clearFilterByEvent', 'isActiveFilterByColumn', 'isRowExpandLoaded', 'clearRowExpandLoaded', 'reloadRowExpand', 'reloadRowExpand', 'toggleRowExpand', 'setAllRowExpand', 'setRowExpand', 'isExpandByRow', 'isRowExpandByRow', 'clearRowExpand', 'clearRowExpandReserve', 'getRowExpandRecords', 'getTreeExpandRecords', 'isTreeExpandLoaded', 'clearTreeExpandLoaded', 'reloadTreeExpand', 'reloadTreeChilds', 'toggleTreeExpand', 'setAllTreeExpand', 'setTreeExpand', 'isTreeExpandByRow', 'clearTreeExpand', 'clearTreeExpandReserve', 'getScroll', 'scrollTo', 'scrollToRow', 'scrollToColumn', 'clearScroll', 'updateFooter', 'updateStatus', 'setMergeCells', 'removeInsertRow', 'removeMergeCells', 'getMergeCells', 'clearMergeCells', 'setMergeFooterItems', 'removeMergeFooterItems', 'getMergeFooterItems', 'clearMergeFooterItems', 'getCustomStoreData', 'setRowGroupExpand', 'setAllRowGroupExpand', 'clearRowGroupExpand', 'isRowGroupExpandByRow', 'isRowGroupRecord', 'isAggregateRecord', 'isAggregateExpandByRow', 'setRowGroups', 'clearRowGroups', 'openTooltip', 'moveColumnTo', 'moveRowTo', 'getCellLabel', 'getCellElement', 'focus', 'blur', 'connect'];
|
|
12579
|
+
const tableComponentMethodKeys = ['clearAll', 'syncData', 'updateData', 'loadData', 'reloadData', 'reloadRow', 'loadColumn', 'reloadColumn', 'getRowNode', 'getColumnNode', 'getRowIndex', 'getVTRowIndex', 'getVMRowIndex', 'getColumnIndex', 'getVTColumnIndex', 'getVMColumnIndex', 'setRow', 'createData', 'createRow', 'revertData', 'clearData', 'isRemoveByRow', 'isInsertByRow', 'isUpdateByRow', 'getColumns', 'getColumnById', 'getColumnByField', 'getTableColumn', 'getFullColumns', 'getData', 'getCheckboxRecords', 'getParentRow', 'getTreeRowChildren', 'getTreeParentRow', 'getRowSeq', 'getRowById', 'getRowid', 'getTableData', 'getFullData', 'setColumnFixed', 'clearColumnFixed', 'setColumnWidth', 'getColumnWidth', 'setRowHeightConf', 'getRowHeightConf', 'setRowHeight', 'getRowHeight', 'hideColumn', 'showColumn', 'resetColumn', 'refreshColumn', 'refreshScroll', 'recalculate', 'closeTooltip', 'isAllCheckboxChecked', 'isAllCheckboxIndeterminate', 'getCheckboxIndeterminateRecords', 'setCheckboxRow', 'setCheckboxRowKey', 'isCheckedByCheckboxRow', 'isCheckedByCheckboxRowKey', 'isIndeterminateByCheckboxRow', 'isIndeterminateByCheckboxRowKey', 'toggleCheckboxRow', 'setAllCheckboxRow', 'getRadioReserveRecord', 'clearRadioReserve', 'getCheckboxReserveRecords', 'clearCheckboxReserve', 'toggleAllCheckboxRow', 'clearCheckboxRow', 'setCurrentRow', 'isCheckedByRadioRow', 'isCheckedByRadioRowKey', 'setRadioRow', 'setRadioRowKey', 'clearCurrentRow', 'clearRadioRow', 'getCurrentRecord', 'getRadioRecord', 'getCurrentColumn', 'setCurrentColumn', 'clearCurrentColumn', 'setPendingRow', 'togglePendingRow', 'hasPendingByRow', 'isPendingByRow', 'getPendingRecords', 'clearPendingRow', 'sort', 'setSort', 'clearSort', 'clearSortByEvent', 'isSort', 'getSortColumns', 'closeFilter', 'isFilter', 'clearFilterByEvent', 'isActiveFilterByColumn', 'isRowExpandLoaded', 'clearRowExpandLoaded', 'reloadRowExpand', 'reloadRowExpand', 'toggleRowExpand', 'setAllRowExpand', 'setRowExpand', 'isExpandByRow', 'isRowExpandByRow', 'clearRowExpand', 'clearRowExpandReserve', 'getRowExpandRecords', 'getTreeExpandRecords', 'isTreeExpandLoaded', 'clearTreeExpandLoaded', 'reloadTreeExpand', 'reloadTreeChilds', 'toggleTreeExpand', 'setAllTreeExpand', 'setTreeExpand', 'isTreeExpandByRow', 'clearTreeExpand', 'clearTreeExpandReserve', 'getScroll', 'scrollTo', 'scrollToRow', 'scrollToColumn', 'clearScroll', 'updateFooter', 'updateStatus', 'setMergeCells', 'removeInsertRow', 'removeMergeCells', 'getMergeCells', 'clearMergeCells', 'setMergeFooterItems', 'removeMergeFooterItems', 'getMergeFooterItems', 'clearMergeFooterItems', 'getCustomStoreData', 'setRowGroupExpand', 'setAllRowGroupExpand', 'clearRowGroupExpand', 'isRowGroupExpandByRow', 'isRowGroupRecord', 'isAggregateRecord', 'isAggregateExpandByRow', 'getAggregateContentByRow', 'getAggregateRowChildren', 'setRowGroups', 'clearRowGroups', 'openTooltip', 'moveColumnTo', 'moveRowTo', 'getCellLabel', 'getCellElement', 'focus', 'blur', 'connect'];
|
|
12566
12580
|
const gridComponentEmits = [...emits, 'page-change', 'form-submit', 'form-submit-invalid', 'form-reset', 'form-collapse', 'form-toggle-collapse', 'proxy-query', 'proxy-delete', 'proxy-save', 'toolbar-button-click', 'toolbar-tool-click', 'zoom'];
|
|
12567
12581
|
/* harmony default export */ var grid = (defineVxeComponent({
|
|
12568
12582
|
name: 'VxeGrid',
|
|
@@ -19536,7 +19550,9 @@ core_.VxeUI.hooks.add('tableCustomModule', {
|
|
|
19536
19550
|
allowVisible,
|
|
19537
19551
|
allowSort,
|
|
19538
19552
|
allowFixed,
|
|
19539
|
-
allowResizable
|
|
19553
|
+
allowResizable,
|
|
19554
|
+
allowGroup,
|
|
19555
|
+
allowValues
|
|
19540
19556
|
} = customOpts;
|
|
19541
19557
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(customColumnList, (column, index, items, path, parentColumn) => {
|
|
19542
19558
|
if (parentColumn) {
|
|
@@ -19562,6 +19578,9 @@ core_.VxeUI.hooks.add('tableCustomModule', {
|
|
|
19562
19578
|
if (allowVisible) {
|
|
19563
19579
|
column.visible = column.renderVisible;
|
|
19564
19580
|
}
|
|
19581
|
+
if (allowGroup && allowValues) {
|
|
19582
|
+
column.aggFunc = column.renderAggFn;
|
|
19583
|
+
}
|
|
19565
19584
|
});
|
|
19566
19585
|
reactData.isCustomStatus = true;
|
|
19567
19586
|
reactData.isDragColMove = true;
|
|
@@ -19569,14 +19588,17 @@ core_.VxeUI.hooks.add('tableCustomModule', {
|
|
|
19569
19588
|
reactData.isDragColMove = false;
|
|
19570
19589
|
}, 1000);
|
|
19571
19590
|
return $xeTable.saveCustomStore('confirm').then(() => {
|
|
19572
|
-
if ($xeTable.handlePivotTableAggregateData) {
|
|
19591
|
+
if (allowGroup && allowValues && $xeTable.handlePivotTableAggregateData) {
|
|
19573
19592
|
if (rowGroupList.length !== aggHandleFields.length || rowGroupList.some((conf, i) => conf.field !== aggHandleFields[i])) {
|
|
19574
|
-
//
|
|
19593
|
+
// 更新数据分组
|
|
19575
19594
|
if (aggHandleFields.length) {
|
|
19576
19595
|
$xeTable.setRowGroups(aggHandleFields);
|
|
19577
19596
|
} else {
|
|
19578
19597
|
$xeTable.clearRowGroups();
|
|
19579
19598
|
}
|
|
19599
|
+
} else {
|
|
19600
|
+
// 更新聚合函数
|
|
19601
|
+
$xeTable.handleUpdateAggData();
|
|
19580
19602
|
}
|
|
19581
19603
|
}
|
|
19582
19604
|
});
|
|
@@ -19699,7 +19721,8 @@ core_.VxeUI.hooks.add('tableCustomModule', {
|
|
|
19699
19721
|
visible: true,
|
|
19700
19722
|
resizable: options === true,
|
|
19701
19723
|
fixed: options === true,
|
|
19702
|
-
sort: options === true
|
|
19724
|
+
sort: options === true,
|
|
19725
|
+
aggFunc: options === true
|
|
19703
19726
|
}, options);
|
|
19704
19727
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(collectColumn, column => {
|
|
19705
19728
|
if (opts.resizable) {
|
|
@@ -19717,12 +19740,16 @@ core_.VxeUI.hooks.add('tableCustomModule', {
|
|
|
19717
19740
|
})) {
|
|
19718
19741
|
column.visible = column.defaultVisible;
|
|
19719
19742
|
}
|
|
19743
|
+
if (opts.aggFunc) {
|
|
19744
|
+
column.aggFunc = column.defaultAggFunc;
|
|
19745
|
+
column.renderAggFn = column.defaultAggFunc;
|
|
19746
|
+
}
|
|
19720
19747
|
column.renderResizeWidth = column.renderWidth;
|
|
19721
19748
|
});
|
|
19722
19749
|
reactData.isCustomStatus = false;
|
|
19723
19750
|
$xeTable.saveCustomStore('reset');
|
|
19724
19751
|
return $xeTable.handleCustom().then(() => {
|
|
19725
|
-
if ($xeTable.handlePivotTableAggregateData) {
|
|
19752
|
+
if (opts.aggFunc && $xeTable.handlePivotTableAggregateData) {
|
|
19726
19753
|
const rowGroupFields = computeRowGroupFields.value;
|
|
19727
19754
|
if (rowGroupFields ? rowGroupFields.length : rowGroupList.length) {
|
|
19728
19755
|
if (rowGroupFields && rowGroupFields.length) {
|
|
@@ -19730,6 +19757,8 @@ core_.VxeUI.hooks.add('tableCustomModule', {
|
|
|
19730
19757
|
} else {
|
|
19731
19758
|
$xeTable.clearRowGroups();
|
|
19732
19759
|
}
|
|
19760
|
+
} else {
|
|
19761
|
+
$xeTable.handleUpdateAggData();
|
|
19733
19762
|
}
|
|
19734
19763
|
}
|
|
19735
19764
|
});
|
|
@@ -21781,6 +21810,15 @@ const Toolbar = VxeToolbar;
|
|
|
21781
21810
|
groupPlaceholder: '拖至此处进行分组',
|
|
21782
21811
|
valuesPlaceholder: '拖至此处进行聚合',
|
|
21783
21812
|
dragExistCol: '该列已存在'
|
|
21813
|
+
},
|
|
21814
|
+
aggFuncs: {
|
|
21815
|
+
sum: '求和',
|
|
21816
|
+
count: '计数',
|
|
21817
|
+
avg: '平均值',
|
|
21818
|
+
min: '最小值',
|
|
21819
|
+
max: '最大值',
|
|
21820
|
+
first: '首个值',
|
|
21821
|
+
last: '末尾值'
|
|
21784
21822
|
}
|
|
21785
21823
|
},
|
|
21786
21824
|
filterComplexInput: {
|