vxe-table 3.17.0-beta.9 → 3.17.0
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 +88 -23
- package/es/style.css +1 -1
- package/es/table/module/custom/mixin.js +22 -14
- package/es/table/module/edit/mixin.js +5 -5
- package/es/table/src/body.js +7 -6
- package/es/table/src/columnInfo.js +5 -0
- package/es/table/src/methods.js +201 -76
- package/es/table/src/table.js +7 -6
- package/es/table/src/util.js +9 -0
- package/es/ui/index.js +2 -1
- package/es/ui/src/log.js +1 -1
- package/lib/grid/src/grid.js +104 -29
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.umd.js +402 -127
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/module/custom/mixin.js +25 -13
- package/lib/table/module/custom/mixin.min.js +1 -1
- package/lib/table/module/edit/mixin.js +5 -0
- package/lib/table/module/edit/mixin.min.js +1 -1
- package/lib/table/src/body.js +7 -6
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/columnInfo.js +5 -0
- package/lib/table/src/columnInfo.min.js +1 -1
- package/lib/table/src/methods.js +238 -73
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +7 -6
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +10 -0
- package/lib/table/src/util.min.js +1 -1
- package/lib/ui/index.js +2 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/package.json +2 -2
- package/packages/grid/src/grid.ts +101 -25
- package/packages/table/module/custom/mixin.ts +21 -13
- package/packages/table/module/edit/mixin.ts +5 -5
- package/packages/table/src/body.ts +7 -6
- package/packages/table/src/columnInfo.ts +7 -0
- package/packages/table/src/methods.ts +215 -76
- package/packages/table/src/props.ts +1 -1
- package/packages/table/src/table.ts +7 -6
- package/packages/table/src/util.ts +10 -0
- package/packages/ui/index.ts +1 -0
- /package/es/{iconfont.1753497303145.ttf → iconfont.1753928711953.ttf} +0 -0
- /package/es/{iconfont.1753497303145.woff → iconfont.1753928711953.woff} +0 -0
- /package/es/{iconfont.1753497303145.woff2 → iconfont.1753928711953.woff2} +0 -0
- /package/lib/{iconfont.1753497303145.ttf → iconfont.1753928711953.ttf} +0 -0
- /package/lib/{iconfont.1753497303145.woff → iconfont.1753928711953.woff} +0 -0
- /package/lib/{iconfont.1753497303145.woff2 → iconfont.1753928711953.woff2} +0 -0
package/lib/index.umd.js
CHANGED
|
@@ -2002,7 +2002,7 @@ function getClass(property, params) {
|
|
|
2002
2002
|
;// CONCATENATED MODULE: ./packages/ui/index.ts
|
|
2003
2003
|
|
|
2004
2004
|
|
|
2005
|
-
const version = "3.17.0
|
|
2005
|
+
const version = "3.17.0";
|
|
2006
2006
|
core_.VxeUI.version = version;
|
|
2007
2007
|
core_.VxeUI.tableVersion = version;
|
|
2008
2008
|
core_.VxeUI.setConfig({
|
|
@@ -2136,6 +2136,7 @@ core_.VxeUI.setConfig({
|
|
|
2136
2136
|
// filterMethod: null,
|
|
2137
2137
|
// destroyOnClose: false,
|
|
2138
2138
|
// isEvery: false,
|
|
2139
|
+
multiple: true,
|
|
2139
2140
|
showIcon: true
|
|
2140
2141
|
},
|
|
2141
2142
|
aggregateConfig: {
|
|
@@ -2667,7 +2668,7 @@ function isNodeElement(elem) {
|
|
|
2667
2668
|
const {
|
|
2668
2669
|
log: log_log
|
|
2669
2670
|
} = core_.VxeUI;
|
|
2670
|
-
const log_version = `table v${"3.17.0
|
|
2671
|
+
const log_version = `table v${"3.17.0"}`;
|
|
2671
2672
|
const warnLog = log_log.create('warn', log_version);
|
|
2672
2673
|
const errLog = log_log.create('error', log_version);
|
|
2673
2674
|
;// CONCATENATED MODULE: ./packages/table/src/columnInfo.ts
|
|
@@ -2804,15 +2805,20 @@ class ColumnInfo {
|
|
|
2804
2805
|
parentId: null,
|
|
2805
2806
|
visible,
|
|
2806
2807
|
// 内部属性(一旦被使用,将导致不可升级版本)
|
|
2808
|
+
defaultParentId: null,
|
|
2807
2809
|
halfVisible: false,
|
|
2808
2810
|
defaultVisible: visible,
|
|
2809
2811
|
defaultFixed: _vm.fixed,
|
|
2812
|
+
defaultAggGroup: _vm.aggGroup,
|
|
2810
2813
|
defaultAggFunc: _vm.aggFunc,
|
|
2811
2814
|
checked: false,
|
|
2812
2815
|
halfChecked: false,
|
|
2813
2816
|
disabled: false,
|
|
2817
|
+
// 分组层级
|
|
2814
2818
|
level: 1,
|
|
2819
|
+
// 跨行
|
|
2815
2820
|
rowSpan: 1,
|
|
2821
|
+
// 跨列
|
|
2816
2822
|
colSpan: 1,
|
|
2817
2823
|
// 数据排序
|
|
2818
2824
|
order: null,
|
|
@@ -3088,6 +3094,7 @@ function assembleColumn(_vm) {
|
|
|
3088
3094
|
if (!groupConfig.children) {
|
|
3089
3095
|
groupConfig.children = [];
|
|
3090
3096
|
}
|
|
3097
|
+
columnConfig.defaultParentId = groupConfig.id;
|
|
3091
3098
|
groupConfig.children.splice(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayIndexOf($xeColumn.$el.children, $el), 0, columnConfig);
|
|
3092
3099
|
} else {
|
|
3093
3100
|
staticColumns.splice(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayIndexOf($xeTable.$refs.hideColumn.children, $el), 0, columnConfig);
|
|
@@ -3334,6 +3341,14 @@ function clearTableAllStatus(_vm) {
|
|
|
3334
3341
|
function isColumnInfo(column) {
|
|
3335
3342
|
return column instanceof ColumnInfo;
|
|
3336
3343
|
}
|
|
3344
|
+
// 获取所有的列,排除分组
|
|
3345
|
+
function getColumnList(columns) {
|
|
3346
|
+
const result = [];
|
|
3347
|
+
columns.forEach(column => {
|
|
3348
|
+
result.push(...(column.children && column.children.length ? getColumnList(column.children) : [column]));
|
|
3349
|
+
});
|
|
3350
|
+
return result;
|
|
3351
|
+
}
|
|
3337
3352
|
function createColumn($xeTable, options, renderOptions) {
|
|
3338
3353
|
return isColumnInfo(options) ? options : new ColumnInfo($xeTable, options, renderOptions);
|
|
3339
3354
|
}
|
|
@@ -5375,44 +5390,122 @@ function handleVirtualXVisible($xeTable) {
|
|
|
5375
5390
|
};
|
|
5376
5391
|
}
|
|
5377
5392
|
function handleCustomRestore($xeTable, storeData) {
|
|
5393
|
+
const props = $xeTable;
|
|
5378
5394
|
const reactData = $xeTable;
|
|
5379
5395
|
const internalData = $xeTable;
|
|
5380
|
-
|
|
5396
|
+
const {
|
|
5397
|
+
aggregateConfig,
|
|
5398
|
+
rowGroupConfig
|
|
5399
|
+
} = props;
|
|
5400
|
+
const {
|
|
5381
5401
|
collectColumn
|
|
5382
5402
|
} = internalData;
|
|
5403
|
+
const customOpts = $xeTable.computeCustomOpts;
|
|
5383
5404
|
const {
|
|
5405
|
+
storage,
|
|
5406
|
+
storeOptions
|
|
5407
|
+
} = customOpts;
|
|
5408
|
+
const isAllCustom = storage === true;
|
|
5409
|
+
const storageOpts = isAllCustom ? {} : Object.assign({}, storage || {}, storeOptions);
|
|
5410
|
+
const isCustomResizable = hangleStorageDefaultValue(storageOpts.resizable, isAllCustom);
|
|
5411
|
+
const isCustomVisible = hangleStorageDefaultValue(storageOpts.visible, isAllCustom);
|
|
5412
|
+
const isCustomFixed = hangleStorageDefaultValue(storageOpts.fixed, isAllCustom);
|
|
5413
|
+
const isCustomSort = hangleStorageDefaultValue(storageOpts.sort, isAllCustom);
|
|
5414
|
+
const isCustomAggGroup = hangleStorageDefaultValue(storageOpts.aggGroup, isAllCustom);
|
|
5415
|
+
const isCustomAggFunc = hangleStorageDefaultValue(storageOpts.aggFunc, isAllCustom);
|
|
5416
|
+
let {
|
|
5384
5417
|
resizableData,
|
|
5385
5418
|
sortData,
|
|
5386
5419
|
visibleData,
|
|
5387
|
-
fixedData
|
|
5420
|
+
fixedData,
|
|
5421
|
+
aggGroupData,
|
|
5422
|
+
aggFuncData
|
|
5388
5423
|
} = storeData;
|
|
5389
|
-
let hasCustomSort = false;
|
|
5390
5424
|
// 处理还原
|
|
5391
|
-
if (resizableData || sortData || visibleData || fixedData) {
|
|
5425
|
+
if (isCustomResizable && resizableData || isCustomSort && sortData || isCustomVisible && visibleData || isCustomFixed && fixedData || isCustomAggGroup && aggGroupData || isCustomAggFunc && aggFuncData) {
|
|
5426
|
+
const sortColMaps = {};
|
|
5427
|
+
if (isCustomSort && sortData) {
|
|
5428
|
+
// 转换兼容老版本数据,即将废弃兼容
|
|
5429
|
+
if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(sortData)) {
|
|
5430
|
+
const sortRests = [];
|
|
5431
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(sortData, (index, colKey) => {
|
|
5432
|
+
sortRests.push({
|
|
5433
|
+
key: colKey,
|
|
5434
|
+
index
|
|
5435
|
+
});
|
|
5436
|
+
});
|
|
5437
|
+
sortData = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().orderBy(sortRests, {
|
|
5438
|
+
field: 'index',
|
|
5439
|
+
order: 'asc'
|
|
5440
|
+
}).map(item => ({
|
|
5441
|
+
k: item.key
|
|
5442
|
+
}));
|
|
5443
|
+
}
|
|
5444
|
+
let colNum = 1;
|
|
5445
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(sortData, (sObj, index, sOjs, path, pSObj) => {
|
|
5446
|
+
sortColMaps[sObj.k] = {
|
|
5447
|
+
key: sObj.k,
|
|
5448
|
+
sNum: colNum++,
|
|
5449
|
+
pKey: pSObj ? pSObj.k : null
|
|
5450
|
+
};
|
|
5451
|
+
}, {
|
|
5452
|
+
children: 'c'
|
|
5453
|
+
});
|
|
5454
|
+
}
|
|
5455
|
+
const colKeyMaps = {};
|
|
5456
|
+
const allCols = [];
|
|
5457
|
+
const aggGroupConfs = [];
|
|
5392
5458
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(collectColumn, (column, index, items, path, parentColumn) => {
|
|
5393
5459
|
const colKey = column.getKey();
|
|
5394
5460
|
// 支持一级
|
|
5395
5461
|
if (!parentColumn) {
|
|
5396
|
-
if (fixedData && fixedData[colKey] !== undefined) {
|
|
5462
|
+
if (isCustomFixed && fixedData && fixedData[colKey] !== undefined) {
|
|
5397
5463
|
column.fixed = fixedData[colKey];
|
|
5398
5464
|
}
|
|
5399
|
-
if (sortData && external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(sortData[colKey])) {
|
|
5400
|
-
hasCustomSort = true;
|
|
5401
|
-
column.renderSortNumber = sortData[colKey];
|
|
5402
|
-
}
|
|
5403
5465
|
}
|
|
5404
|
-
if (resizableData && external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(resizableData[colKey])) {
|
|
5466
|
+
if (isCustomResizable && resizableData && external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(resizableData[colKey])) {
|
|
5405
5467
|
column.resizeWidth = resizableData[colKey];
|
|
5406
5468
|
}
|
|
5407
|
-
if (visibleData && external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(visibleData[colKey])) {
|
|
5469
|
+
if (isCustomVisible && visibleData && external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(visibleData[colKey])) {
|
|
5408
5470
|
column.visible = visibleData[colKey];
|
|
5409
5471
|
}
|
|
5472
|
+
if (isCustomAggFunc && aggFuncData && (aggregateConfig || rowGroupConfig) && aggFuncData[colKey]) {
|
|
5473
|
+
column.aggFunc = aggFuncData[colKey];
|
|
5474
|
+
}
|
|
5475
|
+
if (isCustomAggGroup && aggGroupData && aggGroupData[colKey]) {
|
|
5476
|
+
aggGroupConfs.push({
|
|
5477
|
+
field: column.field
|
|
5478
|
+
});
|
|
5479
|
+
}
|
|
5480
|
+
colKeyMaps[colKey] = column;
|
|
5481
|
+
allCols.push(column);
|
|
5410
5482
|
});
|
|
5483
|
+
if ((aggregateConfig || rowGroupConfig) && aggGroupConfs.length) {
|
|
5484
|
+
const groupRest = handleGroupData($xeTable, internalData.tableFullData, aggGroupConfs);
|
|
5485
|
+
internalData.tableFullTreeData = [];
|
|
5486
|
+
internalData.tableFullGroupData = groupRest.treeData;
|
|
5487
|
+
reactData.isRowGroupStatus = true;
|
|
5488
|
+
reactData.rowGroupList = aggGroupConfs;
|
|
5489
|
+
$xeTable.cacheRowMap(false);
|
|
5490
|
+
}
|
|
5411
5491
|
// 如果自定义了顺序
|
|
5412
|
-
if (
|
|
5413
|
-
|
|
5414
|
-
|
|
5415
|
-
|
|
5492
|
+
if (isCustomSort && sortData) {
|
|
5493
|
+
allCols.forEach(column => {
|
|
5494
|
+
const colKey = column.getKey();
|
|
5495
|
+
const scItem = sortColMaps[colKey];
|
|
5496
|
+
if (scItem) {
|
|
5497
|
+
const parentColumn = scItem.pKey ? colKeyMaps[scItem.pKey] : null;
|
|
5498
|
+
column.parentId = parentColumn ? parentColumn.id : null;
|
|
5499
|
+
column.renderSortNumber = scItem.sNum;
|
|
5500
|
+
}
|
|
5501
|
+
});
|
|
5502
|
+
const newCollectCols = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toArrayTree(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().orderBy(allCols, 'renderSortNumber'), {
|
|
5503
|
+
key: 'id',
|
|
5504
|
+
parentKey: 'parentId',
|
|
5505
|
+
children: 'children'
|
|
5506
|
+
});
|
|
5507
|
+
internalData.collectColumn = newCollectCols;
|
|
5508
|
+
internalData.tableFullColumn = getColumnList(newCollectCols);
|
|
5416
5509
|
}
|
|
5417
5510
|
reactData.isCustomStatus = true;
|
|
5418
5511
|
} else {
|
|
@@ -5887,6 +5980,7 @@ function updateAfterListIndex($xeTable) {
|
|
|
5887
5980
|
$index: -1,
|
|
5888
5981
|
_index: index,
|
|
5889
5982
|
treeIndex: -1,
|
|
5983
|
+
_tIndex: -1,
|
|
5890
5984
|
items: [],
|
|
5891
5985
|
parent: null,
|
|
5892
5986
|
level: 0,
|
|
@@ -5925,6 +6019,7 @@ function updateAfterDataIndex($xeTable) {
|
|
|
5925
6019
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
5926
6020
|
const fullMaps = {};
|
|
5927
6021
|
if (treeConfig) {
|
|
6022
|
+
let _treeIndex = 0;
|
|
5928
6023
|
const {
|
|
5929
6024
|
handleGetRowId
|
|
5930
6025
|
} = createHandleGetRowId($xeTable);
|
|
@@ -5935,6 +6030,7 @@ function updateAfterDataIndex($xeTable) {
|
|
|
5935
6030
|
if (rowRest) {
|
|
5936
6031
|
rowRest.seq = seq;
|
|
5937
6032
|
rowRest.treeIndex = index;
|
|
6033
|
+
rowRest._tIndex = _treeIndex;
|
|
5938
6034
|
} else {
|
|
5939
6035
|
const rest = {
|
|
5940
6036
|
row,
|
|
@@ -5944,6 +6040,7 @@ function updateAfterDataIndex($xeTable) {
|
|
|
5944
6040
|
$index: -1,
|
|
5945
6041
|
_index: -1,
|
|
5946
6042
|
treeIndex: -1,
|
|
6043
|
+
_tIndex: _treeIndex,
|
|
5947
6044
|
items: [],
|
|
5948
6045
|
parent: null,
|
|
5949
6046
|
level: 0,
|
|
@@ -5955,6 +6052,7 @@ function updateAfterDataIndex($xeTable) {
|
|
|
5955
6052
|
fullAllDataRowIdData[rowid] = rest;
|
|
5956
6053
|
fullDataRowIdData[rowid] = rest;
|
|
5957
6054
|
}
|
|
6055
|
+
_treeIndex++;
|
|
5958
6056
|
fullMaps[rowid] = row;
|
|
5959
6057
|
}, {
|
|
5960
6058
|
children: transform ? treeOpts.mapChildrenField : childrenField
|
|
@@ -7658,6 +7756,10 @@ function removeFooterMerges($xeTable, merges) {
|
|
|
7658
7756
|
return rest;
|
|
7659
7757
|
}
|
|
7660
7758
|
function handleSortEvent($xeTable, evnt, sortConfs, isUpdate) {
|
|
7759
|
+
const internalData = $xeTable;
|
|
7760
|
+
const {
|
|
7761
|
+
tableFullColumn
|
|
7762
|
+
} = internalData;
|
|
7661
7763
|
const sortOpts = $xeTable.computeSortOpts;
|
|
7662
7764
|
const {
|
|
7663
7765
|
multiple,
|
|
@@ -7668,10 +7770,16 @@ function handleSortEvent($xeTable, evnt, sortConfs, isUpdate) {
|
|
|
7668
7770
|
sortConfs = [sortConfs];
|
|
7669
7771
|
}
|
|
7670
7772
|
if (sortConfs && sortConfs.length) {
|
|
7773
|
+
const orderActiveMaps = {};
|
|
7671
7774
|
if (!multiple) {
|
|
7672
7775
|
sortConfs = [sortConfs[0]];
|
|
7673
|
-
|
|
7776
|
+
tableFullColumn.forEach(column => {
|
|
7777
|
+
if (column.order) {
|
|
7778
|
+
orderActiveMaps[column.id] = column;
|
|
7779
|
+
}
|
|
7780
|
+
});
|
|
7674
7781
|
}
|
|
7782
|
+
const sortColMpps = {};
|
|
7675
7783
|
let firstColumn = null;
|
|
7676
7784
|
sortConfs.forEach((confs, index) => {
|
|
7677
7785
|
let {
|
|
@@ -7693,8 +7801,16 @@ function handleSortEvent($xeTable, evnt, sortConfs, isUpdate) {
|
|
|
7693
7801
|
column.order = order;
|
|
7694
7802
|
}
|
|
7695
7803
|
column.sortTime = Date.now() + index;
|
|
7804
|
+
sortColMpps[column.id] = column;
|
|
7696
7805
|
}
|
|
7697
7806
|
});
|
|
7807
|
+
if (!multiple) {
|
|
7808
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(orderActiveMaps, (oaCol, oaId) => {
|
|
7809
|
+
if (!sortColMpps[oaId]) {
|
|
7810
|
+
oaCol.order = null;
|
|
7811
|
+
}
|
|
7812
|
+
});
|
|
7813
|
+
}
|
|
7698
7814
|
if (isUpdate) {
|
|
7699
7815
|
if (!remote) {
|
|
7700
7816
|
$xeTable.handleTableData(true);
|
|
@@ -7899,7 +8015,7 @@ const calcCellHeight = $xeTable => {
|
|
|
7899
8015
|
} = internalData;
|
|
7900
8016
|
const defaultRowHeight = $xeTable.computeDefaultRowHeight;
|
|
7901
8017
|
const el = $xeTable.$refs.refElem;
|
|
7902
|
-
if (!isAllOverflow && scrollYLoad && el) {
|
|
8018
|
+
if (!isAllOverflow && (scrollYLoad || scrollXLoad) && el) {
|
|
7903
8019
|
const {
|
|
7904
8020
|
handleGetRowId
|
|
7905
8021
|
} = createHandleGetRowId($xeTable);
|
|
@@ -8438,18 +8554,18 @@ function handleUpdateAggValues($xeTable) {
|
|
|
8438
8554
|
}
|
|
8439
8555
|
function handleUpdateRowGroup($xeTable, groupFields) {
|
|
8440
8556
|
const reactData = $xeTable;
|
|
8441
|
-
const
|
|
8442
|
-
const
|
|
8557
|
+
const aggGroupFields = [];
|
|
8558
|
+
const aggGroupConfs = [];
|
|
8443
8559
|
if (groupFields) {
|
|
8444
8560
|
(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(groupFields) ? groupFields : [groupFields]).forEach(field => {
|
|
8445
|
-
|
|
8446
|
-
|
|
8561
|
+
aggGroupFields.push(field);
|
|
8562
|
+
aggGroupConfs.push({
|
|
8447
8563
|
field
|
|
8448
8564
|
});
|
|
8449
8565
|
});
|
|
8450
8566
|
}
|
|
8451
|
-
reactData.rowGroupList =
|
|
8452
|
-
reactData.aggHandleFields =
|
|
8567
|
+
reactData.rowGroupList = aggGroupConfs;
|
|
8568
|
+
reactData.aggHandleFields = aggGroupFields;
|
|
8453
8569
|
handleUpdateAggValues($xeTable);
|
|
8454
8570
|
}
|
|
8455
8571
|
function handleeGroupSummary($xeTable, aggList) {
|
|
@@ -8875,14 +8991,6 @@ function loadScrollXData($xeTable) {
|
|
|
8875
8991
|
}
|
|
8876
8992
|
$xeTable.closeTooltip();
|
|
8877
8993
|
}
|
|
8878
|
-
// 获取所有的列,排除分组
|
|
8879
|
-
function getColumnList(columns) {
|
|
8880
|
-
const result = [];
|
|
8881
|
-
columns.forEach(column => {
|
|
8882
|
-
result.push(...(column.children && column.children.length ? getColumnList(column.children) : [column]));
|
|
8883
|
-
});
|
|
8884
|
-
return result;
|
|
8885
|
-
}
|
|
8886
8994
|
function parseColumns($xeTable, isReset) {
|
|
8887
8995
|
const props = $xeTable;
|
|
8888
8996
|
const reactData = $xeTable;
|
|
@@ -8913,7 +9021,7 @@ function parseColumns($xeTable, isReset) {
|
|
|
8913
9021
|
if (parentColumn && parentColumn.fixed) {
|
|
8914
9022
|
column.fixed = parentColumn.fixed;
|
|
8915
9023
|
}
|
|
8916
|
-
if (parentColumn && column.fixed !== parentColumn.fixed) {
|
|
9024
|
+
if (parentColumn && (column.fixed || '') !== (parentColumn.fixed || '')) {
|
|
8917
9025
|
errLog('vxe.error.groupFixed');
|
|
8918
9026
|
}
|
|
8919
9027
|
if (isColGroup) {
|
|
@@ -9021,18 +9129,22 @@ function parseColumns($xeTable, isReset) {
|
|
|
9021
9129
|
}
|
|
9022
9130
|
return $xeTable.updateFooter();
|
|
9023
9131
|
}
|
|
9024
|
-
function
|
|
9132
|
+
function initColumnHierarchy($xeTable) {
|
|
9025
9133
|
const internalData = $xeTable;
|
|
9026
9134
|
const {
|
|
9027
9135
|
collectColumn
|
|
9028
9136
|
} = internalData;
|
|
9029
|
-
|
|
9030
|
-
|
|
9137
|
+
let sortIndex = 1;
|
|
9138
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(collectColumn, (column, index, items, path, parentColumn) => {
|
|
9139
|
+
const parentId = parentColumn ? parentColumn.id : null;
|
|
9140
|
+
column.parentId = parentId;
|
|
9141
|
+
column.defaultParentId = parentId;
|
|
9031
9142
|
column.sortNumber = sortIndex;
|
|
9032
9143
|
column.renderSortNumber = sortIndex;
|
|
9144
|
+
sortIndex++;
|
|
9033
9145
|
});
|
|
9034
9146
|
}
|
|
9035
|
-
function
|
|
9147
|
+
function handleInitColumn($xeTable, collectColumn) {
|
|
9036
9148
|
const $xeToolbar = $xeTable.$refs.$xeToolbar;
|
|
9037
9149
|
const reactData = $xeTable;
|
|
9038
9150
|
const internalData = $xeTable;
|
|
@@ -9041,7 +9153,7 @@ function handleColumn($xeTable, collectColumn) {
|
|
|
9041
9153
|
const tableFullColumn = getColumnList(collectColumn);
|
|
9042
9154
|
internalData.tableFullColumn = tableFullColumn;
|
|
9043
9155
|
reactData.isColLoading = true;
|
|
9044
|
-
|
|
9156
|
+
initColumnHierarchy($xeTable);
|
|
9045
9157
|
return Promise.resolve(restoreCustomStorage($xeTable)).then(() => {
|
|
9046
9158
|
const {
|
|
9047
9159
|
scrollXLoad,
|
|
@@ -9768,7 +9880,7 @@ const Methods = {
|
|
|
9768
9880
|
const collectColumn = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().mapTree(columns, column => cell.createColumn($xeTable, column), {
|
|
9769
9881
|
children: 'children'
|
|
9770
9882
|
});
|
|
9771
|
-
return
|
|
9883
|
+
return handleInitColumn($xeTable, collectColumn).then(() => {
|
|
9772
9884
|
let targetScrollLeft = lastScrollLeft;
|
|
9773
9885
|
let targetScrollTop = lastScrollTop;
|
|
9774
9886
|
const virtualXOpts = $xeTable.computeVirtualXOpts;
|
|
@@ -9793,9 +9905,9 @@ const Methods = {
|
|
|
9793
9905
|
return this.loadColumn(columns);
|
|
9794
9906
|
});
|
|
9795
9907
|
},
|
|
9796
|
-
|
|
9908
|
+
handleInitColumn(collectColumn) {
|
|
9797
9909
|
const $xeTable = this;
|
|
9798
|
-
return
|
|
9910
|
+
return handleInitColumn($xeTable, collectColumn);
|
|
9799
9911
|
},
|
|
9800
9912
|
/**
|
|
9801
9913
|
* 更新数据行的 Map
|
|
@@ -9836,6 +9948,7 @@ const Methods = {
|
|
|
9836
9948
|
_index: -1,
|
|
9837
9949
|
$index: -1,
|
|
9838
9950
|
treeIndex: index,
|
|
9951
|
+
_tIndex: -1,
|
|
9839
9952
|
items,
|
|
9840
9953
|
parent: parentRow,
|
|
9841
9954
|
level,
|
|
@@ -9979,6 +10092,7 @@ const Methods = {
|
|
|
9979
10092
|
_index: -1,
|
|
9980
10093
|
$index: -1,
|
|
9981
10094
|
treeIndex: -1,
|
|
10095
|
+
_tIndex: -1,
|
|
9982
10096
|
items,
|
|
9983
10097
|
parent: parentRow,
|
|
9984
10098
|
level: parentLevel + nodes.length,
|
|
@@ -11104,8 +11218,9 @@ const Methods = {
|
|
|
11104
11218
|
const isCustomResizable = hangleStorageDefaultValue(storageOpts.resizable, isAllCustom);
|
|
11105
11219
|
const isCustomVisible = hangleStorageDefaultValue(storageOpts.visible, isAllCustom);
|
|
11106
11220
|
const isCustomFixed = hangleStorageDefaultValue(storageOpts.fixed, isAllCustom);
|
|
11221
|
+
const isCustomAggGroup = hangleStorageDefaultValue(storageOpts.aggGroup, isAllCustom);
|
|
11107
11222
|
const isCustomSort = hangleStorageDefaultValue(storageOpts.sort, isAllCustom);
|
|
11108
|
-
if (storage && (customConfig ? isEnableConf(customOpts) : customOpts.enabled) && (isCustomResizable || isCustomVisible || isCustomFixed || isCustomSort)) {
|
|
11223
|
+
if (storage && (customConfig ? isEnableConf(customOpts) : customOpts.enabled) && (isCustomResizable || isCustomVisible || isCustomFixed || isCustomAggGroup || isCustomSort)) {
|
|
11109
11224
|
if (!tableId) {
|
|
11110
11225
|
errLog('vxe.error.reqProp', ['id']);
|
|
11111
11226
|
return;
|
|
@@ -11131,12 +11246,18 @@ const Methods = {
|
|
|
11131
11246
|
getCustomStoreData() {
|
|
11132
11247
|
const $xeTable = this;
|
|
11133
11248
|
const props = $xeTable;
|
|
11249
|
+
const reactData = $xeTable;
|
|
11134
11250
|
const internalData = $xeTable;
|
|
11135
11251
|
const {
|
|
11136
11252
|
id
|
|
11137
11253
|
} = props;
|
|
11138
11254
|
const customOpts = $xeTable.computeCustomOpts;
|
|
11139
11255
|
const {
|
|
11256
|
+
isRowGroupStatus,
|
|
11257
|
+
rowGroupList
|
|
11258
|
+
} = reactData;
|
|
11259
|
+
const {
|
|
11260
|
+
fullColumnFieldData,
|
|
11140
11261
|
collectColumn
|
|
11141
11262
|
} = internalData;
|
|
11142
11263
|
const {
|
|
@@ -11150,17 +11271,20 @@ const Methods = {
|
|
|
11150
11271
|
const isCustomVisible = hangleStorageDefaultValue(storageOpts.visible, isAllCustom);
|
|
11151
11272
|
const isCustomFixed = hangleStorageDefaultValue(storageOpts.fixed, isAllCustom);
|
|
11152
11273
|
const isCustomSort = hangleStorageDefaultValue(storageOpts.sort, isAllCustom);
|
|
11274
|
+
const isCustomAggGroup = hangleStorageDefaultValue(storageOpts.aggGroup, isAllCustom);
|
|
11153
11275
|
const isCustomAggFunc = hangleStorageDefaultValue(storageOpts.aggFunc, isAllCustom);
|
|
11154
11276
|
const resizableData = {};
|
|
11155
|
-
const sortData =
|
|
11277
|
+
const sortData = [];
|
|
11156
11278
|
const visibleData = {};
|
|
11157
11279
|
const fixedData = {};
|
|
11280
|
+
const aggGroupData = {};
|
|
11158
11281
|
const aggFuncData = {};
|
|
11159
11282
|
const storeData = {
|
|
11160
11283
|
resizableData: undefined,
|
|
11161
11284
|
sortData: undefined,
|
|
11162
11285
|
visibleData: undefined,
|
|
11163
11286
|
fixedData: undefined,
|
|
11287
|
+
aggGroupData: undefined,
|
|
11164
11288
|
aggFuncData: undefined
|
|
11165
11289
|
};
|
|
11166
11290
|
if (!id) {
|
|
@@ -11174,19 +11298,40 @@ const Methods = {
|
|
|
11174
11298
|
let hasFixed = 0;
|
|
11175
11299
|
let hasVisible = 0;
|
|
11176
11300
|
let hasAggFunc = 0;
|
|
11301
|
+
const sortMaps = {};
|
|
11177
11302
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(collectColumn, (column, index, items, path, parentColumn) => {
|
|
11178
11303
|
const colKey = column.getKey();
|
|
11179
11304
|
if (!colKey) {
|
|
11180
11305
|
errLog('vxe.error.reqProp', [`${column.getTitle() || column.type || ''} -> column.field=?`]);
|
|
11181
11306
|
return;
|
|
11182
11307
|
}
|
|
11183
|
-
|
|
11184
|
-
if (!parentColumn) {
|
|
11308
|
+
if (parentColumn) {
|
|
11185
11309
|
if (isCustomSort) {
|
|
11310
|
+
const pColKey = parentColumn.getKey();
|
|
11311
|
+
const psObj = sortMaps[pColKey];
|
|
11186
11312
|
hasSort = 1;
|
|
11187
|
-
|
|
11313
|
+
if (psObj) {
|
|
11314
|
+
const sObj = {
|
|
11315
|
+
k: colKey
|
|
11316
|
+
};
|
|
11317
|
+
sortMaps[colKey] = sObj;
|
|
11318
|
+
if (!psObj.c) {
|
|
11319
|
+
psObj.c = [];
|
|
11320
|
+
}
|
|
11321
|
+
psObj.c.push(sObj);
|
|
11322
|
+
}
|
|
11188
11323
|
}
|
|
11189
|
-
|
|
11324
|
+
} else {
|
|
11325
|
+
if (isCustomSort) {
|
|
11326
|
+
hasSort = 1;
|
|
11327
|
+
const sObj = {
|
|
11328
|
+
k: colKey
|
|
11329
|
+
};
|
|
11330
|
+
sortMaps[colKey] = sObj;
|
|
11331
|
+
sortData.push(sObj);
|
|
11332
|
+
}
|
|
11333
|
+
// 只支持一级
|
|
11334
|
+
if (isCustomFixed && (column.fixed || '') !== (column.defaultFixed || '')) {
|
|
11190
11335
|
hasFixed = 1;
|
|
11191
11336
|
fixedData[colKey] = column.fixed;
|
|
11192
11337
|
}
|
|
@@ -11207,7 +11352,7 @@ const Methods = {
|
|
|
11207
11352
|
visibleData[colKey] = true;
|
|
11208
11353
|
}
|
|
11209
11354
|
}
|
|
11210
|
-
if (isCustomAggFunc && column.aggFunc !== column.defaultAggFunc) {
|
|
11355
|
+
if (isCustomAggFunc && (column.aggFunc || '') !== (column.defaultAggFunc || '')) {
|
|
11211
11356
|
hasAggFunc = 1;
|
|
11212
11357
|
aggFuncData[colKey] = column.aggFunc;
|
|
11213
11358
|
}
|
|
@@ -11224,6 +11369,15 @@ const Methods = {
|
|
|
11224
11369
|
if (hasVisible) {
|
|
11225
11370
|
storeData.visibleData = visibleData;
|
|
11226
11371
|
}
|
|
11372
|
+
if (isCustomAggGroup && isRowGroupStatus) {
|
|
11373
|
+
rowGroupList.forEach(aggConf => {
|
|
11374
|
+
const colRest = fullColumnFieldData[aggConf.field];
|
|
11375
|
+
if (colRest) {
|
|
11376
|
+
aggGroupData[colRest.column.getKey()] = true;
|
|
11377
|
+
}
|
|
11378
|
+
});
|
|
11379
|
+
storeData.aggGroupData = aggGroupData;
|
|
11380
|
+
}
|
|
11227
11381
|
if (hasAggFunc) {
|
|
11228
11382
|
storeData.aggFuncData = aggFuncData;
|
|
11229
11383
|
}
|
|
@@ -11249,11 +11403,12 @@ const Methods = {
|
|
|
11249
11403
|
const isCustomVisible = hangleStorageDefaultValue(storageOpts.visible, isAllCustom);
|
|
11250
11404
|
const isCustomFixed = hangleStorageDefaultValue(storageOpts.fixed, isAllCustom);
|
|
11251
11405
|
const isCustomSort = hangleStorageDefaultValue(storageOpts.sort, isAllCustom);
|
|
11406
|
+
const isCustomAggGroup = hangleStorageDefaultValue(storageOpts.aggGroup, isAllCustom);
|
|
11252
11407
|
const isCustomAggFunc = hangleStorageDefaultValue(storageOpts.aggFunc, isAllCustom);
|
|
11253
11408
|
if (type !== 'reset') {
|
|
11254
11409
|
reactData.isCustomStatus = true;
|
|
11255
11410
|
}
|
|
11256
|
-
if (storage && (customConfig ? isEnableConf(customOpts) : customOpts.enabled) && (isCustomResizable || isCustomVisible || isCustomFixed || isCustomSort || isCustomAggFunc)) {
|
|
11411
|
+
if (storage && (customConfig ? isEnableConf(customOpts) : customOpts.enabled) && (isCustomResizable || isCustomVisible || isCustomFixed || isCustomSort || isCustomAggGroup || isCustomAggFunc)) {
|
|
11257
11412
|
if (!tableId) {
|
|
11258
11413
|
errLog('vxe.error.reqProp', ['id']);
|
|
11259
11414
|
return this.$nextTick();
|
|
@@ -11262,7 +11417,9 @@ const Methods = {
|
|
|
11262
11417
|
resizableData: {},
|
|
11263
11418
|
sortData: {},
|
|
11264
11419
|
visibleData: {},
|
|
11265
|
-
fixedData: {}
|
|
11420
|
+
fixedData: {},
|
|
11421
|
+
aggGroupData: {},
|
|
11422
|
+
aggFuncData: {}
|
|
11266
11423
|
} : this.getCustomStoreData();
|
|
11267
11424
|
if (updateStore) {
|
|
11268
11425
|
return updateStore({
|
|
@@ -15416,9 +15573,9 @@ const Methods = {
|
|
|
15416
15573
|
const $xeTable = this;
|
|
15417
15574
|
return handleSortEvent($xeTable, null, sortConfs, isUpdate);
|
|
15418
15575
|
},
|
|
15419
|
-
setSortByEvent(evnt, sortConfs
|
|
15576
|
+
setSortByEvent(evnt, sortConfs) {
|
|
15420
15577
|
const $xeTable = this;
|
|
15421
|
-
return handleSortEvent($xeTable, evnt, sortConfs,
|
|
15578
|
+
return handleSortEvent($xeTable, evnt, sortConfs, true);
|
|
15422
15579
|
},
|
|
15423
15580
|
/**
|
|
15424
15581
|
* 清空指定列的排序条件
|
|
@@ -15451,6 +15608,9 @@ const Methods = {
|
|
|
15451
15608
|
tableFullColumn
|
|
15452
15609
|
} = internalData;
|
|
15453
15610
|
const sortOpts = $xeTable.computeSortOpts;
|
|
15611
|
+
const {
|
|
15612
|
+
multiple
|
|
15613
|
+
} = sortOpts;
|
|
15454
15614
|
const sortCols = [];
|
|
15455
15615
|
let column = null;
|
|
15456
15616
|
if (evnt) {
|
|
@@ -15470,7 +15630,13 @@ const Methods = {
|
|
|
15470
15630
|
if (!sortOpts.remote) {
|
|
15471
15631
|
$xeTable.handleTableData(true);
|
|
15472
15632
|
}
|
|
15473
|
-
if (
|
|
15633
|
+
if (!multiple) {
|
|
15634
|
+
column = sortCols[0];
|
|
15635
|
+
}
|
|
15636
|
+
if (column) {
|
|
15637
|
+
$xeTable.handleColumnSortEvent(evnt, column);
|
|
15638
|
+
}
|
|
15639
|
+
if (multiple && sortCols.length) {
|
|
15474
15640
|
const params = {
|
|
15475
15641
|
$table: $xeTable,
|
|
15476
15642
|
$event: evnt,
|
|
@@ -15478,8 +15644,6 @@ const Methods = {
|
|
|
15478
15644
|
sortList: []
|
|
15479
15645
|
};
|
|
15480
15646
|
$xeTable.dispatchEvent('clear-all-sort', params, evnt);
|
|
15481
|
-
} else if (column) {
|
|
15482
|
-
$xeTable.handleColumnSortEvent(evnt, column);
|
|
15483
15647
|
}
|
|
15484
15648
|
}
|
|
15485
15649
|
return $xeTable.$nextTick().then(() => {
|
|
@@ -15525,22 +15689,12 @@ const Methods = {
|
|
|
15525
15689
|
}
|
|
15526
15690
|
return sortList;
|
|
15527
15691
|
},
|
|
15528
|
-
setFilterByEvent(evnt, fieldOrColumn, options
|
|
15692
|
+
setFilterByEvent(evnt, fieldOrColumn, options) {
|
|
15529
15693
|
const $xeTable = this;
|
|
15530
|
-
const reactData = $xeTable;
|
|
15531
|
-
const {
|
|
15532
|
-
filterStore
|
|
15533
|
-
} = reactData;
|
|
15534
15694
|
const column = handleFieldOrColumn($xeTable, fieldOrColumn);
|
|
15535
15695
|
if (column && column.filters) {
|
|
15536
15696
|
column.filters = toFilters(options || []);
|
|
15537
|
-
|
|
15538
|
-
return $xeTable.handleColumnConfirmFilter(column, evnt);
|
|
15539
|
-
} else {
|
|
15540
|
-
if (filterStore.visible) {
|
|
15541
|
-
$xeTable.handleFilterOptions(column);
|
|
15542
|
-
}
|
|
15543
|
-
}
|
|
15697
|
+
return $xeTable.handleColumnConfirmFilter(column, evnt);
|
|
15544
15698
|
}
|
|
15545
15699
|
return $xeTable.$nextTick();
|
|
15546
15700
|
},
|
|
@@ -15599,6 +15753,9 @@ const Methods = {
|
|
|
15599
15753
|
tableFullColumn
|
|
15600
15754
|
} = internalData;
|
|
15601
15755
|
const filterOpts = $xeTable.computeFilterOpts;
|
|
15756
|
+
const {
|
|
15757
|
+
multiple
|
|
15758
|
+
} = filterOpts;
|
|
15602
15759
|
const filterCols = [];
|
|
15603
15760
|
let column = null;
|
|
15604
15761
|
if (fieldOrColumn) {
|
|
@@ -15628,7 +15785,34 @@ const Methods = {
|
|
|
15628
15785
|
if (!filterOpts.remote) {
|
|
15629
15786
|
$xeTable.updateData();
|
|
15630
15787
|
}
|
|
15631
|
-
if (
|
|
15788
|
+
if (!multiple) {
|
|
15789
|
+
column = filterCols[0];
|
|
15790
|
+
}
|
|
15791
|
+
if (column) {
|
|
15792
|
+
const filterList = () => $xeTable.getCheckedFilters();
|
|
15793
|
+
const values = [];
|
|
15794
|
+
const datas = [];
|
|
15795
|
+
column.filters.forEach(item => {
|
|
15796
|
+
if (item.checked) {
|
|
15797
|
+
values.push(item.value);
|
|
15798
|
+
datas.push(item.data);
|
|
15799
|
+
}
|
|
15800
|
+
});
|
|
15801
|
+
const params = {
|
|
15802
|
+
$table: $xeTable,
|
|
15803
|
+
$event: evnt,
|
|
15804
|
+
column,
|
|
15805
|
+
field: column.field,
|
|
15806
|
+
property: column.field,
|
|
15807
|
+
values,
|
|
15808
|
+
datas,
|
|
15809
|
+
filters: filterList,
|
|
15810
|
+
filterList
|
|
15811
|
+
};
|
|
15812
|
+
$xeTable.dispatchEvent('filter-change', params, evnt);
|
|
15813
|
+
$xeTable.dispatchEvent('clear-filter', params, evnt);
|
|
15814
|
+
}
|
|
15815
|
+
if (multiple && filterCols.length) {
|
|
15632
15816
|
const params = {
|
|
15633
15817
|
$table: $xeTable,
|
|
15634
15818
|
$event: evnt,
|
|
@@ -15636,10 +15820,6 @@ const Methods = {
|
|
|
15636
15820
|
filterList: []
|
|
15637
15821
|
};
|
|
15638
15822
|
$xeTable.dispatchEvent('clear-all-filter', params, evnt);
|
|
15639
|
-
} else if (column) {
|
|
15640
|
-
$xeTable.dispatchEvent('clear-filter', {
|
|
15641
|
-
filterList: () => $xeTable.getCheckedFilters()
|
|
15642
|
-
}, evnt);
|
|
15643
15823
|
}
|
|
15644
15824
|
return $xeTable.$nextTick();
|
|
15645
15825
|
},
|
|
@@ -18034,7 +18214,7 @@ function renderTdColumn(h, $xeTable, seq, rowid, fixedType, isOptimizeMode, rowL
|
|
|
18034
18214
|
if (!fixedHiddenColumn && editConfig && (editRender || cellRender) && (editOpts.showStatus || editOpts.showUpdateStatus)) {
|
|
18035
18215
|
isDirty = $xeTable.isUpdateByRow(row, column.field);
|
|
18036
18216
|
}
|
|
18037
|
-
const isVNAutoHeight =
|
|
18217
|
+
const isVNAutoHeight = !hasEllipsis && (scrollYLoad || scrollXLoad);
|
|
18038
18218
|
let cellHeight = getCellRestHeight(rowRest, cellOpts, rowOpts, defaultRowHeight);
|
|
18039
18219
|
const isLastColumn = $columnIndex === columns.length - 1;
|
|
18040
18220
|
const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto');
|
|
@@ -18070,7 +18250,7 @@ function renderTdColumn(h, $xeTable, seq, rowid, fixedType, isOptimizeMode, rowL
|
|
|
18070
18250
|
}
|
|
18071
18251
|
tcStyle.width = `${column.renderWidth + mergeColWidth - cellOffsetWidth}px`;
|
|
18072
18252
|
}
|
|
18073
|
-
if (scrollYLoad || hasEllipsis || isCsHeight || isRsHeight) {
|
|
18253
|
+
if (scrollYLoad || scrollXLoad || hasEllipsis || isCsHeight || isRsHeight) {
|
|
18074
18254
|
tcStyle.height = `${cellHeight}px`;
|
|
18075
18255
|
} else {
|
|
18076
18256
|
tcStyle.minHeight = `${cellHeight}px`;
|
|
@@ -18262,14 +18442,15 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
|
|
|
18262
18442
|
};
|
|
18263
18443
|
}
|
|
18264
18444
|
if (rowRest) {
|
|
18445
|
+
rowIndex = rowRest.index;
|
|
18446
|
+
_rowIndex = rowRest._index;
|
|
18265
18447
|
rowLevel = rowRest.level;
|
|
18448
|
+
seq = rowRest.seq;
|
|
18266
18449
|
if (hasRowGroupAggregate || treeConfig && transform && seqMode === 'increasing') {
|
|
18267
18450
|
seq = rowRest._index + 1;
|
|
18268
|
-
} else {
|
|
18269
|
-
seq = rowRest.
|
|
18451
|
+
} else if (treeConfig && seqMode === 'fixed') {
|
|
18452
|
+
seq = rowRest._tIndex + 1;
|
|
18270
18453
|
}
|
|
18271
|
-
rowIndex = rowRest.index;
|
|
18272
|
-
_rowIndex = rowRest._index;
|
|
18273
18454
|
}
|
|
18274
18455
|
const params = {
|
|
18275
18456
|
$table: $xeTable,
|
|
@@ -23186,6 +23367,7 @@ function insertTreeRow($xeTable, newRecords, isAppend) {
|
|
|
23186
23367
|
_index: -1,
|
|
23187
23368
|
$index: -1,
|
|
23188
23369
|
treeIndex: -1,
|
|
23370
|
+
_tIndex: -1,
|
|
23189
23371
|
items: parentChilds,
|
|
23190
23372
|
parent: parentRow,
|
|
23191
23373
|
level: parentLevel + 1,
|
|
@@ -23210,6 +23392,7 @@ function insertTreeRow($xeTable, newRecords, isAppend) {
|
|
|
23210
23392
|
_index: -1,
|
|
23211
23393
|
$index: -1,
|
|
23212
23394
|
treeIndex: -1,
|
|
23395
|
+
_tIndex: -1,
|
|
23213
23396
|
items: tableFullTreeData,
|
|
23214
23397
|
parent: null,
|
|
23215
23398
|
level: 0,
|
|
@@ -23280,6 +23463,7 @@ function handleInsertRowAt($xeTable, records, targetRow, isInsertNextRow) {
|
|
|
23280
23463
|
_index: -1,
|
|
23281
23464
|
$index: -1,
|
|
23282
23465
|
treeIndex: -1,
|
|
23466
|
+
_tIndex: -1,
|
|
23283
23467
|
items: afterFullData,
|
|
23284
23468
|
parent: null,
|
|
23285
23469
|
level: 0,
|
|
@@ -23326,6 +23510,7 @@ function handleInsertRowAt($xeTable, records, targetRow, isInsertNextRow) {
|
|
|
23326
23510
|
_index: -1,
|
|
23327
23511
|
$index: -1,
|
|
23328
23512
|
treeIndex: -1,
|
|
23513
|
+
_tIndex: -1,
|
|
23329
23514
|
items: afterFullData,
|
|
23330
23515
|
parent: null,
|
|
23331
23516
|
level: 0,
|
|
@@ -23376,6 +23561,7 @@ function handleInsertRowAt($xeTable, records, targetRow, isInsertNextRow) {
|
|
|
23376
23561
|
_index: -1,
|
|
23377
23562
|
$index: -1,
|
|
23378
23563
|
treeIndex: -1,
|
|
23564
|
+
_tIndex: -1,
|
|
23379
23565
|
items: parentMapChilds,
|
|
23380
23566
|
parent: parentRow,
|
|
23381
23567
|
level: parentLevel + 1,
|
|
@@ -27510,6 +27696,8 @@ function checkRuleStatus(rule, val) {
|
|
|
27510
27696
|
});
|
|
27511
27697
|
;// CONCATENATED MODULE: ./packages/table/module/custom/mixin.ts
|
|
27512
27698
|
|
|
27699
|
+
|
|
27700
|
+
|
|
27513
27701
|
function calcMaxHeight($xeTable) {
|
|
27514
27702
|
const reactData = $xeTable;
|
|
27515
27703
|
const {
|
|
@@ -27618,21 +27806,20 @@ function emitCustomEvent($xeTable, type, evnt) {
|
|
|
27618
27806
|
}
|
|
27619
27807
|
});
|
|
27620
27808
|
reactData.isCustomStatus = true;
|
|
27621
|
-
|
|
27622
|
-
if (
|
|
27623
|
-
|
|
27624
|
-
|
|
27625
|
-
|
|
27626
|
-
$xeTable.setRowGroups(aggHandleFields);
|
|
27627
|
-
} else {
|
|
27628
|
-
$xeTable.clearRowGroups();
|
|
27629
|
-
}
|
|
27809
|
+
if (allowGroup && allowValues && !!$xeTable.handlePivotTableAggregateData) {
|
|
27810
|
+
if (rowGroupList.length !== aggHandleFields.length || rowGroupList.some((conf, i) => conf.field !== aggHandleFields[i])) {
|
|
27811
|
+
// 更新数据分组
|
|
27812
|
+
if (aggHandleFields.length) {
|
|
27813
|
+
$xeTable.setRowGroups(aggHandleFields);
|
|
27630
27814
|
} else {
|
|
27631
|
-
|
|
27632
|
-
$xeTable.handleUpdateAggData();
|
|
27815
|
+
$xeTable.clearRowGroups();
|
|
27633
27816
|
}
|
|
27817
|
+
} else if (allowValues) {
|
|
27818
|
+
// 更新聚合函数
|
|
27819
|
+
$xeTable.handleUpdateAggData();
|
|
27634
27820
|
}
|
|
27635
|
-
}
|
|
27821
|
+
}
|
|
27822
|
+
return $xeTable.saveCustomStore('confirm');
|
|
27636
27823
|
},
|
|
27637
27824
|
_cancelCustom() {
|
|
27638
27825
|
const $xeTable = this;
|
|
@@ -27697,6 +27884,7 @@ function emitCustomEvent($xeTable, type, evnt) {
|
|
|
27697
27884
|
sort: options === true,
|
|
27698
27885
|
aggFunc: options === true
|
|
27699
27886
|
}, options);
|
|
27887
|
+
const allCols = [];
|
|
27700
27888
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(collectColumn, column => {
|
|
27701
27889
|
if (opts.resizable) {
|
|
27702
27890
|
column.resizeWidth = 0;
|
|
@@ -27706,6 +27894,7 @@ function emitCustomEvent($xeTable, type, evnt) {
|
|
|
27706
27894
|
}
|
|
27707
27895
|
if (opts.sort) {
|
|
27708
27896
|
column.renderSortNumber = column.sortNumber;
|
|
27897
|
+
column.parentId = column.defaultParentId;
|
|
27709
27898
|
}
|
|
27710
27899
|
if (!checkMethod || checkMethod({
|
|
27711
27900
|
$table: $xeTable,
|
|
@@ -27718,9 +27907,18 @@ function emitCustomEvent($xeTable, type, evnt) {
|
|
|
27718
27907
|
column.renderAggFn = column.defaultAggFunc;
|
|
27719
27908
|
}
|
|
27720
27909
|
column.renderResizeWidth = column.renderWidth;
|
|
27910
|
+
allCols.push(column);
|
|
27721
27911
|
});
|
|
27912
|
+
if (opts.sort) {
|
|
27913
|
+
const newCollectCols = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toArrayTree(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().orderBy(allCols, 'renderSortNumber'), {
|
|
27914
|
+
key: 'id',
|
|
27915
|
+
parentKey: 'parentId',
|
|
27916
|
+
children: 'children'
|
|
27917
|
+
});
|
|
27918
|
+
internalData.collectColumn = newCollectCols;
|
|
27919
|
+
internalData.tableFullColumn = getColumnList(newCollectCols);
|
|
27920
|
+
}
|
|
27722
27921
|
reactData.isCustomStatus = false;
|
|
27723
|
-
$xeTable.saveCustomStore('reset');
|
|
27724
27922
|
return $xeTable.handleCustom().then(() => {
|
|
27725
27923
|
if (opts.aggFunc && $xeTable.handlePivotTableAggregateData) {
|
|
27726
27924
|
const rowGroupFields = $xeTable.computeRowGroupFields;
|
|
@@ -27734,6 +27932,7 @@ function emitCustomEvent($xeTable, type, evnt) {
|
|
|
27734
27932
|
$xeTable.handleUpdateAggData();
|
|
27735
27933
|
}
|
|
27736
27934
|
}
|
|
27935
|
+
$xeTable.saveCustomStore('reset');
|
|
27737
27936
|
});
|
|
27738
27937
|
},
|
|
27739
27938
|
_toggleCustomAllCheckbox() {
|
|
@@ -28165,15 +28364,16 @@ function renderRowExpandedVNs(h, $xeTable) {
|
|
|
28165
28364
|
let rowIndex = -1;
|
|
28166
28365
|
let $rowIndex = -1;
|
|
28167
28366
|
if (rowRest) {
|
|
28367
|
+
rowIndex = rowRest.index;
|
|
28368
|
+
$rowIndex = rowRest.$index;
|
|
28369
|
+
_rowIndex = rowRest._index;
|
|
28168
28370
|
rowLevel = rowRest.level;
|
|
28371
|
+
seq = rowRest.seq;
|
|
28169
28372
|
if (isRowGroupStatus || treeConfig && transform && seqMode === 'increasing') {
|
|
28170
28373
|
seq = rowRest._index + 1;
|
|
28171
|
-
} else {
|
|
28172
|
-
seq = rowRest.
|
|
28374
|
+
} else if (treeConfig && seqMode === 'fixed') {
|
|
28375
|
+
seq = rowRest._tIndex + 1;
|
|
28173
28376
|
}
|
|
28174
|
-
rowIndex = rowRest.index;
|
|
28175
|
-
$rowIndex = rowRest.$index;
|
|
28176
|
-
_rowIndex = rowRest._index;
|
|
28177
28377
|
}
|
|
28178
28378
|
if (expandHeight) {
|
|
28179
28379
|
cellStyle.height = `${expandHeight}px`;
|
|
@@ -29249,7 +29449,7 @@ function renderBody(h, $xeTable) {
|
|
|
29249
29449
|
});
|
|
29250
29450
|
},
|
|
29251
29451
|
staticColumns(value) {
|
|
29252
|
-
this.
|
|
29452
|
+
this.$nextTick(() => this.handleInitColumn(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().clone(value)));
|
|
29253
29453
|
},
|
|
29254
29454
|
tableColumn() {
|
|
29255
29455
|
this.analyColumnWidth();
|
|
@@ -31059,9 +31259,11 @@ function getTableOns(_vm) {
|
|
|
31059
31259
|
if (proxyConfig) {
|
|
31060
31260
|
if (proxyOpts.sort) {
|
|
31061
31261
|
ons['sort-change'] = _vm.sortChangeEvent;
|
|
31262
|
+
ons['clear-all-sort'] = _vm.clearAllSortEvent;
|
|
31062
31263
|
}
|
|
31063
31264
|
if (proxyOpts.filter) {
|
|
31064
31265
|
ons['filter-change'] = _vm.filterChangeEvent;
|
|
31266
|
+
ons['clear-all-filter'] = _vm.clearAllFilterEvent;
|
|
31065
31267
|
}
|
|
31066
31268
|
}
|
|
31067
31269
|
return ons;
|
|
@@ -31330,6 +31532,14 @@ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default(
|
|
|
31330
31532
|
const pagerOpts = $xeGrid.computePagerOpts;
|
|
31331
31533
|
return pagerOpts.total;
|
|
31332
31534
|
},
|
|
31535
|
+
computePageCount() {
|
|
31536
|
+
const $xeGrid = this;
|
|
31537
|
+
const reactData = $xeGrid.reactData;
|
|
31538
|
+
const {
|
|
31539
|
+
tablePage
|
|
31540
|
+
} = reactData;
|
|
31541
|
+
return Math.max(Math.ceil(tablePage.total / tablePage.pageSize), 1);
|
|
31542
|
+
},
|
|
31333
31543
|
computeIsLoading() {
|
|
31334
31544
|
const $xeGrid = this;
|
|
31335
31545
|
const props = $xeGrid;
|
|
@@ -31419,7 +31629,7 @@ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default(
|
|
|
31419
31629
|
tablePage.pageSize = pageSize;
|
|
31420
31630
|
}
|
|
31421
31631
|
if (total) {
|
|
31422
|
-
tablePage.
|
|
31632
|
+
tablePage.total = total;
|
|
31423
31633
|
}
|
|
31424
31634
|
}
|
|
31425
31635
|
}
|
|
@@ -32160,29 +32370,71 @@ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default(
|
|
|
32160
32370
|
return $xeGrid.$nextTick();
|
|
32161
32371
|
},
|
|
32162
32372
|
homePage() {
|
|
32373
|
+
const $xeGrid = this;
|
|
32374
|
+
const reactData = $xeGrid.reactData;
|
|
32375
|
+
const {
|
|
32376
|
+
tablePage
|
|
32377
|
+
} = reactData;
|
|
32378
|
+
tablePage.currentPage = 1;
|
|
32379
|
+
return $xeGrid.$nextTick();
|
|
32380
|
+
},
|
|
32381
|
+
homePageByEvent(evnt) {
|
|
32163
32382
|
const $xeGrid = this;
|
|
32164
32383
|
const $pager = $xeGrid.$refs.refPager;
|
|
32165
32384
|
if ($pager) {
|
|
32166
|
-
|
|
32385
|
+
$pager.homePageByEvent(evnt);
|
|
32167
32386
|
}
|
|
32168
|
-
return $xeGrid.$nextTick();
|
|
32169
32387
|
},
|
|
32170
32388
|
endPage() {
|
|
32389
|
+
const $xeGrid = this;
|
|
32390
|
+
const reactData = $xeGrid.reactData;
|
|
32391
|
+
const {
|
|
32392
|
+
tablePage
|
|
32393
|
+
} = reactData;
|
|
32394
|
+
const pageCount = $xeGrid.computePageCount;
|
|
32395
|
+
tablePage.currentPage = pageCount;
|
|
32396
|
+
return $xeGrid.$nextTick();
|
|
32397
|
+
},
|
|
32398
|
+
endPageByEvent(evnt) {
|
|
32171
32399
|
const $xeGrid = this;
|
|
32172
32400
|
const $pager = $xeGrid.$refs.refPager;
|
|
32173
32401
|
if ($pager) {
|
|
32174
|
-
|
|
32402
|
+
$pager.endPageByEvent(evnt);
|
|
32175
32403
|
}
|
|
32404
|
+
},
|
|
32405
|
+
setCurrentPage(currentPage) {
|
|
32406
|
+
const $xeGrid = this;
|
|
32407
|
+
const reactData = $xeGrid.reactData;
|
|
32408
|
+
const {
|
|
32409
|
+
tablePage
|
|
32410
|
+
} = reactData;
|
|
32411
|
+
const pageCount = $xeGrid.computePageCount;
|
|
32412
|
+
tablePage.currentPage = Math.min(pageCount, Math.max(1, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(currentPage)));
|
|
32176
32413
|
return $xeGrid.$nextTick();
|
|
32177
32414
|
},
|
|
32178
|
-
|
|
32415
|
+
setCurrentPageByEvent(evnt, currentPage) {
|
|
32179
32416
|
const $xeGrid = this;
|
|
32180
32417
|
const $pager = $xeGrid.$refs.refPager;
|
|
32181
32418
|
if ($pager) {
|
|
32182
|
-
|
|
32419
|
+
$pager.setCurrentPageByEvent(evnt, currentPage);
|
|
32183
32420
|
}
|
|
32421
|
+
},
|
|
32422
|
+
setPageSize(pageSize) {
|
|
32423
|
+
const $xeGrid = this;
|
|
32424
|
+
const reactData = $xeGrid.reactData;
|
|
32425
|
+
const {
|
|
32426
|
+
tablePage
|
|
32427
|
+
} = reactData;
|
|
32428
|
+
tablePage.pageSize = Math.max(1, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(pageSize));
|
|
32184
32429
|
return $xeGrid.$nextTick();
|
|
32185
32430
|
},
|
|
32431
|
+
setPageSizeByEvent(evnt, pageSize) {
|
|
32432
|
+
const $xeGrid = this;
|
|
32433
|
+
const $pager = $xeGrid.$refs.refPager;
|
|
32434
|
+
if ($pager) {
|
|
32435
|
+
$pager.setPageSizeByEvent(evnt, pageSize);
|
|
32436
|
+
}
|
|
32437
|
+
},
|
|
32186
32438
|
triggerToolbarCommitEvent(params, evnt) {
|
|
32187
32439
|
const $xeGrid = this;
|
|
32188
32440
|
const {
|
|
@@ -32213,28 +32465,6 @@ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default(
|
|
|
32213
32465
|
tool
|
|
32214
32466
|
}, evnt);
|
|
32215
32467
|
},
|
|
32216
|
-
sortChangeEvent(params) {
|
|
32217
|
-
const $xeGrid = this;
|
|
32218
|
-
const props = $xeGrid;
|
|
32219
|
-
const reactData = $xeGrid.reactData;
|
|
32220
|
-
const $xeTable = $xeGrid.$refs.refTable;
|
|
32221
|
-
const {
|
|
32222
|
-
proxyConfig
|
|
32223
|
-
} = props;
|
|
32224
|
-
const proxyOpts = $xeGrid.computeProxyOpts;
|
|
32225
|
-
const sortOpts = $xeTable.computeSortOpts;
|
|
32226
|
-
// 如果是服务端排序
|
|
32227
|
-
if (sortOpts.remote) {
|
|
32228
|
-
reactData.sortData = params.sortList;
|
|
32229
|
-
if (proxyConfig && isEnableConf(proxyOpts)) {
|
|
32230
|
-
reactData.tablePage.currentPage = 1;
|
|
32231
|
-
$xeGrid.commitProxy('query').then(rest => {
|
|
32232
|
-
$xeGrid.dispatchEvent('proxy-query', rest, params.$event);
|
|
32233
|
-
});
|
|
32234
|
-
}
|
|
32235
|
-
}
|
|
32236
|
-
$xeGrid.dispatchEvent('sort-change', params, params.$event);
|
|
32237
|
-
},
|
|
32238
32468
|
pageChangeEvent(params) {
|
|
32239
32469
|
const $xeGrid = this;
|
|
32240
32470
|
const props = $xeGrid;
|
|
@@ -32260,7 +32490,38 @@ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default(
|
|
|
32260
32490
|
});
|
|
32261
32491
|
}
|
|
32262
32492
|
},
|
|
32263
|
-
|
|
32493
|
+
handleSortEvent(params) {
|
|
32494
|
+
const $xeGrid = this;
|
|
32495
|
+
const props = $xeGrid;
|
|
32496
|
+
const reactData = $xeGrid.reactData;
|
|
32497
|
+
const $xeTable = $xeGrid.$refs.refTable;
|
|
32498
|
+
const {
|
|
32499
|
+
proxyConfig
|
|
32500
|
+
} = props;
|
|
32501
|
+
const proxyOpts = $xeGrid.computeProxyOpts;
|
|
32502
|
+
const sortOpts = $xeTable.computeSortOpts;
|
|
32503
|
+
// 如果是服务端排序
|
|
32504
|
+
if (sortOpts.remote) {
|
|
32505
|
+
reactData.sortData = params.sortList;
|
|
32506
|
+
if (proxyConfig && isEnableConf(proxyOpts)) {
|
|
32507
|
+
reactData.tablePage.currentPage = 1;
|
|
32508
|
+
$xeGrid.commitProxy('query').then(rest => {
|
|
32509
|
+
$xeGrid.dispatchEvent('proxy-query', rest, params.$event);
|
|
32510
|
+
});
|
|
32511
|
+
}
|
|
32512
|
+
}
|
|
32513
|
+
},
|
|
32514
|
+
sortChangeEvent(params) {
|
|
32515
|
+
const $xeGrid = this;
|
|
32516
|
+
$xeGrid.handleSortEvent(params);
|
|
32517
|
+
$xeGrid.dispatchEvent('sort-change', params, params.$event);
|
|
32518
|
+
},
|
|
32519
|
+
clearAllSortEvent(params) {
|
|
32520
|
+
const $xeGrid = this;
|
|
32521
|
+
$xeGrid.handleSortEvent(params);
|
|
32522
|
+
$xeGrid.dispatchEvent('clear-all-sort', params, params.$event);
|
|
32523
|
+
},
|
|
32524
|
+
handleFilterEvent(params) {
|
|
32264
32525
|
const $xeGrid = this;
|
|
32265
32526
|
const props = $xeGrid;
|
|
32266
32527
|
const reactData = $xeGrid.reactData;
|
|
@@ -32280,8 +32541,17 @@ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default(
|
|
|
32280
32541
|
});
|
|
32281
32542
|
}
|
|
32282
32543
|
}
|
|
32544
|
+
},
|
|
32545
|
+
filterChangeEvent(params) {
|
|
32546
|
+
const $xeGrid = this;
|
|
32547
|
+
$xeGrid.handleFilterEvent(params);
|
|
32283
32548
|
$xeGrid.dispatchEvent('filter-change', params, params.$event);
|
|
32284
32549
|
},
|
|
32550
|
+
clearAllFilterEvent(params) {
|
|
32551
|
+
const $xeGrid = this;
|
|
32552
|
+
$xeGrid.handleFilterEvent(params);
|
|
32553
|
+
$xeGrid.dispatchEvent('clear-all-filter', params, params.$event);
|
|
32554
|
+
},
|
|
32285
32555
|
submitFormEvent(params) {
|
|
32286
32556
|
const $xeGrid = this;
|
|
32287
32557
|
const props = $xeGrid;
|
|
@@ -32345,6 +32615,11 @@ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default(
|
|
|
32345
32615
|
type: reactData.isZMax ? 'max' : 'revert'
|
|
32346
32616
|
}, evnt);
|
|
32347
32617
|
},
|
|
32618
|
+
getParams() {
|
|
32619
|
+
const $xeGrid = this;
|
|
32620
|
+
const props = $xeGrid;
|
|
32621
|
+
return props.params;
|
|
32622
|
+
},
|
|
32348
32623
|
zoom() {
|
|
32349
32624
|
const $xeGrid = this;
|
|
32350
32625
|
const reactData = $xeGrid.reactData;
|