vxe-table 3.19.7 → 3.19.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/style.css +1 -1
- package/es/table/src/column.js +6 -0
- package/es/table/src/columnInfo.js +3 -0
- package/es/table/src/header.js +1 -7
- package/es/table/src/methods.js +90 -26
- package/es/table/src/table.js +2 -10
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/index.umd.js +107 -47
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/src/column.js +6 -0
- package/lib/table/src/column.min.js +1 -1
- package/lib/table/src/columnInfo.js +3 -0
- package/lib/table/src/columnInfo.min.js +1 -1
- package/lib/table/src/header.js +1 -7
- package/lib/table/src/header.min.js +1 -1
- package/lib/table/src/methods.js +94 -28
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +1 -10
- package/lib/table/src/table.min.js +1 -1
- package/lib/ui/index.js +1 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/package.json +1 -1
- package/packages/table/src/column.ts +8 -0
- package/packages/table/src/columnInfo.ts +5 -0
- package/packages/table/src/header.ts +2 -8
- package/packages/table/src/methods.ts +92 -28
- package/packages/table/src/table.ts +2 -10
- /package/es/{iconfont.1762136064244.ttf → iconfont.1762392676329.ttf} +0 -0
- /package/es/{iconfont.1762136064244.woff → iconfont.1762392676329.woff} +0 -0
- /package/es/{iconfont.1762136064244.woff2 → iconfont.1762392676329.woff2} +0 -0
- /package/lib/{iconfont.1762136064244.ttf → iconfont.1762392676329.ttf} +0 -0
- /package/lib/{iconfont.1762136064244.woff → iconfont.1762392676329.woff} +0 -0
- /package/lib/{iconfont.1762136064244.woff2 → iconfont.1762392676329.woff2} +0 -0
|
@@ -120,6 +120,9 @@ export class ColumnInfo {
|
|
|
120
120
|
titlePrefix: _vm.titlePrefix,
|
|
121
121
|
titleSuffix: _vm.titleSuffix,
|
|
122
122
|
aggFunc: _vm.aggFunc,
|
|
123
|
+
copyMethod: _vm.copyMethod,
|
|
124
|
+
cutMethod: _vm.cutMethod,
|
|
125
|
+
pasteMethod: _vm.pasteMethod,
|
|
123
126
|
// 自定义参数
|
|
124
127
|
params: _vm.params,
|
|
125
128
|
// 渲染属性
|
package/es/table/src/header.js
CHANGED
|
@@ -317,13 +317,7 @@ function renderFilterRows(h, _vm, isOptimizeMode, cols) {
|
|
|
317
317
|
}, flSlot
|
|
318
318
|
? $xeTable.callSlot(flSlot, cellParams, h)
|
|
319
319
|
: (rtFloatingFilter && firstFilterOption
|
|
320
|
-
? getSlotVNs(rtFloatingFilter.call($xeTable, h, filterRender,
|
|
321
|
-
$table: $xeTable,
|
|
322
|
-
option: firstFilterOption,
|
|
323
|
-
column: column,
|
|
324
|
-
columnIndex,
|
|
325
|
-
$columnIndex
|
|
326
|
-
}))
|
|
320
|
+
? getSlotVNs(rtFloatingFilter.call($xeTable, h, filterRender, cellParams))
|
|
327
321
|
: []))
|
|
328
322
|
])
|
|
329
323
|
]);
|
package/es/table/src/methods.js
CHANGED
|
@@ -2402,21 +2402,34 @@ function autoCellWidth($xeTable) {
|
|
|
2402
2402
|
/**
|
|
2403
2403
|
* 计算自适应行高
|
|
2404
2404
|
*/
|
|
2405
|
-
const calcCellAutoHeight = (rowRest, wrapperEl) => {
|
|
2406
|
-
const
|
|
2407
|
-
|
|
2405
|
+
const calcCellAutoHeight = ($xeTable, rowRest, wrapperEl) => {
|
|
2406
|
+
const reactData = $xeTable;
|
|
2407
|
+
const { scrollXLoad } = reactData;
|
|
2408
|
+
const wrapperElemList = wrapperEl.querySelectorAll(`.vxe-cell--wrapper[rowid="${rowRest.rowid}"]`);
|
|
2409
|
+
let colHeight = 0;
|
|
2408
2410
|
let firstCellStyle = null;
|
|
2409
2411
|
let topBottomPadding = 0;
|
|
2410
|
-
for (let i = 0; i <
|
|
2411
|
-
const wrapperElem =
|
|
2412
|
+
for (let i = 0; i < wrapperElemList.length; i++) {
|
|
2413
|
+
const wrapperElem = wrapperElemList[i];
|
|
2412
2414
|
const cellElem = wrapperElem.parentElement;
|
|
2415
|
+
const cellStyle = cellElem.style;
|
|
2416
|
+
const orHeight = cellStyle.height;
|
|
2417
|
+
if (!scrollXLoad) {
|
|
2418
|
+
cellStyle.height = '';
|
|
2419
|
+
}
|
|
2413
2420
|
if (!firstCellStyle) {
|
|
2414
2421
|
firstCellStyle = getComputedStyle(cellElem);
|
|
2415
2422
|
topBottomPadding = firstCellStyle ? Math.ceil(XEUtils.toNumber(firstCellStyle.paddingTop) + XEUtils.toNumber(firstCellStyle.paddingBottom)) : 0;
|
|
2416
2423
|
}
|
|
2424
|
+
if (!scrollXLoad) {
|
|
2425
|
+
cellStyle.height = orHeight;
|
|
2426
|
+
}
|
|
2417
2427
|
const cellHeight = wrapperElem ? wrapperElem.clientHeight : 0;
|
|
2418
2428
|
colHeight = Math.max(colHeight, Math.ceil(cellHeight + topBottomPadding));
|
|
2419
2429
|
}
|
|
2430
|
+
if (scrollXLoad) {
|
|
2431
|
+
colHeight = Math.max(colHeight, rowRest.height);
|
|
2432
|
+
}
|
|
2420
2433
|
return colHeight;
|
|
2421
2434
|
};
|
|
2422
2435
|
/**
|
|
@@ -2432,15 +2445,17 @@ const calcCellHeight = ($xeTable) => {
|
|
|
2432
2445
|
const treeOpts = $xeTable.computeTreeOpts;
|
|
2433
2446
|
const defaultRowHeight = $xeTable.computeDefaultRowHeight;
|
|
2434
2447
|
const el = $xeTable.$refs.refElem;
|
|
2435
|
-
if (!isAllOverflow && (scrollYLoad || scrollXLoad || (treeConfig && treeOpts.showLine))
|
|
2448
|
+
if (el && !isAllOverflow && (scrollYLoad || scrollXLoad || (treeConfig && treeOpts.showLine))) {
|
|
2436
2449
|
const { handleGetRowId } = createHandleGetRowId($xeTable);
|
|
2450
|
+
el.setAttribute('data-calc-row', 'Y');
|
|
2437
2451
|
tableData.forEach(row => {
|
|
2438
2452
|
const rowid = handleGetRowId(row);
|
|
2439
2453
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
2440
2454
|
if (rowRest) {
|
|
2441
|
-
const height = calcCellAutoHeight(rowRest, el);
|
|
2442
|
-
rowRest.height = Math.max(defaultRowHeight,
|
|
2455
|
+
const height = calcCellAutoHeight($xeTable, rowRest, el);
|
|
2456
|
+
rowRest.height = Math.max(defaultRowHeight, height);
|
|
2443
2457
|
}
|
|
2458
|
+
el.removeAttribute('data-calc-row');
|
|
2444
2459
|
});
|
|
2445
2460
|
reactData.calcCellHeightFlag++;
|
|
2446
2461
|
}
|
|
@@ -3772,8 +3787,8 @@ function updateHeight($xeTable) {
|
|
|
3772
3787
|
internalData.customHeight = calcTableHeight($xeTable, 'height');
|
|
3773
3788
|
internalData.customMinHeight = calcTableHeight($xeTable, 'minHeight');
|
|
3774
3789
|
internalData.customMaxHeight = calcTableHeight($xeTable, 'maxHeight');
|
|
3775
|
-
//
|
|
3776
|
-
if (reactData.scrollYLoad && !(internalData.customHeight || internalData.customMinHeight)) {
|
|
3790
|
+
// 如果启用虚拟滚动,纠正高度
|
|
3791
|
+
if (reactData.scrollYLoad && !(internalData.customHeight || internalData.customMinHeight || internalData.customMaxHeight)) {
|
|
3777
3792
|
internalData.customHeight = 300;
|
|
3778
3793
|
}
|
|
3779
3794
|
}
|
|
@@ -4208,6 +4223,26 @@ const Methods = {
|
|
|
4208
4223
|
}
|
|
4209
4224
|
return $xeTable.$nextTick();
|
|
4210
4225
|
},
|
|
4226
|
+
initData() {
|
|
4227
|
+
const $xeTable = this;
|
|
4228
|
+
const props = $xeTable;
|
|
4229
|
+
const reactData = $xeTable;
|
|
4230
|
+
const internalData = $xeTable;
|
|
4231
|
+
const { data } = props;
|
|
4232
|
+
loadTableData($xeTable, data || [], true).then(() => {
|
|
4233
|
+
if (data && data.length) {
|
|
4234
|
+
internalData.inited = true;
|
|
4235
|
+
internalData.initStatus = true;
|
|
4236
|
+
handleLoadDefaults($xeTable);
|
|
4237
|
+
}
|
|
4238
|
+
handleInitDefaults($xeTable);
|
|
4239
|
+
updateStyle($xeTable);
|
|
4240
|
+
if (!reactData.isAllOverflow) {
|
|
4241
|
+
calcCellHeight($xeTable);
|
|
4242
|
+
updateRowOffsetTop($xeTable);
|
|
4243
|
+
}
|
|
4244
|
+
});
|
|
4245
|
+
},
|
|
4211
4246
|
/**
|
|
4212
4247
|
* 加载表格数据
|
|
4213
4248
|
* @param {Array} datas 数据
|
|
@@ -6106,7 +6141,9 @@ const Methods = {
|
|
|
6106
6141
|
return;
|
|
6107
6142
|
}
|
|
6108
6143
|
const handleRsHeight = () => {
|
|
6109
|
-
|
|
6144
|
+
el.setAttribute('data-calc-row', 'Y');
|
|
6145
|
+
const resizeHeight = calcCellAutoHeight($xeTable, rowRest, el);
|
|
6146
|
+
el.removeAttribute('data-calc-row');
|
|
6110
6147
|
const resizeParams = Object.assign(Object.assign({}, params), { resizeHeight, resizeRow: row });
|
|
6111
6148
|
reactData.isDragResize = false;
|
|
6112
6149
|
internalData._lastResizeTime = Date.now();
|
|
@@ -6191,7 +6228,7 @@ const Methods = {
|
|
|
6191
6228
|
const rowid = XEUtils.isString(row) || XEUtils.isNumber(row) ? row : handleGetRowId(row);
|
|
6192
6229
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
6193
6230
|
if (rowRest) {
|
|
6194
|
-
rowRest.resizeHeight = calcCellAutoHeight(rowRest, el);
|
|
6231
|
+
rowRest.resizeHeight = calcCellAutoHeight($xeTable, rowRest, el);
|
|
6195
6232
|
}
|
|
6196
6233
|
el.removeAttribute('data-calc-row');
|
|
6197
6234
|
});
|
|
@@ -11196,14 +11233,28 @@ const Methods = {
|
|
|
11196
11233
|
if (!(scrollXLoad && overflowX)) {
|
|
11197
11234
|
xSpaceLeft = 0;
|
|
11198
11235
|
}
|
|
11199
|
-
if (
|
|
11200
|
-
|
|
11201
|
-
|
|
11202
|
-
|
|
11203
|
-
|
|
11236
|
+
if (getConfig().scrollMarginStyle) {
|
|
11237
|
+
// 已废弃方式
|
|
11238
|
+
if (headerTableElem) {
|
|
11239
|
+
headerTableElem.style.marginLeft = headerTableElem.getAttribute('xvm') ? `${xSpaceLeft}px` : '';
|
|
11240
|
+
}
|
|
11241
|
+
if (bodyTableElem) {
|
|
11242
|
+
bodyTableElem.style.marginLeft = `${xSpaceLeft}px`;
|
|
11243
|
+
}
|
|
11244
|
+
if (footerTableElem) {
|
|
11245
|
+
footerTableElem.style.marginLeft = footerTableElem.getAttribute('xvm') ? `${xSpaceLeft}px` : '';
|
|
11246
|
+
}
|
|
11204
11247
|
}
|
|
11205
|
-
|
|
11206
|
-
|
|
11248
|
+
else {
|
|
11249
|
+
if (headerTableElem) {
|
|
11250
|
+
headerTableElem.style.transform = headerTableElem.getAttribute('xvm') ? `translate(${xSpaceLeft}px, 0px)` : '';
|
|
11251
|
+
}
|
|
11252
|
+
if (bodyTableElem) {
|
|
11253
|
+
bodyTableElem.style.transform = `translate(${xSpaceLeft}px, ${reactData.scrollYTop || 0}px)`;
|
|
11254
|
+
}
|
|
11255
|
+
if (footerTableElem) {
|
|
11256
|
+
footerTableElem.style.transform = footerTableElem.getAttribute('xvm') ? `translate(${xSpaceLeft}px, 0px)` : '';
|
|
11257
|
+
}
|
|
11207
11258
|
}
|
|
11208
11259
|
const containerList = ['main'];
|
|
11209
11260
|
containerList.forEach(name => {
|
|
@@ -11320,14 +11371,27 @@ const Methods = {
|
|
|
11320
11371
|
if (!(scrollYLoad && overflowY)) {
|
|
11321
11372
|
scrollYTop = 0;
|
|
11322
11373
|
}
|
|
11323
|
-
if (
|
|
11324
|
-
|
|
11325
|
-
|
|
11326
|
-
|
|
11327
|
-
|
|
11374
|
+
if (getConfig().scrollMarginStyle) {
|
|
11375
|
+
if (leftBodyTableElem) {
|
|
11376
|
+
leftBodyTableElem.style.marginTop = `${scrollYTop}px`;
|
|
11377
|
+
}
|
|
11378
|
+
if (bodyTableElem) {
|
|
11379
|
+
bodyTableElem.style.marginTop = `${scrollYTop}px`;
|
|
11380
|
+
}
|
|
11381
|
+
if (rightbodyTableElem) {
|
|
11382
|
+
rightbodyTableElem.style.marginTop = `${scrollYTop}px`;
|
|
11383
|
+
}
|
|
11328
11384
|
}
|
|
11329
|
-
|
|
11330
|
-
|
|
11385
|
+
else {
|
|
11386
|
+
if (leftBodyTableElem) {
|
|
11387
|
+
leftBodyTableElem.style.transform = `translate(0px, ${scrollYTop}px)`;
|
|
11388
|
+
}
|
|
11389
|
+
if (bodyTableElem) {
|
|
11390
|
+
bodyTableElem.style.transform = `translate(${reactData.scrollXLeft || 0}px, ${scrollYTop}px)`;
|
|
11391
|
+
}
|
|
11392
|
+
if (rightbodyTableElem) {
|
|
11393
|
+
rightbodyTableElem.style.transform = `translate(0px, ${scrollYTop}px)`;
|
|
11394
|
+
}
|
|
11331
11395
|
}
|
|
11332
11396
|
containerList.forEach(name => {
|
|
11333
11397
|
const layoutList = ['header', 'body', 'footer'];
|
package/es/table/src/table.js
CHANGED
|
@@ -1598,7 +1598,7 @@ export default {
|
|
|
1598
1598
|
const internalData = $xeTable;
|
|
1599
1599
|
XEUtils.assign(internalData, createInternalData());
|
|
1600
1600
|
handleKeyField($xeTable);
|
|
1601
|
-
const {
|
|
1601
|
+
const { exportConfig, importConfig, treeConfig, highlightCurrentRow, highlightCurrentColumn } = props;
|
|
1602
1602
|
const { scrollXStore, scrollYStore } = internalData;
|
|
1603
1603
|
const columnOpts = $xeTable.computeColumnOpts;
|
|
1604
1604
|
const editOpts = $xeTable.computeEditOpts;
|
|
@@ -1851,15 +1851,7 @@ export default {
|
|
|
1851
1851
|
visibleSize: 0
|
|
1852
1852
|
});
|
|
1853
1853
|
this.handleUpdateRowGroup(groupFields);
|
|
1854
|
-
this.
|
|
1855
|
-
if (data && data.length) {
|
|
1856
|
-
this.inited = true;
|
|
1857
|
-
this.initStatus = true;
|
|
1858
|
-
this.handleLoadDefaults();
|
|
1859
|
-
}
|
|
1860
|
-
this.handleInitDefaults();
|
|
1861
|
-
this.updateStyle();
|
|
1862
|
-
});
|
|
1854
|
+
this.initData();
|
|
1863
1855
|
globalEvents.on($xeTable, 'paste', this.handleGlobalPasteEvent);
|
|
1864
1856
|
globalEvents.on($xeTable, 'copy', this.handleGlobalCopyEvent);
|
|
1865
1857
|
globalEvents.on($xeTable, 'cut', this.handleGlobalCutEvent);
|
package/es/ui/index.js
CHANGED
package/es/ui/src/log.js
CHANGED
package/lib/index.umd.js
CHANGED
|
@@ -2005,7 +2005,7 @@ function getClass(property, params) {
|
|
|
2005
2005
|
;// CONCATENATED MODULE: ./packages/ui/index.ts
|
|
2006
2006
|
|
|
2007
2007
|
|
|
2008
|
-
const version = "3.19.
|
|
2008
|
+
const version = "3.19.9";
|
|
2009
2009
|
core_.VxeUI.version = version;
|
|
2010
2010
|
core_.VxeUI.tableVersion = version;
|
|
2011
2011
|
core_.VxeUI.setConfig({
|
|
@@ -2713,7 +2713,7 @@ function isNodeElement(elem) {
|
|
|
2713
2713
|
const {
|
|
2714
2714
|
log: log_log
|
|
2715
2715
|
} = core_.VxeUI;
|
|
2716
|
-
const log_version = `table v${"3.19.
|
|
2716
|
+
const log_version = `table v${"3.19.9"}`;
|
|
2717
2717
|
const warnLog = log_log.create('warn', log_version);
|
|
2718
2718
|
const errLog = log_log.create('error', log_version);
|
|
2719
2719
|
;// CONCATENATED MODULE: ./packages/table/src/columnInfo.ts
|
|
@@ -2853,6 +2853,9 @@ class ColumnInfo {
|
|
|
2853
2853
|
titlePrefix: _vm.titlePrefix,
|
|
2854
2854
|
titleSuffix: _vm.titleSuffix,
|
|
2855
2855
|
aggFunc: _vm.aggFunc,
|
|
2856
|
+
copyMethod: _vm.copyMethod,
|
|
2857
|
+
cutMethod: _vm.cutMethod,
|
|
2858
|
+
pasteMethod: _vm.pasteMethod,
|
|
2856
2859
|
// 自定义参数
|
|
2857
2860
|
params: _vm.params,
|
|
2858
2861
|
// 渲染属性
|
|
@@ -5370,6 +5373,12 @@ const columnProps = {
|
|
|
5370
5373
|
contentRender: Object,
|
|
5371
5374
|
// 聚合函数
|
|
5372
5375
|
aggFunc: [String, Boolean],
|
|
5376
|
+
// 将单元格复制到剪贴板
|
|
5377
|
+
copyMethod: Function,
|
|
5378
|
+
// 将剪贴单元格的值清除
|
|
5379
|
+
cutMethod: Function,
|
|
5380
|
+
// 从剪贴板赋值到单元格
|
|
5381
|
+
pasteMethod: Function,
|
|
5373
5382
|
// 额外的参数
|
|
5374
5383
|
params: Object
|
|
5375
5384
|
};
|
|
@@ -8800,21 +8809,36 @@ function autoCellWidth($xeTable) {
|
|
|
8800
8809
|
/**
|
|
8801
8810
|
* 计算自适应行高
|
|
8802
8811
|
*/
|
|
8803
|
-
const calcCellAutoHeight = (rowRest, wrapperEl) => {
|
|
8804
|
-
const
|
|
8805
|
-
|
|
8812
|
+
const calcCellAutoHeight = ($xeTable, rowRest, wrapperEl) => {
|
|
8813
|
+
const reactData = $xeTable;
|
|
8814
|
+
const {
|
|
8815
|
+
scrollXLoad
|
|
8816
|
+
} = reactData;
|
|
8817
|
+
const wrapperElemList = wrapperEl.querySelectorAll(`.vxe-cell--wrapper[rowid="${rowRest.rowid}"]`);
|
|
8818
|
+
let colHeight = 0;
|
|
8806
8819
|
let firstCellStyle = null;
|
|
8807
8820
|
let topBottomPadding = 0;
|
|
8808
|
-
for (let i = 0; i <
|
|
8809
|
-
const wrapperElem =
|
|
8821
|
+
for (let i = 0; i < wrapperElemList.length; i++) {
|
|
8822
|
+
const wrapperElem = wrapperElemList[i];
|
|
8810
8823
|
const cellElem = wrapperElem.parentElement;
|
|
8824
|
+
const cellStyle = cellElem.style;
|
|
8825
|
+
const orHeight = cellStyle.height;
|
|
8826
|
+
if (!scrollXLoad) {
|
|
8827
|
+
cellStyle.height = '';
|
|
8828
|
+
}
|
|
8811
8829
|
if (!firstCellStyle) {
|
|
8812
8830
|
firstCellStyle = getComputedStyle(cellElem);
|
|
8813
8831
|
topBottomPadding = firstCellStyle ? Math.ceil(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(firstCellStyle.paddingTop) + external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(firstCellStyle.paddingBottom)) : 0;
|
|
8814
8832
|
}
|
|
8833
|
+
if (!scrollXLoad) {
|
|
8834
|
+
cellStyle.height = orHeight;
|
|
8835
|
+
}
|
|
8815
8836
|
const cellHeight = wrapperElem ? wrapperElem.clientHeight : 0;
|
|
8816
8837
|
colHeight = Math.max(colHeight, Math.ceil(cellHeight + topBottomPadding));
|
|
8817
8838
|
}
|
|
8839
|
+
if (scrollXLoad) {
|
|
8840
|
+
colHeight = Math.max(colHeight, rowRest.height);
|
|
8841
|
+
}
|
|
8818
8842
|
return colHeight;
|
|
8819
8843
|
};
|
|
8820
8844
|
/**
|
|
@@ -8839,17 +8863,19 @@ const calcCellHeight = $xeTable => {
|
|
|
8839
8863
|
const treeOpts = $xeTable.computeTreeOpts;
|
|
8840
8864
|
const defaultRowHeight = $xeTable.computeDefaultRowHeight;
|
|
8841
8865
|
const el = $xeTable.$refs.refElem;
|
|
8842
|
-
if (!isAllOverflow && (scrollYLoad || scrollXLoad || treeConfig && treeOpts.showLine)
|
|
8866
|
+
if (el && !isAllOverflow && (scrollYLoad || scrollXLoad || treeConfig && treeOpts.showLine)) {
|
|
8843
8867
|
const {
|
|
8844
8868
|
handleGetRowId
|
|
8845
8869
|
} = createHandleGetRowId($xeTable);
|
|
8870
|
+
el.setAttribute('data-calc-row', 'Y');
|
|
8846
8871
|
tableData.forEach(row => {
|
|
8847
8872
|
const rowid = handleGetRowId(row);
|
|
8848
8873
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
8849
8874
|
if (rowRest) {
|
|
8850
|
-
const height = calcCellAutoHeight(rowRest, el);
|
|
8851
|
-
rowRest.height = Math.max(defaultRowHeight,
|
|
8875
|
+
const height = calcCellAutoHeight($xeTable, rowRest, el);
|
|
8876
|
+
rowRest.height = Math.max(defaultRowHeight, height);
|
|
8852
8877
|
}
|
|
8878
|
+
el.removeAttribute('data-calc-row');
|
|
8853
8879
|
});
|
|
8854
8880
|
reactData.calcCellHeightFlag++;
|
|
8855
8881
|
}
|
|
@@ -10345,8 +10371,8 @@ function updateHeight($xeTable) {
|
|
|
10345
10371
|
internalData.customHeight = calcTableHeight($xeTable, 'height');
|
|
10346
10372
|
internalData.customMinHeight = calcTableHeight($xeTable, 'minHeight');
|
|
10347
10373
|
internalData.customMaxHeight = calcTableHeight($xeTable, 'maxHeight');
|
|
10348
|
-
//
|
|
10349
|
-
if (reactData.scrollYLoad && !(internalData.customHeight || internalData.customMinHeight)) {
|
|
10374
|
+
// 如果启用虚拟滚动,纠正高度
|
|
10375
|
+
if (reactData.scrollYLoad && !(internalData.customHeight || internalData.customMinHeight || internalData.customMaxHeight)) {
|
|
10350
10376
|
internalData.customHeight = 300;
|
|
10351
10377
|
}
|
|
10352
10378
|
}
|
|
@@ -10836,6 +10862,28 @@ const Methods = {
|
|
|
10836
10862
|
}
|
|
10837
10863
|
return $xeTable.$nextTick();
|
|
10838
10864
|
},
|
|
10865
|
+
initData() {
|
|
10866
|
+
const $xeTable = this;
|
|
10867
|
+
const props = $xeTable;
|
|
10868
|
+
const reactData = $xeTable;
|
|
10869
|
+
const internalData = $xeTable;
|
|
10870
|
+
const {
|
|
10871
|
+
data
|
|
10872
|
+
} = props;
|
|
10873
|
+
loadTableData($xeTable, data || [], true).then(() => {
|
|
10874
|
+
if (data && data.length) {
|
|
10875
|
+
internalData.inited = true;
|
|
10876
|
+
internalData.initStatus = true;
|
|
10877
|
+
handleLoadDefaults($xeTable);
|
|
10878
|
+
}
|
|
10879
|
+
handleInitDefaults($xeTable);
|
|
10880
|
+
updateStyle($xeTable);
|
|
10881
|
+
if (!reactData.isAllOverflow) {
|
|
10882
|
+
calcCellHeight($xeTable);
|
|
10883
|
+
updateRowOffsetTop($xeTable);
|
|
10884
|
+
}
|
|
10885
|
+
});
|
|
10886
|
+
},
|
|
10839
10887
|
/**
|
|
10840
10888
|
* 加载表格数据
|
|
10841
10889
|
* @param {Array} datas 数据
|
|
@@ -13039,7 +13087,9 @@ const Methods = {
|
|
|
13039
13087
|
return;
|
|
13040
13088
|
}
|
|
13041
13089
|
const handleRsHeight = () => {
|
|
13042
|
-
|
|
13090
|
+
el.setAttribute('data-calc-row', 'Y');
|
|
13091
|
+
const resizeHeight = calcCellAutoHeight($xeTable, rowRest, el);
|
|
13092
|
+
el.removeAttribute('data-calc-row');
|
|
13043
13093
|
const resizeParams = {
|
|
13044
13094
|
...params,
|
|
13045
13095
|
resizeHeight,
|
|
@@ -13139,7 +13189,7 @@ const Methods = {
|
|
|
13139
13189
|
const rowid = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(row) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(row) ? row : handleGetRowId(row);
|
|
13140
13190
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
13141
13191
|
if (rowRest) {
|
|
13142
|
-
rowRest.resizeHeight = calcCellAutoHeight(rowRest, el);
|
|
13192
|
+
rowRest.resizeHeight = calcCellAutoHeight($xeTable, rowRest, el);
|
|
13143
13193
|
}
|
|
13144
13194
|
el.removeAttribute('data-calc-row');
|
|
13145
13195
|
});
|
|
@@ -18965,14 +19015,27 @@ const Methods = {
|
|
|
18965
19015
|
if (!(scrollXLoad && overflowX)) {
|
|
18966
19016
|
xSpaceLeft = 0;
|
|
18967
19017
|
}
|
|
18968
|
-
if (
|
|
18969
|
-
|
|
18970
|
-
|
|
18971
|
-
|
|
18972
|
-
|
|
18973
|
-
|
|
18974
|
-
|
|
18975
|
-
|
|
19018
|
+
if (methods_getConfig().scrollMarginStyle) {
|
|
19019
|
+
// 已废弃方式
|
|
19020
|
+
if (headerTableElem) {
|
|
19021
|
+
headerTableElem.style.marginLeft = headerTableElem.getAttribute('xvm') ? `${xSpaceLeft}px` : '';
|
|
19022
|
+
}
|
|
19023
|
+
if (bodyTableElem) {
|
|
19024
|
+
bodyTableElem.style.marginLeft = `${xSpaceLeft}px`;
|
|
19025
|
+
}
|
|
19026
|
+
if (footerTableElem) {
|
|
19027
|
+
footerTableElem.style.marginLeft = footerTableElem.getAttribute('xvm') ? `${xSpaceLeft}px` : '';
|
|
19028
|
+
}
|
|
19029
|
+
} else {
|
|
19030
|
+
if (headerTableElem) {
|
|
19031
|
+
headerTableElem.style.transform = headerTableElem.getAttribute('xvm') ? `translate(${xSpaceLeft}px, 0px)` : '';
|
|
19032
|
+
}
|
|
19033
|
+
if (bodyTableElem) {
|
|
19034
|
+
bodyTableElem.style.transform = `translate(${xSpaceLeft}px, ${reactData.scrollYTop || 0}px)`;
|
|
19035
|
+
}
|
|
19036
|
+
if (footerTableElem) {
|
|
19037
|
+
footerTableElem.style.transform = footerTableElem.getAttribute('xvm') ? `translate(${xSpaceLeft}px, 0px)` : '';
|
|
19038
|
+
}
|
|
18976
19039
|
}
|
|
18977
19040
|
const containerList = ['main'];
|
|
18978
19041
|
containerList.forEach(name => {
|
|
@@ -19101,14 +19164,26 @@ const Methods = {
|
|
|
19101
19164
|
if (!(scrollYLoad && overflowY)) {
|
|
19102
19165
|
scrollYTop = 0;
|
|
19103
19166
|
}
|
|
19104
|
-
if (
|
|
19105
|
-
|
|
19106
|
-
|
|
19107
|
-
|
|
19108
|
-
|
|
19109
|
-
|
|
19110
|
-
|
|
19111
|
-
|
|
19167
|
+
if (methods_getConfig().scrollMarginStyle) {
|
|
19168
|
+
if (leftBodyTableElem) {
|
|
19169
|
+
leftBodyTableElem.style.marginTop = `${scrollYTop}px`;
|
|
19170
|
+
}
|
|
19171
|
+
if (bodyTableElem) {
|
|
19172
|
+
bodyTableElem.style.marginTop = `${scrollYTop}px`;
|
|
19173
|
+
}
|
|
19174
|
+
if (rightbodyTableElem) {
|
|
19175
|
+
rightbodyTableElem.style.marginTop = `${scrollYTop}px`;
|
|
19176
|
+
}
|
|
19177
|
+
} else {
|
|
19178
|
+
if (leftBodyTableElem) {
|
|
19179
|
+
leftBodyTableElem.style.transform = `translate(0px, ${scrollYTop}px)`;
|
|
19180
|
+
}
|
|
19181
|
+
if (bodyTableElem) {
|
|
19182
|
+
bodyTableElem.style.transform = `translate(${reactData.scrollXLeft || 0}px, ${scrollYTop}px)`;
|
|
19183
|
+
}
|
|
19184
|
+
if (rightbodyTableElem) {
|
|
19185
|
+
rightbodyTableElem.style.transform = `translate(0px, ${scrollYTop}px)`;
|
|
19186
|
+
}
|
|
19112
19187
|
}
|
|
19113
19188
|
containerList.forEach(name => {
|
|
19114
19189
|
const layoutList = ['header', 'body', 'footer'];
|
|
@@ -21056,13 +21131,7 @@ function renderFilterRows(h, _vm, isOptimizeMode, cols) {
|
|
|
21056
21131
|
colid
|
|
21057
21132
|
},
|
|
21058
21133
|
class: 'vxe-cell--wrapper vxe-header-cell--wrapper'
|
|
21059
|
-
}, flSlot ? $xeTable.callSlot(flSlot, cellParams, h) : rtFloatingFilter && firstFilterOption ? getSlotVNs(rtFloatingFilter.call($xeTable, h, filterRender,
|
|
21060
|
-
$table: $xeTable,
|
|
21061
|
-
option: firstFilterOption,
|
|
21062
|
-
column: column,
|
|
21063
|
-
columnIndex,
|
|
21064
|
-
$columnIndex
|
|
21065
|
-
})) : [])])]);
|
|
21134
|
+
}, flSlot ? $xeTable.callSlot(flSlot, cellParams, h) : rtFloatingFilter && firstFilterOption ? getSlotVNs(rtFloatingFilter.call($xeTable, h, filterRender, cellParams)) : [])])]);
|
|
21066
21135
|
});
|
|
21067
21136
|
}
|
|
21068
21137
|
function renderHeads(h, _vm, isGroup, isOptimizeMode, headerGroups) {
|
|
@@ -31893,7 +31962,6 @@ function renderBody(h, $xeTable) {
|
|
|
31893
31962
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().assign(internalData, createInternalData());
|
|
31894
31963
|
handleKeyField($xeTable);
|
|
31895
31964
|
const {
|
|
31896
|
-
data,
|
|
31897
31965
|
exportConfig,
|
|
31898
31966
|
importConfig,
|
|
31899
31967
|
treeConfig,
|
|
@@ -32157,15 +32225,7 @@ function renderBody(h, $xeTable) {
|
|
|
32157
32225
|
visibleSize: 0
|
|
32158
32226
|
});
|
|
32159
32227
|
this.handleUpdateRowGroup(groupFields);
|
|
32160
|
-
this.
|
|
32161
|
-
if (data && data.length) {
|
|
32162
|
-
this.inited = true;
|
|
32163
|
-
this.initStatus = true;
|
|
32164
|
-
this.handleLoadDefaults();
|
|
32165
|
-
}
|
|
32166
|
-
this.handleInitDefaults();
|
|
32167
|
-
this.updateStyle();
|
|
32168
|
-
});
|
|
32228
|
+
this.initData();
|
|
32169
32229
|
table_globalEvents.on($xeTable, 'paste', this.handleGlobalPasteEvent);
|
|
32170
32230
|
table_globalEvents.on($xeTable, 'copy', this.handleGlobalCopyEvent);
|
|
32171
32231
|
table_globalEvents.on($xeTable, 'cut', this.handleGlobalCutEvent);
|