vxe-table 3.17.0-beta.9 → 3.17.1
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 +32 -14
- package/es/table/module/custom/panel.js +1 -1
- 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 +223 -85
- package/es/table/src/table.js +17 -8
- package/es/table/src/util.js +9 -0
- package/es/ui/index.js +3 -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 +465 -139
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/module/custom/mixin.js +37 -13
- package/lib/table/module/custom/mixin.min.js +1 -1
- package/lib/table/module/custom/panel.js +1 -1
- package/lib/table/module/custom/panel.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 +273 -82
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +21 -8
- 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 +3 -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 +32 -13
- package/packages/table/module/custom/panel.ts +1 -1
- 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 +237 -85
- package/packages/table/src/props.ts +1 -1
- package/packages/table/src/table.ts +18 -9
- package/packages/table/src/util.ts +10 -0
- package/packages/ui/index.ts +2 -0
- /package/es/{iconfont.1753497303145.ttf → iconfont.1754358049869.ttf} +0 -0
- /package/es/{iconfont.1753497303145.woff → iconfont.1754358049869.woff} +0 -0
- /package/es/{iconfont.1753497303145.woff2 → iconfont.1754358049869.woff2} +0 -0
- /package/lib/{iconfont.1753497303145.ttf → iconfont.1754358049869.ttf} +0 -0
- /package/lib/{iconfont.1753497303145.woff → iconfont.1754358049869.woff} +0 -0
- /package/lib/{iconfont.1753497303145.woff2 → iconfont.1754358049869.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.
|
|
2005
|
+
const version = "3.17.1";
|
|
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: {
|
|
@@ -2222,6 +2223,7 @@ core_.VxeUI.setConfig({
|
|
|
2222
2223
|
},
|
|
2223
2224
|
virtualYConfig: {
|
|
2224
2225
|
// enabled: false,
|
|
2226
|
+
// mode: 'wheel',
|
|
2225
2227
|
gt: 100,
|
|
2226
2228
|
preSize: 1,
|
|
2227
2229
|
oSize: 0
|
|
@@ -2667,7 +2669,7 @@ function isNodeElement(elem) {
|
|
|
2667
2669
|
const {
|
|
2668
2670
|
log: log_log
|
|
2669
2671
|
} = core_.VxeUI;
|
|
2670
|
-
const log_version = `table v${"3.17.
|
|
2672
|
+
const log_version = `table v${"3.17.1"}`;
|
|
2671
2673
|
const warnLog = log_log.create('warn', log_version);
|
|
2672
2674
|
const errLog = log_log.create('error', log_version);
|
|
2673
2675
|
;// CONCATENATED MODULE: ./packages/table/src/columnInfo.ts
|
|
@@ -2804,15 +2806,20 @@ class ColumnInfo {
|
|
|
2804
2806
|
parentId: null,
|
|
2805
2807
|
visible,
|
|
2806
2808
|
// 内部属性(一旦被使用,将导致不可升级版本)
|
|
2809
|
+
defaultParentId: null,
|
|
2807
2810
|
halfVisible: false,
|
|
2808
2811
|
defaultVisible: visible,
|
|
2809
2812
|
defaultFixed: _vm.fixed,
|
|
2813
|
+
defaultAggGroup: _vm.aggGroup,
|
|
2810
2814
|
defaultAggFunc: _vm.aggFunc,
|
|
2811
2815
|
checked: false,
|
|
2812
2816
|
halfChecked: false,
|
|
2813
2817
|
disabled: false,
|
|
2818
|
+
// 分组层级
|
|
2814
2819
|
level: 1,
|
|
2820
|
+
// 跨行
|
|
2815
2821
|
rowSpan: 1,
|
|
2822
|
+
// 跨列
|
|
2816
2823
|
colSpan: 1,
|
|
2817
2824
|
// 数据排序
|
|
2818
2825
|
order: null,
|
|
@@ -3088,6 +3095,7 @@ function assembleColumn(_vm) {
|
|
|
3088
3095
|
if (!groupConfig.children) {
|
|
3089
3096
|
groupConfig.children = [];
|
|
3090
3097
|
}
|
|
3098
|
+
columnConfig.defaultParentId = groupConfig.id;
|
|
3091
3099
|
groupConfig.children.splice(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayIndexOf($xeColumn.$el.children, $el), 0, columnConfig);
|
|
3092
3100
|
} else {
|
|
3093
3101
|
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 +3342,14 @@ function clearTableAllStatus(_vm) {
|
|
|
3334
3342
|
function isColumnInfo(column) {
|
|
3335
3343
|
return column instanceof ColumnInfo;
|
|
3336
3344
|
}
|
|
3345
|
+
// 获取所有的列,排除分组
|
|
3346
|
+
function getColumnList(columns) {
|
|
3347
|
+
const result = [];
|
|
3348
|
+
columns.forEach(column => {
|
|
3349
|
+
result.push(...(column.children && column.children.length ? getColumnList(column.children) : [column]));
|
|
3350
|
+
});
|
|
3351
|
+
return result;
|
|
3352
|
+
}
|
|
3337
3353
|
function createColumn($xeTable, options, renderOptions) {
|
|
3338
3354
|
return isColumnInfo(options) ? options : new ColumnInfo($xeTable, options, renderOptions);
|
|
3339
3355
|
}
|
|
@@ -5375,44 +5391,122 @@ function handleVirtualXVisible($xeTable) {
|
|
|
5375
5391
|
};
|
|
5376
5392
|
}
|
|
5377
5393
|
function handleCustomRestore($xeTable, storeData) {
|
|
5394
|
+
const props = $xeTable;
|
|
5378
5395
|
const reactData = $xeTable;
|
|
5379
5396
|
const internalData = $xeTable;
|
|
5380
|
-
|
|
5397
|
+
const {
|
|
5398
|
+
aggregateConfig,
|
|
5399
|
+
rowGroupConfig
|
|
5400
|
+
} = props;
|
|
5401
|
+
const {
|
|
5381
5402
|
collectColumn
|
|
5382
5403
|
} = internalData;
|
|
5404
|
+
const customOpts = $xeTable.computeCustomOpts;
|
|
5383
5405
|
const {
|
|
5406
|
+
storage,
|
|
5407
|
+
storeOptions
|
|
5408
|
+
} = customOpts;
|
|
5409
|
+
const isAllCustom = storage === true;
|
|
5410
|
+
const storageOpts = isAllCustom ? {} : Object.assign({}, storage || {}, storeOptions);
|
|
5411
|
+
const isCustomResizable = hangleStorageDefaultValue(storageOpts.resizable, isAllCustom);
|
|
5412
|
+
const isCustomVisible = hangleStorageDefaultValue(storageOpts.visible, isAllCustom);
|
|
5413
|
+
const isCustomFixed = hangleStorageDefaultValue(storageOpts.fixed, isAllCustom);
|
|
5414
|
+
const isCustomSort = hangleStorageDefaultValue(storageOpts.sort, isAllCustom);
|
|
5415
|
+
const isCustomAggGroup = hangleStorageDefaultValue(storageOpts.aggGroup, isAllCustom);
|
|
5416
|
+
const isCustomAggFunc = hangleStorageDefaultValue(storageOpts.aggFunc, isAllCustom);
|
|
5417
|
+
let {
|
|
5384
5418
|
resizableData,
|
|
5385
5419
|
sortData,
|
|
5386
5420
|
visibleData,
|
|
5387
|
-
fixedData
|
|
5421
|
+
fixedData,
|
|
5422
|
+
aggGroupData,
|
|
5423
|
+
aggFuncData
|
|
5388
5424
|
} = storeData;
|
|
5389
|
-
let hasCustomSort = false;
|
|
5390
5425
|
// 处理还原
|
|
5391
|
-
if (resizableData || sortData || visibleData || fixedData) {
|
|
5426
|
+
if (isCustomResizable && resizableData || isCustomSort && sortData || isCustomVisible && visibleData || isCustomFixed && fixedData || isCustomAggGroup && aggGroupData || isCustomAggFunc && aggFuncData) {
|
|
5427
|
+
const sortColMaps = {};
|
|
5428
|
+
if (isCustomSort && sortData) {
|
|
5429
|
+
// 转换兼容老版本数据,即将废弃兼容
|
|
5430
|
+
if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(sortData)) {
|
|
5431
|
+
const sortRests = [];
|
|
5432
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(sortData, (index, colKey) => {
|
|
5433
|
+
sortRests.push({
|
|
5434
|
+
key: colKey,
|
|
5435
|
+
index
|
|
5436
|
+
});
|
|
5437
|
+
});
|
|
5438
|
+
sortData = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().orderBy(sortRests, {
|
|
5439
|
+
field: 'index',
|
|
5440
|
+
order: 'asc'
|
|
5441
|
+
}).map(item => ({
|
|
5442
|
+
k: item.key
|
|
5443
|
+
}));
|
|
5444
|
+
}
|
|
5445
|
+
let colNum = 1;
|
|
5446
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(sortData, (sObj, index, sOjs, path, pSObj) => {
|
|
5447
|
+
sortColMaps[sObj.k] = {
|
|
5448
|
+
key: sObj.k,
|
|
5449
|
+
sNum: colNum++,
|
|
5450
|
+
pKey: pSObj ? pSObj.k : null
|
|
5451
|
+
};
|
|
5452
|
+
}, {
|
|
5453
|
+
children: 'c'
|
|
5454
|
+
});
|
|
5455
|
+
}
|
|
5456
|
+
const colKeyMaps = {};
|
|
5457
|
+
const allCols = [];
|
|
5458
|
+
const aggGroupConfs = [];
|
|
5392
5459
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(collectColumn, (column, index, items, path, parentColumn) => {
|
|
5393
5460
|
const colKey = column.getKey();
|
|
5394
5461
|
// 支持一级
|
|
5395
5462
|
if (!parentColumn) {
|
|
5396
|
-
if (fixedData && fixedData[colKey] !== undefined) {
|
|
5463
|
+
if (isCustomFixed && fixedData && fixedData[colKey] !== undefined) {
|
|
5397
5464
|
column.fixed = fixedData[colKey];
|
|
5398
5465
|
}
|
|
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
5466
|
}
|
|
5404
|
-
if (resizableData && external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(resizableData[colKey])) {
|
|
5467
|
+
if (isCustomResizable && resizableData && external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(resizableData[colKey])) {
|
|
5405
5468
|
column.resizeWidth = resizableData[colKey];
|
|
5406
5469
|
}
|
|
5407
|
-
if (visibleData && external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(visibleData[colKey])) {
|
|
5470
|
+
if (isCustomVisible && visibleData && external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(visibleData[colKey])) {
|
|
5408
5471
|
column.visible = visibleData[colKey];
|
|
5409
5472
|
}
|
|
5473
|
+
if (isCustomAggFunc && aggFuncData && (aggregateConfig || rowGroupConfig) && aggFuncData[colKey]) {
|
|
5474
|
+
column.aggFunc = aggFuncData[colKey];
|
|
5475
|
+
}
|
|
5476
|
+
if (isCustomAggGroup && aggGroupData && aggGroupData[colKey]) {
|
|
5477
|
+
aggGroupConfs.push({
|
|
5478
|
+
field: column.field
|
|
5479
|
+
});
|
|
5480
|
+
}
|
|
5481
|
+
colKeyMaps[colKey] = column;
|
|
5482
|
+
allCols.push(column);
|
|
5410
5483
|
});
|
|
5484
|
+
if ((aggregateConfig || rowGroupConfig) && aggGroupConfs.length) {
|
|
5485
|
+
const groupRest = handleGroupData($xeTable, internalData.tableFullData, aggGroupConfs);
|
|
5486
|
+
internalData.tableFullTreeData = [];
|
|
5487
|
+
internalData.tableFullGroupData = groupRest.treeData;
|
|
5488
|
+
reactData.isRowGroupStatus = true;
|
|
5489
|
+
reactData.rowGroupList = aggGroupConfs;
|
|
5490
|
+
$xeTable.cacheRowMap(false);
|
|
5491
|
+
}
|
|
5411
5492
|
// 如果自定义了顺序
|
|
5412
|
-
if (
|
|
5413
|
-
|
|
5414
|
-
|
|
5415
|
-
|
|
5493
|
+
if (isCustomSort && sortData) {
|
|
5494
|
+
allCols.forEach(column => {
|
|
5495
|
+
const colKey = column.getKey();
|
|
5496
|
+
const scItem = sortColMaps[colKey];
|
|
5497
|
+
if (scItem) {
|
|
5498
|
+
const parentColumn = scItem.pKey ? colKeyMaps[scItem.pKey] : null;
|
|
5499
|
+
column.parentId = parentColumn ? parentColumn.id : null;
|
|
5500
|
+
column.renderSortNumber = scItem.sNum;
|
|
5501
|
+
}
|
|
5502
|
+
});
|
|
5503
|
+
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'), {
|
|
5504
|
+
key: 'id',
|
|
5505
|
+
parentKey: 'parentId',
|
|
5506
|
+
children: 'children'
|
|
5507
|
+
});
|
|
5508
|
+
internalData.collectColumn = newCollectCols;
|
|
5509
|
+
internalData.tableFullColumn = getColumnList(newCollectCols);
|
|
5416
5510
|
}
|
|
5417
5511
|
reactData.isCustomStatus = true;
|
|
5418
5512
|
} else {
|
|
@@ -5476,8 +5570,8 @@ function cacheColumnMap($xeTable) {
|
|
|
5476
5570
|
tableFullColumn,
|
|
5477
5571
|
collectColumn
|
|
5478
5572
|
} = internalData;
|
|
5479
|
-
const
|
|
5480
|
-
const
|
|
5573
|
+
const fullColIdData = internalData.fullColumnIdData = {};
|
|
5574
|
+
const fullColFieldData = internalData.fullColumnFieldData = {};
|
|
5481
5575
|
const mouseOpts = $xeTable.computeMouseOpts;
|
|
5482
5576
|
const expandOpts = $xeTable.computeExpandOpts;
|
|
5483
5577
|
const columnOpts = $xeTable.computeColumnOpts;
|
|
@@ -5521,10 +5615,10 @@ function cacheColumnMap($xeTable) {
|
|
|
5521
5615
|
oLeft: 0
|
|
5522
5616
|
};
|
|
5523
5617
|
if (field) {
|
|
5524
|
-
if (
|
|
5618
|
+
if (fullColFieldData[field]) {
|
|
5525
5619
|
errLog('vxe.error.colRepet', ['field', field]);
|
|
5526
5620
|
}
|
|
5527
|
-
|
|
5621
|
+
fullColFieldData[field] = rest;
|
|
5528
5622
|
} else {
|
|
5529
5623
|
if (storage && !type || columnOpts.drag && (isCrossDrag || isSelfToChildDrag)) {
|
|
5530
5624
|
errLog('vxe.error.reqProp', [`${column.getTitle() || type || ''} -> column.field=?`]);
|
|
@@ -5578,10 +5672,10 @@ function cacheColumnMap($xeTable) {
|
|
|
5578
5672
|
if (isAllOverflow && column.showOverflow === false) {
|
|
5579
5673
|
isAllOverflow = false;
|
|
5580
5674
|
}
|
|
5581
|
-
if (
|
|
5675
|
+
if (fullColIdData[colid]) {
|
|
5582
5676
|
errLog('vxe.error.colRepet', ['colId', colid]);
|
|
5583
5677
|
}
|
|
5584
|
-
|
|
5678
|
+
fullColIdData[colid] = rest;
|
|
5585
5679
|
};
|
|
5586
5680
|
if (isGroup) {
|
|
5587
5681
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(collectColumn, (column, index, items, path, parentColumn, nodes) => {
|
|
@@ -5596,10 +5690,10 @@ function cacheColumnMap($xeTable) {
|
|
|
5596
5690
|
}
|
|
5597
5691
|
if (htmlColumn) {
|
|
5598
5692
|
if (!columnOpts.useKey) {
|
|
5599
|
-
errLog('vxe.error.
|
|
5693
|
+
errLog('vxe.error.notSupportProp', ['column.type=html', 'column-config.useKey=false', 'column-config.useKey=true']);
|
|
5600
5694
|
}
|
|
5601
5695
|
if (!rowOpts.useKey) {
|
|
5602
|
-
errLog('vxe.error.
|
|
5696
|
+
errLog('vxe.error.notSupportProp', ['column.type=html', 'row-config.useKey=false', 'row-config.useKey=true']);
|
|
5603
5697
|
}
|
|
5604
5698
|
}
|
|
5605
5699
|
reactData.isGroup = isGroup;
|
|
@@ -5887,6 +5981,7 @@ function updateAfterListIndex($xeTable) {
|
|
|
5887
5981
|
$index: -1,
|
|
5888
5982
|
_index: index,
|
|
5889
5983
|
treeIndex: -1,
|
|
5984
|
+
_tIndex: -1,
|
|
5890
5985
|
items: [],
|
|
5891
5986
|
parent: null,
|
|
5892
5987
|
level: 0,
|
|
@@ -5925,6 +6020,7 @@ function updateAfterDataIndex($xeTable) {
|
|
|
5925
6020
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
5926
6021
|
const fullMaps = {};
|
|
5927
6022
|
if (treeConfig) {
|
|
6023
|
+
let _treeIndex = 0;
|
|
5928
6024
|
const {
|
|
5929
6025
|
handleGetRowId
|
|
5930
6026
|
} = createHandleGetRowId($xeTable);
|
|
@@ -5935,6 +6031,7 @@ function updateAfterDataIndex($xeTable) {
|
|
|
5935
6031
|
if (rowRest) {
|
|
5936
6032
|
rowRest.seq = seq;
|
|
5937
6033
|
rowRest.treeIndex = index;
|
|
6034
|
+
rowRest._tIndex = _treeIndex;
|
|
5938
6035
|
} else {
|
|
5939
6036
|
const rest = {
|
|
5940
6037
|
row,
|
|
@@ -5944,6 +6041,7 @@ function updateAfterDataIndex($xeTable) {
|
|
|
5944
6041
|
$index: -1,
|
|
5945
6042
|
_index: -1,
|
|
5946
6043
|
treeIndex: -1,
|
|
6044
|
+
_tIndex: _treeIndex,
|
|
5947
6045
|
items: [],
|
|
5948
6046
|
parent: null,
|
|
5949
6047
|
level: 0,
|
|
@@ -5955,6 +6053,7 @@ function updateAfterDataIndex($xeTable) {
|
|
|
5955
6053
|
fullAllDataRowIdData[rowid] = rest;
|
|
5956
6054
|
fullDataRowIdData[rowid] = rest;
|
|
5957
6055
|
}
|
|
6056
|
+
_treeIndex++;
|
|
5958
6057
|
fullMaps[rowid] = row;
|
|
5959
6058
|
}, {
|
|
5960
6059
|
children: transform ? treeOpts.mapChildrenField : childrenField
|
|
@@ -7658,6 +7757,10 @@ function removeFooterMerges($xeTable, merges) {
|
|
|
7658
7757
|
return rest;
|
|
7659
7758
|
}
|
|
7660
7759
|
function handleSortEvent($xeTable, evnt, sortConfs, isUpdate) {
|
|
7760
|
+
const internalData = $xeTable;
|
|
7761
|
+
const {
|
|
7762
|
+
tableFullColumn
|
|
7763
|
+
} = internalData;
|
|
7661
7764
|
const sortOpts = $xeTable.computeSortOpts;
|
|
7662
7765
|
const {
|
|
7663
7766
|
multiple,
|
|
@@ -7668,10 +7771,16 @@ function handleSortEvent($xeTable, evnt, sortConfs, isUpdate) {
|
|
|
7668
7771
|
sortConfs = [sortConfs];
|
|
7669
7772
|
}
|
|
7670
7773
|
if (sortConfs && sortConfs.length) {
|
|
7774
|
+
const orderActiveMaps = {};
|
|
7671
7775
|
if (!multiple) {
|
|
7672
7776
|
sortConfs = [sortConfs[0]];
|
|
7673
|
-
|
|
7777
|
+
tableFullColumn.forEach(column => {
|
|
7778
|
+
if (column.order) {
|
|
7779
|
+
orderActiveMaps[column.id] = column;
|
|
7780
|
+
}
|
|
7781
|
+
});
|
|
7674
7782
|
}
|
|
7783
|
+
const sortColMpps = {};
|
|
7675
7784
|
let firstColumn = null;
|
|
7676
7785
|
sortConfs.forEach((confs, index) => {
|
|
7677
7786
|
let {
|
|
@@ -7693,8 +7802,16 @@ function handleSortEvent($xeTable, evnt, sortConfs, isUpdate) {
|
|
|
7693
7802
|
column.order = order;
|
|
7694
7803
|
}
|
|
7695
7804
|
column.sortTime = Date.now() + index;
|
|
7805
|
+
sortColMpps[column.id] = column;
|
|
7696
7806
|
}
|
|
7697
7807
|
});
|
|
7808
|
+
if (!multiple) {
|
|
7809
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(orderActiveMaps, (oaCol, oaId) => {
|
|
7810
|
+
if (!sortColMpps[oaId]) {
|
|
7811
|
+
oaCol.order = null;
|
|
7812
|
+
}
|
|
7813
|
+
});
|
|
7814
|
+
}
|
|
7698
7815
|
if (isUpdate) {
|
|
7699
7816
|
if (!remote) {
|
|
7700
7817
|
$xeTable.handleTableData(true);
|
|
@@ -7899,7 +8016,7 @@ const calcCellHeight = $xeTable => {
|
|
|
7899
8016
|
} = internalData;
|
|
7900
8017
|
const defaultRowHeight = $xeTable.computeDefaultRowHeight;
|
|
7901
8018
|
const el = $xeTable.$refs.refElem;
|
|
7902
|
-
if (!isAllOverflow && scrollYLoad && el) {
|
|
8019
|
+
if (!isAllOverflow && (scrollYLoad || scrollXLoad) && el) {
|
|
7903
8020
|
const {
|
|
7904
8021
|
handleGetRowId
|
|
7905
8022
|
} = createHandleGetRowId($xeTable);
|
|
@@ -8438,18 +8555,18 @@ function handleUpdateAggValues($xeTable) {
|
|
|
8438
8555
|
}
|
|
8439
8556
|
function handleUpdateRowGroup($xeTable, groupFields) {
|
|
8440
8557
|
const reactData = $xeTable;
|
|
8441
|
-
const
|
|
8442
|
-
const
|
|
8558
|
+
const aggGroupFields = [];
|
|
8559
|
+
const aggGroupConfs = [];
|
|
8443
8560
|
if (groupFields) {
|
|
8444
8561
|
(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(groupFields) ? groupFields : [groupFields]).forEach(field => {
|
|
8445
|
-
|
|
8446
|
-
|
|
8562
|
+
aggGroupFields.push(field);
|
|
8563
|
+
aggGroupConfs.push({
|
|
8447
8564
|
field
|
|
8448
8565
|
});
|
|
8449
8566
|
});
|
|
8450
8567
|
}
|
|
8451
|
-
reactData.rowGroupList =
|
|
8452
|
-
reactData.aggHandleFields =
|
|
8568
|
+
reactData.rowGroupList = aggGroupConfs;
|
|
8569
|
+
reactData.aggHandleFields = aggGroupFields;
|
|
8453
8570
|
handleUpdateAggValues($xeTable);
|
|
8454
8571
|
}
|
|
8455
8572
|
function handleeGroupSummary($xeTable, aggList) {
|
|
@@ -8875,14 +8992,6 @@ function loadScrollXData($xeTable) {
|
|
|
8875
8992
|
}
|
|
8876
8993
|
$xeTable.closeTooltip();
|
|
8877
8994
|
}
|
|
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
8995
|
function parseColumns($xeTable, isReset) {
|
|
8887
8996
|
const props = $xeTable;
|
|
8888
8997
|
const reactData = $xeTable;
|
|
@@ -8913,7 +9022,7 @@ function parseColumns($xeTable, isReset) {
|
|
|
8913
9022
|
if (parentColumn && parentColumn.fixed) {
|
|
8914
9023
|
column.fixed = parentColumn.fixed;
|
|
8915
9024
|
}
|
|
8916
|
-
if (parentColumn && column.fixed !== parentColumn.fixed) {
|
|
9025
|
+
if (parentColumn && (column.fixed || '') !== (parentColumn.fixed || '')) {
|
|
8917
9026
|
errLog('vxe.error.groupFixed');
|
|
8918
9027
|
}
|
|
8919
9028
|
if (isColGroup) {
|
|
@@ -9021,18 +9130,48 @@ function parseColumns($xeTable, isReset) {
|
|
|
9021
9130
|
}
|
|
9022
9131
|
return $xeTable.updateFooter();
|
|
9023
9132
|
}
|
|
9024
|
-
function
|
|
9133
|
+
function initColumnHierarchy($xeTable) {
|
|
9025
9134
|
const internalData = $xeTable;
|
|
9026
9135
|
const {
|
|
9027
9136
|
collectColumn
|
|
9028
9137
|
} = internalData;
|
|
9029
|
-
|
|
9030
|
-
|
|
9138
|
+
const fullColIdData = {};
|
|
9139
|
+
const fullColFieldData = {};
|
|
9140
|
+
let sortIndex = 1;
|
|
9141
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(collectColumn, (column, index, items, path, parentColumn) => {
|
|
9142
|
+
const {
|
|
9143
|
+
id: colid,
|
|
9144
|
+
field
|
|
9145
|
+
} = column;
|
|
9146
|
+
const parentId = parentColumn ? parentColumn.id : null;
|
|
9147
|
+
const rest = {
|
|
9148
|
+
$index: -1,
|
|
9149
|
+
_index: -1,
|
|
9150
|
+
column,
|
|
9151
|
+
colid,
|
|
9152
|
+
index,
|
|
9153
|
+
items,
|
|
9154
|
+
parent: parentColumn || null,
|
|
9155
|
+
width: 0,
|
|
9156
|
+
oLeft: 0
|
|
9157
|
+
};
|
|
9158
|
+
column.parentId = parentId;
|
|
9159
|
+
column.defaultParentId = parentId;
|
|
9031
9160
|
column.sortNumber = sortIndex;
|
|
9032
9161
|
column.renderSortNumber = sortIndex;
|
|
9162
|
+
sortIndex++;
|
|
9163
|
+
if (field) {
|
|
9164
|
+
if (fullColFieldData[field]) {
|
|
9165
|
+
errLog('vxe.error.colRepet', ['field', field]);
|
|
9166
|
+
}
|
|
9167
|
+
fullColFieldData[field] = rest;
|
|
9168
|
+
}
|
|
9169
|
+
fullColIdData[colid] = rest;
|
|
9033
9170
|
});
|
|
9171
|
+
internalData.fullColumnIdData = fullColIdData;
|
|
9172
|
+
internalData.fullColumnFieldData = fullColFieldData;
|
|
9034
9173
|
}
|
|
9035
|
-
function
|
|
9174
|
+
function handleInitColumn($xeTable, collectColumn) {
|
|
9036
9175
|
const $xeToolbar = $xeTable.$refs.$xeToolbar;
|
|
9037
9176
|
const reactData = $xeTable;
|
|
9038
9177
|
const internalData = $xeTable;
|
|
@@ -9041,7 +9180,7 @@ function handleColumn($xeTable, collectColumn) {
|
|
|
9041
9180
|
const tableFullColumn = getColumnList(collectColumn);
|
|
9042
9181
|
internalData.tableFullColumn = tableFullColumn;
|
|
9043
9182
|
reactData.isColLoading = true;
|
|
9044
|
-
|
|
9183
|
+
initColumnHierarchy($xeTable);
|
|
9045
9184
|
return Promise.resolve(restoreCustomStorage($xeTable)).then(() => {
|
|
9046
9185
|
const {
|
|
9047
9186
|
scrollXLoad,
|
|
@@ -9768,7 +9907,7 @@ const Methods = {
|
|
|
9768
9907
|
const collectColumn = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().mapTree(columns, column => cell.createColumn($xeTable, column), {
|
|
9769
9908
|
children: 'children'
|
|
9770
9909
|
});
|
|
9771
|
-
return
|
|
9910
|
+
return handleInitColumn($xeTable, collectColumn).then(() => {
|
|
9772
9911
|
let targetScrollLeft = lastScrollLeft;
|
|
9773
9912
|
let targetScrollTop = lastScrollTop;
|
|
9774
9913
|
const virtualXOpts = $xeTable.computeVirtualXOpts;
|
|
@@ -9793,9 +9932,9 @@ const Methods = {
|
|
|
9793
9932
|
return this.loadColumn(columns);
|
|
9794
9933
|
});
|
|
9795
9934
|
},
|
|
9796
|
-
|
|
9935
|
+
handleInitColumn(collectColumn) {
|
|
9797
9936
|
const $xeTable = this;
|
|
9798
|
-
return
|
|
9937
|
+
return handleInitColumn($xeTable, collectColumn);
|
|
9799
9938
|
},
|
|
9800
9939
|
/**
|
|
9801
9940
|
* 更新数据行的 Map
|
|
@@ -9836,6 +9975,7 @@ const Methods = {
|
|
|
9836
9975
|
_index: -1,
|
|
9837
9976
|
$index: -1,
|
|
9838
9977
|
treeIndex: index,
|
|
9978
|
+
_tIndex: -1,
|
|
9839
9979
|
items,
|
|
9840
9980
|
parent: parentRow,
|
|
9841
9981
|
level,
|
|
@@ -9979,6 +10119,7 @@ const Methods = {
|
|
|
9979
10119
|
_index: -1,
|
|
9980
10120
|
$index: -1,
|
|
9981
10121
|
treeIndex: -1,
|
|
10122
|
+
_tIndex: -1,
|
|
9982
10123
|
items,
|
|
9983
10124
|
parent: parentRow,
|
|
9984
10125
|
level: parentLevel + nodes.length,
|
|
@@ -11104,8 +11245,9 @@ const Methods = {
|
|
|
11104
11245
|
const isCustomResizable = hangleStorageDefaultValue(storageOpts.resizable, isAllCustom);
|
|
11105
11246
|
const isCustomVisible = hangleStorageDefaultValue(storageOpts.visible, isAllCustom);
|
|
11106
11247
|
const isCustomFixed = hangleStorageDefaultValue(storageOpts.fixed, isAllCustom);
|
|
11248
|
+
const isCustomAggGroup = hangleStorageDefaultValue(storageOpts.aggGroup, isAllCustom);
|
|
11107
11249
|
const isCustomSort = hangleStorageDefaultValue(storageOpts.sort, isAllCustom);
|
|
11108
|
-
if (storage && (customConfig ? isEnableConf(customOpts) : customOpts.enabled) && (isCustomResizable || isCustomVisible || isCustomFixed || isCustomSort)) {
|
|
11250
|
+
if (storage && (customConfig ? isEnableConf(customOpts) : customOpts.enabled) && (isCustomResizable || isCustomVisible || isCustomFixed || isCustomAggGroup || isCustomSort)) {
|
|
11109
11251
|
if (!tableId) {
|
|
11110
11252
|
errLog('vxe.error.reqProp', ['id']);
|
|
11111
11253
|
return;
|
|
@@ -11131,12 +11273,18 @@ const Methods = {
|
|
|
11131
11273
|
getCustomStoreData() {
|
|
11132
11274
|
const $xeTable = this;
|
|
11133
11275
|
const props = $xeTable;
|
|
11276
|
+
const reactData = $xeTable;
|
|
11134
11277
|
const internalData = $xeTable;
|
|
11135
11278
|
const {
|
|
11136
11279
|
id
|
|
11137
11280
|
} = props;
|
|
11138
11281
|
const customOpts = $xeTable.computeCustomOpts;
|
|
11139
11282
|
const {
|
|
11283
|
+
isRowGroupStatus,
|
|
11284
|
+
rowGroupList
|
|
11285
|
+
} = reactData;
|
|
11286
|
+
const {
|
|
11287
|
+
fullColumnFieldData,
|
|
11140
11288
|
collectColumn
|
|
11141
11289
|
} = internalData;
|
|
11142
11290
|
const {
|
|
@@ -11150,17 +11298,20 @@ const Methods = {
|
|
|
11150
11298
|
const isCustomVisible = hangleStorageDefaultValue(storageOpts.visible, isAllCustom);
|
|
11151
11299
|
const isCustomFixed = hangleStorageDefaultValue(storageOpts.fixed, isAllCustom);
|
|
11152
11300
|
const isCustomSort = hangleStorageDefaultValue(storageOpts.sort, isAllCustom);
|
|
11301
|
+
const isCustomAggGroup = hangleStorageDefaultValue(storageOpts.aggGroup, isAllCustom);
|
|
11153
11302
|
const isCustomAggFunc = hangleStorageDefaultValue(storageOpts.aggFunc, isAllCustom);
|
|
11154
11303
|
const resizableData = {};
|
|
11155
|
-
const sortData =
|
|
11304
|
+
const sortData = [];
|
|
11156
11305
|
const visibleData = {};
|
|
11157
11306
|
const fixedData = {};
|
|
11307
|
+
const aggGroupData = {};
|
|
11158
11308
|
const aggFuncData = {};
|
|
11159
11309
|
const storeData = {
|
|
11160
11310
|
resizableData: undefined,
|
|
11161
11311
|
sortData: undefined,
|
|
11162
11312
|
visibleData: undefined,
|
|
11163
11313
|
fixedData: undefined,
|
|
11314
|
+
aggGroupData: undefined,
|
|
11164
11315
|
aggFuncData: undefined
|
|
11165
11316
|
};
|
|
11166
11317
|
if (!id) {
|
|
@@ -11174,19 +11325,40 @@ const Methods = {
|
|
|
11174
11325
|
let hasFixed = 0;
|
|
11175
11326
|
let hasVisible = 0;
|
|
11176
11327
|
let hasAggFunc = 0;
|
|
11328
|
+
const sortMaps = {};
|
|
11177
11329
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(collectColumn, (column, index, items, path, parentColumn) => {
|
|
11178
11330
|
const colKey = column.getKey();
|
|
11179
11331
|
if (!colKey) {
|
|
11180
11332
|
errLog('vxe.error.reqProp', [`${column.getTitle() || column.type || ''} -> column.field=?`]);
|
|
11181
11333
|
return;
|
|
11182
11334
|
}
|
|
11183
|
-
|
|
11184
|
-
if (!parentColumn) {
|
|
11335
|
+
if (parentColumn) {
|
|
11185
11336
|
if (isCustomSort) {
|
|
11337
|
+
const pColKey = parentColumn.getKey();
|
|
11338
|
+
const psObj = sortMaps[pColKey];
|
|
11186
11339
|
hasSort = 1;
|
|
11187
|
-
|
|
11340
|
+
if (psObj) {
|
|
11341
|
+
const sObj = {
|
|
11342
|
+
k: colKey
|
|
11343
|
+
};
|
|
11344
|
+
sortMaps[colKey] = sObj;
|
|
11345
|
+
if (!psObj.c) {
|
|
11346
|
+
psObj.c = [];
|
|
11347
|
+
}
|
|
11348
|
+
psObj.c.push(sObj);
|
|
11349
|
+
}
|
|
11350
|
+
}
|
|
11351
|
+
} else {
|
|
11352
|
+
if (isCustomSort) {
|
|
11353
|
+
hasSort = 1;
|
|
11354
|
+
const sObj = {
|
|
11355
|
+
k: colKey
|
|
11356
|
+
};
|
|
11357
|
+
sortMaps[colKey] = sObj;
|
|
11358
|
+
sortData.push(sObj);
|
|
11188
11359
|
}
|
|
11189
|
-
|
|
11360
|
+
// 只支持一级
|
|
11361
|
+
if (isCustomFixed && (column.fixed || '') !== (column.defaultFixed || '')) {
|
|
11190
11362
|
hasFixed = 1;
|
|
11191
11363
|
fixedData[colKey] = column.fixed;
|
|
11192
11364
|
}
|
|
@@ -11207,7 +11379,7 @@ const Methods = {
|
|
|
11207
11379
|
visibleData[colKey] = true;
|
|
11208
11380
|
}
|
|
11209
11381
|
}
|
|
11210
|
-
if (isCustomAggFunc && column.aggFunc !== column.defaultAggFunc) {
|
|
11382
|
+
if (isCustomAggFunc && (column.aggFunc || '') !== (column.defaultAggFunc || '')) {
|
|
11211
11383
|
hasAggFunc = 1;
|
|
11212
11384
|
aggFuncData[colKey] = column.aggFunc;
|
|
11213
11385
|
}
|
|
@@ -11224,6 +11396,15 @@ const Methods = {
|
|
|
11224
11396
|
if (hasVisible) {
|
|
11225
11397
|
storeData.visibleData = visibleData;
|
|
11226
11398
|
}
|
|
11399
|
+
if (isCustomAggGroup && isRowGroupStatus) {
|
|
11400
|
+
rowGroupList.forEach(aggConf => {
|
|
11401
|
+
const colRest = fullColumnFieldData[aggConf.field];
|
|
11402
|
+
if (colRest) {
|
|
11403
|
+
aggGroupData[colRest.column.getKey()] = true;
|
|
11404
|
+
}
|
|
11405
|
+
});
|
|
11406
|
+
storeData.aggGroupData = aggGroupData;
|
|
11407
|
+
}
|
|
11227
11408
|
if (hasAggFunc) {
|
|
11228
11409
|
storeData.aggFuncData = aggFuncData;
|
|
11229
11410
|
}
|
|
@@ -11249,11 +11430,12 @@ const Methods = {
|
|
|
11249
11430
|
const isCustomVisible = hangleStorageDefaultValue(storageOpts.visible, isAllCustom);
|
|
11250
11431
|
const isCustomFixed = hangleStorageDefaultValue(storageOpts.fixed, isAllCustom);
|
|
11251
11432
|
const isCustomSort = hangleStorageDefaultValue(storageOpts.sort, isAllCustom);
|
|
11433
|
+
const isCustomAggGroup = hangleStorageDefaultValue(storageOpts.aggGroup, isAllCustom);
|
|
11252
11434
|
const isCustomAggFunc = hangleStorageDefaultValue(storageOpts.aggFunc, isAllCustom);
|
|
11253
11435
|
if (type !== 'reset') {
|
|
11254
11436
|
reactData.isCustomStatus = true;
|
|
11255
11437
|
}
|
|
11256
|
-
if (storage && (customConfig ? isEnableConf(customOpts) : customOpts.enabled) && (isCustomResizable || isCustomVisible || isCustomFixed || isCustomSort || isCustomAggFunc)) {
|
|
11438
|
+
if (storage && (customConfig ? isEnableConf(customOpts) : customOpts.enabled) && (isCustomResizable || isCustomVisible || isCustomFixed || isCustomSort || isCustomAggGroup || isCustomAggFunc)) {
|
|
11257
11439
|
if (!tableId) {
|
|
11258
11440
|
errLog('vxe.error.reqProp', ['id']);
|
|
11259
11441
|
return this.$nextTick();
|
|
@@ -11262,7 +11444,9 @@ const Methods = {
|
|
|
11262
11444
|
resizableData: {},
|
|
11263
11445
|
sortData: {},
|
|
11264
11446
|
visibleData: {},
|
|
11265
|
-
fixedData: {}
|
|
11447
|
+
fixedData: {},
|
|
11448
|
+
aggGroupData: {},
|
|
11449
|
+
aggFuncData: {}
|
|
11266
11450
|
} : this.getCustomStoreData();
|
|
11267
11451
|
if (updateStore) {
|
|
11268
11452
|
return updateStore({
|
|
@@ -15416,9 +15600,9 @@ const Methods = {
|
|
|
15416
15600
|
const $xeTable = this;
|
|
15417
15601
|
return handleSortEvent($xeTable, null, sortConfs, isUpdate);
|
|
15418
15602
|
},
|
|
15419
|
-
setSortByEvent(evnt, sortConfs
|
|
15603
|
+
setSortByEvent(evnt, sortConfs) {
|
|
15420
15604
|
const $xeTable = this;
|
|
15421
|
-
return handleSortEvent($xeTable, evnt, sortConfs,
|
|
15605
|
+
return handleSortEvent($xeTable, evnt, sortConfs, true);
|
|
15422
15606
|
},
|
|
15423
15607
|
/**
|
|
15424
15608
|
* 清空指定列的排序条件
|
|
@@ -15451,6 +15635,9 @@ const Methods = {
|
|
|
15451
15635
|
tableFullColumn
|
|
15452
15636
|
} = internalData;
|
|
15453
15637
|
const sortOpts = $xeTable.computeSortOpts;
|
|
15638
|
+
const {
|
|
15639
|
+
multiple
|
|
15640
|
+
} = sortOpts;
|
|
15454
15641
|
const sortCols = [];
|
|
15455
15642
|
let column = null;
|
|
15456
15643
|
if (evnt) {
|
|
@@ -15470,7 +15657,13 @@ const Methods = {
|
|
|
15470
15657
|
if (!sortOpts.remote) {
|
|
15471
15658
|
$xeTable.handleTableData(true);
|
|
15472
15659
|
}
|
|
15473
|
-
if (
|
|
15660
|
+
if (!multiple) {
|
|
15661
|
+
column = sortCols[0];
|
|
15662
|
+
}
|
|
15663
|
+
if (column) {
|
|
15664
|
+
$xeTable.handleColumnSortEvent(evnt, column);
|
|
15665
|
+
}
|
|
15666
|
+
if (multiple && sortCols.length) {
|
|
15474
15667
|
const params = {
|
|
15475
15668
|
$table: $xeTable,
|
|
15476
15669
|
$event: evnt,
|
|
@@ -15478,8 +15671,6 @@ const Methods = {
|
|
|
15478
15671
|
sortList: []
|
|
15479
15672
|
};
|
|
15480
15673
|
$xeTable.dispatchEvent('clear-all-sort', params, evnt);
|
|
15481
|
-
} else if (column) {
|
|
15482
|
-
$xeTable.handleColumnSortEvent(evnt, column);
|
|
15483
15674
|
}
|
|
15484
15675
|
}
|
|
15485
15676
|
return $xeTable.$nextTick().then(() => {
|
|
@@ -15525,22 +15716,12 @@ const Methods = {
|
|
|
15525
15716
|
}
|
|
15526
15717
|
return sortList;
|
|
15527
15718
|
},
|
|
15528
|
-
setFilterByEvent(evnt, fieldOrColumn, options
|
|
15719
|
+
setFilterByEvent(evnt, fieldOrColumn, options) {
|
|
15529
15720
|
const $xeTable = this;
|
|
15530
|
-
const reactData = $xeTable;
|
|
15531
|
-
const {
|
|
15532
|
-
filterStore
|
|
15533
|
-
} = reactData;
|
|
15534
15721
|
const column = handleFieldOrColumn($xeTable, fieldOrColumn);
|
|
15535
15722
|
if (column && column.filters) {
|
|
15536
15723
|
column.filters = toFilters(options || []);
|
|
15537
|
-
|
|
15538
|
-
return $xeTable.handleColumnConfirmFilter(column, evnt);
|
|
15539
|
-
} else {
|
|
15540
|
-
if (filterStore.visible) {
|
|
15541
|
-
$xeTable.handleFilterOptions(column);
|
|
15542
|
-
}
|
|
15543
|
-
}
|
|
15724
|
+
return $xeTable.handleColumnConfirmFilter(column, evnt);
|
|
15544
15725
|
}
|
|
15545
15726
|
return $xeTable.$nextTick();
|
|
15546
15727
|
},
|
|
@@ -15599,6 +15780,9 @@ const Methods = {
|
|
|
15599
15780
|
tableFullColumn
|
|
15600
15781
|
} = internalData;
|
|
15601
15782
|
const filterOpts = $xeTable.computeFilterOpts;
|
|
15783
|
+
const {
|
|
15784
|
+
multiple
|
|
15785
|
+
} = filterOpts;
|
|
15602
15786
|
const filterCols = [];
|
|
15603
15787
|
let column = null;
|
|
15604
15788
|
if (fieldOrColumn) {
|
|
@@ -15628,7 +15812,34 @@ const Methods = {
|
|
|
15628
15812
|
if (!filterOpts.remote) {
|
|
15629
15813
|
$xeTable.updateData();
|
|
15630
15814
|
}
|
|
15631
|
-
if (
|
|
15815
|
+
if (!multiple) {
|
|
15816
|
+
column = filterCols[0];
|
|
15817
|
+
}
|
|
15818
|
+
if (column) {
|
|
15819
|
+
const filterList = () => $xeTable.getCheckedFilters();
|
|
15820
|
+
const values = [];
|
|
15821
|
+
const datas = [];
|
|
15822
|
+
column.filters.forEach(item => {
|
|
15823
|
+
if (item.checked) {
|
|
15824
|
+
values.push(item.value);
|
|
15825
|
+
datas.push(item.data);
|
|
15826
|
+
}
|
|
15827
|
+
});
|
|
15828
|
+
const params = {
|
|
15829
|
+
$table: $xeTable,
|
|
15830
|
+
$event: evnt,
|
|
15831
|
+
column,
|
|
15832
|
+
field: column.field,
|
|
15833
|
+
property: column.field,
|
|
15834
|
+
values,
|
|
15835
|
+
datas,
|
|
15836
|
+
filters: filterList,
|
|
15837
|
+
filterList
|
|
15838
|
+
};
|
|
15839
|
+
$xeTable.dispatchEvent('filter-change', params, evnt);
|
|
15840
|
+
$xeTable.dispatchEvent('clear-filter', params, evnt);
|
|
15841
|
+
}
|
|
15842
|
+
if (multiple && filterCols.length) {
|
|
15632
15843
|
const params = {
|
|
15633
15844
|
$table: $xeTable,
|
|
15634
15845
|
$event: evnt,
|
|
@@ -15636,10 +15847,6 @@ const Methods = {
|
|
|
15636
15847
|
filterList: []
|
|
15637
15848
|
};
|
|
15638
15849
|
$xeTable.dispatchEvent('clear-all-filter', params, evnt);
|
|
15639
|
-
} else if (column) {
|
|
15640
|
-
$xeTable.dispatchEvent('clear-filter', {
|
|
15641
|
-
filterList: () => $xeTable.getCheckedFilters()
|
|
15642
|
-
}, evnt);
|
|
15643
15850
|
}
|
|
15644
15851
|
return $xeTable.$nextTick();
|
|
15645
15852
|
},
|
|
@@ -17681,7 +17888,7 @@ const Methods = {
|
|
|
17681
17888
|
}
|
|
17682
17889
|
};
|
|
17683
17890
|
// Module methods
|
|
17684
|
-
const funcs = 'setFilter,openFilter,clearFilter,saveFilterPanel,saveFilterPanelByEvent,resetFilterPanel,resetFilterPanelByEvent,getCheckedFilters,updateFilterOptionStatus,closeMenu,setActiveCellArea,getActiveCellArea,getCellAreas,clearCellAreas,copyCellArea,cutCellArea,pasteCellArea,getCopyCellArea,getCopyCellAreas,clearCopyCellArea,setCellAreas,openFNR,openFind,openReplace,closeFNR,getSelectedCell,clearSelected,insert,insertAt,insertNextAt,insertChild,insertChildAt,insertChildNextAt,remove,removeCheckboxRow,removeRadioRow,removeCurrentRow,getRecordset,getInsertRecords,getRemoveRecords,getUpdateRecords,clearEdit,clearActived,getEditRecord,getEditCell,getActiveRecord,isEditByRow,isActiveByRow,setEditRow,setActiveRow,setEditCell,setActiveCell,setSelectCell,clearValidate,fullValidate,validate,fullValidateField,validateField,openExport,closeExport,openPrint,closePrint,getPrintHtml,exportData,openImport,closeImport,importData,saveFile,readFile,importByFile,print,openCustom,closeCustom,toggleCustom,saveCustom,cancelCustom,resetCustom,toggleCustomAllCheckbox,setCustomAllCheckbox'.split(',');
|
|
17891
|
+
const funcs = 'setFilter,openFilter,clearFilter,saveFilterPanel,saveFilterPanelByEvent,resetFilterPanel,resetFilterPanelByEvent,getCheckedFilters,updateFilterOptionStatus,closeMenu,setActiveCellArea,getActiveCellArea,getCellAreas,clearCellAreas,copyCellArea,cutCellArea,pasteCellArea,getCopyCellArea,getCopyCellAreas,clearCopyCellArea,setCellAreas,openFNR,openFind,openReplace,closeFNR,getSelectedCell,clearSelected,insert,insertAt,insertNextAt,insertChild,insertChildAt,insertChildNextAt,remove,removeCheckboxRow,removeRadioRow,removeCurrentRow,getRecordset,getInsertRecords,getRemoveRecords,getUpdateRecords,clearEdit,clearActived,getEditRecord,getEditCell,getActiveRecord,isEditByRow,isActiveByRow,setEditRow,setActiveRow,setEditCell,setActiveCell,setSelectCell,clearValidate,fullValidate,validate,fullValidateField,validateField,openExport,closeExport,openPrint,closePrint,getPrintHtml,exportData,openImport,closeImport,importData,saveFile,readFile,importByFile,print,getCustomVisible,openCustom,closeCustom,toggleCustom,saveCustom,cancelCustom,resetCustom,toggleCustomAllCheckbox,setCustomAllCheckbox'.split(',');
|
|
17685
17892
|
funcs.forEach(name => {
|
|
17686
17893
|
Methods[name] = function (...args) {
|
|
17687
17894
|
if (!this[`_${name}`]) {
|
|
@@ -18034,7 +18241,7 @@ function renderTdColumn(h, $xeTable, seq, rowid, fixedType, isOptimizeMode, rowL
|
|
|
18034
18241
|
if (!fixedHiddenColumn && editConfig && (editRender || cellRender) && (editOpts.showStatus || editOpts.showUpdateStatus)) {
|
|
18035
18242
|
isDirty = $xeTable.isUpdateByRow(row, column.field);
|
|
18036
18243
|
}
|
|
18037
|
-
const isVNAutoHeight =
|
|
18244
|
+
const isVNAutoHeight = !hasEllipsis && (scrollYLoad || scrollXLoad);
|
|
18038
18245
|
let cellHeight = getCellRestHeight(rowRest, cellOpts, rowOpts, defaultRowHeight);
|
|
18039
18246
|
const isLastColumn = $columnIndex === columns.length - 1;
|
|
18040
18247
|
const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto');
|
|
@@ -18070,7 +18277,7 @@ function renderTdColumn(h, $xeTable, seq, rowid, fixedType, isOptimizeMode, rowL
|
|
|
18070
18277
|
}
|
|
18071
18278
|
tcStyle.width = `${column.renderWidth + mergeColWidth - cellOffsetWidth}px`;
|
|
18072
18279
|
}
|
|
18073
|
-
if (scrollYLoad || hasEllipsis || isCsHeight || isRsHeight) {
|
|
18280
|
+
if (scrollYLoad || scrollXLoad || hasEllipsis || isCsHeight || isRsHeight) {
|
|
18074
18281
|
tcStyle.height = `${cellHeight}px`;
|
|
18075
18282
|
} else {
|
|
18076
18283
|
tcStyle.minHeight = `${cellHeight}px`;
|
|
@@ -18262,14 +18469,15 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
|
|
|
18262
18469
|
};
|
|
18263
18470
|
}
|
|
18264
18471
|
if (rowRest) {
|
|
18472
|
+
rowIndex = rowRest.index;
|
|
18473
|
+
_rowIndex = rowRest._index;
|
|
18265
18474
|
rowLevel = rowRest.level;
|
|
18475
|
+
seq = rowRest.seq;
|
|
18266
18476
|
if (hasRowGroupAggregate || treeConfig && transform && seqMode === 'increasing') {
|
|
18267
18477
|
seq = rowRest._index + 1;
|
|
18268
|
-
} else {
|
|
18269
|
-
seq = rowRest.
|
|
18478
|
+
} else if (treeConfig && seqMode === 'fixed') {
|
|
18479
|
+
seq = rowRest._tIndex + 1;
|
|
18270
18480
|
}
|
|
18271
|
-
rowIndex = rowRest.index;
|
|
18272
|
-
_rowIndex = rowRest._index;
|
|
18273
18481
|
}
|
|
18274
18482
|
const params = {
|
|
18275
18483
|
$table: $xeTable,
|
|
@@ -20861,7 +21069,7 @@ const renderPopupPanel = (h, $xeTableCustomPanel) => {
|
|
|
20861
21069
|
}
|
|
20862
21070
|
}
|
|
20863
21071
|
}
|
|
20864
|
-
if (
|
|
21072
|
+
if (targetFixed !== null) {
|
|
20865
21073
|
$xeTable.dispatchEvent('custom-fixed-change', {
|
|
20866
21074
|
column,
|
|
20867
21075
|
fixed: targetFixed
|
|
@@ -23186,6 +23394,7 @@ function insertTreeRow($xeTable, newRecords, isAppend) {
|
|
|
23186
23394
|
_index: -1,
|
|
23187
23395
|
$index: -1,
|
|
23188
23396
|
treeIndex: -1,
|
|
23397
|
+
_tIndex: -1,
|
|
23189
23398
|
items: parentChilds,
|
|
23190
23399
|
parent: parentRow,
|
|
23191
23400
|
level: parentLevel + 1,
|
|
@@ -23210,6 +23419,7 @@ function insertTreeRow($xeTable, newRecords, isAppend) {
|
|
|
23210
23419
|
_index: -1,
|
|
23211
23420
|
$index: -1,
|
|
23212
23421
|
treeIndex: -1,
|
|
23422
|
+
_tIndex: -1,
|
|
23213
23423
|
items: tableFullTreeData,
|
|
23214
23424
|
parent: null,
|
|
23215
23425
|
level: 0,
|
|
@@ -23280,6 +23490,7 @@ function handleInsertRowAt($xeTable, records, targetRow, isInsertNextRow) {
|
|
|
23280
23490
|
_index: -1,
|
|
23281
23491
|
$index: -1,
|
|
23282
23492
|
treeIndex: -1,
|
|
23493
|
+
_tIndex: -1,
|
|
23283
23494
|
items: afterFullData,
|
|
23284
23495
|
parent: null,
|
|
23285
23496
|
level: 0,
|
|
@@ -23326,6 +23537,7 @@ function handleInsertRowAt($xeTable, records, targetRow, isInsertNextRow) {
|
|
|
23326
23537
|
_index: -1,
|
|
23327
23538
|
$index: -1,
|
|
23328
23539
|
treeIndex: -1,
|
|
23540
|
+
_tIndex: -1,
|
|
23329
23541
|
items: afterFullData,
|
|
23330
23542
|
parent: null,
|
|
23331
23543
|
level: 0,
|
|
@@ -23376,6 +23588,7 @@ function handleInsertRowAt($xeTable, records, targetRow, isInsertNextRow) {
|
|
|
23376
23588
|
_index: -1,
|
|
23377
23589
|
$index: -1,
|
|
23378
23590
|
treeIndex: -1,
|
|
23591
|
+
_tIndex: -1,
|
|
23379
23592
|
items: parentMapChilds,
|
|
23380
23593
|
parent: parentRow,
|
|
23381
23594
|
level: parentLevel + 1,
|
|
@@ -27510,6 +27723,8 @@ function checkRuleStatus(rule, val) {
|
|
|
27510
27723
|
});
|
|
27511
27724
|
;// CONCATENATED MODULE: ./packages/table/module/custom/mixin.ts
|
|
27512
27725
|
|
|
27726
|
+
|
|
27727
|
+
|
|
27513
27728
|
function calcMaxHeight($xeTable) {
|
|
27514
27729
|
const reactData = $xeTable;
|
|
27515
27730
|
const {
|
|
@@ -27532,6 +27747,14 @@ function emitCustomEvent($xeTable, type, evnt) {
|
|
|
27532
27747
|
}
|
|
27533
27748
|
/* harmony default export */ var custom_mixin = ({
|
|
27534
27749
|
methods: {
|
|
27750
|
+
_getCustomVisible() {
|
|
27751
|
+
const $xeTable = this;
|
|
27752
|
+
const reactData = $xeTable;
|
|
27753
|
+
const {
|
|
27754
|
+
customStore
|
|
27755
|
+
} = reactData;
|
|
27756
|
+
return customStore.visible;
|
|
27757
|
+
},
|
|
27535
27758
|
_openCustom() {
|
|
27536
27759
|
const $xeTable = this;
|
|
27537
27760
|
const reactData = $xeTable;
|
|
@@ -27575,6 +27798,7 @@ function emitCustomEvent($xeTable, type, evnt) {
|
|
|
27575
27798
|
_saveCustom() {
|
|
27576
27799
|
const $xeTable = this;
|
|
27577
27800
|
const reactData = $xeTable;
|
|
27801
|
+
const internalData = $xeTable;
|
|
27578
27802
|
const {
|
|
27579
27803
|
customColumnList,
|
|
27580
27804
|
aggHandleFields,
|
|
@@ -27618,21 +27842,23 @@ function emitCustomEvent($xeTable, type, evnt) {
|
|
|
27618
27842
|
}
|
|
27619
27843
|
});
|
|
27620
27844
|
reactData.isCustomStatus = true;
|
|
27621
|
-
|
|
27622
|
-
if (
|
|
27623
|
-
|
|
27624
|
-
|
|
27625
|
-
|
|
27626
|
-
$xeTable.setRowGroups(aggHandleFields);
|
|
27627
|
-
} else {
|
|
27628
|
-
$xeTable.clearRowGroups();
|
|
27629
|
-
}
|
|
27845
|
+
if (allowGroup && allowValues && !!$xeTable.handlePivotTableAggregateData) {
|
|
27846
|
+
if (rowGroupList.length !== aggHandleFields.length || rowGroupList.some((conf, i) => conf.field !== aggHandleFields[i])) {
|
|
27847
|
+
// 更新数据分组
|
|
27848
|
+
if (aggHandleFields.length) {
|
|
27849
|
+
$xeTable.setRowGroups(aggHandleFields);
|
|
27630
27850
|
} else {
|
|
27631
|
-
|
|
27632
|
-
$xeTable.handleUpdateAggData();
|
|
27851
|
+
$xeTable.clearRowGroups();
|
|
27633
27852
|
}
|
|
27853
|
+
} else if (allowValues) {
|
|
27854
|
+
// 更新聚合函数
|
|
27855
|
+
$xeTable.handleUpdateAggData();
|
|
27634
27856
|
}
|
|
27635
|
-
}
|
|
27857
|
+
}
|
|
27858
|
+
if (allowSort) {
|
|
27859
|
+
internalData.collectColumn = customColumnList;
|
|
27860
|
+
}
|
|
27861
|
+
return $xeTable.saveCustomStore('confirm');
|
|
27636
27862
|
},
|
|
27637
27863
|
_cancelCustom() {
|
|
27638
27864
|
const $xeTable = this;
|
|
@@ -27697,6 +27923,7 @@ function emitCustomEvent($xeTable, type, evnt) {
|
|
|
27697
27923
|
sort: options === true,
|
|
27698
27924
|
aggFunc: options === true
|
|
27699
27925
|
}, options);
|
|
27926
|
+
const allCols = [];
|
|
27700
27927
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(collectColumn, column => {
|
|
27701
27928
|
if (opts.resizable) {
|
|
27702
27929
|
column.resizeWidth = 0;
|
|
@@ -27706,6 +27933,7 @@ function emitCustomEvent($xeTable, type, evnt) {
|
|
|
27706
27933
|
}
|
|
27707
27934
|
if (opts.sort) {
|
|
27708
27935
|
column.renderSortNumber = column.sortNumber;
|
|
27936
|
+
column.parentId = column.defaultParentId;
|
|
27709
27937
|
}
|
|
27710
27938
|
if (!checkMethod || checkMethod({
|
|
27711
27939
|
$table: $xeTable,
|
|
@@ -27718,9 +27946,18 @@ function emitCustomEvent($xeTable, type, evnt) {
|
|
|
27718
27946
|
column.renderAggFn = column.defaultAggFunc;
|
|
27719
27947
|
}
|
|
27720
27948
|
column.renderResizeWidth = column.renderWidth;
|
|
27949
|
+
allCols.push(column);
|
|
27721
27950
|
});
|
|
27951
|
+
if (opts.sort) {
|
|
27952
|
+
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'), {
|
|
27953
|
+
key: 'id',
|
|
27954
|
+
parentKey: 'parentId',
|
|
27955
|
+
children: 'children'
|
|
27956
|
+
});
|
|
27957
|
+
internalData.collectColumn = newCollectCols;
|
|
27958
|
+
internalData.tableFullColumn = getColumnList(newCollectCols);
|
|
27959
|
+
}
|
|
27722
27960
|
reactData.isCustomStatus = false;
|
|
27723
|
-
$xeTable.saveCustomStore('reset');
|
|
27724
27961
|
return $xeTable.handleCustom().then(() => {
|
|
27725
27962
|
if (opts.aggFunc && $xeTable.handlePivotTableAggregateData) {
|
|
27726
27963
|
const rowGroupFields = $xeTable.computeRowGroupFields;
|
|
@@ -27734,6 +27971,7 @@ function emitCustomEvent($xeTable, type, evnt) {
|
|
|
27734
27971
|
$xeTable.handleUpdateAggData();
|
|
27735
27972
|
}
|
|
27736
27973
|
}
|
|
27974
|
+
$xeTable.saveCustomStore('reset');
|
|
27737
27975
|
});
|
|
27738
27976
|
},
|
|
27739
27977
|
_toggleCustomAllCheckbox() {
|
|
@@ -28165,15 +28403,16 @@ function renderRowExpandedVNs(h, $xeTable) {
|
|
|
28165
28403
|
let rowIndex = -1;
|
|
28166
28404
|
let $rowIndex = -1;
|
|
28167
28405
|
if (rowRest) {
|
|
28406
|
+
rowIndex = rowRest.index;
|
|
28407
|
+
$rowIndex = rowRest.$index;
|
|
28408
|
+
_rowIndex = rowRest._index;
|
|
28168
28409
|
rowLevel = rowRest.level;
|
|
28410
|
+
seq = rowRest.seq;
|
|
28169
28411
|
if (isRowGroupStatus || treeConfig && transform && seqMode === 'increasing') {
|
|
28170
28412
|
seq = rowRest._index + 1;
|
|
28171
|
-
} else {
|
|
28172
|
-
seq = rowRest.
|
|
28413
|
+
} else if (treeConfig && seqMode === 'fixed') {
|
|
28414
|
+
seq = rowRest._tIndex + 1;
|
|
28173
28415
|
}
|
|
28174
|
-
rowIndex = rowRest.index;
|
|
28175
|
-
$rowIndex = rowRest.$index;
|
|
28176
|
-
_rowIndex = rowRest._index;
|
|
28177
28416
|
}
|
|
28178
28417
|
if (expandHeight) {
|
|
28179
28418
|
cellStyle.height = `${expandHeight}px`;
|
|
@@ -28666,12 +28905,24 @@ function renderBody(h, $xeTable) {
|
|
|
28666
28905
|
computeVirtualXOpts() {
|
|
28667
28906
|
const $xeTable = this;
|
|
28668
28907
|
const props = $xeTable;
|
|
28669
|
-
|
|
28908
|
+
const {
|
|
28909
|
+
virtualXConfig
|
|
28910
|
+
} = props;
|
|
28911
|
+
if (virtualXConfig) {
|
|
28912
|
+
return Object.assign({}, table_getConfig().table.virtualXConfig, virtualXConfig);
|
|
28913
|
+
}
|
|
28914
|
+
return Object.assign({}, table_getConfig().table.virtualXConfig, table_getConfig().table.scrollX, props.scrollX);
|
|
28670
28915
|
},
|
|
28671
28916
|
computeVirtualYOpts() {
|
|
28672
28917
|
const $xeTable = this;
|
|
28673
28918
|
const props = $xeTable;
|
|
28674
|
-
|
|
28919
|
+
const {
|
|
28920
|
+
virtualYConfig
|
|
28921
|
+
} = props;
|
|
28922
|
+
if (virtualYConfig) {
|
|
28923
|
+
return Object.assign({}, table_getConfig().table.virtualYConfig, virtualYConfig);
|
|
28924
|
+
}
|
|
28925
|
+
return Object.assign({}, table_getConfig().table.virtualYConfig, table_getConfig().table.scrollY, props.scrollY);
|
|
28675
28926
|
},
|
|
28676
28927
|
computeScrollbarOpts() {
|
|
28677
28928
|
const $xeTable = this;
|
|
@@ -29249,7 +29500,7 @@ function renderBody(h, $xeTable) {
|
|
|
29249
29500
|
});
|
|
29250
29501
|
},
|
|
29251
29502
|
staticColumns(value) {
|
|
29252
|
-
this.
|
|
29503
|
+
this.$nextTick(() => this.handleInitColumn(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().clone(value)));
|
|
29253
29504
|
},
|
|
29254
29505
|
tableColumn() {
|
|
29255
29506
|
this.analyColumnWidth();
|
|
@@ -31059,9 +31310,11 @@ function getTableOns(_vm) {
|
|
|
31059
31310
|
if (proxyConfig) {
|
|
31060
31311
|
if (proxyOpts.sort) {
|
|
31061
31312
|
ons['sort-change'] = _vm.sortChangeEvent;
|
|
31313
|
+
ons['clear-all-sort'] = _vm.clearAllSortEvent;
|
|
31062
31314
|
}
|
|
31063
31315
|
if (proxyOpts.filter) {
|
|
31064
31316
|
ons['filter-change'] = _vm.filterChangeEvent;
|
|
31317
|
+
ons['clear-all-filter'] = _vm.clearAllFilterEvent;
|
|
31065
31318
|
}
|
|
31066
31319
|
}
|
|
31067
31320
|
return ons;
|
|
@@ -31330,6 +31583,14 @@ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default(
|
|
|
31330
31583
|
const pagerOpts = $xeGrid.computePagerOpts;
|
|
31331
31584
|
return pagerOpts.total;
|
|
31332
31585
|
},
|
|
31586
|
+
computePageCount() {
|
|
31587
|
+
const $xeGrid = this;
|
|
31588
|
+
const reactData = $xeGrid.reactData;
|
|
31589
|
+
const {
|
|
31590
|
+
tablePage
|
|
31591
|
+
} = reactData;
|
|
31592
|
+
return Math.max(Math.ceil(tablePage.total / tablePage.pageSize), 1);
|
|
31593
|
+
},
|
|
31333
31594
|
computeIsLoading() {
|
|
31334
31595
|
const $xeGrid = this;
|
|
31335
31596
|
const props = $xeGrid;
|
|
@@ -31419,7 +31680,7 @@ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default(
|
|
|
31419
31680
|
tablePage.pageSize = pageSize;
|
|
31420
31681
|
}
|
|
31421
31682
|
if (total) {
|
|
31422
|
-
tablePage.
|
|
31683
|
+
tablePage.total = total;
|
|
31423
31684
|
}
|
|
31424
31685
|
}
|
|
31425
31686
|
}
|
|
@@ -32160,29 +32421,71 @@ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default(
|
|
|
32160
32421
|
return $xeGrid.$nextTick();
|
|
32161
32422
|
},
|
|
32162
32423
|
homePage() {
|
|
32424
|
+
const $xeGrid = this;
|
|
32425
|
+
const reactData = $xeGrid.reactData;
|
|
32426
|
+
const {
|
|
32427
|
+
tablePage
|
|
32428
|
+
} = reactData;
|
|
32429
|
+
tablePage.currentPage = 1;
|
|
32430
|
+
return $xeGrid.$nextTick();
|
|
32431
|
+
},
|
|
32432
|
+
homePageByEvent(evnt) {
|
|
32163
32433
|
const $xeGrid = this;
|
|
32164
32434
|
const $pager = $xeGrid.$refs.refPager;
|
|
32165
32435
|
if ($pager) {
|
|
32166
|
-
|
|
32436
|
+
$pager.homePageByEvent(evnt);
|
|
32167
32437
|
}
|
|
32168
|
-
return $xeGrid.$nextTick();
|
|
32169
32438
|
},
|
|
32170
32439
|
endPage() {
|
|
32440
|
+
const $xeGrid = this;
|
|
32441
|
+
const reactData = $xeGrid.reactData;
|
|
32442
|
+
const {
|
|
32443
|
+
tablePage
|
|
32444
|
+
} = reactData;
|
|
32445
|
+
const pageCount = $xeGrid.computePageCount;
|
|
32446
|
+
tablePage.currentPage = pageCount;
|
|
32447
|
+
return $xeGrid.$nextTick();
|
|
32448
|
+
},
|
|
32449
|
+
endPageByEvent(evnt) {
|
|
32171
32450
|
const $xeGrid = this;
|
|
32172
32451
|
const $pager = $xeGrid.$refs.refPager;
|
|
32173
32452
|
if ($pager) {
|
|
32174
|
-
|
|
32453
|
+
$pager.endPageByEvent(evnt);
|
|
32175
32454
|
}
|
|
32455
|
+
},
|
|
32456
|
+
setCurrentPage(currentPage) {
|
|
32457
|
+
const $xeGrid = this;
|
|
32458
|
+
const reactData = $xeGrid.reactData;
|
|
32459
|
+
const {
|
|
32460
|
+
tablePage
|
|
32461
|
+
} = reactData;
|
|
32462
|
+
const pageCount = $xeGrid.computePageCount;
|
|
32463
|
+
tablePage.currentPage = Math.min(pageCount, Math.max(1, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(currentPage)));
|
|
32176
32464
|
return $xeGrid.$nextTick();
|
|
32177
32465
|
},
|
|
32178
|
-
|
|
32466
|
+
setCurrentPageByEvent(evnt, currentPage) {
|
|
32179
32467
|
const $xeGrid = this;
|
|
32180
32468
|
const $pager = $xeGrid.$refs.refPager;
|
|
32181
32469
|
if ($pager) {
|
|
32182
|
-
|
|
32470
|
+
$pager.setCurrentPageByEvent(evnt, currentPage);
|
|
32183
32471
|
}
|
|
32472
|
+
},
|
|
32473
|
+
setPageSize(pageSize) {
|
|
32474
|
+
const $xeGrid = this;
|
|
32475
|
+
const reactData = $xeGrid.reactData;
|
|
32476
|
+
const {
|
|
32477
|
+
tablePage
|
|
32478
|
+
} = reactData;
|
|
32479
|
+
tablePage.pageSize = Math.max(1, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(pageSize));
|
|
32184
32480
|
return $xeGrid.$nextTick();
|
|
32185
32481
|
},
|
|
32482
|
+
setPageSizeByEvent(evnt, pageSize) {
|
|
32483
|
+
const $xeGrid = this;
|
|
32484
|
+
const $pager = $xeGrid.$refs.refPager;
|
|
32485
|
+
if ($pager) {
|
|
32486
|
+
$pager.setPageSizeByEvent(evnt, pageSize);
|
|
32487
|
+
}
|
|
32488
|
+
},
|
|
32186
32489
|
triggerToolbarCommitEvent(params, evnt) {
|
|
32187
32490
|
const $xeGrid = this;
|
|
32188
32491
|
const {
|
|
@@ -32213,28 +32516,6 @@ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default(
|
|
|
32213
32516
|
tool
|
|
32214
32517
|
}, evnt);
|
|
32215
32518
|
},
|
|
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
32519
|
pageChangeEvent(params) {
|
|
32239
32520
|
const $xeGrid = this;
|
|
32240
32521
|
const props = $xeGrid;
|
|
@@ -32260,7 +32541,38 @@ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default(
|
|
|
32260
32541
|
});
|
|
32261
32542
|
}
|
|
32262
32543
|
},
|
|
32263
|
-
|
|
32544
|
+
handleSortEvent(params) {
|
|
32545
|
+
const $xeGrid = this;
|
|
32546
|
+
const props = $xeGrid;
|
|
32547
|
+
const reactData = $xeGrid.reactData;
|
|
32548
|
+
const $xeTable = $xeGrid.$refs.refTable;
|
|
32549
|
+
const {
|
|
32550
|
+
proxyConfig
|
|
32551
|
+
} = props;
|
|
32552
|
+
const proxyOpts = $xeGrid.computeProxyOpts;
|
|
32553
|
+
const sortOpts = $xeTable.computeSortOpts;
|
|
32554
|
+
// 如果是服务端排序
|
|
32555
|
+
if (sortOpts.remote) {
|
|
32556
|
+
reactData.sortData = params.sortList;
|
|
32557
|
+
if (proxyConfig && isEnableConf(proxyOpts)) {
|
|
32558
|
+
reactData.tablePage.currentPage = 1;
|
|
32559
|
+
$xeGrid.commitProxy('query').then(rest => {
|
|
32560
|
+
$xeGrid.dispatchEvent('proxy-query', rest, params.$event);
|
|
32561
|
+
});
|
|
32562
|
+
}
|
|
32563
|
+
}
|
|
32564
|
+
},
|
|
32565
|
+
sortChangeEvent(params) {
|
|
32566
|
+
const $xeGrid = this;
|
|
32567
|
+
$xeGrid.handleSortEvent(params);
|
|
32568
|
+
$xeGrid.dispatchEvent('sort-change', params, params.$event);
|
|
32569
|
+
},
|
|
32570
|
+
clearAllSortEvent(params) {
|
|
32571
|
+
const $xeGrid = this;
|
|
32572
|
+
$xeGrid.handleSortEvent(params);
|
|
32573
|
+
$xeGrid.dispatchEvent('clear-all-sort', params, params.$event);
|
|
32574
|
+
},
|
|
32575
|
+
handleFilterEvent(params) {
|
|
32264
32576
|
const $xeGrid = this;
|
|
32265
32577
|
const props = $xeGrid;
|
|
32266
32578
|
const reactData = $xeGrid.reactData;
|
|
@@ -32280,8 +32592,17 @@ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default(
|
|
|
32280
32592
|
});
|
|
32281
32593
|
}
|
|
32282
32594
|
}
|
|
32595
|
+
},
|
|
32596
|
+
filterChangeEvent(params) {
|
|
32597
|
+
const $xeGrid = this;
|
|
32598
|
+
$xeGrid.handleFilterEvent(params);
|
|
32283
32599
|
$xeGrid.dispatchEvent('filter-change', params, params.$event);
|
|
32284
32600
|
},
|
|
32601
|
+
clearAllFilterEvent(params) {
|
|
32602
|
+
const $xeGrid = this;
|
|
32603
|
+
$xeGrid.handleFilterEvent(params);
|
|
32604
|
+
$xeGrid.dispatchEvent('clear-all-filter', params, params.$event);
|
|
32605
|
+
},
|
|
32285
32606
|
submitFormEvent(params) {
|
|
32286
32607
|
const $xeGrid = this;
|
|
32287
32608
|
const props = $xeGrid;
|
|
@@ -32345,6 +32666,11 @@ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default(
|
|
|
32345
32666
|
type: reactData.isZMax ? 'max' : 'revert'
|
|
32346
32667
|
}, evnt);
|
|
32347
32668
|
},
|
|
32669
|
+
getParams() {
|
|
32670
|
+
const $xeGrid = this;
|
|
32671
|
+
const props = $xeGrid;
|
|
32672
|
+
return props.params;
|
|
32673
|
+
},
|
|
32348
32674
|
zoom() {
|
|
32349
32675
|
const $xeGrid = this;
|
|
32350
32676
|
const reactData = $xeGrid.reactData;
|