vxe-table 3.12.10-beta.2 → 3.12.10-beta.21
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/index.css +1 -1
- package/es/index.min.css +1 -1
- package/es/locale/lang/ar-EG.js +2 -1
- package/es/locale/lang/de-DE.js +2 -1
- package/es/locale/lang/en-US.js +2 -1
- package/es/locale/lang/es-ES.js +2 -1
- package/es/locale/lang/fr-FR.js +2 -1
- package/es/locale/lang/hu-HU.js +2 -1
- package/es/locale/lang/hy-AM.js +2 -1
- package/es/locale/lang/it-IT.js +2 -1
- package/es/locale/lang/ja-JP.js +2 -1
- package/es/locale/lang/ko-KR.js +2 -1
- package/es/locale/lang/nb-NO.js +2 -1
- package/es/locale/lang/pt-BR.js +2 -1
- package/es/locale/lang/ru-RU.js +4 -3
- package/es/locale/lang/th-TH.js +2 -1
- package/es/locale/lang/ug-CN.js +2 -1
- package/es/locale/lang/uk-UA.js +518 -517
- package/es/locale/lang/vi-VN.js +2 -1
- package/es/locale/lang/zh-CHT.js +2 -1
- package/es/locale/lang/zh-CN.js +2 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/module/edit/mixin.js +7 -7
- package/es/table/module/export/mixin.js +55 -32
- package/es/table/module/keyboard/mixin.js +68 -25
- package/es/table/module/menu/mixin.js +3 -1
- package/es/table/src/body.js +96 -64
- package/es/table/src/cell.js +3 -7
- package/es/table/src/column.js +2 -0
- package/es/table/src/columnInfo.js +1 -0
- package/es/table/src/footer.js +31 -6
- package/es/table/src/header.js +45 -141
- package/es/table/src/methods.js +918 -456
- package/es/table/src/props.js +6 -2
- package/es/table/src/table.js +299 -149
- package/es/table/src/util.js +67 -57
- package/es/table/style.css +299 -191
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +20 -10
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +299 -191
- package/es/vxe-table/style.min.css +1 -1
- package/lib/index.css +1 -1
- package/lib/index.min.css +1 -1
- package/lib/index.umd.js +1735 -1025
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/ar-EG.js +2 -1
- package/lib/locale/lang/ar-EG.min.js +1 -1
- package/lib/locale/lang/de-DE.js +2 -1
- package/lib/locale/lang/de-DE.min.js +1 -1
- package/lib/locale/lang/en-US.js +2 -1
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +2 -1
- package/lib/locale/lang/es-ES.js +2 -1
- package/lib/locale/lang/es-ES.min.js +1 -1
- package/lib/locale/lang/es-ES.umd.js +2 -1
- package/lib/locale/lang/fr-FR.js +2 -1
- package/lib/locale/lang/fr-FR.min.js +1 -1
- package/lib/locale/lang/hu-HU.js +2 -1
- package/lib/locale/lang/hu-HU.min.js +1 -1
- package/lib/locale/lang/hu-HU.umd.js +2 -1
- package/lib/locale/lang/hy-AM.js +2 -1
- package/lib/locale/lang/hy-AM.min.js +1 -1
- package/lib/locale/lang/it-IT.js +2 -1
- package/lib/locale/lang/it-IT.min.js +1 -1
- package/lib/locale/lang/ja-JP.js +2 -1
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +2 -1
- package/lib/locale/lang/ko-KR.js +2 -1
- package/lib/locale/lang/ko-KR.min.js +1 -1
- package/lib/locale/lang/ko-KR.umd.js +2 -1
- package/lib/locale/lang/nb-NO.js +2 -1
- package/lib/locale/lang/nb-NO.min.js +1 -1
- package/lib/locale/lang/pt-BR.js +2 -1
- package/lib/locale/lang/pt-BR.min.js +1 -1
- package/lib/locale/lang/pt-BR.umd.js +2 -1
- package/lib/locale/lang/ru-RU.js +4 -3
- package/lib/locale/lang/ru-RU.min.js +1 -1
- package/lib/locale/lang/ru-RU.umd.js +4 -3
- package/lib/locale/lang/th-TH.js +2 -1
- package/lib/locale/lang/th-TH.min.js +1 -1
- package/lib/locale/lang/ug-CN.js +2 -1
- package/lib/locale/lang/ug-CN.min.js +1 -1
- package/lib/locale/lang/uk-UA.js +518 -517
- package/lib/locale/lang/uk-UA.min.js +1 -1
- package/lib/locale/lang/uk-UA.umd.js +518 -517
- package/lib/locale/lang/vi-VN.js +2 -1
- package/lib/locale/lang/vi-VN.min.js +1 -1
- package/lib/locale/lang/zh-CHT.js +2 -1
- package/lib/locale/lang/zh-CHT.min.js +1 -1
- package/lib/locale/lang/zh-CHT.umd.js +2 -1
- package/lib/locale/lang/zh-CN.js +2 -1
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +2 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/module/edit/mixin.js +12 -2
- package/lib/table/module/edit/mixin.min.js +1 -1
- package/lib/table/module/export/mixin.js +52 -27
- package/lib/table/module/export/mixin.min.js +1 -1
- package/lib/table/module/keyboard/mixin.js +73 -27
- package/lib/table/module/keyboard/mixin.min.js +1 -1
- package/lib/table/module/menu/mixin.js +3 -1
- package/lib/table/src/body.js +89 -60
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/cell.js +3 -5
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/column.js +2 -0
- package/lib/table/src/column.min.js +1 -1
- package/lib/table/src/columnInfo.js +1 -0
- package/lib/table/src/columnInfo.min.js +1 -1
- package/lib/table/src/footer.js +26 -6
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/header.js +38 -153
- package/lib/table/src/header.min.js +1 -1
- package/lib/table/src/methods.js +1076 -551
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/props.js +6 -2
- package/lib/table/src/props.min.js +1 -1
- package/lib/table/src/table.js +269 -129
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +80 -70
- package/lib/table/src/util.min.js +1 -1
- package/lib/table/style/style.css +299 -191
- package/lib/table/style/style.min.css +1 -1
- package/lib/ui/index.js +20 -10
- 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/lib/vxe-table/style/style.css +299 -191
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/locale/lang/ar-EG.ts +2 -1
- package/packages/locale/lang/de-DE.ts +2 -1
- package/packages/locale/lang/en-US.ts +2 -1
- package/packages/locale/lang/es-ES.ts +2 -1
- package/packages/locale/lang/fr-FR.ts +2 -1
- package/packages/locale/lang/hu-HU.ts +2 -1
- package/packages/locale/lang/hy-AM.ts +2 -1
- package/packages/locale/lang/it-IT.ts +2 -1
- package/packages/locale/lang/ja-JP.ts +2 -1
- package/packages/locale/lang/ko-KR.ts +2 -1
- package/packages/locale/lang/nb-NO.ts +2 -1
- package/packages/locale/lang/pt-BR.ts +2 -1
- package/packages/locale/lang/ru-RU.ts +4 -3
- package/packages/locale/lang/th-TH.ts +2 -1
- package/packages/locale/lang/ug-CN.ts +2 -1
- package/packages/locale/lang/uk-UA.ts +518 -517
- package/packages/locale/lang/vi-VN.ts +2 -1
- package/packages/locale/lang/zh-CHT.ts +2 -1
- package/packages/locale/lang/zh-CN.ts +2 -1
- package/packages/table/module/edit/mixin.ts +7 -7
- package/packages/table/module/export/mixin.ts +50 -27
- package/packages/table/module/keyboard/mixin.ts +65 -24
- package/packages/table/module/menu/mixin.ts +4 -1
- package/packages/table/src/body.ts +102 -61
- package/packages/table/src/cell.ts +3 -7
- package/packages/table/src/column.ts +7 -2
- package/packages/table/src/columnInfo.ts +1 -0
- package/packages/table/src/footer.ts +31 -6
- package/packages/table/src/header.ts +45 -141
- package/packages/table/src/methods.ts +957 -461
- package/packages/table/src/props.ts +6 -2
- package/packages/table/src/table.ts +325 -149
- package/packages/table/src/util.ts +75 -62
- package/packages/ui/index.ts +21 -9
- package/styles/components/table.scss +352 -260
- package/styles/theme/base.scss +4 -6
- package/styles/theme/dark.scss +1 -0
- package/styles/theme/light.scss +1 -0
- package/styles/variable.scss +1 -0
- /package/es/{iconfont.1736736807414.ttf → iconfont.1737182271148.ttf} +0 -0
- /package/es/{iconfont.1736736807414.woff → iconfont.1737182271148.woff} +0 -0
- /package/es/{iconfont.1736736807414.woff2 → iconfont.1737182271148.woff2} +0 -0
- /package/lib/{iconfont.1736736807414.ttf → iconfont.1737182271148.ttf} +0 -0
- /package/lib/{iconfont.1736736807414.woff → iconfont.1737182271148.woff} +0 -0
- /package/lib/{iconfont.1736736807414.woff2 → iconfont.1737182271148.woff2} +0 -0
package/lib/index.umd.js
CHANGED
|
@@ -2220,7 +2220,7 @@ function getClass(property, params) {
|
|
|
2220
2220
|
;// CONCATENATED MODULE: ./packages/ui/index.ts
|
|
2221
2221
|
|
|
2222
2222
|
|
|
2223
|
-
const version = "3.12.10-beta.
|
|
2223
|
+
const version = "3.12.10-beta.21";
|
|
2224
2224
|
core_.VxeUI.version = version;
|
|
2225
2225
|
core_.VxeUI.tableVersion = version;
|
|
2226
2226
|
core_.VxeUI.setConfig({
|
|
@@ -2255,7 +2255,10 @@ core_.VxeUI.setConfig({
|
|
|
2255
2255
|
},
|
|
2256
2256
|
resizableConfig: {
|
|
2257
2257
|
dragMode: 'auto',
|
|
2258
|
-
showDragTip: true
|
|
2258
|
+
showDragTip: true,
|
|
2259
|
+
isSyncAutoHeight: true,
|
|
2260
|
+
isSyncAutoWidth: true,
|
|
2261
|
+
minHeight: 18
|
|
2259
2262
|
},
|
|
2260
2263
|
radioConfig: {
|
|
2261
2264
|
// trigger: 'default'
|
|
@@ -2289,6 +2292,11 @@ core_.VxeUI.setConfig({
|
|
|
2289
2292
|
columnConfig: {
|
|
2290
2293
|
maxFixedSize: 4
|
|
2291
2294
|
},
|
|
2295
|
+
cellConfig: {
|
|
2296
|
+
padding: true
|
|
2297
|
+
},
|
|
2298
|
+
headerCellConfig: {},
|
|
2299
|
+
footerCellConfig: {},
|
|
2292
2300
|
// menuConfig: {
|
|
2293
2301
|
// visibleMethod () {}
|
|
2294
2302
|
// },
|
|
@@ -2393,18 +2401,20 @@ core_.VxeUI.setConfig({
|
|
|
2393
2401
|
isReplace: true
|
|
2394
2402
|
},
|
|
2395
2403
|
virtualXConfig: {
|
|
2396
|
-
|
|
2397
|
-
gt: 60
|
|
2398
|
-
|
|
2404
|
+
enabled: true,
|
|
2405
|
+
gt: 60,
|
|
2406
|
+
preSize: 0,
|
|
2407
|
+
oSize: 1
|
|
2399
2408
|
},
|
|
2400
2409
|
virtualYConfig: {
|
|
2401
|
-
|
|
2402
|
-
gt: 100
|
|
2403
|
-
|
|
2410
|
+
enabled: true,
|
|
2411
|
+
gt: 100,
|
|
2412
|
+
preSize: 1,
|
|
2413
|
+
oSize: 2
|
|
2404
2414
|
},
|
|
2405
2415
|
scrollbarConfig: {
|
|
2406
|
-
width:
|
|
2407
|
-
height:
|
|
2416
|
+
// width: 0,
|
|
2417
|
+
// height: 0
|
|
2408
2418
|
}
|
|
2409
2419
|
},
|
|
2410
2420
|
// export: {
|
|
@@ -2824,7 +2834,7 @@ function isNodeElement(elem) {
|
|
|
2824
2834
|
const {
|
|
2825
2835
|
log: log_log
|
|
2826
2836
|
} = core_.VxeUI;
|
|
2827
|
-
const log_version = `table v${"3.12.10-beta.
|
|
2837
|
+
const log_version = `table v${"3.12.10-beta.21"}`;
|
|
2828
2838
|
const warnLog = log_log.create('warn', log_version);
|
|
2829
2839
|
const errLog = log_log.create('error', log_version);
|
|
2830
2840
|
;// CONCATENATED MODULE: ./packages/table/src/columnInfo.ts
|
|
@@ -2927,6 +2937,7 @@ class ColumnInfo {
|
|
|
2927
2937
|
filterRender: _vm.filterRender,
|
|
2928
2938
|
treeNode: _vm.treeNode,
|
|
2929
2939
|
dragSort: _vm.dragSort,
|
|
2940
|
+
rowResize: _vm.rowResize,
|
|
2930
2941
|
cellType: _vm.cellType,
|
|
2931
2942
|
cellRender: _vm.cellRender,
|
|
2932
2943
|
editRender: _vm.editRender,
|
|
@@ -3122,7 +3133,7 @@ function getElementMarginWidth(elem) {
|
|
|
3122
3133
|
}
|
|
3123
3134
|
function handleFieldOrColumn(_vm, fieldOrColumn) {
|
|
3124
3135
|
if (fieldOrColumn) {
|
|
3125
|
-
return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(fieldOrColumn) ? _vm.getColumnByField(fieldOrColumn) : fieldOrColumn;
|
|
3136
|
+
return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(fieldOrColumn) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(fieldOrColumn) ? _vm.getColumnByField(`${fieldOrColumn}`) : fieldOrColumn;
|
|
3126
3137
|
}
|
|
3127
3138
|
return null;
|
|
3128
3139
|
}
|
|
@@ -3207,6 +3218,7 @@ function getColReMinWidth(params) {
|
|
|
3207
3218
|
column,
|
|
3208
3219
|
cell
|
|
3209
3220
|
} = params;
|
|
3221
|
+
const internalData = $table;
|
|
3210
3222
|
const {
|
|
3211
3223
|
showHeaderOverflow: allColumnHeaderOverflow,
|
|
3212
3224
|
resizableOpts
|
|
@@ -3221,6 +3233,9 @@ function getColReMinWidth(params) {
|
|
|
3221
3233
|
return Math.max(1, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(customMinWidth));
|
|
3222
3234
|
}
|
|
3223
3235
|
}
|
|
3236
|
+
const {
|
|
3237
|
+
elemStore
|
|
3238
|
+
} = internalData;
|
|
3224
3239
|
const {
|
|
3225
3240
|
showHeaderOverflow,
|
|
3226
3241
|
minWidth: colMinWidth
|
|
@@ -3247,13 +3262,10 @@ function getColReMinWidth(params) {
|
|
|
3247
3262
|
}
|
|
3248
3263
|
// 如果设置最小宽
|
|
3249
3264
|
if (colMinWidth) {
|
|
3250
|
-
const
|
|
3251
|
-
|
|
3252
|
-
} = $table.$refs;
|
|
3253
|
-
const bodyElem = refTableBody ? refTableBody.$el : null;
|
|
3254
|
-
if (bodyElem) {
|
|
3265
|
+
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
3266
|
+
if (bodyScrollElem) {
|
|
3255
3267
|
if (isScale(colMinWidth)) {
|
|
3256
|
-
const bodyWidth =
|
|
3268
|
+
const bodyWidth = bodyScrollElem.clientWidth - 1;
|
|
3257
3269
|
const meanWidth = bodyWidth / 100;
|
|
3258
3270
|
return Math.max(mWidth, Math.floor(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toInteger(colMinWidth) * meanWidth));
|
|
3259
3271
|
} else if (isPx(colMinWidth)) {
|
|
@@ -3299,14 +3311,39 @@ function getOffsetSize($xeTable) {
|
|
|
3299
3311
|
}
|
|
3300
3312
|
function calcTreeLine(params, prevRow) {
|
|
3301
3313
|
const {
|
|
3302
|
-
$table
|
|
3314
|
+
$table,
|
|
3315
|
+
row
|
|
3303
3316
|
} = params;
|
|
3317
|
+
const tableProps = $table;
|
|
3304
3318
|
const tableReactData = $table;
|
|
3319
|
+
const tableInternalData = $table;
|
|
3320
|
+
const {
|
|
3321
|
+
showOverflow
|
|
3322
|
+
} = tableProps;
|
|
3323
|
+
const {
|
|
3324
|
+
scrollYLoad
|
|
3325
|
+
} = tableReactData;
|
|
3326
|
+
const {
|
|
3327
|
+
fullAllDataRowIdData
|
|
3328
|
+
} = tableInternalData;
|
|
3329
|
+
const rowOpts = $table.computeRowOpts;
|
|
3330
|
+
const cellOpts = $table.computeCellOpts;
|
|
3331
|
+
const defaultRowHeight = $table.computeDefaultRowHeight;
|
|
3332
|
+
const rowid = getRowid($table, row);
|
|
3333
|
+
const rowRest = fullAllDataRowIdData[rowid];
|
|
3334
|
+
const currCellHeight = rowRest.resizeHeight || cellOpts.height || rowOpts.height || defaultRowHeight;
|
|
3305
3335
|
let expandSize = 1;
|
|
3306
3336
|
if (prevRow) {
|
|
3307
3337
|
expandSize = countTreeExpand(prevRow, params);
|
|
3308
3338
|
}
|
|
3309
|
-
|
|
3339
|
+
let cellHeight = currCellHeight;
|
|
3340
|
+
const vnHeight = rowRest.height;
|
|
3341
|
+
if (scrollYLoad) {
|
|
3342
|
+
if (!showOverflow) {
|
|
3343
|
+
cellHeight = vnHeight || currCellHeight;
|
|
3344
|
+
}
|
|
3345
|
+
}
|
|
3346
|
+
return cellHeight * expandSize - (prevRow ? 1 : 12 - getOffsetSize($table));
|
|
3310
3347
|
}
|
|
3311
3348
|
function mergeBodyMethod(mergeList, _rowIndex, _columnIndex) {
|
|
3312
3349
|
for (let mIndex = 0; mIndex < mergeList.length; mIndex++) {
|
|
@@ -3381,43 +3418,32 @@ function createColumn($xeTable, options, renderOptions) {
|
|
|
3381
3418
|
return isColumnInfo(options) ? options : new ColumnInfo($xeTable, options, renderOptions);
|
|
3382
3419
|
}
|
|
3383
3420
|
function rowToVisible($xeTable, row) {
|
|
3421
|
+
const tableProps = $xeTable;
|
|
3384
3422
|
const reactData = $xeTable;
|
|
3385
3423
|
const internalData = $xeTable;
|
|
3386
|
-
const tableProps = $xeTable;
|
|
3387
3424
|
const {
|
|
3388
3425
|
showOverflow
|
|
3389
3426
|
} = tableProps;
|
|
3390
|
-
const refTableBody = $xeTable.$refs.refTableBody;
|
|
3391
3427
|
const {
|
|
3392
|
-
columnStore,
|
|
3393
3428
|
scrollYLoad
|
|
3394
3429
|
} = reactData;
|
|
3395
3430
|
const {
|
|
3431
|
+
elemStore,
|
|
3396
3432
|
afterFullData,
|
|
3397
|
-
|
|
3398
|
-
|
|
3433
|
+
fullAllDataRowIdData,
|
|
3434
|
+
isResizeCellHeight
|
|
3399
3435
|
} = internalData;
|
|
3400
|
-
const
|
|
3401
|
-
|
|
3402
|
-
|
|
3403
|
-
const
|
|
3404
|
-
|
|
3405
|
-
|
|
3406
|
-
} = columnStore;
|
|
3407
|
-
const bodyElem = refTableBody ? refTableBody.$el : null;
|
|
3436
|
+
const rowOpts = $xeTable.computeRowOpts;
|
|
3437
|
+
const cellOpts = $xeTable.computeCellOpts;
|
|
3438
|
+
const defaultRowHeight = $xeTable.computeDefaultRowHeight;
|
|
3439
|
+
const leftFixedWidth = $xeTable.computeLeftFixedWidth;
|
|
3440
|
+
const rightFixedWidth = $xeTable.computeRightFixedWidth;
|
|
3441
|
+
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
3408
3442
|
const rowid = getRowid($xeTable, row);
|
|
3409
|
-
|
|
3410
|
-
|
|
3411
|
-
|
|
3412
|
-
|
|
3413
|
-
let offsetFixedRight = 0;
|
|
3414
|
-
rightList.forEach(item => {
|
|
3415
|
-
offsetFixedRight += item.renderWidth;
|
|
3416
|
-
});
|
|
3417
|
-
if (bodyElem) {
|
|
3418
|
-
const bodyHeight = bodyElem.clientHeight;
|
|
3419
|
-
const bodyScrollTop = bodyElem.scrollTop;
|
|
3420
|
-
const trElem = bodyElem.querySelector(`[rowid="${rowid}"]`);
|
|
3443
|
+
if (bodyScrollElem) {
|
|
3444
|
+
const bodyHeight = bodyScrollElem.clientHeight;
|
|
3445
|
+
const bodyScrollTop = bodyScrollElem.scrollTop;
|
|
3446
|
+
const trElem = bodyScrollElem.querySelector(`[rowid="${rowid}"]`);
|
|
3421
3447
|
if (trElem) {
|
|
3422
3448
|
const trOffsetParent = trElem.offsetParent;
|
|
3423
3449
|
const trOffsetTop = trElem.offsetTop + (trOffsetParent ? trOffsetParent.offsetTop : 0);
|
|
@@ -3431,12 +3457,13 @@ function rowToVisible($xeTable, row) {
|
|
|
3431
3457
|
} else {
|
|
3432
3458
|
// 如果是虚拟渲染滚动
|
|
3433
3459
|
if (scrollYLoad) {
|
|
3434
|
-
|
|
3435
|
-
|
|
3460
|
+
const isCustomCellHeight = isResizeCellHeight || cellOpts.height || rowOpts.height;
|
|
3461
|
+
if (!isCustomCellHeight && showOverflow) {
|
|
3462
|
+
return $xeTable.scrollTo(null, ($xeTable.findRowIndexOf(afterFullData, row) - 1) * defaultRowHeight);
|
|
3436
3463
|
}
|
|
3437
3464
|
let scrollTop = 0;
|
|
3438
3465
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
3439
|
-
const rHeight = rowRest ? rowRest.height ||
|
|
3466
|
+
const rHeight = rowRest ? rowRest.resizeHeight || cellOpts.height || rowOpts.height || defaultRowHeight : defaultRowHeight;
|
|
3440
3467
|
for (let i = 0; i < afterFullData.length; i++) {
|
|
3441
3468
|
const currRow = afterFullData[i];
|
|
3442
3469
|
const currRowid = getRowid($xeTable, currRow);
|
|
@@ -3444,60 +3471,53 @@ function rowToVisible($xeTable, row) {
|
|
|
3444
3471
|
break;
|
|
3445
3472
|
}
|
|
3446
3473
|
const rowRest = fullAllDataRowIdData[currRowid];
|
|
3447
|
-
scrollTop += rowRest ? rowRest.height ||
|
|
3474
|
+
scrollTop += rowRest ? rowRest.resizeHeight || cellOpts.height || rowOpts.height || defaultRowHeight : defaultRowHeight;
|
|
3448
3475
|
}
|
|
3449
3476
|
if (scrollTop < bodyScrollTop) {
|
|
3450
|
-
return $xeTable.scrollTo(null, scrollTop -
|
|
3477
|
+
return $xeTable.scrollTo(null, scrollTop - leftFixedWidth - 1);
|
|
3451
3478
|
}
|
|
3452
|
-
return $xeTable.scrollTo(null, scrollTop + rHeight - (bodyHeight -
|
|
3479
|
+
return $xeTable.scrollTo(null, scrollTop + rHeight - (bodyHeight - rightFixedWidth - 1));
|
|
3453
3480
|
}
|
|
3454
3481
|
}
|
|
3455
3482
|
}
|
|
3456
3483
|
return Promise.resolve();
|
|
3457
3484
|
}
|
|
3458
3485
|
function colToVisible($xeTable, column, row) {
|
|
3486
|
+
const reactData = $xeTable;
|
|
3487
|
+
const internalData = $xeTable;
|
|
3459
3488
|
const {
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
visibleColumn
|
|
3463
|
-
} = $xeTable;
|
|
3464
|
-
const refTableBody = $xeTable.$refs.refTableBody;
|
|
3489
|
+
scrollXLoad
|
|
3490
|
+
} = reactData;
|
|
3465
3491
|
const {
|
|
3466
|
-
|
|
3467
|
-
|
|
3468
|
-
} =
|
|
3469
|
-
const
|
|
3492
|
+
elemStore,
|
|
3493
|
+
visibleColumn
|
|
3494
|
+
} = internalData;
|
|
3495
|
+
const leftFixedWidth = $xeTable.computeLeftFixedWidth;
|
|
3496
|
+
const rightFixedWidth = $xeTable.computeRightFixedWidth;
|
|
3497
|
+
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
3470
3498
|
if (column.fixed) {
|
|
3471
3499
|
return Promise.resolve();
|
|
3472
3500
|
}
|
|
3473
|
-
|
|
3474
|
-
|
|
3475
|
-
|
|
3476
|
-
});
|
|
3477
|
-
let offsetFixedRight = 0;
|
|
3478
|
-
rightList.forEach(item => {
|
|
3479
|
-
offsetFixedRight += item.renderWidth;
|
|
3480
|
-
});
|
|
3481
|
-
if (bodyElem) {
|
|
3482
|
-
const bodyWidth = bodyElem.clientWidth;
|
|
3483
|
-
const bodyScrollLeft = bodyElem.scrollLeft;
|
|
3501
|
+
if (bodyScrollElem) {
|
|
3502
|
+
const bodyWidth = bodyScrollElem.clientWidth;
|
|
3503
|
+
const bodyScrollLeft = bodyScrollElem.scrollLeft;
|
|
3484
3504
|
let tdElem = null;
|
|
3485
3505
|
if (row) {
|
|
3486
3506
|
const rowid = getRowid($xeTable, row);
|
|
3487
|
-
tdElem =
|
|
3507
|
+
tdElem = bodyScrollElem.querySelector(`[rowid="${rowid}"] .${column.id}`);
|
|
3488
3508
|
}
|
|
3489
3509
|
if (!tdElem) {
|
|
3490
|
-
tdElem =
|
|
3510
|
+
tdElem = bodyScrollElem.querySelector(`.${column.id}`);
|
|
3491
3511
|
}
|
|
3492
3512
|
if (tdElem) {
|
|
3493
3513
|
const tdOffsetParent = tdElem.offsetParent;
|
|
3494
3514
|
const tdOffsetLeft = tdElem.offsetLeft + (tdOffsetParent ? tdOffsetParent.offsetLeft : 0);
|
|
3495
3515
|
const cellWidth = tdElem.clientWidth;
|
|
3496
3516
|
// 检测是否在可视区中
|
|
3497
|
-
if (tdOffsetLeft < bodyScrollLeft +
|
|
3498
|
-
return $xeTable.scrollTo(tdOffsetLeft -
|
|
3499
|
-
} else if (tdOffsetLeft + cellWidth - bodyScrollLeft > bodyWidth -
|
|
3500
|
-
return $xeTable.scrollTo(tdOffsetLeft + cellWidth - (bodyWidth -
|
|
3517
|
+
if (tdOffsetLeft < bodyScrollLeft + leftFixedWidth) {
|
|
3518
|
+
return $xeTable.scrollTo(tdOffsetLeft - leftFixedWidth - 1);
|
|
3519
|
+
} else if (tdOffsetLeft + cellWidth - bodyScrollLeft > bodyWidth - rightFixedWidth) {
|
|
3520
|
+
return $xeTable.scrollTo(tdOffsetLeft + cellWidth - (bodyWidth - rightFixedWidth - 1));
|
|
3501
3521
|
}
|
|
3502
3522
|
} else {
|
|
3503
3523
|
// 检测是否在虚拟渲染可视区中
|
|
@@ -3505,15 +3525,16 @@ function colToVisible($xeTable, column, row) {
|
|
|
3505
3525
|
let scrollLeft = 0;
|
|
3506
3526
|
const cellWidth = column.renderWidth;
|
|
3507
3527
|
for (let i = 0; i < visibleColumn.length; i++) {
|
|
3508
|
-
|
|
3528
|
+
const currCol = visibleColumn[i];
|
|
3529
|
+
if (currCol === column || currCol.id === column.id) {
|
|
3509
3530
|
break;
|
|
3510
3531
|
}
|
|
3511
|
-
scrollLeft +=
|
|
3532
|
+
scrollLeft += currCol.renderWidth;
|
|
3512
3533
|
}
|
|
3513
3534
|
if (scrollLeft < bodyScrollLeft) {
|
|
3514
|
-
return $xeTable.scrollTo(scrollLeft -
|
|
3535
|
+
return $xeTable.scrollTo(scrollLeft - leftFixedWidth - 1);
|
|
3515
3536
|
}
|
|
3516
|
-
return $xeTable.scrollTo(scrollLeft + cellWidth - (bodyWidth -
|
|
3537
|
+
return $xeTable.scrollTo(scrollLeft + cellWidth - (bodyWidth - rightFixedWidth - 1));
|
|
3517
3538
|
}
|
|
3518
3539
|
}
|
|
3519
3540
|
}
|
|
@@ -3757,7 +3778,7 @@ function renderTitleContent(h, params, content) {
|
|
|
3757
3778
|
const ons = {};
|
|
3758
3779
|
if (showTitle || showTooltip || showAllTip) {
|
|
3759
3780
|
ons.mouseenter = evnt => {
|
|
3760
|
-
if (tableReactData.
|
|
3781
|
+
if (tableReactData.isDragResize) {
|
|
3761
3782
|
return;
|
|
3762
3783
|
}
|
|
3763
3784
|
if (showTitle) {
|
|
@@ -3769,7 +3790,7 @@ function renderTitleContent(h, params, content) {
|
|
|
3769
3790
|
}
|
|
3770
3791
|
if (showTooltip || showAllTip) {
|
|
3771
3792
|
ons.mouseleave = evnt => {
|
|
3772
|
-
if (tableReactData.
|
|
3793
|
+
if (tableReactData.isDragResize) {
|
|
3773
3794
|
return;
|
|
3774
3795
|
}
|
|
3775
3796
|
if (showTooltip || showAllTip) {
|
|
@@ -4017,9 +4038,7 @@ const Cell = {
|
|
|
4017
4038
|
return Cell.renderTreeIcon(h, params, Cell.renderDefaultCell.call(this, h, params));
|
|
4018
4039
|
},
|
|
4019
4040
|
renderDefaultFooter(h, params) {
|
|
4020
|
-
return
|
|
4021
|
-
class: 'vxe-cell--item'
|
|
4022
|
-
}, getFooterContent(h, params))];
|
|
4041
|
+
return getFooterContent(h, params);
|
|
4023
4042
|
},
|
|
4024
4043
|
/**
|
|
4025
4044
|
* 树节点
|
|
@@ -4874,6 +4893,8 @@ const columnProps = {
|
|
|
4874
4893
|
treeNode: Boolean,
|
|
4875
4894
|
// 设置为拖拽排序
|
|
4876
4895
|
dragSort: Boolean,
|
|
4896
|
+
// 设置为行高拖拽
|
|
4897
|
+
rowResize: Boolean,
|
|
4877
4898
|
// 是否可视
|
|
4878
4899
|
visible: {
|
|
4879
4900
|
type: Boolean,
|
|
@@ -5291,7 +5312,7 @@ function cacheColumnMap($xeTable) {
|
|
|
5291
5312
|
}
|
|
5292
5313
|
fullColumnFieldData[field] = rest;
|
|
5293
5314
|
} else {
|
|
5294
|
-
if (storage || columnOpts.drag && (isCrossDrag || isSelfToChildDrag)) {
|
|
5315
|
+
if (storage && !type || columnOpts.drag && (isCrossDrag || isSelfToChildDrag)) {
|
|
5295
5316
|
errLog('vxe.error.reqProp', [`${column.getTitle() || type || ''} -> column.field`]);
|
|
5296
5317
|
}
|
|
5297
5318
|
}
|
|
@@ -5382,6 +5403,102 @@ const updateScrollYStatus = ($xeTable, fullData) => {
|
|
|
5382
5403
|
reactData.scrollYLoad = scrollYLoad;
|
|
5383
5404
|
return scrollYLoad;
|
|
5384
5405
|
};
|
|
5406
|
+
function updateAfterListIndex($xeTable) {
|
|
5407
|
+
const internalData = $xeTable;
|
|
5408
|
+
const {
|
|
5409
|
+
afterFullData,
|
|
5410
|
+
fullDataRowIdData,
|
|
5411
|
+
fullAllDataRowIdData
|
|
5412
|
+
} = internalData;
|
|
5413
|
+
const fullMaps = {};
|
|
5414
|
+
afterFullData.forEach((row, index) => {
|
|
5415
|
+
const rowid = getRowid($xeTable, row);
|
|
5416
|
+
const rowRest = fullAllDataRowIdData[rowid];
|
|
5417
|
+
const seq = index + 1;
|
|
5418
|
+
if (rowRest) {
|
|
5419
|
+
rowRest.seq = seq;
|
|
5420
|
+
rowRest._index = index;
|
|
5421
|
+
} else {
|
|
5422
|
+
const rest = {
|
|
5423
|
+
row,
|
|
5424
|
+
rowid,
|
|
5425
|
+
seq,
|
|
5426
|
+
index: -1,
|
|
5427
|
+
$index: -1,
|
|
5428
|
+
_index: index,
|
|
5429
|
+
treeIndex: -1,
|
|
5430
|
+
items: [],
|
|
5431
|
+
parent: null,
|
|
5432
|
+
level: 0,
|
|
5433
|
+
height: 0,
|
|
5434
|
+
resizeHeight: 0,
|
|
5435
|
+
oTop: 0
|
|
5436
|
+
};
|
|
5437
|
+
fullAllDataRowIdData[rowid] = rest;
|
|
5438
|
+
fullDataRowIdData[rowid] = rest;
|
|
5439
|
+
}
|
|
5440
|
+
fullMaps[rowid] = row;
|
|
5441
|
+
});
|
|
5442
|
+
internalData.afterFullRowMaps = fullMaps;
|
|
5443
|
+
}
|
|
5444
|
+
/**
|
|
5445
|
+
* 预编译
|
|
5446
|
+
* 对渲染中的数据提前解析序号及索引。牺牲提前编译耗时换取渲染中额外损耗,使运行时更加流畅
|
|
5447
|
+
*/
|
|
5448
|
+
function updateAfterDataIndex($xeTable) {
|
|
5449
|
+
const props = $xeTable;
|
|
5450
|
+
const internalData = $xeTable;
|
|
5451
|
+
const {
|
|
5452
|
+
treeConfig
|
|
5453
|
+
} = props;
|
|
5454
|
+
const {
|
|
5455
|
+
fullDataRowIdData,
|
|
5456
|
+
fullAllDataRowIdData,
|
|
5457
|
+
afterTreeFullData
|
|
5458
|
+
} = internalData;
|
|
5459
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
5460
|
+
const {
|
|
5461
|
+
transform
|
|
5462
|
+
} = treeOpts;
|
|
5463
|
+
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
5464
|
+
const fullMaps = {};
|
|
5465
|
+
if (treeConfig) {
|
|
5466
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(afterTreeFullData, (row, index, items, path) => {
|
|
5467
|
+
const rowid = getRowid($xeTable, row);
|
|
5468
|
+
const rowRest = fullAllDataRowIdData[rowid];
|
|
5469
|
+
const seq = path.map((num, i) => i % 2 === 0 ? Number(num) + 1 : '.').join('');
|
|
5470
|
+
if (rowRest) {
|
|
5471
|
+
rowRest.seq = seq;
|
|
5472
|
+
rowRest.treeIndex = index;
|
|
5473
|
+
} else {
|
|
5474
|
+
const rest = {
|
|
5475
|
+
row,
|
|
5476
|
+
rowid,
|
|
5477
|
+
seq,
|
|
5478
|
+
index: -1,
|
|
5479
|
+
$index: -1,
|
|
5480
|
+
_index: -1,
|
|
5481
|
+
treeIndex: -1,
|
|
5482
|
+
items: [],
|
|
5483
|
+
parent: null,
|
|
5484
|
+
level: 0,
|
|
5485
|
+
height: 0,
|
|
5486
|
+
resizeHeight: 0,
|
|
5487
|
+
oTop: 0
|
|
5488
|
+
};
|
|
5489
|
+
fullAllDataRowIdData[rowid] = rest;
|
|
5490
|
+
fullDataRowIdData[rowid] = rest;
|
|
5491
|
+
}
|
|
5492
|
+
fullMaps[rowid] = row;
|
|
5493
|
+
}, {
|
|
5494
|
+
children: transform ? treeOpts.mapChildrenField : childrenField
|
|
5495
|
+
});
|
|
5496
|
+
internalData.afterFullRowMaps = fullMaps;
|
|
5497
|
+
updateAfterListIndex($xeTable);
|
|
5498
|
+
} else {
|
|
5499
|
+
updateAfterListIndex($xeTable);
|
|
5500
|
+
}
|
|
5501
|
+
}
|
|
5385
5502
|
/**
|
|
5386
5503
|
* 如果为虚拟树,将树结构拍平
|
|
5387
5504
|
* @returns
|
|
@@ -5443,7 +5560,9 @@ function updateStyle($xeTable) {
|
|
|
5443
5560
|
tableColumn,
|
|
5444
5561
|
scrollXLoad,
|
|
5445
5562
|
scrollYLoad,
|
|
5563
|
+
overflowX,
|
|
5446
5564
|
scrollbarWidth,
|
|
5565
|
+
overflowY,
|
|
5447
5566
|
scrollbarHeight,
|
|
5448
5567
|
columnStore,
|
|
5449
5568
|
editStore,
|
|
@@ -5467,6 +5586,8 @@ function updateStyle($xeTable) {
|
|
|
5467
5586
|
return;
|
|
5468
5587
|
}
|
|
5469
5588
|
const containerList = ['main', 'left', 'right'];
|
|
5589
|
+
const osbWidth = overflowY ? scrollbarWidth : 0;
|
|
5590
|
+
const osbHeight = overflowX ? scrollbarHeight : 0;
|
|
5470
5591
|
const emptyPlaceholderElem = $xeTable.$refs.refEmptyPlaceholder;
|
|
5471
5592
|
const cellOffsetWidth = $xeTable.computeCellOffsetWidth;
|
|
5472
5593
|
const mouseOpts = $xeTable.computeMouseOpts;
|
|
@@ -5474,16 +5595,16 @@ function updateStyle($xeTable) {
|
|
|
5474
5595
|
const bodyTableElem = getRefElem(elemStore['main-body-table']);
|
|
5475
5596
|
if (emptyPlaceholderElem) {
|
|
5476
5597
|
emptyPlaceholderElem.style.top = `${headerHeight}px`;
|
|
5477
|
-
emptyPlaceholderElem.style.height = bodyWrapperElem ? `${bodyWrapperElem.offsetHeight -
|
|
5598
|
+
emptyPlaceholderElem.style.height = bodyWrapperElem ? `${bodyWrapperElem.offsetHeight - osbHeight}px` : '';
|
|
5478
5599
|
}
|
|
5479
5600
|
let bodyHeight = 0;
|
|
5480
5601
|
let bodyMaxHeight = 0;
|
|
5481
|
-
const bodyMinHeight = customMinHeight - headerHeight - footerHeight -
|
|
5602
|
+
const bodyMinHeight = customMinHeight - headerHeight - footerHeight - osbHeight;
|
|
5482
5603
|
if (customMaxHeight) {
|
|
5483
|
-
bodyMaxHeight = Math.max(bodyMinHeight, customMaxHeight - headerHeight - footerHeight -
|
|
5604
|
+
bodyMaxHeight = Math.max(bodyMinHeight, customMaxHeight - headerHeight - footerHeight - osbHeight);
|
|
5484
5605
|
}
|
|
5485
5606
|
if (customHeight) {
|
|
5486
|
-
bodyHeight = customHeight - headerHeight - footerHeight -
|
|
5607
|
+
bodyHeight = customHeight - headerHeight - footerHeight - osbHeight;
|
|
5487
5608
|
}
|
|
5488
5609
|
if (!bodyHeight) {
|
|
5489
5610
|
if (bodyTableElem) {
|
|
@@ -5496,35 +5617,42 @@ function updateStyle($xeTable) {
|
|
|
5496
5617
|
}
|
|
5497
5618
|
bodyHeight = Math.max(bodyMinHeight, bodyHeight);
|
|
5498
5619
|
}
|
|
5620
|
+
const xLeftCornerEl = $xeTable.$refs.refScrollXLeftCornerElem;
|
|
5621
|
+
const xRightCornerEl = $xeTable.$refs.refScrollXRightCornerElem;
|
|
5622
|
+
const scrollbarXToTop = $xeTable.computeScrollbarXToTop;
|
|
5499
5623
|
const scrollXVirtualEl = $xeTable.$refs.refScrollXVirtualElem;
|
|
5500
5624
|
if (scrollXVirtualEl) {
|
|
5501
|
-
scrollXVirtualEl.style.height = `${
|
|
5502
|
-
scrollXVirtualEl.style.visibility =
|
|
5625
|
+
scrollXVirtualEl.style.height = `${osbHeight}px`;
|
|
5626
|
+
scrollXVirtualEl.style.visibility = overflowX ? 'visible' : 'hidden';
|
|
5503
5627
|
}
|
|
5504
|
-
const
|
|
5505
|
-
if (
|
|
5506
|
-
|
|
5628
|
+
const xWrapperEl = $xeTable.$refs.refScrollXWrapperElem;
|
|
5629
|
+
if (xWrapperEl) {
|
|
5630
|
+
xWrapperEl.style.left = scrollbarXToTop ? `${osbWidth}px` : '';
|
|
5631
|
+
xWrapperEl.style.width = `${el.clientWidth - osbWidth}px`;
|
|
5632
|
+
}
|
|
5633
|
+
if (xLeftCornerEl) {
|
|
5634
|
+
xLeftCornerEl.style.width = scrollbarXToTop ? `${osbWidth}px` : '';
|
|
5635
|
+
xLeftCornerEl.style.display = scrollbarXToTop ? osbWidth && osbHeight ? 'block' : '' : '';
|
|
5507
5636
|
}
|
|
5508
|
-
const xRightCornerEl = $xeTable.$refs.refScrollXRightCornerElem;
|
|
5509
5637
|
if (xRightCornerEl) {
|
|
5510
|
-
xRightCornerEl.style.width = `${
|
|
5511
|
-
xRightCornerEl.style.display =
|
|
5638
|
+
xRightCornerEl.style.width = scrollbarXToTop ? '' : `${osbWidth}px`;
|
|
5639
|
+
xRightCornerEl.style.display = scrollbarXToTop ? '' : osbWidth && osbHeight ? 'block' : '';
|
|
5512
5640
|
}
|
|
5513
5641
|
const scrollYVirtualEl = $xeTable.$refs.refScrollYVirtualElem;
|
|
5514
5642
|
if (scrollYVirtualEl) {
|
|
5515
|
-
scrollYVirtualEl.style.width = `${
|
|
5643
|
+
scrollYVirtualEl.style.width = `${osbWidth}px`;
|
|
5516
5644
|
scrollYVirtualEl.style.height = `${bodyHeight + headerHeight + footerHeight}px`;
|
|
5517
|
-
scrollYVirtualEl.style.visibility =
|
|
5645
|
+
scrollYVirtualEl.style.visibility = overflowY ? 'visible' : 'hidden';
|
|
5518
5646
|
}
|
|
5519
5647
|
const yTopCornerEl = $xeTable.$refs.refScrollYTopCornerElem;
|
|
5520
5648
|
if (yTopCornerEl) {
|
|
5521
5649
|
yTopCornerEl.style.height = `${headerHeight}px`;
|
|
5522
5650
|
yTopCornerEl.style.display = headerHeight ? 'block' : '';
|
|
5523
5651
|
}
|
|
5524
|
-
const
|
|
5525
|
-
if (
|
|
5526
|
-
|
|
5527
|
-
|
|
5652
|
+
const yWrapperEl = $xeTable.$refs.refScrollYWrapperElem;
|
|
5653
|
+
if (yWrapperEl) {
|
|
5654
|
+
yWrapperEl.style.height = `${bodyHeight}px`;
|
|
5655
|
+
yWrapperEl.style.top = `${headerHeight}px`;
|
|
5528
5656
|
}
|
|
5529
5657
|
const yBottomCornerEl = $xeTable.$refs.refScrollYBottomCornerElem;
|
|
5530
5658
|
if (yBottomCornerEl) {
|
|
@@ -5633,7 +5761,7 @@ function updateStyle($xeTable) {
|
|
|
5633
5761
|
if (wrapperElem) {
|
|
5634
5762
|
wrapperElem.style.top = `${headerHeight}px`;
|
|
5635
5763
|
}
|
|
5636
|
-
fixedWrapperElem.style.height = `${customHeight > 0 ? customHeight : tableHeight + headerHeight + footerHeight +
|
|
5764
|
+
fixedWrapperElem.style.height = `${customHeight > 0 ? customHeight : tableHeight + headerHeight + footerHeight + osbHeight}px`;
|
|
5637
5765
|
fixedWrapperElem.style.width = `${fixedColumn.reduce((previous, column) => previous + column.renderWidth, 0)}px`;
|
|
5638
5766
|
}
|
|
5639
5767
|
let tWidth = tableWidth;
|
|
@@ -5662,7 +5790,7 @@ function updateStyle($xeTable) {
|
|
|
5662
5790
|
if (tableElem) {
|
|
5663
5791
|
tableElem.style.width = tWidth ? `${tWidth}px` : '';
|
|
5664
5792
|
// 兼容性处理
|
|
5665
|
-
tableElem.style.paddingRight =
|
|
5793
|
+
tableElem.style.paddingRight = osbWidth && fixedType && (browse['-moz'] || browse.safari) ? `${osbWidth}px` : '';
|
|
5666
5794
|
}
|
|
5667
5795
|
const emptyBlockElem = getRefElem(elemStore[`${name}-${layout}-emptyBlock`]);
|
|
5668
5796
|
if (emptyBlockElem) {
|
|
@@ -5697,7 +5825,7 @@ function updateStyle($xeTable) {
|
|
|
5697
5825
|
// 如果是固定列
|
|
5698
5826
|
if (fixedWrapperElem) {
|
|
5699
5827
|
if (wrapperElem) {
|
|
5700
|
-
wrapperElem.style.top = `${customHeight > 0 ? customHeight - footerHeight -
|
|
5828
|
+
wrapperElem.style.top = `${customHeight > 0 ? customHeight - footerHeight - osbHeight : tableHeight + headerHeight}px`;
|
|
5701
5829
|
}
|
|
5702
5830
|
}
|
|
5703
5831
|
}
|
|
@@ -5768,62 +5896,69 @@ function updateStyle($xeTable) {
|
|
|
5768
5896
|
return $xeTable.$nextTick();
|
|
5769
5897
|
}
|
|
5770
5898
|
function computeRowHeight($xeTable) {
|
|
5899
|
+
const props = $xeTable;
|
|
5900
|
+
const {
|
|
5901
|
+
showOverflow
|
|
5902
|
+
} = props;
|
|
5771
5903
|
const tableHeader = $xeTable.$refs.refTableHeader;
|
|
5772
5904
|
const tableBody = $xeTable.$refs.refTableBody;
|
|
5773
5905
|
const tableBodyElem = tableBody ? tableBody.$el : null;
|
|
5774
5906
|
const defaultRowHeight = $xeTable.computeDefaultRowHeight;
|
|
5775
5907
|
let rowHeight = 0;
|
|
5776
|
-
if (
|
|
5777
|
-
|
|
5778
|
-
|
|
5779
|
-
|
|
5780
|
-
|
|
5781
|
-
firstTrElem
|
|
5908
|
+
if (showOverflow) {
|
|
5909
|
+
if (tableBodyElem) {
|
|
5910
|
+
const tableHeaderElem = tableHeader ? tableHeader.$el : null;
|
|
5911
|
+
let firstTrElem;
|
|
5912
|
+
firstTrElem = tableBodyElem.querySelector('tr');
|
|
5913
|
+
if (!firstTrElem && tableHeaderElem) {
|
|
5914
|
+
firstTrElem = tableHeaderElem.querySelector('tr');
|
|
5915
|
+
}
|
|
5916
|
+
if (firstTrElem) {
|
|
5917
|
+
rowHeight = firstTrElem.clientHeight;
|
|
5918
|
+
}
|
|
5782
5919
|
}
|
|
5783
|
-
if (
|
|
5784
|
-
rowHeight =
|
|
5920
|
+
if (!rowHeight) {
|
|
5921
|
+
rowHeight = defaultRowHeight;
|
|
5785
5922
|
}
|
|
5786
|
-
}
|
|
5787
|
-
if (!rowHeight) {
|
|
5923
|
+
} else {
|
|
5788
5924
|
rowHeight = defaultRowHeight;
|
|
5789
5925
|
}
|
|
5790
5926
|
// 最低支持 18px 行高
|
|
5791
5927
|
return Math.max(18, rowHeight);
|
|
5792
5928
|
}
|
|
5793
|
-
function handleVirtualYVisible($xeTable) {
|
|
5929
|
+
function handleVirtualYVisible($xeTable, currScrollTop) {
|
|
5794
5930
|
const props = $xeTable;
|
|
5795
|
-
const reactData = $xeTable;
|
|
5796
5931
|
const internalData = $xeTable;
|
|
5797
5932
|
const {
|
|
5798
5933
|
showOverflow
|
|
5799
5934
|
} = props;
|
|
5800
|
-
const {
|
|
5801
|
-
rowHeight
|
|
5802
|
-
} = reactData;
|
|
5803
5935
|
const {
|
|
5804
5936
|
elemStore,
|
|
5937
|
+
isResizeCellHeight,
|
|
5805
5938
|
afterFullData,
|
|
5806
5939
|
fullAllDataRowIdData
|
|
5807
5940
|
} = internalData;
|
|
5941
|
+
const rowOpts = $xeTable.computeRowOpts;
|
|
5942
|
+
const cellOpts = $xeTable.computeCellOpts;
|
|
5943
|
+
const defaultRowHeight = $xeTable.computeDefaultRowHeight;
|
|
5808
5944
|
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
5809
5945
|
if (bodyScrollElem) {
|
|
5810
|
-
const
|
|
5811
|
-
|
|
5812
|
-
clientHeight
|
|
5813
|
-
} = bodyScrollElem;
|
|
5946
|
+
const clientHeight = bodyScrollElem.clientHeight;
|
|
5947
|
+
const scrollTop = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(currScrollTop) ? currScrollTop : bodyScrollElem.scrollTop;
|
|
5814
5948
|
const endHeight = scrollTop + clientHeight;
|
|
5815
5949
|
let toVisibleIndex = -1;
|
|
5816
5950
|
let offsetTop = 0;
|
|
5817
5951
|
let visibleSize = 0;
|
|
5818
|
-
|
|
5819
|
-
|
|
5820
|
-
|
|
5952
|
+
const isCustomCellHeight = isResizeCellHeight || cellOpts.height || rowOpts.height;
|
|
5953
|
+
if (!isCustomCellHeight && showOverflow) {
|
|
5954
|
+
toVisibleIndex = Math.floor(scrollTop / defaultRowHeight);
|
|
5955
|
+
visibleSize = Math.ceil(clientHeight / defaultRowHeight) + 1;
|
|
5821
5956
|
} else {
|
|
5822
5957
|
for (let rIndex = 0, rLen = afterFullData.length; rIndex < rLen; rIndex++) {
|
|
5823
5958
|
const row = afterFullData[rIndex];
|
|
5824
5959
|
const rowid = getRowid($xeTable, row);
|
|
5825
5960
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
5826
|
-
offsetTop += rowRest ? rowRest.height ||
|
|
5961
|
+
offsetTop += rowRest ? rowRest.resizeHeight || cellOpts.height || rowOpts.height || defaultRowHeight : defaultRowHeight;
|
|
5827
5962
|
if (toVisibleIndex === -1 && scrollTop < offsetTop) {
|
|
5828
5963
|
toVisibleIndex = rIndex;
|
|
5829
5964
|
}
|
|
@@ -6111,7 +6246,7 @@ function autoCellWidth($xeTable) {
|
|
|
6111
6246
|
}
|
|
6112
6247
|
const tableHeight = bodyElem.offsetHeight;
|
|
6113
6248
|
const overflowY = yHandleEl.scrollHeight > yHandleEl.clientHeight;
|
|
6114
|
-
reactData.scrollbarWidth =
|
|
6249
|
+
reactData.scrollbarWidth = Math.max(scrollbarOpts.width || 0, yHandleEl.offsetWidth - yHandleEl.clientWidth);
|
|
6115
6250
|
reactData.overflowY = overflowY;
|
|
6116
6251
|
internalData.tableWidth = tableWidth;
|
|
6117
6252
|
internalData.tableHeight = tableHeight;
|
|
@@ -6120,7 +6255,7 @@ function autoCellWidth($xeTable) {
|
|
|
6120
6255
|
const headerHeight = headerTableElem ? headerTableElem.clientHeight : 0;
|
|
6121
6256
|
const overflowX = tableWidth > bodyWidth;
|
|
6122
6257
|
const footerHeight = footerTableElem ? footerTableElem.clientHeight : 0;
|
|
6123
|
-
reactData.scrollbarHeight =
|
|
6258
|
+
reactData.scrollbarHeight = Math.max(scrollbarOpts.height || 0, xHandleEl.offsetHeight - xHandleEl.clientHeight);
|
|
6124
6259
|
internalData.headerHeight = headerHeight;
|
|
6125
6260
|
internalData.footerHeight = footerHeight;
|
|
6126
6261
|
reactData.overflowX = overflowX;
|
|
@@ -6130,20 +6265,22 @@ function autoCellWidth($xeTable) {
|
|
|
6130
6265
|
$xeTable.checkScrolling();
|
|
6131
6266
|
}
|
|
6132
6267
|
}
|
|
6133
|
-
|
|
6134
|
-
|
|
6135
|
-
|
|
6136
|
-
|
|
6137
|
-
|
|
6138
|
-
|
|
6139
|
-
|
|
6140
|
-
|
|
6141
|
-
|
|
6142
|
-
|
|
6143
|
-
|
|
6144
|
-
|
|
6145
|
-
|
|
6146
|
-
|
|
6268
|
+
const calcCellAutoHeight = (rowRest, wrapperEl) => {
|
|
6269
|
+
const cellElemList = wrapperEl.querySelectorAll(`.vxe-cell--wrapper[rowid="${rowRest.rowid}"]`);
|
|
6270
|
+
let topBottomPadding = 0;
|
|
6271
|
+
const firstCellEl = cellElemList[0];
|
|
6272
|
+
if (firstCellEl && firstCellEl.parentElement) {
|
|
6273
|
+
const cellStyle = getComputedStyle(firstCellEl.parentElement);
|
|
6274
|
+
topBottomPadding = Math.ceil(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellStyle.paddingTop) + external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellStyle.paddingBottom));
|
|
6275
|
+
}
|
|
6276
|
+
let colHeight = rowRest.height - topBottomPadding;
|
|
6277
|
+
for (let i = 0; i < cellElemList.length; i++) {
|
|
6278
|
+
const cellElem = cellElemList[i];
|
|
6279
|
+
const cellHeight = cellElem ? cellElem.clientHeight : 0;
|
|
6280
|
+
colHeight = Math.max(colHeight, Math.ceil(cellHeight));
|
|
6281
|
+
}
|
|
6282
|
+
return colHeight + topBottomPadding;
|
|
6283
|
+
};
|
|
6147
6284
|
const calcCellHeight = $xeTable => {
|
|
6148
6285
|
const props = $xeTable;
|
|
6149
6286
|
const reactData = $xeTable;
|
|
@@ -6153,45 +6290,25 @@ const calcCellHeight = $xeTable => {
|
|
|
6153
6290
|
} = props;
|
|
6154
6291
|
const {
|
|
6155
6292
|
tableData,
|
|
6293
|
+
scrollYLoad,
|
|
6156
6294
|
scrollXLoad
|
|
6157
6295
|
} = reactData;
|
|
6158
6296
|
const {
|
|
6159
6297
|
fullAllDataRowIdData
|
|
6160
6298
|
} = internalData;
|
|
6299
|
+
const defaultRowHeight = $xeTable.computeDefaultRowHeight;
|
|
6161
6300
|
const el = $xeTable.$refs.refElem;
|
|
6162
|
-
if (!showOverflow && el) {
|
|
6163
|
-
let paddingTop = 0;
|
|
6164
|
-
let paddingBottom = 0;
|
|
6165
|
-
let calcPadding = false;
|
|
6301
|
+
if (!showOverflow && scrollYLoad && el) {
|
|
6166
6302
|
tableData.forEach(row => {
|
|
6167
6303
|
const rowid = getRowid($xeTable, row);
|
|
6168
6304
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
6169
|
-
|
|
6170
|
-
|
|
6171
|
-
|
|
6172
|
-
for (let i = 0; i < cellList.length; i++) {
|
|
6173
|
-
const cellElem = cellList[i];
|
|
6174
|
-
const tdEl = cellElem.parentElement;
|
|
6175
|
-
if (!tdEl || !tdEl.clientWidth) {
|
|
6176
|
-
break;
|
|
6177
|
-
}
|
|
6178
|
-
if (!calcPadding) {
|
|
6179
|
-
paddingTop = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(getComputedStyle(tdEl).paddingTop);
|
|
6180
|
-
paddingBottom = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(getComputedStyle(tdEl).paddingBottom);
|
|
6181
|
-
calcPadding = true;
|
|
6182
|
-
}
|
|
6183
|
-
let cellHeight = paddingTop + paddingBottom;
|
|
6184
|
-
if (cellElem) {
|
|
6185
|
-
cellHeight += cellElem.clientHeight;
|
|
6186
|
-
}
|
|
6187
|
-
height = Math.max(height, cellHeight);
|
|
6188
|
-
}
|
|
6189
|
-
rowRest.height = scrollXLoad ? Math.max(rowRest.height, height) : height;
|
|
6305
|
+
if (rowRest) {
|
|
6306
|
+
const height = calcCellAutoHeight(rowRest, el);
|
|
6307
|
+
rowRest.height = Math.max(defaultRowHeight, scrollXLoad ? Math.max(rowRest.height, height) : height);
|
|
6190
6308
|
}
|
|
6191
6309
|
});
|
|
6192
|
-
reactData.
|
|
6310
|
+
reactData.calcCellHeightFlag++;
|
|
6193
6311
|
}
|
|
6194
|
-
// updateCellOffset()
|
|
6195
6312
|
};
|
|
6196
6313
|
function getOrderField(_vm, column) {
|
|
6197
6314
|
const {
|
|
@@ -6218,6 +6335,18 @@ function getOrderField(_vm, column) {
|
|
|
6218
6335
|
return cellValue;
|
|
6219
6336
|
};
|
|
6220
6337
|
}
|
|
6338
|
+
function handleTargetEnterEvent($xeTable, isClear) {
|
|
6339
|
+
const internalData = $xeTable;
|
|
6340
|
+
const $tooltip = $xeTable.$refs.refTooltip;
|
|
6341
|
+
clearTimeout(internalData.tooltipTimeout);
|
|
6342
|
+
if (isClear) {
|
|
6343
|
+
$xeTable.closeTooltip();
|
|
6344
|
+
} else {
|
|
6345
|
+
if ($tooltip && $tooltip.setActived) {
|
|
6346
|
+
$tooltip.setActived(true);
|
|
6347
|
+
}
|
|
6348
|
+
}
|
|
6349
|
+
}
|
|
6221
6350
|
function clearDragStatus($xeTable) {
|
|
6222
6351
|
const reactData = $xeTable;
|
|
6223
6352
|
const {
|
|
@@ -6328,29 +6457,35 @@ function showDropTip($xeTable, evnt, trEl, thEl, showLine, dragPos) {
|
|
|
6328
6457
|
return;
|
|
6329
6458
|
}
|
|
6330
6459
|
const {
|
|
6460
|
+
overflowX,
|
|
6331
6461
|
scrollbarWidth,
|
|
6462
|
+
overflowY,
|
|
6332
6463
|
scrollbarHeight
|
|
6333
6464
|
} = reactData;
|
|
6334
6465
|
const {
|
|
6335
6466
|
prevDragToChild
|
|
6336
6467
|
} = internalData;
|
|
6337
6468
|
const wrapperRect = el.getBoundingClientRect();
|
|
6469
|
+
const osbWidth = overflowY ? scrollbarWidth : 0;
|
|
6470
|
+
const osbHeight = overflowX ? scrollbarHeight : 0;
|
|
6338
6471
|
const tableWidth = el.clientWidth;
|
|
6339
6472
|
const tableHeight = el.clientHeight;
|
|
6340
6473
|
if (trEl) {
|
|
6341
6474
|
const rdLineEl = $xeTable.$refs.refDragRowLineElem;
|
|
6342
6475
|
if (rdLineEl) {
|
|
6343
6476
|
if (showLine) {
|
|
6477
|
+
const scrollbarYToLeft = $xeTable.computeScrollbarYToLeft;
|
|
6344
6478
|
const trRect = trEl.getBoundingClientRect();
|
|
6345
6479
|
let trHeight = trEl.clientHeight;
|
|
6346
6480
|
const offsetTop = Math.max(1, trRect.y - wrapperRect.y);
|
|
6347
|
-
if (offsetTop + trHeight > tableHeight -
|
|
6348
|
-
trHeight = tableHeight - offsetTop -
|
|
6481
|
+
if (offsetTop + trHeight > tableHeight - osbHeight) {
|
|
6482
|
+
trHeight = tableHeight - offsetTop - osbHeight;
|
|
6349
6483
|
}
|
|
6350
6484
|
rdLineEl.style.display = 'block';
|
|
6485
|
+
rdLineEl.style.left = `${scrollbarYToLeft ? osbWidth : 0}px`;
|
|
6351
6486
|
rdLineEl.style.top = `${offsetTop}px`;
|
|
6352
6487
|
rdLineEl.style.height = `${trHeight}px`;
|
|
6353
|
-
rdLineEl.style.width = `${tableWidth -
|
|
6488
|
+
rdLineEl.style.width = `${tableWidth - osbWidth}px`;
|
|
6354
6489
|
rdLineEl.setAttribute('drag-pos', dragPos);
|
|
6355
6490
|
rdLineEl.setAttribute('drag-to-child', prevDragToChild ? 'y' : 'n');
|
|
6356
6491
|
} else {
|
|
@@ -6361,6 +6496,7 @@ function showDropTip($xeTable, evnt, trEl, thEl, showLine, dragPos) {
|
|
|
6361
6496
|
const cdLineEl = $xeTable.$refs.refDragColLineElem;
|
|
6362
6497
|
if (cdLineEl) {
|
|
6363
6498
|
if (showLine) {
|
|
6499
|
+
const scrollbarXToTop = $xeTable.computeScrollbarXToTop;
|
|
6364
6500
|
const leftContainerElem = $xeTable.$refs.refLeftContainer;
|
|
6365
6501
|
const leftContainerWidth = leftContainerElem ? leftContainerElem.clientWidth : 0;
|
|
6366
6502
|
const rightContainerElem = $xeTable.$refs.refRightContainer;
|
|
@@ -6374,7 +6510,7 @@ function showDropTip($xeTable, evnt, trEl, thEl, showLine, dragPos) {
|
|
|
6374
6510
|
thWidth -= startX - offsetLeft;
|
|
6375
6511
|
offsetLeft = startX;
|
|
6376
6512
|
}
|
|
6377
|
-
const endX = tableWidth - rightContainerWidth - (rightContainerWidth ? 0 :
|
|
6513
|
+
const endX = tableWidth - rightContainerWidth - (rightContainerWidth ? 0 : osbWidth);
|
|
6378
6514
|
if (offsetLeft + thWidth > endX) {
|
|
6379
6515
|
thWidth = endX - offsetLeft;
|
|
6380
6516
|
}
|
|
@@ -6385,7 +6521,7 @@ function showDropTip($xeTable, evnt, trEl, thEl, showLine, dragPos) {
|
|
|
6385
6521
|
if (prevDragToChild) {
|
|
6386
6522
|
cdLineEl.style.height = `${thRect.height}px`;
|
|
6387
6523
|
} else {
|
|
6388
|
-
cdLineEl.style.height = `${tableHeight - offsetTop -
|
|
6524
|
+
cdLineEl.style.height = `${tableHeight - offsetTop - (scrollbarXToTop ? 0 : osbHeight)}px`;
|
|
6389
6525
|
}
|
|
6390
6526
|
cdLineEl.setAttribute('drag-pos', dragPos);
|
|
6391
6527
|
cdLineEl.setAttribute('drag-to-child', prevDragToChild ? 'y' : 'n');
|
|
@@ -6416,6 +6552,49 @@ function hideDropTip($xeTable) {
|
|
|
6416
6552
|
cdLineEl.style.display = '';
|
|
6417
6553
|
}
|
|
6418
6554
|
}
|
|
6555
|
+
/**
|
|
6556
|
+
* 处理显示 tooltip
|
|
6557
|
+
* @param {Event} evnt 事件
|
|
6558
|
+
* @param {Row} row 行对象
|
|
6559
|
+
*/
|
|
6560
|
+
function handleTooltip($xeTable, evnt, tdEl, overflowElem, tipElem, params) {
|
|
6561
|
+
const reactData = $xeTable;
|
|
6562
|
+
if (!overflowElem) {
|
|
6563
|
+
return $xeTable.$nextTick();
|
|
6564
|
+
}
|
|
6565
|
+
params.cell = tdEl;
|
|
6566
|
+
const {
|
|
6567
|
+
tooltipStore
|
|
6568
|
+
} = reactData;
|
|
6569
|
+
const tooltipOpts = $xeTable.computeTooltipOpts;
|
|
6570
|
+
const {
|
|
6571
|
+
column,
|
|
6572
|
+
row
|
|
6573
|
+
} = params;
|
|
6574
|
+
const {
|
|
6575
|
+
showAll,
|
|
6576
|
+
contentMethod
|
|
6577
|
+
} = tooltipOpts;
|
|
6578
|
+
const customContent = contentMethod ? contentMethod(params) : null;
|
|
6579
|
+
const useCustom = contentMethod && !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(customContent);
|
|
6580
|
+
const content = useCustom ? customContent : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toString(column.type === 'html' ? overflowElem.innerText : overflowElem.textContent).trim();
|
|
6581
|
+
const isCellOverflow = overflowElem.scrollWidth > overflowElem.clientWidth;
|
|
6582
|
+
if (content && (showAll || useCustom || isCellOverflow)) {
|
|
6583
|
+
Object.assign(tooltipStore, {
|
|
6584
|
+
row,
|
|
6585
|
+
column,
|
|
6586
|
+
visible: true,
|
|
6587
|
+
currOpts: {}
|
|
6588
|
+
});
|
|
6589
|
+
$xeTable.$nextTick(() => {
|
|
6590
|
+
const $tooltip = $xeTable.$refs.refTooltip;
|
|
6591
|
+
if ($tooltip && $tooltip.open) {
|
|
6592
|
+
$tooltip.open(isCellOverflow ? overflowElem : tipElem || overflowElem, formatText(content));
|
|
6593
|
+
}
|
|
6594
|
+
});
|
|
6595
|
+
}
|
|
6596
|
+
return $xeTable.$nextTick();
|
|
6597
|
+
}
|
|
6419
6598
|
function handleScrollToRowColumn($xeTable, fieldOrColumn, row) {
|
|
6420
6599
|
const internalData = $xeTable;
|
|
6421
6600
|
const {
|
|
@@ -6440,16 +6619,16 @@ function computeScrollLoad($xeTable) {
|
|
|
6440
6619
|
scrollXStore,
|
|
6441
6620
|
scrollYStore
|
|
6442
6621
|
} = internalData;
|
|
6443
|
-
const
|
|
6444
|
-
const
|
|
6622
|
+
const virtualYOpts = $xeTable.computeVirtualYOpts;
|
|
6623
|
+
const virtualXOpts = $xeTable.computeVirtualXOpts;
|
|
6445
6624
|
// 计算 X 逻辑
|
|
6446
6625
|
if (scrollXLoad) {
|
|
6447
6626
|
const {
|
|
6448
6627
|
toVisibleIndex: toXVisibleIndex,
|
|
6449
6628
|
visibleSize: visibleXSize
|
|
6450
6629
|
} = handleVirtualXVisible($xeTable);
|
|
6451
|
-
const offsetXSize = Math.max(0,
|
|
6452
|
-
scrollXStore.preloadSize =
|
|
6630
|
+
const offsetXSize = Math.max(0, virtualXOpts.oSize ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(virtualXOpts.oSize) : 0);
|
|
6631
|
+
scrollXStore.preloadSize = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(virtualXOpts.preSize);
|
|
6453
6632
|
scrollXStore.offsetSize = offsetXSize;
|
|
6454
6633
|
scrollXStore.visibleSize = visibleXSize;
|
|
6455
6634
|
scrollXStore.endIndex = Math.max(scrollXStore.startIndex + scrollXStore.visibleSize + offsetXSize, scrollXStore.endIndex);
|
|
@@ -6461,7 +6640,6 @@ function computeScrollLoad($xeTable) {
|
|
|
6461
6640
|
} else {
|
|
6462
6641
|
$xeTable.updateScrollXSpace();
|
|
6463
6642
|
}
|
|
6464
|
-
calcCellHeight($xeTable);
|
|
6465
6643
|
// 计算 Y 逻辑
|
|
6466
6644
|
const rowHeight = computeRowHeight($xeTable);
|
|
6467
6645
|
scrollYStore.rowHeight = rowHeight;
|
|
@@ -6471,8 +6649,8 @@ function computeScrollLoad($xeTable) {
|
|
|
6471
6649
|
visibleSize: visibleYSize
|
|
6472
6650
|
} = handleVirtualYVisible($xeTable);
|
|
6473
6651
|
if (scrollYLoad) {
|
|
6474
|
-
const offsetYSize = Math.max(0,
|
|
6475
|
-
scrollYStore.preloadSize =
|
|
6652
|
+
const offsetYSize = Math.max(0, virtualYOpts.oSize ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(virtualYOpts.oSize) : 0);
|
|
6653
|
+
scrollYStore.preloadSize = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(virtualYOpts.preSize);
|
|
6476
6654
|
scrollYStore.offsetSize = offsetYSize;
|
|
6477
6655
|
scrollYStore.visibleSize = visibleYSize;
|
|
6478
6656
|
scrollYStore.endIndex = Math.max(scrollYStore.startIndex + visibleYSize + offsetYSize, scrollYStore.endIndex);
|
|
@@ -6498,12 +6676,14 @@ function handleRecalculateLayout($xeTable, reFull) {
|
|
|
6498
6676
|
}
|
|
6499
6677
|
calcCellWidth($xeTable);
|
|
6500
6678
|
autoCellWidth($xeTable);
|
|
6679
|
+
updateStyle($xeTable);
|
|
6501
6680
|
return computeScrollLoad($xeTable).then(() => {
|
|
6502
6681
|
if (reFull === true) {
|
|
6503
6682
|
// 初始化时需要在列计算之后再执行优化运算,达到最优显示效果
|
|
6504
6683
|
calcCellHeight($xeTable);
|
|
6505
6684
|
calcCellWidth($xeTable);
|
|
6506
6685
|
autoCellWidth($xeTable);
|
|
6686
|
+
updateStyle($xeTable);
|
|
6507
6687
|
return computeScrollLoad($xeTable);
|
|
6508
6688
|
}
|
|
6509
6689
|
});
|
|
@@ -6782,7 +6962,7 @@ function handleColumn($xeTable, collectColumn) {
|
|
|
6782
6962
|
/**
|
|
6783
6963
|
* 纵向 Y 可视渲染处理
|
|
6784
6964
|
*/
|
|
6785
|
-
function loadScrollYData($xeTable) {
|
|
6965
|
+
function loadScrollYData($xeTable, scrollTop) {
|
|
6786
6966
|
const props = $xeTable;
|
|
6787
6967
|
const reactData = $xeTable;
|
|
6788
6968
|
const internalData = $xeTable;
|
|
@@ -6805,7 +6985,7 @@ function loadScrollYData($xeTable) {
|
|
|
6805
6985
|
const {
|
|
6806
6986
|
toVisibleIndex,
|
|
6807
6987
|
visibleSize
|
|
6808
|
-
} = handleVirtualYVisible($xeTable);
|
|
6988
|
+
} = handleVirtualYVisible($xeTable, scrollTop);
|
|
6809
6989
|
const offsetItem = {
|
|
6810
6990
|
startIndex: Math.max(0, toVisibleIndex - 1 - offsetSize - preloadSize),
|
|
6811
6991
|
endIndex: toVisibleIndex + visibleSize + autoOffsetYSize + preloadSize
|
|
@@ -6825,6 +7005,54 @@ function loadScrollYData($xeTable) {
|
|
|
6825
7005
|
}
|
|
6826
7006
|
}
|
|
6827
7007
|
}
|
|
7008
|
+
function lazyScrollXData($xeTable) {
|
|
7009
|
+
const internalData = $xeTable;
|
|
7010
|
+
const {
|
|
7011
|
+
lxTimeout,
|
|
7012
|
+
lxRunTime,
|
|
7013
|
+
scrollXStore
|
|
7014
|
+
} = internalData;
|
|
7015
|
+
const {
|
|
7016
|
+
visibleSize
|
|
7017
|
+
} = scrollXStore;
|
|
7018
|
+
const fpsTime = Math.max(5, Math.min(10, Math.floor(visibleSize / 3)));
|
|
7019
|
+
if (lxTimeout) {
|
|
7020
|
+
clearTimeout(lxTimeout);
|
|
7021
|
+
}
|
|
7022
|
+
if (!lxRunTime || lxRunTime + fpsTime < Date.now()) {
|
|
7023
|
+
internalData.lxRunTime = Date.now();
|
|
7024
|
+
loadScrollXData($xeTable);
|
|
7025
|
+
}
|
|
7026
|
+
internalData.lxTimeout = setTimeout(() => {
|
|
7027
|
+
internalData.lxTimeout = undefined;
|
|
7028
|
+
internalData.lxRunTime = undefined;
|
|
7029
|
+
loadScrollXData($xeTable);
|
|
7030
|
+
}, fpsTime);
|
|
7031
|
+
}
|
|
7032
|
+
function lazyScrollYData($xeTable) {
|
|
7033
|
+
const internalData = $xeTable;
|
|
7034
|
+
const {
|
|
7035
|
+
lyTimeout,
|
|
7036
|
+
lyRunTime,
|
|
7037
|
+
scrollYStore
|
|
7038
|
+
} = internalData;
|
|
7039
|
+
const {
|
|
7040
|
+
visibleSize
|
|
7041
|
+
} = scrollYStore;
|
|
7042
|
+
const fpsTime = Math.floor(Math.max(4, Math.min(10, visibleSize / 3)));
|
|
7043
|
+
if (lyTimeout) {
|
|
7044
|
+
clearTimeout(lyTimeout);
|
|
7045
|
+
}
|
|
7046
|
+
if (!lyRunTime || lyRunTime + fpsTime < Date.now()) {
|
|
7047
|
+
internalData.lyRunTime = Date.now();
|
|
7048
|
+
loadScrollYData($xeTable);
|
|
7049
|
+
}
|
|
7050
|
+
internalData.lyTimeout = setTimeout(() => {
|
|
7051
|
+
internalData.lyTimeout = undefined;
|
|
7052
|
+
internalData.lyRunTime = undefined;
|
|
7053
|
+
loadScrollYData($xeTable);
|
|
7054
|
+
}, fpsTime);
|
|
7055
|
+
}
|
|
6828
7056
|
function checkLastSyncScroll($xeTable, isRollX, isRollY) {
|
|
6829
7057
|
const reactData = $xeTable;
|
|
6830
7058
|
const internalData = $xeTable;
|
|
@@ -6841,27 +7069,63 @@ function checkLastSyncScroll($xeTable, isRollX, isRollY) {
|
|
|
6841
7069
|
internalData.lcsTimeout = setTimeout(() => {
|
|
6842
7070
|
internalData.lcsRunTime = Date.now();
|
|
6843
7071
|
internalData.lcsTimeout = undefined;
|
|
7072
|
+
internalData.intoRunScroll = false;
|
|
6844
7073
|
internalData.inVirtualScroll = false;
|
|
6845
7074
|
internalData.inWheelScroll = false;
|
|
6846
7075
|
internalData.inHeaderScroll = false;
|
|
6847
7076
|
internalData.inBodyScroll = false;
|
|
6848
7077
|
internalData.inFooterScroll = false;
|
|
6849
7078
|
internalData.scrollRenderType = '';
|
|
7079
|
+
calcCellHeight($xeTable);
|
|
6850
7080
|
if (isRollX && scrollXLoad) {
|
|
6851
|
-
$xeTable.updateScrollXData()
|
|
6852
|
-
calcCellHeight($xeTable);
|
|
6853
|
-
loadScrollXData($xeTable);
|
|
6854
|
-
});
|
|
7081
|
+
$xeTable.updateScrollXData();
|
|
6855
7082
|
}
|
|
6856
7083
|
if (isRollY && scrollYLoad) {
|
|
6857
7084
|
$xeTable.updateScrollYData().then(() => {
|
|
6858
7085
|
calcCellHeight($xeTable);
|
|
6859
|
-
|
|
7086
|
+
$xeTable.updateScrollYSpace();
|
|
6860
7087
|
});
|
|
6861
7088
|
}
|
|
6862
7089
|
$xeTable.updateCellAreas();
|
|
6863
7090
|
}, 200);
|
|
6864
7091
|
}
|
|
7092
|
+
const getWheelSpeed = lastScrollTime => {
|
|
7093
|
+
let multiple = 1;
|
|
7094
|
+
const currTime = Date.now();
|
|
7095
|
+
if (lastScrollTime + 25 > currTime) {
|
|
7096
|
+
multiple = 1.18;
|
|
7097
|
+
} else if (lastScrollTime + 30 > currTime) {
|
|
7098
|
+
multiple = 1.15;
|
|
7099
|
+
} else if (lastScrollTime + 40 > currTime) {
|
|
7100
|
+
multiple = 1.12;
|
|
7101
|
+
} else if (lastScrollTime + 55 > currTime) {
|
|
7102
|
+
multiple = 1.09;
|
|
7103
|
+
} else if (lastScrollTime + 75 > currTime) {
|
|
7104
|
+
multiple = 1.06;
|
|
7105
|
+
} else if (lastScrollTime + 100 > currTime) {
|
|
7106
|
+
multiple = 1.03;
|
|
7107
|
+
}
|
|
7108
|
+
return multiple;
|
|
7109
|
+
};
|
|
7110
|
+
const wheelScrollTo = (diffNum, cb) => {
|
|
7111
|
+
const duration = Math.abs(diffNum);
|
|
7112
|
+
const startTime = performance.now();
|
|
7113
|
+
let countTop = 0;
|
|
7114
|
+
const step = timestamp => {
|
|
7115
|
+
let progress = (timestamp - startTime) / duration;
|
|
7116
|
+
if (progress > 1) {
|
|
7117
|
+
progress = 1;
|
|
7118
|
+
}
|
|
7119
|
+
const easedProgress = Math.pow(progress, 2);
|
|
7120
|
+
const offsetTop = Math.floor(diffNum * easedProgress) - countTop;
|
|
7121
|
+
countTop += offsetTop;
|
|
7122
|
+
cb(offsetTop);
|
|
7123
|
+
if (progress < 1) {
|
|
7124
|
+
requestAnimationFrame(step);
|
|
7125
|
+
}
|
|
7126
|
+
};
|
|
7127
|
+
requestAnimationFrame(step);
|
|
7128
|
+
};
|
|
6865
7129
|
function updateHeight($xeTable) {
|
|
6866
7130
|
const internalData = $xeTable;
|
|
6867
7131
|
internalData.customHeight = calcTableHeight($xeTable, 'height');
|
|
@@ -6869,59 +7133,62 @@ function updateHeight($xeTable) {
|
|
|
6869
7133
|
internalData.customMaxHeight = calcTableHeight($xeTable, 'maxHeight');
|
|
6870
7134
|
}
|
|
6871
7135
|
function calcColumnAutoWidth(column, wrapperEl) {
|
|
6872
|
-
const
|
|
6873
|
-
|
|
6874
|
-
|
|
6875
|
-
if (firstCellEl) {
|
|
6876
|
-
const cellStyle = getComputedStyle(firstCellEl);
|
|
6877
|
-
|
|
6878
|
-
}
|
|
6879
|
-
let colWidth = column.renderAutoWidth -
|
|
6880
|
-
|
|
6881
|
-
const
|
|
6882
|
-
|
|
6883
|
-
|
|
6884
|
-
|
|
6885
|
-
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(cellEl.children, btnEl => {
|
|
6886
|
-
titleWidth += btnEl.offsetWidth + 1;
|
|
6887
|
-
});
|
|
6888
|
-
} else {
|
|
6889
|
-
const labelEl = cellEl.firstElementChild;
|
|
6890
|
-
if (labelEl) {
|
|
6891
|
-
titleWidth = labelEl.offsetWidth;
|
|
6892
|
-
}
|
|
6893
|
-
}
|
|
6894
|
-
if (titleWidth) {
|
|
6895
|
-
colWidth = Math.max(colWidth, Math.ceil(titleWidth) + 4);
|
|
6896
|
-
}
|
|
6897
|
-
});
|
|
6898
|
-
return colWidth + paddingSize;
|
|
7136
|
+
const cellElemList = wrapperEl.querySelectorAll(`.vxe-cell--wrapper[colid="${column.id}"]`);
|
|
7137
|
+
let leftRightPadding = 0;
|
|
7138
|
+
const firstCellEl = cellElemList[0];
|
|
7139
|
+
if (firstCellEl && firstCellEl.parentElement) {
|
|
7140
|
+
const cellStyle = getComputedStyle(firstCellEl.parentElement);
|
|
7141
|
+
leftRightPadding = Math.ceil(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellStyle.paddingLeft) + external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellStyle.paddingRight));
|
|
7142
|
+
}
|
|
7143
|
+
let colWidth = column.renderAutoWidth - leftRightPadding;
|
|
7144
|
+
for (let i = 0; i < cellElemList.length; i++) {
|
|
7145
|
+
const celEl = cellElemList[i];
|
|
7146
|
+
colWidth = Math.max(colWidth, celEl ? Math.ceil(celEl.scrollWidth) + 4 : 0);
|
|
7147
|
+
}
|
|
7148
|
+
return colWidth + leftRightPadding;
|
|
6899
7149
|
}
|
|
6900
7150
|
function calcCellWidth($xeTable) {
|
|
6901
|
-
const reactData = $xeTable;
|
|
6902
7151
|
const internalData = $xeTable;
|
|
6903
7152
|
const autoWidthColumnList = $xeTable.computeAutoWidthColumnList;
|
|
6904
|
-
|
|
6905
|
-
|
|
6906
|
-
|
|
6907
|
-
|
|
6908
|
-
|
|
6909
|
-
|
|
6910
|
-
|
|
6911
|
-
|
|
6912
|
-
|
|
6913
|
-
|
|
6914
|
-
|
|
6915
|
-
|
|
6916
|
-
|
|
6917
|
-
|
|
6918
|
-
|
|
6919
|
-
|
|
6920
|
-
|
|
6921
|
-
|
|
6922
|
-
reactData.isCalcColumn = false;
|
|
6923
|
-
});
|
|
7153
|
+
const {
|
|
7154
|
+
fullColumnIdData
|
|
7155
|
+
} = internalData;
|
|
7156
|
+
const el = $xeTable.$refs.refElem;
|
|
7157
|
+
if (el) {
|
|
7158
|
+
el.setAttribute('data-calc-col', 'Y');
|
|
7159
|
+
autoWidthColumnList.forEach(column => {
|
|
7160
|
+
const colid = column.id;
|
|
7161
|
+
const colRest = fullColumnIdData[colid];
|
|
7162
|
+
const colWidth = calcColumnAutoWidth(column, el);
|
|
7163
|
+
if (colRest) {
|
|
7164
|
+
colRest.width = Math.max(colWidth, colRest.width);
|
|
7165
|
+
}
|
|
7166
|
+
column.renderAutoWidth = colWidth;
|
|
7167
|
+
});
|
|
7168
|
+
$xeTable.analyColumnWidth();
|
|
7169
|
+
el.removeAttribute('data-calc-col');
|
|
7170
|
+
}
|
|
6924
7171
|
}
|
|
7172
|
+
const handleUpdateColResize = ($xeTable, evnt, params) => {
|
|
7173
|
+
$xeTable.analyColumnWidth();
|
|
7174
|
+
$xeTable.recalculate(true).then(() => {
|
|
7175
|
+
$xeTable.saveCustomStore('update:width');
|
|
7176
|
+
$xeTable.updateCellAreas();
|
|
7177
|
+
$xeTable.dispatchEvent('column-resizable-change', params, evnt);
|
|
7178
|
+
// 已废弃 resizable-change
|
|
7179
|
+
$xeTable.dispatchEvent('resizable-change', params, evnt);
|
|
7180
|
+
setTimeout(() => $xeTable.recalculate(true), 300);
|
|
7181
|
+
});
|
|
7182
|
+
};
|
|
7183
|
+
const handleUpdateRowResize = ($xeTable, evnt, params) => {
|
|
7184
|
+
const reactData = $xeTable;
|
|
7185
|
+
reactData.resizeHeightFlag++;
|
|
7186
|
+
$xeTable.recalculate(true).then(() => {
|
|
7187
|
+
$xeTable.updateCellAreas();
|
|
7188
|
+
$xeTable.dispatchEvent('row-resizable-change', params, evnt);
|
|
7189
|
+
setTimeout(() => $xeTable.recalculate(true), 300);
|
|
7190
|
+
});
|
|
7191
|
+
};
|
|
6925
7192
|
const Methods = {
|
|
6926
7193
|
callSlot(slotFunc, params, h, vNodes) {
|
|
6927
7194
|
if (slotFunc) {
|
|
@@ -6986,7 +7253,7 @@ const Methods = {
|
|
|
6986
7253
|
warnLog('vxe.error.delFunc', ['syncData', 'getData']);
|
|
6987
7254
|
return this.$nextTick().then(() => {
|
|
6988
7255
|
this.tableData = [];
|
|
6989
|
-
return this.$nextTick().then(() => this.loadTableData(this.tableFullData));
|
|
7256
|
+
return this.$nextTick().then(() => this.loadTableData(this.tableFullData, true));
|
|
6990
7257
|
});
|
|
6991
7258
|
},
|
|
6992
7259
|
/**
|
|
@@ -7048,8 +7315,9 @@ const Methods = {
|
|
|
7048
7315
|
* 加载表格数据
|
|
7049
7316
|
* @param {Array} datas 数据
|
|
7050
7317
|
*/
|
|
7051
|
-
loadTableData(datas) {
|
|
7318
|
+
loadTableData(datas, isReset) {
|
|
7052
7319
|
const $xeTable = this;
|
|
7320
|
+
const internalData = $xeTable;
|
|
7053
7321
|
const {
|
|
7054
7322
|
keepSource,
|
|
7055
7323
|
showOverflow,
|
|
@@ -7117,9 +7385,12 @@ const Methods = {
|
|
|
7117
7385
|
this.tableFullData = fullData;
|
|
7118
7386
|
this.tableFullTreeData = treeData;
|
|
7119
7387
|
// 缓存数据
|
|
7120
|
-
this.cacheRowMap(true);
|
|
7388
|
+
this.cacheRowMap(isReset, true);
|
|
7121
7389
|
// 原始数据
|
|
7122
7390
|
this.tableSynchData = datas;
|
|
7391
|
+
if (isReset) {
|
|
7392
|
+
internalData.isResizeCellHeight = false;
|
|
7393
|
+
}
|
|
7123
7394
|
// 克隆原数据,用于显示编辑状态,与编辑值做对比
|
|
7124
7395
|
if (keepSource) {
|
|
7125
7396
|
this.cacheSourceMap(fullData);
|
|
@@ -7176,6 +7447,7 @@ const Methods = {
|
|
|
7176
7447
|
if (sYOpts.scrollToTopOnChange) {
|
|
7177
7448
|
targetScrollTop = 0;
|
|
7178
7449
|
}
|
|
7450
|
+
calcCellHeight($xeTable);
|
|
7179
7451
|
// 是否变更虚拟滚动
|
|
7180
7452
|
if (oldScrollYLoad === sYLoad) {
|
|
7181
7453
|
restoreScrollLocation(this, targetScrollLeft, targetScrollTop).then(() => {
|
|
@@ -7200,7 +7472,7 @@ const Methods = {
|
|
|
7200
7472
|
const {
|
|
7201
7473
|
initStatus
|
|
7202
7474
|
} = this;
|
|
7203
|
-
return this.loadTableData(datas).then(() => {
|
|
7475
|
+
return this.loadTableData(datas, false).then(() => {
|
|
7204
7476
|
this.inited = true;
|
|
7205
7477
|
this.initStatus = true;
|
|
7206
7478
|
if (!initStatus) {
|
|
@@ -7217,7 +7489,7 @@ const Methods = {
|
|
|
7217
7489
|
return this.clearAll().then(() => {
|
|
7218
7490
|
this.inited = true;
|
|
7219
7491
|
this.initStatus = true;
|
|
7220
|
-
return this.loadTableData(datas);
|
|
7492
|
+
return this.loadTableData(datas, true);
|
|
7221
7493
|
}).then(() => {
|
|
7222
7494
|
this.handleLoadDefaults();
|
|
7223
7495
|
return this.recalculate();
|
|
@@ -7300,9 +7572,8 @@ const Methods = {
|
|
|
7300
7572
|
},
|
|
7301
7573
|
/**
|
|
7302
7574
|
* 更新数据行的 Map
|
|
7303
|
-
* 牺牲数据组装的耗时,用来换取使用过程中的流畅
|
|
7304
7575
|
*/
|
|
7305
|
-
cacheRowMap(isSource) {
|
|
7576
|
+
cacheRowMap(isReset, isSource) {
|
|
7306
7577
|
const {
|
|
7307
7578
|
treeConfig,
|
|
7308
7579
|
treeOpts,
|
|
@@ -7328,7 +7599,7 @@ const Methods = {
|
|
|
7328
7599
|
row[childrenField] = null;
|
|
7329
7600
|
}
|
|
7330
7601
|
let cacheItem = fullAllDataRowIdData[rowid];
|
|
7331
|
-
if (!cacheItem) {
|
|
7602
|
+
if (isReset || !cacheItem) {
|
|
7332
7603
|
cacheItem = {
|
|
7333
7604
|
row,
|
|
7334
7605
|
rowid,
|
|
@@ -7336,10 +7607,12 @@ const Methods = {
|
|
|
7336
7607
|
index: -1,
|
|
7337
7608
|
_index: -1,
|
|
7338
7609
|
$index: -1,
|
|
7610
|
+
treeIndex: index,
|
|
7339
7611
|
items,
|
|
7340
7612
|
parent: parentRow,
|
|
7341
7613
|
level,
|
|
7342
7614
|
height: 0,
|
|
7615
|
+
resizeHeight: 0,
|
|
7343
7616
|
oTop: 0
|
|
7344
7617
|
};
|
|
7345
7618
|
}
|
|
@@ -7440,10 +7713,12 @@ const Methods = {
|
|
|
7440
7713
|
index,
|
|
7441
7714
|
_index: -1,
|
|
7442
7715
|
$index: -1,
|
|
7716
|
+
treeIndex: -1,
|
|
7443
7717
|
items,
|
|
7444
7718
|
parent: parentRow,
|
|
7445
7719
|
level: parentLevel + nodes.length,
|
|
7446
7720
|
height: 0,
|
|
7721
|
+
resizeHeight: 0,
|
|
7447
7722
|
oTop: 0
|
|
7448
7723
|
};
|
|
7449
7724
|
fullDataRowIdData[rowid] = rest;
|
|
@@ -7455,7 +7730,7 @@ const Methods = {
|
|
|
7455
7730
|
if (transform) {
|
|
7456
7731
|
row[mapChildrenField] = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().clone(rows, false);
|
|
7457
7732
|
}
|
|
7458
|
-
|
|
7733
|
+
updateAfterDataIndex($xeTable);
|
|
7459
7734
|
return rows;
|
|
7460
7735
|
});
|
|
7461
7736
|
},
|
|
@@ -7836,20 +8111,38 @@ const Methods = {
|
|
|
7836
8111
|
return this.$nextTick();
|
|
7837
8112
|
},
|
|
7838
8113
|
getCellElement(row, fieldOrColumn) {
|
|
7839
|
-
const
|
|
8114
|
+
const $xeTable = this;
|
|
8115
|
+
const internalData = $xeTable;
|
|
8116
|
+
const {
|
|
8117
|
+
elemStore
|
|
8118
|
+
} = internalData;
|
|
8119
|
+
const column = handleFieldOrColumn($xeTable, fieldOrColumn);
|
|
7840
8120
|
if (!column) {
|
|
7841
8121
|
return null;
|
|
7842
8122
|
}
|
|
7843
|
-
const
|
|
7844
|
-
|
|
7845
|
-
|
|
7846
|
-
const
|
|
7847
|
-
let bodyElem
|
|
8123
|
+
const rowid = getRowid($xeTable, row);
|
|
8124
|
+
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
8125
|
+
const leftScrollElem = getRefElem(elemStore['left-body-scroll']);
|
|
8126
|
+
const rightScrollElem = getRefElem(elemStore['right-body-scroll']);
|
|
8127
|
+
let bodyElem;
|
|
7848
8128
|
if (column) {
|
|
7849
|
-
|
|
7850
|
-
|
|
7851
|
-
|
|
7852
|
-
|
|
8129
|
+
if (column.fixed) {
|
|
8130
|
+
if (column.fixed === 'left') {
|
|
8131
|
+
if (leftScrollElem) {
|
|
8132
|
+
bodyElem = leftScrollElem;
|
|
8133
|
+
}
|
|
8134
|
+
} else {
|
|
8135
|
+
if (rightScrollElem) {
|
|
8136
|
+
bodyElem = rightScrollElem;
|
|
8137
|
+
}
|
|
8138
|
+
}
|
|
8139
|
+
}
|
|
8140
|
+
if (!bodyElem) {
|
|
8141
|
+
bodyElem = bodyScrollElem;
|
|
8142
|
+
}
|
|
8143
|
+
if (bodyElem) {
|
|
8144
|
+
return bodyElem.querySelector(`.vxe-body--row[rowid="${rowid}"] .${column.id}`);
|
|
8145
|
+
}
|
|
7853
8146
|
}
|
|
7854
8147
|
return null;
|
|
7855
8148
|
},
|
|
@@ -8088,6 +8381,7 @@ const Methods = {
|
|
|
8088
8381
|
* 如果存在筛选条件,继续处理
|
|
8089
8382
|
*/
|
|
8090
8383
|
updateAfterFullData() {
|
|
8384
|
+
const $xeTable = this;
|
|
8091
8385
|
const {
|
|
8092
8386
|
tableFullColumn,
|
|
8093
8387
|
tableFullData,
|
|
@@ -8292,7 +8586,7 @@ const Methods = {
|
|
|
8292
8586
|
}
|
|
8293
8587
|
this.afterFullData = tableData;
|
|
8294
8588
|
this.afterTreeFullData = tableTree;
|
|
8295
|
-
|
|
8589
|
+
updateAfterDataIndex($xeTable);
|
|
8296
8590
|
},
|
|
8297
8591
|
/**
|
|
8298
8592
|
* 预编译
|
|
@@ -8300,78 +8594,7 @@ const Methods = {
|
|
|
8300
8594
|
*/
|
|
8301
8595
|
updateAfterDataIndex() {
|
|
8302
8596
|
const $xeTable = this;
|
|
8303
|
-
|
|
8304
|
-
const internalData = $xeTable;
|
|
8305
|
-
const {
|
|
8306
|
-
treeConfig
|
|
8307
|
-
} = props;
|
|
8308
|
-
const {
|
|
8309
|
-
afterFullData,
|
|
8310
|
-
fullDataRowIdData,
|
|
8311
|
-
fullAllDataRowIdData,
|
|
8312
|
-
afterTreeFullData
|
|
8313
|
-
} = internalData;
|
|
8314
|
-
const treeOpts = $xeTable.computeTreeOpts;
|
|
8315
|
-
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
8316
|
-
const fullMaps = {};
|
|
8317
|
-
if (treeConfig) {
|
|
8318
|
-
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(afterTreeFullData, (row, index, items, path) => {
|
|
8319
|
-
const rowid = getRowid($xeTable, row);
|
|
8320
|
-
const rowRest = fullAllDataRowIdData[rowid];
|
|
8321
|
-
const seq = path.map((num, i) => i % 2 === 0 ? Number(num) + 1 : '.').join('');
|
|
8322
|
-
if (rowRest) {
|
|
8323
|
-
rowRest.seq = seq;
|
|
8324
|
-
rowRest._index = index;
|
|
8325
|
-
} else {
|
|
8326
|
-
const rest = {
|
|
8327
|
-
row,
|
|
8328
|
-
rowid,
|
|
8329
|
-
seq,
|
|
8330
|
-
index: -1,
|
|
8331
|
-
$index: -1,
|
|
8332
|
-
_index: index,
|
|
8333
|
-
items: [],
|
|
8334
|
-
parent: null,
|
|
8335
|
-
level: 0,
|
|
8336
|
-
height: 0,
|
|
8337
|
-
oTop: 0
|
|
8338
|
-
};
|
|
8339
|
-
fullAllDataRowIdData[rowid] = rest;
|
|
8340
|
-
fullDataRowIdData[rowid] = rest;
|
|
8341
|
-
}
|
|
8342
|
-
fullMaps[rowid] = row;
|
|
8343
|
-
}, {
|
|
8344
|
-
children: treeOpts.transform ? treeOpts.mapChildrenField : childrenField
|
|
8345
|
-
});
|
|
8346
|
-
} else {
|
|
8347
|
-
afterFullData.forEach((row, index) => {
|
|
8348
|
-
const rowid = getRowid($xeTable, row);
|
|
8349
|
-
const rowRest = fullAllDataRowIdData[rowid];
|
|
8350
|
-
const seq = index + 1;
|
|
8351
|
-
if (rowRest) {
|
|
8352
|
-
rowRest.seq = seq;
|
|
8353
|
-
rowRest._index = index;
|
|
8354
|
-
} else {
|
|
8355
|
-
const rest = {
|
|
8356
|
-
row,
|
|
8357
|
-
rowid,
|
|
8358
|
-
seq,
|
|
8359
|
-
index: -1,
|
|
8360
|
-
$index: -1,
|
|
8361
|
-
_index: index,
|
|
8362
|
-
items: [],
|
|
8363
|
-
parent: null,
|
|
8364
|
-
level: 0,
|
|
8365
|
-
height: 0,
|
|
8366
|
-
oTop: 0
|
|
8367
|
-
};
|
|
8368
|
-
fullAllDataRowIdData[rowid] = rest;
|
|
8369
|
-
fullDataRowIdData[rowid] = rest;
|
|
8370
|
-
}
|
|
8371
|
-
fullMaps[rowid] = row;
|
|
8372
|
-
});
|
|
8373
|
-
}
|
|
8374
|
-
this.afterFullRowMaps = fullMaps;
|
|
8597
|
+
updateAfterDataIndex($xeTable);
|
|
8375
8598
|
},
|
|
8376
8599
|
/**
|
|
8377
8600
|
* 只对 tree-config 有效,获取行的子级
|
|
@@ -8446,7 +8669,11 @@ const Methods = {
|
|
|
8446
8669
|
* @param {String/Number} rowid 行主键
|
|
8447
8670
|
*/
|
|
8448
8671
|
getRowById(cellValue) {
|
|
8449
|
-
const
|
|
8672
|
+
const $xeTable = this;
|
|
8673
|
+
const internalData = $xeTable;
|
|
8674
|
+
const {
|
|
8675
|
+
fullDataRowIdData
|
|
8676
|
+
} = internalData;
|
|
8450
8677
|
const rowid = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(cellValue) ? '' : encodeURIComponent(cellValue);
|
|
8451
8678
|
return fullDataRowIdData[rowid] ? fullDataRowIdData[rowid].row : null;
|
|
8452
8679
|
},
|
|
@@ -8454,14 +8681,9 @@ const Methods = {
|
|
|
8454
8681
|
* 根据行获取行的唯一主键
|
|
8455
8682
|
* @param {Row} row 行对象
|
|
8456
8683
|
*/
|
|
8457
|
-
getRowid(
|
|
8684
|
+
getRowid(row) {
|
|
8458
8685
|
const $xeTable = this;
|
|
8459
|
-
|
|
8460
|
-
const {
|
|
8461
|
-
fullDataRowIdData
|
|
8462
|
-
} = internalData;
|
|
8463
|
-
const rowid = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(cellValue) ? '' : encodeURIComponent(cellValue || '');
|
|
8464
|
-
return fullDataRowIdData[rowid] ? fullDataRowIdData[rowid].row : null;
|
|
8686
|
+
return getRowid($xeTable, row);
|
|
8465
8687
|
},
|
|
8466
8688
|
/**
|
|
8467
8689
|
* 获取处理后的表格数据
|
|
@@ -8665,29 +8887,41 @@ const Methods = {
|
|
|
8665
8887
|
},
|
|
8666
8888
|
setColumnWidth(fieldOrColumn, width) {
|
|
8667
8889
|
const $xeTable = this;
|
|
8890
|
+
const internalData = $xeTable;
|
|
8891
|
+
const {
|
|
8892
|
+
elemStore
|
|
8893
|
+
} = internalData;
|
|
8668
8894
|
let status = false;
|
|
8669
8895
|
const cols = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(fieldOrColumn) ? fieldOrColumn : [fieldOrColumn];
|
|
8670
|
-
|
|
8671
|
-
|
|
8672
|
-
|
|
8673
|
-
|
|
8674
|
-
|
|
8675
|
-
|
|
8676
|
-
|
|
8677
|
-
|
|
8678
|
-
|
|
8679
|
-
|
|
8680
|
-
|
|
8681
|
-
|
|
8682
|
-
|
|
8683
|
-
|
|
8896
|
+
let cWidth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toInteger(width);
|
|
8897
|
+
if (isScale(width)) {
|
|
8898
|
+
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
8899
|
+
const bodyWidth = bodyScrollElem ? bodyScrollElem.clientWidth - 1 : 0;
|
|
8900
|
+
cWidth = Math.floor(cWidth * bodyWidth);
|
|
8901
|
+
}
|
|
8902
|
+
if (cWidth) {
|
|
8903
|
+
cols.forEach(item => {
|
|
8904
|
+
const column = handleFieldOrColumn($xeTable, item);
|
|
8905
|
+
if (column) {
|
|
8906
|
+
column.resizeWidth = cWidth;
|
|
8907
|
+
if (!status) {
|
|
8908
|
+
status = true;
|
|
8909
|
+
}
|
|
8684
8910
|
}
|
|
8911
|
+
});
|
|
8912
|
+
if (status) {
|
|
8913
|
+
return $xeTable.refreshColumn().then(() => {
|
|
8914
|
+
return {
|
|
8915
|
+
status
|
|
8916
|
+
};
|
|
8917
|
+
});
|
|
8685
8918
|
}
|
|
8686
|
-
});
|
|
8687
|
-
if (status) {
|
|
8688
|
-
return $xeTable.refreshColumn();
|
|
8689
8919
|
}
|
|
8690
|
-
return $xeTable.$nextTick()
|
|
8920
|
+
return $xeTable.$nextTick().then(() => {
|
|
8921
|
+
return {
|
|
8922
|
+
status
|
|
8923
|
+
};
|
|
8924
|
+
});
|
|
8691
8925
|
},
|
|
8692
8926
|
getColumnWidth(fieldOrColumn) {
|
|
8693
8927
|
const column = handleFieldOrColumn(this, fieldOrColumn);
|
|
@@ -9014,7 +9248,159 @@ const Methods = {
|
|
|
9014
9248
|
remainList
|
|
9015
9249
|
});
|
|
9016
9250
|
},
|
|
9017
|
-
|
|
9251
|
+
handleColResizeMousedownEvent(evnt, fixedType, params) {
|
|
9252
|
+
const $xeTable = this;
|
|
9253
|
+
const reactData = $xeTable;
|
|
9254
|
+
const internalData = $xeTable;
|
|
9255
|
+
evnt.stopPropagation();
|
|
9256
|
+
evnt.preventDefault();
|
|
9257
|
+
const {
|
|
9258
|
+
column
|
|
9259
|
+
} = params;
|
|
9260
|
+
const {
|
|
9261
|
+
overflowX,
|
|
9262
|
+
scrollbarHeight
|
|
9263
|
+
} = reactData;
|
|
9264
|
+
const {
|
|
9265
|
+
elemStore,
|
|
9266
|
+
visibleColumn
|
|
9267
|
+
} = internalData;
|
|
9268
|
+
const resizableOpts = $xeTable.computeResizableOpts;
|
|
9269
|
+
const osbHeight = overflowX ? scrollbarHeight : 0;
|
|
9270
|
+
const tableEl = $xeTable.$refs.refElem;
|
|
9271
|
+
const leftContainerElem = $xeTable.$refs.refLeftContainer;
|
|
9272
|
+
const rightContainerElem = $xeTable.$refs.refRightContainer;
|
|
9273
|
+
const resizeBarElem = $xeTable.$refs.refColResizeBar;
|
|
9274
|
+
if (!resizeBarElem) {
|
|
9275
|
+
return;
|
|
9276
|
+
}
|
|
9277
|
+
const resizeTipElem = resizeBarElem.firstElementChild;
|
|
9278
|
+
const scrollbarXToTop = $xeTable.computeScrollbarXToTop;
|
|
9279
|
+
const {
|
|
9280
|
+
clientX: dragClientX
|
|
9281
|
+
} = evnt;
|
|
9282
|
+
const wrapperElem = $xeTable.$refs.refElem;
|
|
9283
|
+
const dragBtnElem = evnt.target;
|
|
9284
|
+
let resizeColumn = column;
|
|
9285
|
+
if (column.children && column.children.length) {
|
|
9286
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(column.children, childColumn => {
|
|
9287
|
+
resizeColumn = childColumn;
|
|
9288
|
+
});
|
|
9289
|
+
}
|
|
9290
|
+
const cell = dragBtnElem.parentNode;
|
|
9291
|
+
const cellParams = Object.assign(params, {
|
|
9292
|
+
cell
|
|
9293
|
+
});
|
|
9294
|
+
let dragLeft = 0;
|
|
9295
|
+
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
9296
|
+
if (!bodyScrollElem) {
|
|
9297
|
+
return;
|
|
9298
|
+
}
|
|
9299
|
+
const pos = getOffsetPos(dragBtnElem, wrapperElem);
|
|
9300
|
+
const dragBtnWidth = dragBtnElem.clientWidth;
|
|
9301
|
+
const dragBtnOffsetWidth = Math.floor(dragBtnWidth / 2);
|
|
9302
|
+
const minInterval = getColReMinWidth(cellParams) - dragBtnOffsetWidth; // 列之间的最小间距
|
|
9303
|
+
let dragMinLeft = pos.left - cell.clientWidth + dragBtnWidth + minInterval;
|
|
9304
|
+
let dragPosLeft = pos.left + dragBtnOffsetWidth;
|
|
9305
|
+
const isLeftFixed = fixedType === 'left';
|
|
9306
|
+
const isRightFixed = fixedType === 'right';
|
|
9307
|
+
// 计算左右侧固定列偏移量
|
|
9308
|
+
let fixedOffsetWidth = 0;
|
|
9309
|
+
if (isLeftFixed || isRightFixed) {
|
|
9310
|
+
const siblingProp = isLeftFixed ? 'nextElementSibling' : 'previousElementSibling';
|
|
9311
|
+
let tempCellElem = cell[siblingProp];
|
|
9312
|
+
while (tempCellElem) {
|
|
9313
|
+
if (hasClass(tempCellElem, 'fixed--hidden')) {
|
|
9314
|
+
break;
|
|
9315
|
+
} else if (!hasClass(tempCellElem, 'col--group')) {
|
|
9316
|
+
fixedOffsetWidth += tempCellElem.offsetWidth;
|
|
9317
|
+
}
|
|
9318
|
+
tempCellElem = tempCellElem[siblingProp];
|
|
9319
|
+
}
|
|
9320
|
+
if (isRightFixed && rightContainerElem) {
|
|
9321
|
+
dragPosLeft = rightContainerElem.offsetLeft + fixedOffsetWidth;
|
|
9322
|
+
}
|
|
9323
|
+
}
|
|
9324
|
+
// 处理拖动事件
|
|
9325
|
+
const updateEvent = evnt => {
|
|
9326
|
+
evnt.stopPropagation();
|
|
9327
|
+
evnt.preventDefault();
|
|
9328
|
+
const tableHeight = tableEl.clientHeight;
|
|
9329
|
+
const offsetX = evnt.clientX - dragClientX;
|
|
9330
|
+
let left = dragPosLeft + offsetX;
|
|
9331
|
+
const scrollLeft = fixedType ? 0 : bodyScrollElem.scrollLeft;
|
|
9332
|
+
if (isLeftFixed) {
|
|
9333
|
+
// 左固定列(不允许超过右侧固定列、不允许超过右边距)
|
|
9334
|
+
left = Math.min(left, (rightContainerElem ? rightContainerElem.offsetLeft : bodyScrollElem.clientWidth) - fixedOffsetWidth - minInterval);
|
|
9335
|
+
} else if (isRightFixed) {
|
|
9336
|
+
// 右侧固定列(不允许超过左侧固定列、不允许超过左边距)
|
|
9337
|
+
dragMinLeft = (leftContainerElem ? leftContainerElem.clientWidth : 0) + fixedOffsetWidth + minInterval;
|
|
9338
|
+
left = Math.min(left, dragPosLeft + cell.clientWidth - minInterval);
|
|
9339
|
+
} else {
|
|
9340
|
+
dragMinLeft = Math.max(bodyScrollElem.scrollLeft, dragMinLeft);
|
|
9341
|
+
// left = Math.min(left, bodyScrollElem.clientWidth + bodyScrollElem.scrollLeft - 40)
|
|
9342
|
+
}
|
|
9343
|
+
dragLeft = Math.max(left, dragMinLeft);
|
|
9344
|
+
const resizeBarLeft = Math.max(1, dragLeft - scrollLeft);
|
|
9345
|
+
resizeBarElem.style.left = `${resizeBarLeft}px`;
|
|
9346
|
+
resizeBarElem.style.top = `${scrollbarXToTop ? osbHeight : 0}px`;
|
|
9347
|
+
resizeBarElem.style.height = `${scrollbarXToTop ? tableHeight - osbHeight : tableHeight}px`;
|
|
9348
|
+
if (resizableOpts.showDragTip && resizeTipElem) {
|
|
9349
|
+
resizeTipElem.textContent = methods_getI18n('vxe.table.resizeColTip', [resizeColumn.renderWidth + (isRightFixed ? dragPosLeft - dragLeft : dragLeft - dragPosLeft)]);
|
|
9350
|
+
const tableWidth = tableEl.clientWidth;
|
|
9351
|
+
const wrapperRect = wrapperElem.getBoundingClientRect();
|
|
9352
|
+
const resizeBarWidth = resizeBarElem.clientWidth;
|
|
9353
|
+
const resizeTipWidth = resizeTipElem.clientWidth;
|
|
9354
|
+
const resizeTipHeight = resizeTipElem.clientHeight;
|
|
9355
|
+
let resizeTipLeft = -resizeTipWidth;
|
|
9356
|
+
if (resizeBarLeft < resizeTipWidth + resizeBarWidth) {
|
|
9357
|
+
resizeTipLeft = 0;
|
|
9358
|
+
} else if (resizeBarLeft > tableWidth) {
|
|
9359
|
+
resizeTipLeft += tableWidth - resizeBarLeft;
|
|
9360
|
+
}
|
|
9361
|
+
resizeTipElem.style.left = `${resizeTipLeft}px`;
|
|
9362
|
+
resizeTipElem.style.top = `${Math.min(tableHeight - resizeTipHeight, Math.max(0, evnt.clientY - wrapperRect.y - resizeTipHeight / 2))}px`;
|
|
9363
|
+
}
|
|
9364
|
+
};
|
|
9365
|
+
reactData.isDragResize = true;
|
|
9366
|
+
addClass(tableEl, 'col-drag--resize');
|
|
9367
|
+
resizeBarElem.style.display = 'block';
|
|
9368
|
+
document.onmousemove = updateEvent;
|
|
9369
|
+
document.onmouseup = function (evnt) {
|
|
9370
|
+
document.onmousemove = null;
|
|
9371
|
+
document.onmouseup = null;
|
|
9372
|
+
resizeBarElem.style.display = 'none';
|
|
9373
|
+
reactData.isDragResize = false;
|
|
9374
|
+
internalData._lastResizeTime = Date.now();
|
|
9375
|
+
const resizeWidth = resizeColumn.renderWidth + (isRightFixed ? dragPosLeft - dragLeft : dragLeft - dragPosLeft);
|
|
9376
|
+
const resizeParams = {
|
|
9377
|
+
...params,
|
|
9378
|
+
resizeWidth,
|
|
9379
|
+
resizeColumn
|
|
9380
|
+
};
|
|
9381
|
+
if (resizableOpts.dragMode === 'fixed') {
|
|
9382
|
+
visibleColumn.forEach(item => {
|
|
9383
|
+
if (item.id !== resizeColumn.id) {
|
|
9384
|
+
if (!item.resizeWidth) {
|
|
9385
|
+
item.resizeWidth = item.renderWidth;
|
|
9386
|
+
}
|
|
9387
|
+
}
|
|
9388
|
+
});
|
|
9389
|
+
}
|
|
9390
|
+
if ($xeTable.handleColResizeCellAreaEvent) {
|
|
9391
|
+
$xeTable.handleColResizeCellAreaEvent(evnt, resizeParams);
|
|
9392
|
+
} else {
|
|
9393
|
+
resizeColumn.resizeWidth = resizeWidth;
|
|
9394
|
+
handleUpdateColResize($xeTable, evnt, resizeParams);
|
|
9395
|
+
}
|
|
9396
|
+
removeClass(tableEl, 'col-drag--resize');
|
|
9397
|
+
};
|
|
9398
|
+
updateEvent(evnt);
|
|
9399
|
+
if ($xeTable.closeMenu) {
|
|
9400
|
+
$xeTable.closeMenu();
|
|
9401
|
+
}
|
|
9402
|
+
},
|
|
9403
|
+
handleColResizeDblclickEvent(evnt, params) {
|
|
9018
9404
|
const $xeTable = this;
|
|
9019
9405
|
const reactData = $xeTable;
|
|
9020
9406
|
const internalData = $xeTable;
|
|
@@ -9030,32 +9416,300 @@ const Methods = {
|
|
|
9030
9416
|
const {
|
|
9031
9417
|
column
|
|
9032
9418
|
} = params;
|
|
9033
|
-
|
|
9419
|
+
let resizeColumn = column;
|
|
9420
|
+
if (column.children && column.children.length) {
|
|
9421
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(column.children, childColumn => {
|
|
9422
|
+
resizeColumn = childColumn;
|
|
9423
|
+
});
|
|
9424
|
+
}
|
|
9425
|
+
const colid = resizeColumn.id;
|
|
9034
9426
|
const colRest = fullColumnIdData[colid];
|
|
9035
9427
|
const dragBtnElem = evnt.target;
|
|
9036
9428
|
const cell = dragBtnElem.parentNode;
|
|
9037
9429
|
const cellParams = Object.assign(params, {
|
|
9038
9430
|
cell
|
|
9039
9431
|
});
|
|
9040
|
-
const colMinWidth = getColReMinWidth(cellParams);
|
|
9041
|
-
|
|
9042
|
-
|
|
9043
|
-
|
|
9432
|
+
const colMinWidth = getColReMinWidth(cellParams);
|
|
9433
|
+
el.setAttribute('data-calc-col', 'Y');
|
|
9434
|
+
let resizeWidth = calcColumnAutoWidth(resizeColumn, el);
|
|
9435
|
+
el.removeAttribute('data-calc-col');
|
|
9436
|
+
if (colRest) {
|
|
9437
|
+
resizeWidth = Math.max(resizeWidth, colRest.width);
|
|
9438
|
+
}
|
|
9439
|
+
resizeWidth = Math.max(colMinWidth, resizeWidth);
|
|
9440
|
+
const resizeParams = {
|
|
9441
|
+
...params,
|
|
9442
|
+
resizeWidth,
|
|
9443
|
+
resizeColumn
|
|
9444
|
+
};
|
|
9445
|
+
reactData.isDragResize = false;
|
|
9446
|
+
internalData._lastResizeTime = Date.now();
|
|
9447
|
+
if ($xeTable.handleColResizeDblclickCellAreaEvent) {
|
|
9448
|
+
$xeTable.handleColResizeDblclickCellAreaEvent(evnt, resizeParams);
|
|
9449
|
+
} else {
|
|
9450
|
+
resizeColumn.resizeWidth = resizeWidth;
|
|
9451
|
+
handleUpdateColResize($xeTable, evnt, resizeParams);
|
|
9452
|
+
}
|
|
9453
|
+
}
|
|
9454
|
+
},
|
|
9455
|
+
handleRowResizeMousedownEvent(evnt, params) {
|
|
9456
|
+
const $xeTable = this;
|
|
9457
|
+
const reactData = $xeTable;
|
|
9458
|
+
const internalData = $xeTable;
|
|
9459
|
+
evnt.stopPropagation();
|
|
9460
|
+
evnt.preventDefault();
|
|
9461
|
+
const {
|
|
9462
|
+
row
|
|
9463
|
+
} = params;
|
|
9464
|
+
const {
|
|
9465
|
+
overflowX,
|
|
9466
|
+
scrollbarWidth,
|
|
9467
|
+
overflowY,
|
|
9468
|
+
scrollbarHeight
|
|
9469
|
+
} = reactData;
|
|
9470
|
+
const {
|
|
9471
|
+
elemStore,
|
|
9472
|
+
fullAllDataRowIdData
|
|
9473
|
+
} = internalData;
|
|
9474
|
+
const osbWidth = overflowY ? scrollbarWidth : 0;
|
|
9475
|
+
const osbHeight = overflowX ? scrollbarHeight : 0;
|
|
9476
|
+
const scrollbarYToLeft = $xeTable.computeScrollbarYToLeft;
|
|
9477
|
+
const resizableOpts = $xeTable.computeResizableOpts;
|
|
9478
|
+
const rowOpts = $xeTable.computeRowOpts;
|
|
9479
|
+
const cellOpts = $xeTable.computeCellOpts;
|
|
9480
|
+
const tableEl = $xeTable.$refs.refElem;
|
|
9481
|
+
const resizeBarElem = $xeTable.$refs.refRowResizeBar;
|
|
9482
|
+
if (!resizeBarElem) {
|
|
9483
|
+
return;
|
|
9484
|
+
}
|
|
9485
|
+
const {
|
|
9486
|
+
clientY: dragClientY
|
|
9487
|
+
} = evnt;
|
|
9488
|
+
const resizeTipElem = resizeBarElem.firstElementChild;
|
|
9489
|
+
const dragBtnElem = evnt.currentTarget;
|
|
9490
|
+
const tdEl = dragBtnElem.parentNode;
|
|
9491
|
+
const trEl = tdEl.parentNode;
|
|
9492
|
+
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
9493
|
+
if (!bodyScrollElem) {
|
|
9494
|
+
return;
|
|
9495
|
+
}
|
|
9496
|
+
const rowid = getRowid($xeTable, row);
|
|
9497
|
+
const rowRest = fullAllDataRowIdData[rowid];
|
|
9498
|
+
if (!rowRest) {
|
|
9499
|
+
return;
|
|
9500
|
+
}
|
|
9501
|
+
const defaultRowHeight = $xeTable.computeDefaultRowHeight;
|
|
9502
|
+
const currCellHeight = rowRest.resizeHeight || cellOpts.height || rowOpts.height || defaultRowHeight;
|
|
9503
|
+
const tableRect = tableEl.getBoundingClientRect();
|
|
9504
|
+
const trRect = trEl.getBoundingClientRect();
|
|
9505
|
+
const targetOffsetY = dragClientY - trRect.y - trEl.clientHeight;
|
|
9506
|
+
let resizeHeight = currCellHeight;
|
|
9507
|
+
const cellEl = tdEl.querySelector('.vxe-cell');
|
|
9508
|
+
let cellMinHeight = 0;
|
|
9509
|
+
if (cellEl) {
|
|
9510
|
+
const cellStyle = getComputedStyle(cellEl);
|
|
9511
|
+
cellMinHeight = Math.max(1, Math.ceil(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellStyle.paddingTop) + external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellStyle.paddingBottom)));
|
|
9512
|
+
}
|
|
9513
|
+
const minTop = trRect.y - tableRect.y + cellMinHeight;
|
|
9514
|
+
// 处理拖动事件
|
|
9515
|
+
const updateEvent = evnt => {
|
|
9516
|
+
evnt.stopPropagation();
|
|
9517
|
+
evnt.preventDefault();
|
|
9518
|
+
const tableWidth = tableEl.clientWidth - osbWidth;
|
|
9519
|
+
const tableHeight = tableEl.clientHeight - osbHeight;
|
|
9520
|
+
let dragTop = evnt.clientY - tableRect.y - targetOffsetY;
|
|
9521
|
+
if (dragTop < minTop) {
|
|
9522
|
+
dragTop = minTop;
|
|
9523
|
+
} else {
|
|
9524
|
+
resizeHeight = Math.max(cellMinHeight, currCellHeight + evnt.clientY - dragClientY);
|
|
9525
|
+
}
|
|
9526
|
+
resizeBarElem.style.left = `${scrollbarYToLeft ? osbWidth : 0}px`;
|
|
9527
|
+
resizeBarElem.style.top = `${dragTop}px`;
|
|
9528
|
+
resizeBarElem.style.width = `${tableWidth}px`;
|
|
9529
|
+
if (resizableOpts.showDragTip && resizeTipElem) {
|
|
9530
|
+
resizeTipElem.textContent = methods_getI18n('vxe.table.resizeRowTip', [resizeHeight]);
|
|
9531
|
+
const resizeTipWidth = resizeTipElem.clientWidth;
|
|
9532
|
+
const resizeTipHeight = resizeTipElem.clientHeight;
|
|
9533
|
+
let resizeBarLeft = Math.max(2, evnt.clientX - tableRect.x);
|
|
9534
|
+
let resizeBarTop = 0;
|
|
9535
|
+
if (resizeBarLeft + resizeTipWidth >= tableWidth - 2) {
|
|
9536
|
+
resizeBarLeft = tableWidth - resizeTipWidth - 2;
|
|
9537
|
+
}
|
|
9538
|
+
if (dragTop + resizeTipHeight >= tableHeight) {
|
|
9539
|
+
resizeBarTop = tableHeight - (dragTop + resizeTipHeight);
|
|
9540
|
+
}
|
|
9541
|
+
resizeTipElem.style.left = `${resizeBarLeft}px`;
|
|
9542
|
+
resizeTipElem.style.top = `${resizeBarTop}px`;
|
|
9543
|
+
}
|
|
9544
|
+
};
|
|
9545
|
+
reactData.isDragResize = true;
|
|
9546
|
+
addClass(tableEl, 'row-drag--resize');
|
|
9547
|
+
resizeBarElem.style.display = 'block';
|
|
9548
|
+
document.onmousemove = updateEvent;
|
|
9549
|
+
document.onmouseup = function (evnt) {
|
|
9550
|
+
document.onmousemove = null;
|
|
9551
|
+
document.onmouseup = null;
|
|
9552
|
+
resizeBarElem.style.display = 'none';
|
|
9553
|
+
reactData.isDragResize = false;
|
|
9554
|
+
internalData._lastResizeTime = Date.now();
|
|
9555
|
+
if (resizeHeight !== currCellHeight) {
|
|
9556
|
+
const resizeParams = {
|
|
9557
|
+
...params,
|
|
9558
|
+
resizeHeight,
|
|
9559
|
+
resizeRow: row
|
|
9560
|
+
};
|
|
9561
|
+
internalData.isResizeCellHeight = true;
|
|
9562
|
+
if ($xeTable.handleRowResizeCellAreaEvent) {
|
|
9563
|
+
$xeTable.handleRowResizeCellAreaEvent(evnt, resizeParams);
|
|
9564
|
+
} else {
|
|
9565
|
+
rowRest.resizeHeight = resizeHeight;
|
|
9566
|
+
handleUpdateRowResize($xeTable, evnt, resizeParams);
|
|
9567
|
+
}
|
|
9568
|
+
}
|
|
9569
|
+
removeClass(tableEl, 'row-drag--resize');
|
|
9570
|
+
};
|
|
9571
|
+
updateEvent(evnt);
|
|
9572
|
+
},
|
|
9573
|
+
handleRowResizeDblclickEvent(evnt, params) {
|
|
9574
|
+
const $xeTable = this;
|
|
9575
|
+
const reactData = $xeTable;
|
|
9576
|
+
const internalData = $xeTable;
|
|
9577
|
+
const resizableOpts = $xeTable.computeResizableOpts;
|
|
9578
|
+
const {
|
|
9579
|
+
isDblclickAutoHeight
|
|
9580
|
+
} = resizableOpts;
|
|
9581
|
+
const el = $xeTable.$refs.refElem;
|
|
9582
|
+
if (isDblclickAutoHeight && el) {
|
|
9583
|
+
const {
|
|
9584
|
+
fullAllDataRowIdData
|
|
9585
|
+
} = internalData;
|
|
9586
|
+
const {
|
|
9587
|
+
row
|
|
9588
|
+
} = params;
|
|
9589
|
+
const rowid = getRowid($xeTable, row);
|
|
9590
|
+
const rowRest = fullAllDataRowIdData[rowid];
|
|
9591
|
+
if (!rowRest) {
|
|
9592
|
+
return;
|
|
9593
|
+
}
|
|
9594
|
+
const resizeHeight = calcCellAutoHeight(rowRest, el);
|
|
9595
|
+
const resizeParams = {
|
|
9596
|
+
...params,
|
|
9597
|
+
resizeHeight,
|
|
9598
|
+
resizeRow: row
|
|
9599
|
+
};
|
|
9600
|
+
reactData.isDragResize = false;
|
|
9601
|
+
internalData._lastResizeTime = Date.now();
|
|
9602
|
+
if ($xeTable.handleRowResizeDblclickCellAreaEvent) {
|
|
9603
|
+
$xeTable.handleRowResizeDblclickCellAreaEvent(evnt, resizeParams);
|
|
9604
|
+
} else {
|
|
9605
|
+
rowRest.resizeHeight = resizeHeight;
|
|
9606
|
+
handleUpdateRowResize($xeTable, evnt, resizeParams);
|
|
9607
|
+
}
|
|
9608
|
+
}
|
|
9609
|
+
},
|
|
9610
|
+
setRowHeightConf(heightConf) {
|
|
9611
|
+
const $xeTable = this;
|
|
9612
|
+
const reactData = $xeTable;
|
|
9613
|
+
const internalData = $xeTable;
|
|
9614
|
+
const {
|
|
9615
|
+
fullAllDataRowIdData
|
|
9616
|
+
} = internalData;
|
|
9617
|
+
let status = false;
|
|
9618
|
+
if (heightConf) {
|
|
9619
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(heightConf, (height, rowid) => {
|
|
9620
|
+
const rowRest = fullAllDataRowIdData[rowid];
|
|
9621
|
+
if (rowRest) {
|
|
9622
|
+
const rHeight = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toInteger(height);
|
|
9623
|
+
if (rHeight) {
|
|
9624
|
+
rowRest.resizeHeight = rHeight;
|
|
9625
|
+
if (!status) {
|
|
9626
|
+
status = true;
|
|
9627
|
+
}
|
|
9628
|
+
}
|
|
9629
|
+
}
|
|
9630
|
+
});
|
|
9631
|
+
if (status) {
|
|
9632
|
+
internalData.isResizeCellHeight = true;
|
|
9633
|
+
reactData.resizeHeightFlag++;
|
|
9634
|
+
}
|
|
9635
|
+
}
|
|
9636
|
+
return $xeTable.$nextTick().then(() => {
|
|
9637
|
+
return {
|
|
9638
|
+
status
|
|
9639
|
+
};
|
|
9640
|
+
});
|
|
9641
|
+
},
|
|
9642
|
+
getRowHeightConf(isFull) {
|
|
9643
|
+
const $xeTable = this;
|
|
9644
|
+
const internalData = $xeTable;
|
|
9645
|
+
const {
|
|
9646
|
+
fullAllDataRowIdData,
|
|
9647
|
+
afterFullData
|
|
9648
|
+
} = internalData;
|
|
9649
|
+
const rowOpts = $xeTable.computeRowOpts;
|
|
9650
|
+
const cellOpts = $xeTable.computeCellOpts;
|
|
9651
|
+
const defaultRowHeight = $xeTable.computeDefaultRowHeight;
|
|
9652
|
+
const rest = {};
|
|
9653
|
+
afterFullData.forEach(row => {
|
|
9654
|
+
const rowid = getRowid($xeTable, row);
|
|
9655
|
+
const rowRest = fullAllDataRowIdData[rowid];
|
|
9656
|
+
if (rowRest) {
|
|
9657
|
+
const resizeHeight = rowRest.resizeHeight;
|
|
9658
|
+
if (resizeHeight || isFull) {
|
|
9659
|
+
const currCellHeight = resizeHeight || cellOpts.height || rowOpts.height || defaultRowHeight;
|
|
9660
|
+
rest[rowid] = currCellHeight;
|
|
9661
|
+
}
|
|
9662
|
+
}
|
|
9663
|
+
});
|
|
9664
|
+
return rest;
|
|
9665
|
+
},
|
|
9666
|
+
setRowHeight(rowOrId, height) {
|
|
9667
|
+
const $xeTable = this;
|
|
9668
|
+
const reactData = $xeTable;
|
|
9669
|
+
const internalData = $xeTable;
|
|
9670
|
+
const {
|
|
9671
|
+
fullAllDataRowIdData
|
|
9672
|
+
} = internalData;
|
|
9673
|
+
let status = false;
|
|
9674
|
+
const rows = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(rowOrId) ? rowOrId : [rowOrId];
|
|
9675
|
+
let rHeight = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toInteger(height);
|
|
9676
|
+
if (isScale(height)) {
|
|
9677
|
+
const tableBody = $xeTable.$refs.refTableBody;
|
|
9678
|
+
const bodyElem = tableBody ? tableBody.$el : null;
|
|
9679
|
+
const bodyHeight = bodyElem ? bodyElem.clientHeight - 1 : 0;
|
|
9680
|
+
rHeight = Math.floor(rHeight * bodyHeight);
|
|
9681
|
+
}
|
|
9682
|
+
if (rHeight) {
|
|
9683
|
+
rows.forEach(row => {
|
|
9684
|
+
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 : getRowid($xeTable, row);
|
|
9685
|
+
const rowRest = fullAllDataRowIdData[rowid];
|
|
9686
|
+
if (rowRest) {
|
|
9687
|
+
rowRest.resizeHeight = rHeight;
|
|
9688
|
+
if (!status) {
|
|
9689
|
+
status = true;
|
|
9690
|
+
}
|
|
9691
|
+
}
|
|
9692
|
+
});
|
|
9693
|
+
if (status) {
|
|
9694
|
+
internalData.isResizeCellHeight = true;
|
|
9695
|
+
reactData.resizeHeightFlag++;
|
|
9044
9696
|
}
|
|
9045
|
-
column.resizeWidth = Math.max(colMinWidth, resizeWidth);
|
|
9046
|
-
reactData._isResize = false;
|
|
9047
|
-
internalData._lastResizeTime = Date.now();
|
|
9048
|
-
$xeTable.analyColumnWidth();
|
|
9049
|
-
$xeTable.recalculate(true).then(() => {
|
|
9050
|
-
$xeTable.saveCustomStore('update:visible');
|
|
9051
|
-
$xeTable.updateCellAreas();
|
|
9052
|
-
$xeTable.dispatchEvent('resizable-change', {
|
|
9053
|
-
...params,
|
|
9054
|
-
resizeWidth
|
|
9055
|
-
}, evnt);
|
|
9056
|
-
setTimeout(() => $xeTable.recalculate(true), 300);
|
|
9057
|
-
});
|
|
9058
9697
|
}
|
|
9698
|
+
return $xeTable.$nextTick();
|
|
9699
|
+
},
|
|
9700
|
+
getRowHeight(rowOrId) {
|
|
9701
|
+
const $xeTable = this;
|
|
9702
|
+
const internalData = $xeTable;
|
|
9703
|
+
const {
|
|
9704
|
+
fullAllDataRowIdData
|
|
9705
|
+
} = internalData;
|
|
9706
|
+
const rowOpts = $xeTable.computeRowOpts;
|
|
9707
|
+
const cellOpts = $xeTable.computeCellOpts;
|
|
9708
|
+
const defaultRowHeight = $xeTable.computeDefaultRowHeight;
|
|
9709
|
+
const rowid = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(rowOrId) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(rowOrId) ? rowOrId : getRowid($xeTable, rowOrId);
|
|
9710
|
+
const rowRest = fullAllDataRowIdData[rowid];
|
|
9711
|
+
const currCellHeight = rowRest ? rowRest.resizeHeight : cellOpts.height || rowOpts.height || defaultRowHeight;
|
|
9712
|
+
return currCellHeight;
|
|
9059
9713
|
},
|
|
9060
9714
|
/**
|
|
9061
9715
|
* 刷新滚动操作,手动同步滚动相关位置(对于某些特殊的操作,比如滚动条错位、固定列不同步)
|
|
@@ -9491,10 +10145,10 @@ const Methods = {
|
|
|
9491
10145
|
}
|
|
9492
10146
|
} else if (isContextMenu) {
|
|
9493
10147
|
// 如果按下上下文键
|
|
9494
|
-
|
|
10148
|
+
internalData._keyCtx = selected.row && selected.column && bodyCtxMenu.length;
|
|
9495
10149
|
clearTimeout(internalData.keyCtxTimeout);
|
|
9496
10150
|
internalData.keyCtxTimeout = setTimeout(() => {
|
|
9497
|
-
|
|
10151
|
+
internalData._keyCtx = false;
|
|
9498
10152
|
}, 1000);
|
|
9499
10153
|
} else if (isEnter && !hasAltKey && keyboardConfig && keyboardOpts.isEnter && (selected.row || actived.row || treeConfig && (rowOpts.isCurrent || highlightCurrentRow) && currentRow)) {
|
|
9500
10154
|
const {
|
|
@@ -9775,17 +10429,6 @@ const Methods = {
|
|
|
9775
10429
|
this.updateCellAreas();
|
|
9776
10430
|
this.recalculate(true);
|
|
9777
10431
|
},
|
|
9778
|
-
handleTargetEnterEvent(isClear) {
|
|
9779
|
-
const $tooltip = this.$refs.tooltip;
|
|
9780
|
-
clearTimeout(this.tooltipTimeout);
|
|
9781
|
-
if (isClear) {
|
|
9782
|
-
this.closeTooltip();
|
|
9783
|
-
} else {
|
|
9784
|
-
if ($tooltip) {
|
|
9785
|
-
$tooltip.setActived(true);
|
|
9786
|
-
}
|
|
9787
|
-
}
|
|
9788
|
-
},
|
|
9789
10432
|
handleTargetLeaveEvent() {
|
|
9790
10433
|
const tooltipOpts = this.tooltipOpts;
|
|
9791
10434
|
let $tooltip = this.$refs.tooltip;
|
|
@@ -9804,24 +10447,25 @@ const Methods = {
|
|
|
9804
10447
|
}
|
|
9805
10448
|
},
|
|
9806
10449
|
triggerHeaderTitleEvent(evnt, iconParams, params) {
|
|
10450
|
+
const $xeTable = this;
|
|
10451
|
+
const reactData = $xeTable;
|
|
9807
10452
|
const tipContent = iconParams.content || iconParams.message;
|
|
9808
10453
|
if (tipContent) {
|
|
9809
10454
|
const {
|
|
9810
|
-
$refs,
|
|
9811
10455
|
tooltipStore
|
|
9812
|
-
} =
|
|
10456
|
+
} = reactData;
|
|
9813
10457
|
const {
|
|
9814
10458
|
column
|
|
9815
10459
|
} = params;
|
|
9816
10460
|
const content = getFuncText(tipContent);
|
|
9817
|
-
|
|
10461
|
+
handleTargetEnterEvent($xeTable, true);
|
|
9818
10462
|
tooltipStore.row = null;
|
|
9819
10463
|
tooltipStore.column = column;
|
|
9820
10464
|
tooltipStore.visible = true;
|
|
9821
10465
|
tooltipStore.currOpts = iconParams;
|
|
9822
|
-
|
|
9823
|
-
const $tooltip = $refs.
|
|
9824
|
-
if ($tooltip) {
|
|
10466
|
+
$xeTable.$nextTick(() => {
|
|
10467
|
+
const $tooltip = $xeTable.$refs.refTooltip;
|
|
10468
|
+
if ($tooltip && $tooltip.open) {
|
|
9825
10469
|
$tooltip.open(evnt.currentTarget, content);
|
|
9826
10470
|
}
|
|
9827
10471
|
});
|
|
@@ -9831,28 +10475,48 @@ const Methods = {
|
|
|
9831
10475
|
* 触发表头 tooltip 事件
|
|
9832
10476
|
*/
|
|
9833
10477
|
triggerHeaderTooltipEvent(evnt, params) {
|
|
10478
|
+
const $xeTable = this;
|
|
10479
|
+
const reactData = $xeTable;
|
|
9834
10480
|
const {
|
|
9835
10481
|
tooltipStore
|
|
9836
|
-
} =
|
|
10482
|
+
} = reactData;
|
|
9837
10483
|
const {
|
|
9838
10484
|
column
|
|
9839
10485
|
} = params;
|
|
10486
|
+
handleTargetEnterEvent($xeTable, true);
|
|
9840
10487
|
const titleElem = evnt.currentTarget;
|
|
9841
|
-
|
|
10488
|
+
if (!titleElem) {
|
|
10489
|
+
return;
|
|
10490
|
+
}
|
|
10491
|
+
const cellEl = titleElem.parentElement;
|
|
10492
|
+
if (!cellEl) {
|
|
10493
|
+
return;
|
|
10494
|
+
}
|
|
10495
|
+
const thEl = cellEl.parentElement;
|
|
10496
|
+
if (!thEl) {
|
|
10497
|
+
return;
|
|
10498
|
+
}
|
|
9842
10499
|
if (tooltipStore.column !== column || !tooltipStore.visible) {
|
|
9843
|
-
|
|
10500
|
+
handleTooltip($xeTable, evnt, thEl, cellEl, null, params);
|
|
9844
10501
|
}
|
|
9845
10502
|
},
|
|
9846
10503
|
/**
|
|
9847
10504
|
* 触发单元格 tooltip 事件
|
|
9848
10505
|
*/
|
|
9849
10506
|
triggerBodyTooltipEvent(evnt, params) {
|
|
10507
|
+
const $xeTable = this;
|
|
10508
|
+
const props = $xeTable;
|
|
10509
|
+
const reactData = $xeTable;
|
|
10510
|
+
const {
|
|
10511
|
+
editConfig
|
|
10512
|
+
} = props;
|
|
10513
|
+
const {
|
|
10514
|
+
editStore
|
|
10515
|
+
} = reactData;
|
|
9850
10516
|
const {
|
|
9851
|
-
editConfig,
|
|
9852
|
-
editOpts,
|
|
9853
|
-
editStore,
|
|
9854
10517
|
tooltipStore
|
|
9855
|
-
} =
|
|
10518
|
+
} = reactData;
|
|
10519
|
+
const editOpts = $xeTable.computeEditOpts;
|
|
9856
10520
|
const {
|
|
9857
10521
|
actived
|
|
9858
10522
|
} = editStore;
|
|
@@ -9860,8 +10524,8 @@ const Methods = {
|
|
|
9860
10524
|
row,
|
|
9861
10525
|
column
|
|
9862
10526
|
} = params;
|
|
9863
|
-
const
|
|
9864
|
-
|
|
10527
|
+
const tdEl = evnt.currentTarget;
|
|
10528
|
+
handleTargetEnterEvent($xeTable, tooltipStore.column !== column || tooltipStore.row !== row);
|
|
9865
10529
|
// 单元格处于编辑状态时不触发提示框
|
|
9866
10530
|
if (column.editRender && isEnableConf(editConfig)) {
|
|
9867
10531
|
// 如果是行编辑模式
|
|
@@ -9874,80 +10538,26 @@ const Methods = {
|
|
|
9874
10538
|
}
|
|
9875
10539
|
}
|
|
9876
10540
|
if (tooltipStore.column !== column || tooltipStore.row !== row || !tooltipStore.visible) {
|
|
9877
|
-
|
|
9878
|
-
let tipElem;
|
|
9879
|
-
if (column.treeNode) {
|
|
9880
|
-
overflowElem = cell.querySelector('.vxe-tree-cell');
|
|
9881
|
-
if (column.type === 'html') {
|
|
9882
|
-
tipElem = cell.querySelector('.vxe-cell--html');
|
|
9883
|
-
}
|
|
9884
|
-
} else {
|
|
9885
|
-
tipElem = cell.querySelector(column.type === 'html' ? '.vxe-cell--html' : '.vxe-cell--label');
|
|
9886
|
-
}
|
|
9887
|
-
this.handleTooltip(evnt, cell, overflowElem || cell.children[0], tipElem, params);
|
|
10541
|
+
handleTooltip($xeTable, evnt, tdEl, tdEl.querySelector('.vxe-cell--wrapper'), null, params);
|
|
9888
10542
|
}
|
|
9889
10543
|
},
|
|
9890
10544
|
/**
|
|
9891
10545
|
* 触发表尾 tooltip 事件
|
|
9892
10546
|
*/
|
|
9893
10547
|
triggerFooterTooltipEvent(evnt, params) {
|
|
10548
|
+
const $xeTable = this;
|
|
10549
|
+
const reactData = $xeTable;
|
|
9894
10550
|
const {
|
|
9895
10551
|
column
|
|
9896
10552
|
} = params;
|
|
9897
10553
|
const {
|
|
9898
10554
|
tooltipStore
|
|
9899
|
-
} =
|
|
10555
|
+
} = reactData;
|
|
9900
10556
|
const cell = evnt.currentTarget;
|
|
9901
|
-
|
|
10557
|
+
handleTargetEnterEvent($xeTable, tooltipStore.column !== column || !!tooltipStore.row);
|
|
9902
10558
|
if (tooltipStore.column !== column || !tooltipStore.visible) {
|
|
9903
|
-
|
|
9904
|
-
}
|
|
9905
|
-
},
|
|
9906
|
-
/**
|
|
9907
|
-
* 处理显示 tooltip
|
|
9908
|
-
* @param {Event} evnt 事件
|
|
9909
|
-
* @param {ColumnInfo} column 列配置
|
|
9910
|
-
* @param {Row} row 行对象
|
|
9911
|
-
*/
|
|
9912
|
-
handleTooltip(evnt, cell, overflowElem, tipElem, params) {
|
|
9913
|
-
const $xeTable = this;
|
|
9914
|
-
if (!overflowElem) {
|
|
9915
|
-
return $xeTable.$nextTick();
|
|
9916
|
-
}
|
|
9917
|
-
params.cell = cell;
|
|
9918
|
-
const {
|
|
9919
|
-
$refs,
|
|
9920
|
-
tooltipOpts,
|
|
9921
|
-
tooltipStore
|
|
9922
|
-
} = this;
|
|
9923
|
-
const {
|
|
9924
|
-
column,
|
|
9925
|
-
row
|
|
9926
|
-
} = params;
|
|
9927
|
-
const {
|
|
9928
|
-
showAll,
|
|
9929
|
-
enabled,
|
|
9930
|
-
contentMethod
|
|
9931
|
-
} = tooltipOpts;
|
|
9932
|
-
const customContent = contentMethod ? contentMethod(params) : null;
|
|
9933
|
-
const useCustom = contentMethod && !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(customContent);
|
|
9934
|
-
const content = useCustom ? customContent : (column.type === 'html' ? overflowElem.innerText : overflowElem.textContent).trim();
|
|
9935
|
-
const isCellOverflow = overflowElem.scrollWidth > overflowElem.clientWidth;
|
|
9936
|
-
if (content && (showAll || enabled || useCustom || isCellOverflow)) {
|
|
9937
|
-
Object.assign(tooltipStore, {
|
|
9938
|
-
row,
|
|
9939
|
-
column,
|
|
9940
|
-
visible: true,
|
|
9941
|
-
currOpts: {}
|
|
9942
|
-
});
|
|
9943
|
-
this.$nextTick(() => {
|
|
9944
|
-
const $tooltip = $refs.tooltip;
|
|
9945
|
-
if ($tooltip) {
|
|
9946
|
-
$tooltip.open(isCellOverflow ? overflowElem : tipElem || overflowElem, formatText(content));
|
|
9947
|
-
}
|
|
9948
|
-
});
|
|
10559
|
+
handleTooltip($xeTable, evnt, cell, cell.querySelector('.vxe-cell--wrapper') || cell.children[0], null, params);
|
|
9949
10560
|
}
|
|
9950
|
-
return this.$nextTick();
|
|
9951
10561
|
},
|
|
9952
10562
|
openTooltip(target, content) {
|
|
9953
10563
|
const {
|
|
@@ -10681,7 +11291,7 @@ const Methods = {
|
|
|
10681
11291
|
}
|
|
10682
11292
|
vLen++;
|
|
10683
11293
|
});
|
|
10684
|
-
const isSelected =
|
|
11294
|
+
const isSelected = vLen > 0 ? sLen >= vLen : sLen >= rootList.length;
|
|
10685
11295
|
const halfSelect = !isSelected && (sLen >= 1 || hLen >= 1);
|
|
10686
11296
|
reactData.isAllSelected = isSelected;
|
|
10687
11297
|
reactData.isIndeterminate = halfSelect;
|
|
@@ -11753,10 +12363,10 @@ const Methods = {
|
|
|
11753
12363
|
}
|
|
11754
12364
|
reactData.isDragRowMove = true;
|
|
11755
12365
|
$xeTable.handleTableData(treeConfig && transform);
|
|
11756
|
-
$xeTable.cacheRowMap();
|
|
12366
|
+
$xeTable.cacheRowMap(false);
|
|
11757
12367
|
updateScrollYStatus($xeTable);
|
|
11758
12368
|
if (!(treeConfig && transform)) {
|
|
11759
|
-
$xeTable
|
|
12369
|
+
updateAfterDataIndex($xeTable);
|
|
11760
12370
|
}
|
|
11761
12371
|
$xeTable.checkSelectionStatus();
|
|
11762
12372
|
if (reactData.scrollYLoad) {
|
|
@@ -11806,18 +12416,16 @@ const Methods = {
|
|
|
11806
12416
|
prevDragRow,
|
|
11807
12417
|
prevDragPos
|
|
11808
12418
|
} = internalData;
|
|
11809
|
-
if (treeConfig && prevDragToChild) {
|
|
12419
|
+
if (treeConfig && lazy && prevDragToChild) {
|
|
11810
12420
|
// 懒加载
|
|
11811
|
-
|
|
11812
|
-
|
|
11813
|
-
|
|
11814
|
-
if (
|
|
11815
|
-
if (rowRest && rowRest.treeLoaded) {
|
|
11816
|
-
$xeTable.handleRowDragSwapEvent(evnt, true, dragRow, prevDragRow, prevDragPos, prevDragToChild);
|
|
11817
|
-
}
|
|
11818
|
-
} else {
|
|
12421
|
+
const newRowid = getRowid($xeTable, prevDragRow);
|
|
12422
|
+
const rowRest = fullAllDataRowIdData[newRowid];
|
|
12423
|
+
if (prevDragRow[hasChildField]) {
|
|
12424
|
+
if (rowRest && rowRest.treeLoaded) {
|
|
11819
12425
|
$xeTable.handleRowDragSwapEvent(evnt, true, dragRow, prevDragRow, prevDragPos, prevDragToChild);
|
|
11820
12426
|
}
|
|
12427
|
+
} else {
|
|
12428
|
+
$xeTable.handleRowDragSwapEvent(evnt, true, dragRow, prevDragRow, prevDragPos, prevDragToChild);
|
|
11821
12429
|
}
|
|
11822
12430
|
} else {
|
|
11823
12431
|
$xeTable.handleRowDragSwapEvent(evnt, true, dragRow, prevDragRow, prevDragPos, prevDragToChild);
|
|
@@ -13123,7 +13731,7 @@ const Methods = {
|
|
|
13123
13731
|
return this.$nextTick().then(() => {
|
|
13124
13732
|
if (transform) {
|
|
13125
13733
|
this.handleTableData();
|
|
13126
|
-
|
|
13734
|
+
updateAfterDataIndex($xeTable);
|
|
13127
13735
|
return this.$nextTick();
|
|
13128
13736
|
}
|
|
13129
13737
|
});
|
|
@@ -13267,7 +13875,7 @@ const Methods = {
|
|
|
13267
13875
|
return this.handleBaseTreeExpand(rows, expanded).then(() => {
|
|
13268
13876
|
handleVirtualTreeToList($xeTable);
|
|
13269
13877
|
this.handleTableData();
|
|
13270
|
-
|
|
13878
|
+
updateAfterDataIndex($xeTable);
|
|
13271
13879
|
}).then(() => {
|
|
13272
13880
|
return this.recalculate();
|
|
13273
13881
|
}).then(() => {
|
|
@@ -13369,17 +13977,22 @@ const Methods = {
|
|
|
13369
13977
|
* 获取表格的滚动状态
|
|
13370
13978
|
*/
|
|
13371
13979
|
getScroll() {
|
|
13980
|
+
const $xeTable = this;
|
|
13981
|
+
const reactData = $xeTable;
|
|
13982
|
+
const internalData = $xeTable;
|
|
13372
13983
|
const {
|
|
13373
|
-
$refs,
|
|
13374
13984
|
scrollXLoad,
|
|
13375
13985
|
scrollYLoad
|
|
13376
|
-
} =
|
|
13377
|
-
const
|
|
13986
|
+
} = reactData;
|
|
13987
|
+
const {
|
|
13988
|
+
elemStore
|
|
13989
|
+
} = internalData;
|
|
13990
|
+
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
13378
13991
|
return {
|
|
13379
13992
|
virtualX: scrollXLoad,
|
|
13380
13993
|
virtualY: scrollYLoad,
|
|
13381
|
-
scrollTop:
|
|
13382
|
-
scrollLeft:
|
|
13994
|
+
scrollTop: bodyScrollElem ? bodyScrollElem.scrollTop : 0,
|
|
13995
|
+
scrollLeft: bodyScrollElem ? bodyScrollElem.scrollLeft : 0
|
|
13383
13996
|
};
|
|
13384
13997
|
},
|
|
13385
13998
|
handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, params) {
|
|
@@ -13488,60 +14101,6 @@ const Methods = {
|
|
|
13488
14101
|
}
|
|
13489
14102
|
$xeTable.dispatchEvent('scroll', evntParams, evnt);
|
|
13490
14103
|
},
|
|
13491
|
-
lazyScrollXData() {
|
|
13492
|
-
const $xeTable = this;
|
|
13493
|
-
const internalData = $xeTable;
|
|
13494
|
-
const {
|
|
13495
|
-
lxTimeout,
|
|
13496
|
-
lxRunTime,
|
|
13497
|
-
scrollXStore
|
|
13498
|
-
} = internalData;
|
|
13499
|
-
const {
|
|
13500
|
-
visibleSize
|
|
13501
|
-
} = scrollXStore;
|
|
13502
|
-
const fpsTime = Math.max(5, Math.min(80, Math.floor(visibleSize * 3)));
|
|
13503
|
-
if (lxTimeout) {
|
|
13504
|
-
clearTimeout(lxTimeout);
|
|
13505
|
-
}
|
|
13506
|
-
if (!lxRunTime || lxRunTime + fpsTime < Date.now()) {
|
|
13507
|
-
internalData.lxRunTime = Date.now();
|
|
13508
|
-
loadScrollXData($xeTable);
|
|
13509
|
-
}
|
|
13510
|
-
internalData.lxTimeout = setTimeout(() => {
|
|
13511
|
-
internalData.lxTimeout = undefined;
|
|
13512
|
-
internalData.lxRunTime = undefined;
|
|
13513
|
-
loadScrollXData($xeTable);
|
|
13514
|
-
}, fpsTime);
|
|
13515
|
-
},
|
|
13516
|
-
lazyScrollYData() {
|
|
13517
|
-
const $xeTable = this;
|
|
13518
|
-
const props = $xeTable;
|
|
13519
|
-
const internalData = $xeTable;
|
|
13520
|
-
const {
|
|
13521
|
-
showOverflow
|
|
13522
|
-
} = props;
|
|
13523
|
-
const {
|
|
13524
|
-
lyTimeout,
|
|
13525
|
-
lyRunTime,
|
|
13526
|
-
scrollYStore
|
|
13527
|
-
} = internalData;
|
|
13528
|
-
const {
|
|
13529
|
-
visibleSize
|
|
13530
|
-
} = scrollYStore;
|
|
13531
|
-
const fpsTime = showOverflow ? 5 : Math.max(5, Math.min(80, Math.floor(visibleSize / 2)));
|
|
13532
|
-
if (lyTimeout) {
|
|
13533
|
-
clearTimeout(lyTimeout);
|
|
13534
|
-
}
|
|
13535
|
-
if (!lyRunTime || lyRunTime + fpsTime < Date.now()) {
|
|
13536
|
-
internalData.lyRunTime = Date.now();
|
|
13537
|
-
loadScrollYData($xeTable);
|
|
13538
|
-
}
|
|
13539
|
-
internalData.lyTimeout = setTimeout(() => {
|
|
13540
|
-
internalData.lyTimeout = undefined;
|
|
13541
|
-
internalData.lyRunTime = undefined;
|
|
13542
|
-
loadScrollYData($xeTable);
|
|
13543
|
-
}, fpsTime);
|
|
13544
|
-
},
|
|
13545
14104
|
/**
|
|
13546
14105
|
* 横向 X 可视渲染事件处理
|
|
13547
14106
|
*/
|
|
@@ -13551,7 +14110,7 @@ const Methods = {
|
|
|
13551
14110
|
if (sXOpts.immediate) {
|
|
13552
14111
|
loadScrollXData($xeTable);
|
|
13553
14112
|
} else {
|
|
13554
|
-
$xeTable
|
|
14113
|
+
lazyScrollXData($xeTable);
|
|
13555
14114
|
}
|
|
13556
14115
|
},
|
|
13557
14116
|
/**
|
|
@@ -13563,7 +14122,7 @@ const Methods = {
|
|
|
13563
14122
|
if (sYOpts.immediate) {
|
|
13564
14123
|
loadScrollYData($xeTable);
|
|
13565
14124
|
} else {
|
|
13566
|
-
$xeTable
|
|
14125
|
+
lazyScrollYData($xeTable);
|
|
13567
14126
|
}
|
|
13568
14127
|
},
|
|
13569
14128
|
triggerBodyScrollEvent(evnt, fixedType) {
|
|
@@ -13571,6 +14130,7 @@ const Methods = {
|
|
|
13571
14130
|
const internalData = $xeTable;
|
|
13572
14131
|
const {
|
|
13573
14132
|
elemStore,
|
|
14133
|
+
intoRunScroll,
|
|
13574
14134
|
lastScrollTop,
|
|
13575
14135
|
lastScrollLeft,
|
|
13576
14136
|
inWheelScroll,
|
|
@@ -13590,6 +14150,9 @@ const Methods = {
|
|
|
13590
14150
|
if (inWheelScroll || inVirtualScroll || inHeaderScroll || inFooterScroll) {
|
|
13591
14151
|
return;
|
|
13592
14152
|
}
|
|
14153
|
+
if (intoRunScroll) {
|
|
14154
|
+
return;
|
|
14155
|
+
}
|
|
13593
14156
|
if (!bodyScrollElem) {
|
|
13594
14157
|
return;
|
|
13595
14158
|
}
|
|
@@ -13648,6 +14211,7 @@ const Methods = {
|
|
|
13648
14211
|
const internalData = $xeTable;
|
|
13649
14212
|
const {
|
|
13650
14213
|
elemStore,
|
|
14214
|
+
intoRunScroll,
|
|
13651
14215
|
inWheelScroll,
|
|
13652
14216
|
inVirtualScroll,
|
|
13653
14217
|
inBodyScroll,
|
|
@@ -13658,16 +14222,10 @@ const Methods = {
|
|
|
13658
14222
|
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
13659
14223
|
const headerScrollElem = getRefElem(elemStore['main-header-scroll']);
|
|
13660
14224
|
const footerScrollElem = getRefElem(elemStore['main-footer-scroll']);
|
|
13661
|
-
if (inWheelScroll) {
|
|
13662
|
-
return;
|
|
13663
|
-
}
|
|
13664
|
-
if (inVirtualScroll) {
|
|
14225
|
+
if (inWheelScroll || inVirtualScroll || inBodyScroll || inFooterScroll) {
|
|
13665
14226
|
return;
|
|
13666
14227
|
}
|
|
13667
|
-
if (
|
|
13668
|
-
return;
|
|
13669
|
-
}
|
|
13670
|
-
if (inFooterScroll) {
|
|
14228
|
+
if (intoRunScroll) {
|
|
13671
14229
|
return;
|
|
13672
14230
|
}
|
|
13673
14231
|
if (!headerScrollElem) {
|
|
@@ -13698,6 +14256,7 @@ const Methods = {
|
|
|
13698
14256
|
const internalData = $xeTable;
|
|
13699
14257
|
const {
|
|
13700
14258
|
elemStore,
|
|
14259
|
+
intoRunScroll,
|
|
13701
14260
|
inWheelScroll,
|
|
13702
14261
|
inVirtualScroll,
|
|
13703
14262
|
inHeaderScroll,
|
|
@@ -13708,16 +14267,10 @@ const Methods = {
|
|
|
13708
14267
|
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
13709
14268
|
const headerScrollElem = getRefElem(elemStore['main-header-scroll']);
|
|
13710
14269
|
const footerScrollElem = getRefElem(elemStore['main-footer-scroll']);
|
|
13711
|
-
if (inWheelScroll) {
|
|
14270
|
+
if (inWheelScroll || inVirtualScroll || inHeaderScroll || inBodyScroll) {
|
|
13712
14271
|
return;
|
|
13713
14272
|
}
|
|
13714
|
-
if (
|
|
13715
|
-
return;
|
|
13716
|
-
}
|
|
13717
|
-
if (inHeaderScroll) {
|
|
13718
|
-
return;
|
|
13719
|
-
}
|
|
13720
|
-
if (inBodyScroll) {
|
|
14273
|
+
if (intoRunScroll) {
|
|
13721
14274
|
return;
|
|
13722
14275
|
}
|
|
13723
14276
|
if (!footerScrollElem) {
|
|
@@ -13775,26 +14328,13 @@ const Methods = {
|
|
|
13775
14328
|
if (!bodyScrollElem) {
|
|
13776
14329
|
return;
|
|
13777
14330
|
}
|
|
13778
|
-
|
|
13779
|
-
|
|
13780
|
-
|
|
13781
|
-
} else if (reactData.lastScrollTime + 30 > Date.now()) {
|
|
13782
|
-
multiple = 1.15;
|
|
13783
|
-
} else if (reactData.lastScrollTime + 40 > Date.now()) {
|
|
13784
|
-
multiple = 1.12;
|
|
13785
|
-
} else if (reactData.lastScrollTime + 55 > Date.now()) {
|
|
13786
|
-
multiple = 1.09;
|
|
13787
|
-
} else if (reactData.lastScrollTime + 75 > Date.now()) {
|
|
13788
|
-
multiple = 1.06;
|
|
13789
|
-
} else if (reactData.lastScrollTime + 100 > Date.now()) {
|
|
13790
|
-
multiple = 1.03;
|
|
13791
|
-
}
|
|
13792
|
-
const deltaTop = deltaY * multiple;
|
|
13793
|
-
const deltaLeft = deltaX * multiple;
|
|
14331
|
+
const wheelSpeed = getWheelSpeed(reactData.lastScrollTime);
|
|
14332
|
+
const deltaTop = deltaY * wheelSpeed;
|
|
14333
|
+
const deltaLeft = deltaX * wheelSpeed;
|
|
13794
14334
|
const isTopWheel = deltaTop < 0;
|
|
13795
|
-
const currScrollTop =
|
|
14335
|
+
const currScrollTop = bodyScrollElem.scrollTop;
|
|
13796
14336
|
// 如果滚动位置已经是顶部或底部,则不需要触发
|
|
13797
|
-
if (isTopWheel ? currScrollTop <= 0 : currScrollTop >=
|
|
14337
|
+
if (isTopWheel ? currScrollTop <= 0 : currScrollTop >= bodyScrollElem.scrollHeight - bodyScrollElem.clientHeight) {
|
|
13798
14338
|
return;
|
|
13799
14339
|
}
|
|
13800
14340
|
const scrollTop = bodyScrollElem.scrollTop + deltaTop;
|
|
@@ -13807,19 +14347,32 @@ const Methods = {
|
|
|
13807
14347
|
if (rowOpts.isHover || highlightHoverRow) {
|
|
13808
14348
|
$xeTable.clearHoverRow();
|
|
13809
14349
|
}
|
|
13810
|
-
|
|
13811
|
-
|
|
13812
|
-
|
|
13813
|
-
|
|
13814
|
-
|
|
13815
|
-
|
|
13816
|
-
|
|
13817
|
-
|
|
13818
|
-
|
|
14350
|
+
wheelScrollTo(scrollTop - bodyScrollElem.scrollTop, offsetTop => {
|
|
14351
|
+
const currTopNum = bodyScrollElem.scrollTop + offsetTop;
|
|
14352
|
+
internalData.inWheelScroll = true;
|
|
14353
|
+
setScrollTop(yHandleEl, currTopNum);
|
|
14354
|
+
setScrollTop(bodyScrollElem, currTopNum);
|
|
14355
|
+
setScrollTop(leftScrollElem, currTopNum);
|
|
14356
|
+
setScrollTop(rightScrollElem, currTopNum);
|
|
14357
|
+
$xeTable.triggerScrollYEvent(evnt);
|
|
14358
|
+
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, currTopNum, scrollLeft, {
|
|
14359
|
+
type: 'table',
|
|
14360
|
+
fixed: ''
|
|
14361
|
+
});
|
|
13819
14362
|
});
|
|
13820
|
-
|
|
13821
|
-
|
|
13822
|
-
|
|
14363
|
+
// internalData.inWheelScroll = true
|
|
14364
|
+
// setScrollTop(yHandleEl, scrollTop)
|
|
14365
|
+
// setScrollTop(bodyScrollElem, scrollTop)
|
|
14366
|
+
// setScrollTop(leftScrollElem, scrollTop)
|
|
14367
|
+
// setScrollTop(rightScrollElem, scrollTop)
|
|
14368
|
+
// loadScrollYData($xeTable, scrollTop)
|
|
14369
|
+
// $xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
|
|
14370
|
+
// type: 'footer',
|
|
14371
|
+
// fixed: ''
|
|
14372
|
+
// })
|
|
14373
|
+
}
|
|
14374
|
+
},
|
|
14375
|
+
triggerVirtualScrollXEvent(evnt) {
|
|
13823
14376
|
const $xeTable = this;
|
|
13824
14377
|
const internalData = $xeTable;
|
|
13825
14378
|
const {
|
|
@@ -13861,7 +14414,7 @@ const Methods = {
|
|
|
13861
14414
|
fixed: ''
|
|
13862
14415
|
});
|
|
13863
14416
|
},
|
|
13864
|
-
|
|
14417
|
+
triggerVirtualScrollYEvent(evnt) {
|
|
13865
14418
|
const $xeTable = this;
|
|
13866
14419
|
const internalData = $xeTable;
|
|
13867
14420
|
const {
|
|
@@ -13910,9 +14463,7 @@ const Methods = {
|
|
|
13910
14463
|
showOverflow
|
|
13911
14464
|
} = props;
|
|
13912
14465
|
handleTableColumn($xeTable);
|
|
13913
|
-
// calcCellHeight()
|
|
13914
14466
|
return $xeTable.$nextTick().then(() => {
|
|
13915
|
-
// calcCellHeight()
|
|
13916
14467
|
handleTableColumn($xeTable);
|
|
13917
14468
|
$xeTable.updateScrollXSpace();
|
|
13918
14469
|
if (!showOverflow) {
|
|
@@ -13979,9 +14530,7 @@ const Methods = {
|
|
|
13979
14530
|
updateScrollYData() {
|
|
13980
14531
|
const $xeTable = this;
|
|
13981
14532
|
$xeTable.handleTableData();
|
|
13982
|
-
// calcCellHeight()
|
|
13983
14533
|
return $xeTable.$nextTick().then(() => {
|
|
13984
|
-
// calcCellHeight()
|
|
13985
14534
|
$xeTable.handleTableData();
|
|
13986
14535
|
$xeTable.updateScrollYSpace();
|
|
13987
14536
|
});
|
|
@@ -13996,42 +14545,42 @@ const Methods = {
|
|
|
13996
14545
|
showOverflow
|
|
13997
14546
|
} = props;
|
|
13998
14547
|
const {
|
|
13999
|
-
scrollYLoad
|
|
14000
|
-
rowHeight
|
|
14548
|
+
scrollYLoad
|
|
14001
14549
|
} = reactData;
|
|
14002
14550
|
const {
|
|
14003
14551
|
scrollYStore,
|
|
14004
14552
|
elemStore,
|
|
14553
|
+
isResizeCellHeight,
|
|
14005
14554
|
afterFullData,
|
|
14006
14555
|
fullAllDataRowIdData
|
|
14007
14556
|
} = internalData;
|
|
14008
14557
|
const {
|
|
14009
14558
|
startIndex
|
|
14010
14559
|
} = scrollYStore;
|
|
14560
|
+
const rowOpts = $xeTable.computeRowOpts;
|
|
14561
|
+
const cellOpts = $xeTable.computeCellOpts;
|
|
14562
|
+
const defaultRowHeight = $xeTable.computeDefaultRowHeight;
|
|
14011
14563
|
const bodyTableElem = getRefElem(elemStore['main-body-table']);
|
|
14012
14564
|
const containerList = ['main', 'left', 'right'];
|
|
14013
14565
|
let topSpaceHeight = 0;
|
|
14014
14566
|
let ySpaceHeight = 0;
|
|
14015
14567
|
if (scrollYLoad) {
|
|
14016
|
-
|
|
14017
|
-
|
|
14018
|
-
|
|
14568
|
+
const isCustomCellHeight = isResizeCellHeight || cellOpts.height || rowOpts.height;
|
|
14569
|
+
if (!isCustomCellHeight && showOverflow) {
|
|
14570
|
+
ySpaceHeight = afterFullData.length * defaultRowHeight;
|
|
14571
|
+
topSpaceHeight = Math.max(0, startIndex * defaultRowHeight);
|
|
14019
14572
|
} else {
|
|
14020
14573
|
for (let i = 0; i < afterFullData.length; i++) {
|
|
14021
14574
|
const row = afterFullData[i];
|
|
14022
14575
|
const rowid = getRowid($xeTable, row);
|
|
14023
14576
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
14024
|
-
|
|
14025
|
-
ySpaceHeight += rowRest.height || rowHeight;
|
|
14026
|
-
}
|
|
14577
|
+
ySpaceHeight += rowRest ? rowRest.resizeHeight || cellOpts.height || rowOpts.height || defaultRowHeight : defaultRowHeight;
|
|
14027
14578
|
}
|
|
14028
14579
|
for (let i = 0; i < startIndex; i++) {
|
|
14029
14580
|
const row = afterFullData[i];
|
|
14030
14581
|
const rowid = getRowid($xeTable, row);
|
|
14031
14582
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
14032
|
-
|
|
14033
|
-
topSpaceHeight += rowRest.height || rowHeight;
|
|
14034
|
-
}
|
|
14583
|
+
topSpaceHeight += rowRest ? rowRest.resizeHeight || cellOpts.height || rowOpts.height || defaultRowHeight : defaultRowHeight;
|
|
14035
14584
|
}
|
|
14036
14585
|
}
|
|
14037
14586
|
} else {
|
|
@@ -14056,7 +14605,7 @@ const Methods = {
|
|
|
14056
14605
|
if (scrollYSpaceEl) {
|
|
14057
14606
|
scrollYSpaceEl.style.height = ySpaceHeight ? `${ySpaceHeight}px` : '';
|
|
14058
14607
|
}
|
|
14059
|
-
$xeTable.$nextTick(() => {
|
|
14608
|
+
return $xeTable.$nextTick().then(() => {
|
|
14060
14609
|
updateStyle($xeTable);
|
|
14061
14610
|
});
|
|
14062
14611
|
},
|
|
@@ -14520,11 +15069,11 @@ const isVMScrollProcess = $xeTable => {
|
|
|
14520
15069
|
} = tableProps;
|
|
14521
15070
|
const {
|
|
14522
15071
|
lastScrollTime,
|
|
14523
|
-
|
|
15072
|
+
isDragResize
|
|
14524
15073
|
} = tableReactData;
|
|
14525
|
-
return !!(
|
|
15074
|
+
return !!(isDragResize || lastScrollTime && Date.now() < lastScrollTime + delayHover);
|
|
14526
15075
|
};
|
|
14527
|
-
function renderLine(h, _vm, params) {
|
|
15076
|
+
function renderLine(h, _vm, params, cellHeight) {
|
|
14528
15077
|
const $xeTable = _vm.$parent;
|
|
14529
15078
|
const tableProps = $xeTable;
|
|
14530
15079
|
const tableInternalData = $xeTable;
|
|
@@ -14555,16 +15104,18 @@ function renderLine(h, _vm, params) {
|
|
|
14555
15104
|
let prevRow = null;
|
|
14556
15105
|
if (rest) {
|
|
14557
15106
|
rLevel = rest.level;
|
|
14558
|
-
prevRow = rest.items[rest.
|
|
15107
|
+
prevRow = rest.items[rest.treeIndex - 1];
|
|
14559
15108
|
}
|
|
14560
15109
|
const isFirstRow = $xeTable.eqRow(afterFullData[0], row);
|
|
14561
15110
|
if (treeConfig && treeNode && (treeOpts.showLine || treeOpts.line)) {
|
|
14562
15111
|
return [h('div', {
|
|
15112
|
+
key: 'tl',
|
|
14563
15113
|
class: 'vxe-tree--line-wrapper'
|
|
14564
15114
|
}, [h('div', {
|
|
14565
15115
|
class: 'vxe-tree--line',
|
|
14566
15116
|
style: {
|
|
14567
15117
|
height: `${isFirstRow ? 1 : calcTreeLine(params, prevRow)}px`,
|
|
15118
|
+
bottom: `-${Math.floor(cellHeight / 2)}px`,
|
|
14568
15119
|
left: `${rLevel * treeOpts.indent + (rLevel ? 2 - getOffsetSize($xeTable) : 0) + 16}px`
|
|
14569
15120
|
}
|
|
14570
15121
|
})])];
|
|
@@ -14593,7 +15144,8 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
|
|
|
14593
15144
|
mouseConfig,
|
|
14594
15145
|
editConfig,
|
|
14595
15146
|
editRules,
|
|
14596
|
-
tooltipConfig
|
|
15147
|
+
tooltipConfig,
|
|
15148
|
+
padding: allPadding
|
|
14597
15149
|
} = tableProps;
|
|
14598
15150
|
const {
|
|
14599
15151
|
tableData,
|
|
@@ -14601,7 +15153,8 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
|
|
|
14601
15153
|
currentColumn,
|
|
14602
15154
|
scrollXLoad,
|
|
14603
15155
|
scrollYLoad,
|
|
14604
|
-
|
|
15156
|
+
calcCellHeightFlag,
|
|
15157
|
+
resizeHeightFlag,
|
|
14605
15158
|
mergeList,
|
|
14606
15159
|
editStore,
|
|
14607
15160
|
isAllOverflow,
|
|
@@ -14620,6 +15173,7 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
|
|
|
14620
15173
|
const rowOpts = $xeTable.computeRowOpts;
|
|
14621
15174
|
const rowDragOpts = $xeTable.computeRowDragOpts;
|
|
14622
15175
|
const defaultRowHeight = $xeTable.computeDefaultRowHeight;
|
|
15176
|
+
const currCellHeight = cellOpts.height || rowOpts.height || defaultRowHeight;
|
|
14623
15177
|
const {
|
|
14624
15178
|
disabledMethod: dragDisabledMethod,
|
|
14625
15179
|
isCrossDrag,
|
|
@@ -14639,6 +15193,7 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
|
|
|
14639
15193
|
showOverflow,
|
|
14640
15194
|
className,
|
|
14641
15195
|
treeNode,
|
|
15196
|
+
rowResize,
|
|
14642
15197
|
slots
|
|
14643
15198
|
} = column;
|
|
14644
15199
|
const {
|
|
@@ -14647,9 +15202,7 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
|
|
|
14647
15202
|
const {
|
|
14648
15203
|
actived
|
|
14649
15204
|
} = editStore;
|
|
14650
|
-
const
|
|
14651
|
-
height: customRHeight
|
|
14652
|
-
} = rowOpts;
|
|
15205
|
+
const rowRest = fullAllDataRowIdData[rowid];
|
|
14653
15206
|
const colid = column.id;
|
|
14654
15207
|
const renderOpts = editRender || cellRender;
|
|
14655
15208
|
const compConf = renderOpts ? body_renderer.get(renderOpts.name) : null;
|
|
@@ -14659,23 +15212,24 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
|
|
|
14659
15212
|
const columnIndex = $xeTable.getColumnIndex(column);
|
|
14660
15213
|
const _columnIndex = $xeTable.getVTColumnIndex(column);
|
|
14661
15214
|
const isEdit = isEnableConf(editRender);
|
|
15215
|
+
const resizeHeight = resizeHeightFlag ? rowRest.resizeHeight : 0;
|
|
14662
15216
|
let fixedHiddenColumn = fixedType ? column.fixed !== fixedType : column.fixed && overflowX;
|
|
15217
|
+
const isPadding = allPadding === null ? cellOpts.padding : allPadding;
|
|
14663
15218
|
const cellOverflow = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isUndefined(showOverflow) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNull(showOverflow) ? allColumnOverflow : showOverflow;
|
|
14664
15219
|
const showEllipsis = cellOverflow === 'ellipsis';
|
|
14665
15220
|
const showTitle = cellOverflow === 'title';
|
|
14666
15221
|
const showTooltip = cellOverflow === true || cellOverflow === 'tooltip';
|
|
14667
15222
|
// 如果表格加上 showOverflow 则不再支持列单独设置
|
|
14668
|
-
const hasEllipsis = allColumnOverflow || showTitle || showTooltip || showEllipsis;
|
|
15223
|
+
const hasEllipsis = allColumnOverflow || showTitle || showTooltip || showEllipsis || resizeHeight > 0;
|
|
14669
15224
|
let isDirty;
|
|
14670
15225
|
const tdOns = {};
|
|
14671
|
-
const rest = fullAllDataRowIdData[rowid];
|
|
14672
15226
|
const cellAlign = align || (compConf ? compConf.tableCellAlign : '') || allAlign;
|
|
14673
15227
|
const errorValidItem = validErrorMaps[`${rowid}:${colid}`];
|
|
14674
15228
|
const showValidTip = editRules && validOpts.showMessage && (validOpts.message === 'default' ? height || tableData.length > 1 : validOpts.message === 'inline');
|
|
14675
|
-
const
|
|
15229
|
+
const tdAttrs = {
|
|
14676
15230
|
colid
|
|
14677
15231
|
};
|
|
14678
|
-
const
|
|
15232
|
+
const cellParams = {
|
|
14679
15233
|
$table: $xeTable,
|
|
14680
15234
|
$grid: $xeTable.xegrid,
|
|
14681
15235
|
isEdit: false,
|
|
@@ -14703,7 +15257,7 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
|
|
|
14703
15257
|
isRowDragCell = rowDragOpts.trigger === 'row' || column.dragSort && rowDragOpts.trigger === 'cell';
|
|
14704
15258
|
}
|
|
14705
15259
|
if (isRowDragCell) {
|
|
14706
|
-
isDisabledDrag = !!(dragDisabledMethod && dragDisabledMethod(
|
|
15260
|
+
isDisabledDrag = !!(dragDisabledMethod && dragDisabledMethod(cellParams));
|
|
14707
15261
|
}
|
|
14708
15262
|
// hover 进入事件
|
|
14709
15263
|
if (showTitle || showTooltip || showAllTip || tooltipConfig) {
|
|
@@ -14715,11 +15269,11 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
|
|
|
14715
15269
|
updateCellTitle(evnt.currentTarget, column);
|
|
14716
15270
|
} else if (showTooltip || showAllTip) {
|
|
14717
15271
|
// 如果配置了显示 tooltip
|
|
14718
|
-
$xeTable.triggerBodyTooltipEvent(evnt,
|
|
15272
|
+
$xeTable.triggerBodyTooltipEvent(evnt, cellParams);
|
|
14719
15273
|
}
|
|
14720
15274
|
$xeTable.dispatchEvent('cell-mouseenter', Object.assign({
|
|
14721
15275
|
cell: evnt.currentTarget
|
|
14722
|
-
},
|
|
15276
|
+
}, cellParams), evnt);
|
|
14723
15277
|
};
|
|
14724
15278
|
}
|
|
14725
15279
|
// hover 退出事件
|
|
@@ -14733,13 +15287,13 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
|
|
|
14733
15287
|
}
|
|
14734
15288
|
$xeTable.dispatchEvent('cell-mouseleave', Object.assign({
|
|
14735
15289
|
cell: evnt.currentTarget
|
|
14736
|
-
},
|
|
15290
|
+
}, cellParams), evnt);
|
|
14737
15291
|
};
|
|
14738
15292
|
}
|
|
14739
15293
|
// 按下事件处理
|
|
14740
15294
|
if (isRowDragCell || checkboxOpts.range || mouseConfig) {
|
|
14741
15295
|
tdOns.mousedown = evnt => {
|
|
14742
|
-
$xeTable.triggerCellMousedownEvent(evnt,
|
|
15296
|
+
$xeTable.triggerCellMousedownEvent(evnt, cellParams);
|
|
14743
15297
|
};
|
|
14744
15298
|
}
|
|
14745
15299
|
// 拖拽列事件
|
|
@@ -14748,11 +15302,11 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
|
|
|
14748
15302
|
}
|
|
14749
15303
|
// 点击事件处理
|
|
14750
15304
|
tdOns.click = evnt => {
|
|
14751
|
-
$xeTable.triggerCellClickEvent(evnt,
|
|
15305
|
+
$xeTable.triggerCellClickEvent(evnt, cellParams);
|
|
14752
15306
|
};
|
|
14753
15307
|
// 双击事件处理
|
|
14754
15308
|
tdOns.dblclick = evnt => {
|
|
14755
|
-
$xeTable.triggerCellDblclickEvent(evnt,
|
|
15309
|
+
$xeTable.triggerCellDblclickEvent(evnt, cellParams);
|
|
14756
15310
|
};
|
|
14757
15311
|
// 合并行或列
|
|
14758
15312
|
if (mergeList.length) {
|
|
@@ -14766,10 +15320,10 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
|
|
|
14766
15320
|
return null;
|
|
14767
15321
|
}
|
|
14768
15322
|
if (rowspan > 1) {
|
|
14769
|
-
|
|
15323
|
+
tdAttrs.rowspan = rowspan;
|
|
14770
15324
|
}
|
|
14771
15325
|
if (colspan > 1) {
|
|
14772
|
-
|
|
15326
|
+
tdAttrs.colspan = colspan;
|
|
14773
15327
|
}
|
|
14774
15328
|
}
|
|
14775
15329
|
} else if (spanMethod) {
|
|
@@ -14777,20 +15331,20 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
|
|
|
14777
15331
|
const {
|
|
14778
15332
|
rowspan = 1,
|
|
14779
15333
|
colspan = 1
|
|
14780
|
-
} = spanMethod(
|
|
15334
|
+
} = spanMethod(cellParams) || {};
|
|
14781
15335
|
if (!rowspan || !colspan) {
|
|
14782
15336
|
return null;
|
|
14783
15337
|
}
|
|
14784
15338
|
if (rowspan > 1) {
|
|
14785
|
-
|
|
15339
|
+
tdAttrs.rowspan = rowspan;
|
|
14786
15340
|
}
|
|
14787
15341
|
if (colspan > 1) {
|
|
14788
|
-
|
|
15342
|
+
tdAttrs.colspan = colspan;
|
|
14789
15343
|
}
|
|
14790
15344
|
}
|
|
14791
15345
|
// 如果被合并不可隐藏
|
|
14792
15346
|
if (fixedHiddenColumn && mergeList) {
|
|
14793
|
-
if (
|
|
15347
|
+
if (tdAttrs.colspan > 1 || tdAttrs.rowspan > 1) {
|
|
14794
15348
|
fixedHiddenColumn = false;
|
|
14795
15349
|
}
|
|
14796
15350
|
}
|
|
@@ -14798,42 +15352,73 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
|
|
|
14798
15352
|
if (!fixedHiddenColumn && editConfig && (editRender || cellRender) && (editOpts.showStatus || editOpts.showUpdateStatus)) {
|
|
14799
15353
|
isDirty = $xeTable.isUpdateByRow(row, column.field);
|
|
14800
15354
|
}
|
|
15355
|
+
const isVNAutoHeight = scrollYLoad && !hasEllipsis;
|
|
15356
|
+
let cellHeight = currCellHeight;
|
|
15357
|
+
const vnHeight = calcCellHeightFlag ? rowRest.height : 0;
|
|
15358
|
+
if (resizeHeight) {
|
|
15359
|
+
cellHeight = resizeHeight;
|
|
15360
|
+
} else {
|
|
15361
|
+
if (scrollYLoad) {
|
|
15362
|
+
if (!hasEllipsis) {
|
|
15363
|
+
cellHeight = vnHeight || currCellHeight;
|
|
15364
|
+
}
|
|
15365
|
+
}
|
|
15366
|
+
}
|
|
15367
|
+
const isLastColumn = $columnIndex === columns.length - 1;
|
|
15368
|
+
const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto');
|
|
15369
|
+
let isVNPreEmptyStatus = false;
|
|
15370
|
+
if (scrollYLoad && (_rowIndex < scrollYStore.visibleStartIndex - scrollYStore.preloadSize || _rowIndex > scrollYStore.visibleEndIndex + scrollYStore.preloadSize)) {
|
|
15371
|
+
isVNPreEmptyStatus = true;
|
|
15372
|
+
} else if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
|
|
15373
|
+
isVNPreEmptyStatus = true;
|
|
15374
|
+
}
|
|
15375
|
+
const tcStyle = {};
|
|
15376
|
+
if (hasEllipsis) {
|
|
15377
|
+
tcStyle.height = `${cellHeight}px`;
|
|
15378
|
+
} else {
|
|
15379
|
+
tcStyle.minHeight = `${cellHeight}px`;
|
|
15380
|
+
}
|
|
14801
15381
|
const tdVNs = [];
|
|
14802
15382
|
if (fixedHiddenColumn && (allColumnOverflow ? isAllOverflow : allColumnOverflow)) {
|
|
14803
15383
|
tdVNs.push(h('div', {
|
|
15384
|
+
key: 'tc',
|
|
14804
15385
|
class: ['vxe-cell', {
|
|
14805
15386
|
'c--title': showTitle,
|
|
14806
15387
|
'c--tooltip': showTooltip,
|
|
14807
15388
|
'c--ellipsis': showEllipsis
|
|
14808
15389
|
}],
|
|
14809
|
-
style:
|
|
14810
|
-
maxHeight: hasEllipsis && (customRHeight || defaultRowHeight) ? `${customRHeight || defaultRowHeight}px` : ''
|
|
14811
|
-
}
|
|
15390
|
+
style: tcStyle
|
|
14812
15391
|
}));
|
|
14813
15392
|
} else {
|
|
14814
15393
|
// 渲染单元格
|
|
14815
|
-
tdVNs.push(...renderLine(h, _vm,
|
|
15394
|
+
tdVNs.push(...renderLine(h, _vm, cellParams, cellHeight), h('div', {
|
|
15395
|
+
key: 'tc',
|
|
14816
15396
|
class: ['vxe-cell', {
|
|
14817
15397
|
'c--title': showTitle,
|
|
14818
15398
|
'c--tooltip': showTooltip,
|
|
14819
15399
|
'c--ellipsis': showEllipsis
|
|
14820
15400
|
}],
|
|
14821
|
-
style:
|
|
14822
|
-
maxHeight: hasEllipsis && (customRHeight || defaultRowHeight) ? `${customRHeight || defaultRowHeight}px` : ''
|
|
14823
|
-
},
|
|
15401
|
+
style: tcStyle,
|
|
14824
15402
|
attrs: {
|
|
14825
15403
|
title: showTitle ? $xeTable.getCellLabel(row, column) : null
|
|
14826
15404
|
}
|
|
14827
|
-
},
|
|
15405
|
+
}, isVNPreEmptyStatus ? [] : [h('div', {
|
|
15406
|
+
attrs: {
|
|
15407
|
+
colid,
|
|
15408
|
+
rowid
|
|
15409
|
+
},
|
|
15410
|
+
class: 'vxe-cell--wrapper'
|
|
15411
|
+
}, column.renderCell(h, cellParams))]));
|
|
14828
15412
|
if (showValidTip && errorValidItem) {
|
|
14829
15413
|
const errRule = errorValidItem.rule;
|
|
14830
15414
|
const validSlot = slots ? slots.valid : null;
|
|
14831
15415
|
const validParams = {
|
|
14832
|
-
...
|
|
15416
|
+
...cellParams,
|
|
14833
15417
|
...errorValidItem,
|
|
14834
15418
|
rule: errorValidItem
|
|
14835
15419
|
};
|
|
14836
15420
|
tdVNs.push(h('div', {
|
|
15421
|
+
key: 'tcv',
|
|
14837
15422
|
class: ['vxe-cell--valid-error-tip', getClass(validOpts.className, errorValidItem)],
|
|
14838
15423
|
style: errRule && errRule.maxWidth ? {
|
|
14839
15424
|
width: `${errRule.maxWidth}px`
|
|
@@ -14845,56 +15430,49 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
|
|
|
14845
15430
|
}, errorValidItem.content)]])]));
|
|
14846
15431
|
}
|
|
14847
15432
|
}
|
|
14848
|
-
let cellHeight = '';
|
|
14849
|
-
const vnHeight = isCalcCellHeight ? rest.height : 0;
|
|
14850
|
-
if (hasEllipsis) {
|
|
14851
|
-
if (customRHeight) {
|
|
14852
|
-
cellHeight = `${customRHeight}px`;
|
|
14853
|
-
} else if (!isAllOverflow) {
|
|
14854
|
-
cellHeight = `${vnHeight || defaultRowHeight || 18}px`;
|
|
14855
|
-
}
|
|
14856
|
-
} else {
|
|
14857
|
-
cellHeight = `${vnHeight || defaultRowHeight || 18}px`;
|
|
14858
|
-
}
|
|
14859
15433
|
if (mouseConfig && mouseOpts.area && selectCellToRow) {
|
|
14860
15434
|
if (!$columnIndex && selectCellToRow === true || selectCellToRow === column.field) {
|
|
14861
15435
|
tdVNs.push(h('div', {
|
|
15436
|
+
key: 'tca',
|
|
14862
15437
|
class: 'vxe-cell--area-status'
|
|
14863
15438
|
}));
|
|
14864
15439
|
}
|
|
14865
15440
|
}
|
|
14866
|
-
|
|
14867
|
-
|
|
14868
|
-
|
|
14869
|
-
|
|
14870
|
-
|
|
14871
|
-
|
|
15441
|
+
if (rowResize && rowOpts.resizable) {
|
|
15442
|
+
tdVNs.push(h('div', {
|
|
15443
|
+
key: 'tcr',
|
|
15444
|
+
class: 'vxe-cell--row-resizable',
|
|
15445
|
+
on: {
|
|
15446
|
+
mousedown: evnt => $xeTable.handleRowResizeMousedownEvent(evnt, cellParams),
|
|
15447
|
+
dblclick: evnt => $xeTable.handleRowResizeDblclickEvent(evnt, cellParams)
|
|
15448
|
+
}
|
|
15449
|
+
}));
|
|
14872
15450
|
}
|
|
14873
15451
|
return h('td', {
|
|
14874
15452
|
class: ['vxe-body--column', column.id, {
|
|
14875
15453
|
[`col--${cellAlign}`]: cellAlign,
|
|
14876
15454
|
[`col--vertical-${verticalAlign}`]: verticalAlign,
|
|
14877
15455
|
[`col--${type}`]: type,
|
|
14878
|
-
'col--last':
|
|
15456
|
+
'col--last': isLastColumn,
|
|
14879
15457
|
'col--tree-node': treeNode,
|
|
14880
15458
|
'col--edit': isEdit,
|
|
14881
15459
|
'col--ellipsis': hasEllipsis,
|
|
15460
|
+
'col--auto-height': isVNAutoHeight,
|
|
14882
15461
|
'fixed--width': !isAutoCellWidth,
|
|
14883
15462
|
'fixed--hidden': fixedHiddenColumn,
|
|
15463
|
+
'is--padding': isPadding,
|
|
14884
15464
|
'is--drag-cell': isRowDragCell && (isCrossDrag || isPeerDrag || !rowLevel),
|
|
14885
15465
|
'is--drag-disabled': isDisabledDrag,
|
|
14886
15466
|
'col--dirty': isDirty,
|
|
14887
15467
|
'col--active': editConfig && isEdit && actived.row === row && (actived.column === column || editOpts.mode === 'row'),
|
|
14888
15468
|
'col--valid-error': !!errorValidItem,
|
|
14889
15469
|
'col--current': currentColumn === column
|
|
14890
|
-
}, getClass(compCellClassName,
|
|
15470
|
+
}, getClass(compCellClassName, cellParams), getClass(className, cellParams), getClass(allCellClassName, cellParams)],
|
|
14891
15471
|
key: columnKey || scrollXLoad || scrollYLoad || columnOpts.useKey || rowOpts.useKey || columnOpts.drag ? column.id : $columnIndex,
|
|
14892
|
-
attrs,
|
|
14893
|
-
style: Object.assign({
|
|
14894
|
-
height: cellHeight
|
|
14895
|
-
}, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(compCellStyle) ? compCellStyle(params) : compCellStyle, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(cellStyle) ? cellStyle(params) : cellStyle),
|
|
15472
|
+
attrs: tdAttrs,
|
|
15473
|
+
style: Object.assign({}, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(compCellStyle) ? compCellStyle(cellParams) : compCellStyle, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(cellStyle) ? cellStyle(cellParams) : cellStyle),
|
|
14896
15474
|
on: tdOns
|
|
14897
|
-
},
|
|
15475
|
+
}, isOptimizeMode && fixedHiddenColumn ? [] : tdVNs);
|
|
14898
15476
|
}
|
|
14899
15477
|
function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
|
|
14900
15478
|
const $xeTable = _vm.$parent;
|
|
@@ -15282,7 +15860,7 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
|
|
|
15282
15860
|
$xeTable.triggerBodyScrollEvent(evnt, fixedType);
|
|
15283
15861
|
}
|
|
15284
15862
|
};
|
|
15285
|
-
if (
|
|
15863
|
+
if (leftFixedWidth || rightFixedWidth) {
|
|
15286
15864
|
ons.wheel = $xeTable.triggerBodyWheelEvent;
|
|
15287
15865
|
}
|
|
15288
15866
|
return h('div', {
|
|
@@ -15375,9 +15953,7 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
|
|
|
15375
15953
|
|
|
15376
15954
|
|
|
15377
15955
|
|
|
15378
|
-
|
|
15379
15956
|
const {
|
|
15380
|
-
getI18n: header_getI18n,
|
|
15381
15957
|
renderer: header_renderer,
|
|
15382
15958
|
renderEmptyElement: header_renderEmptyElement
|
|
15383
15959
|
} = core_.VxeUI;
|
|
@@ -15414,6 +15990,10 @@ const header_renderRows = (h, _vm, isGroup, isOptimizeMode, cols, $rowIndex) =>
|
|
|
15414
15990
|
} = tableInternalData;
|
|
15415
15991
|
const columnOpts = $xeTable.computeColumnOpts;
|
|
15416
15992
|
const columnDragOpts = $xeTable.computeColumnDragOpts;
|
|
15993
|
+
const cellOpts = $xeTable.computeCellOpts;
|
|
15994
|
+
const defaultRowHeight = $xeTable.computeDefaultRowHeight;
|
|
15995
|
+
const headerCellOpts = $xeTable.computeHeaderCellOpts;
|
|
15996
|
+
const currCellHeight = headerCellOpts.height || cellOpts.height || defaultRowHeight;
|
|
15417
15997
|
const {
|
|
15418
15998
|
disabledMethod: dragDisabledMethod,
|
|
15419
15999
|
isCrossDrag,
|
|
@@ -15436,6 +16016,7 @@ const header_renderRows = (h, _vm, isGroup, isOptimizeMode, cols, $rowIndex) =>
|
|
|
15436
16016
|
const compConf = renderOpts ? header_renderer.get(renderOpts.name) : null;
|
|
15437
16017
|
const isColGroup = column.children && column.children.length;
|
|
15438
16018
|
const fixedHiddenColumn = fixedType ? column.fixed !== fixedType && !isColGroup : column.fixed && overflowX;
|
|
16019
|
+
const isPadding = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(headerCellOpts.padding) ? headerCellOpts.padding : cellOpts.padding;
|
|
15439
16020
|
const headOverflow = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isUndefined(showHeaderOverflow) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNull(showHeaderOverflow) ? allColumnHeaderOverflow : showHeaderOverflow;
|
|
15440
16021
|
const headAlign = headerAlign || (compConf ? compConf.tableHeaderCellAlign : '') || allHeaderAlign || align || (compConf ? compConf.tableCellAlign : '') || allAlign;
|
|
15441
16022
|
let showEllipsis = headOverflow === 'ellipsis';
|
|
@@ -15450,7 +16031,7 @@ const header_renderRows = (h, _vm, isGroup, isOptimizeMode, cols, $rowIndex) =>
|
|
|
15450
16031
|
}
|
|
15451
16032
|
const columnIndex = $xeTable.getColumnIndex(column);
|
|
15452
16033
|
const _columnIndex = $xeTable.getVTColumnIndex(column);
|
|
15453
|
-
const
|
|
16034
|
+
const cellParams = {
|
|
15454
16035
|
$table: $xeTable,
|
|
15455
16036
|
$grid: $xeGrid,
|
|
15456
16037
|
$rowIndex,
|
|
@@ -15470,8 +16051,8 @@ const header_renderRows = (h, _vm, isGroup, isOptimizeMode, cols, $rowIndex) =>
|
|
|
15470
16051
|
rowspan: column.rowSpan > 1 ? column.rowSpan : null
|
|
15471
16052
|
};
|
|
15472
16053
|
const thOns = {
|
|
15473
|
-
click: evnt => $xeTable.triggerHeaderCellClickEvent(evnt,
|
|
15474
|
-
dblclick: evnt => $xeTable.triggerHeaderCellDblclickEvent(evnt,
|
|
16054
|
+
click: evnt => $xeTable.triggerHeaderCellClickEvent(evnt, cellParams),
|
|
16055
|
+
dblclick: evnt => $xeTable.triggerHeaderCellDblclickEvent(evnt, cellParams)
|
|
15475
16056
|
};
|
|
15476
16057
|
// 虚拟滚动不支持动态高度
|
|
15477
16058
|
if (scrollXLoad && !hasEllipsis) {
|
|
@@ -15480,11 +16061,11 @@ const header_renderRows = (h, _vm, isGroup, isOptimizeMode, cols, $rowIndex) =>
|
|
|
15480
16061
|
const isColDragCell = columnOpts.drag && columnDragOpts.trigger === 'cell';
|
|
15481
16062
|
let isDisabledDrag = false;
|
|
15482
16063
|
if (isColDragCell) {
|
|
15483
|
-
isDisabledDrag = !!(dragDisabledMethod && dragDisabledMethod(
|
|
16064
|
+
isDisabledDrag = !!(dragDisabledMethod && dragDisabledMethod(cellParams));
|
|
15484
16065
|
}
|
|
15485
16066
|
// 按下事件处理
|
|
15486
16067
|
if (mouseConfig || isColDragCell) {
|
|
15487
|
-
thOns.mousedown = evnt => $xeTable.triggerHeaderCellMousedownEvent(evnt,
|
|
16068
|
+
thOns.mousedown = evnt => $xeTable.triggerHeaderCellMousedownEvent(evnt, cellParams);
|
|
15488
16069
|
}
|
|
15489
16070
|
// 拖拽列事件
|
|
15490
16071
|
if (columnOpts.drag) {
|
|
@@ -15495,30 +16076,39 @@ const header_renderRows = (h, _vm, isGroup, isOptimizeMode, cols, $rowIndex) =>
|
|
|
15495
16076
|
thOns.mouseup = $xeTable.handleHeaderCellDragMouseupEvent;
|
|
15496
16077
|
}
|
|
15497
16078
|
}
|
|
16079
|
+
const isLastColumn = $columnIndex === cols.length - 1;
|
|
16080
|
+
const showResizable = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(column.resizable) ? column.resizable : columnOpts.resizable || allResizable;
|
|
15498
16081
|
const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto');
|
|
15499
|
-
let
|
|
15500
|
-
if (scrollXLoad && !
|
|
15501
|
-
|
|
16082
|
+
let isVNPreEmptyStatus = false;
|
|
16083
|
+
if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
|
|
16084
|
+
isVNPreEmptyStatus = true;
|
|
16085
|
+
}
|
|
16086
|
+
const tcStyle = {};
|
|
16087
|
+
if (hasEllipsis) {
|
|
16088
|
+
tcStyle.height = `${currCellHeight}px`;
|
|
16089
|
+
} else {
|
|
16090
|
+
tcStyle.minHeight = `${currCellHeight}px`;
|
|
15502
16091
|
}
|
|
15503
16092
|
return h('th', {
|
|
15504
16093
|
class: ['vxe-header--column', colid, {
|
|
15505
16094
|
[`col--${headAlign}`]: headAlign,
|
|
15506
16095
|
[`col--${type}`]: type,
|
|
15507
|
-
'col--last':
|
|
16096
|
+
'col--last': isLastColumn,
|
|
15508
16097
|
'col--fixed': column.fixed,
|
|
15509
16098
|
'col--group': isColGroup,
|
|
15510
16099
|
'col--ellipsis': hasEllipsis,
|
|
15511
16100
|
'fixed--width': !isAutoCellWidth,
|
|
15512
16101
|
'fixed--hidden': fixedHiddenColumn,
|
|
16102
|
+
'is--padding': isPadding,
|
|
15513
16103
|
'is--sortable': column.sortable,
|
|
15514
16104
|
'col--filter': !!filters,
|
|
15515
16105
|
'is--filter-active': hasFilter,
|
|
15516
16106
|
'is--drag-active': !column.fixed && !isDisabledDrag && (isCrossDrag || isPeerDrag || !column.parentId),
|
|
15517
16107
|
'is--drag-disabled': isDisabledDrag,
|
|
15518
16108
|
'col--current': currentColumn === column
|
|
15519
|
-
}, getClass(headerClassName,
|
|
16109
|
+
}, getClass(headerClassName, cellParams), getClass(headerCellClassName, cellParams)],
|
|
15520
16110
|
attrs: thAttrs,
|
|
15521
|
-
style: headerCellStyle ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(headerCellStyle) ? headerCellStyle(
|
|
16111
|
+
style: headerCellStyle ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(headerCellStyle) ? headerCellStyle(cellParams) : headerCellStyle : undefined,
|
|
15522
16112
|
on: thOns,
|
|
15523
16113
|
key: columnKey || scrollXLoad || scrollYLoad || columnOpts.useKey || columnOpts.drag || isColGroup ? colid : $columnIndex
|
|
15524
16114
|
}, [h('div', {
|
|
@@ -15526,20 +16116,26 @@ const header_renderRows = (h, _vm, isGroup, isOptimizeMode, cols, $rowIndex) =>
|
|
|
15526
16116
|
'c--title': showTitle,
|
|
15527
16117
|
'c--tooltip': showTooltip,
|
|
15528
16118
|
'c--ellipsis': showEllipsis
|
|
15529
|
-
}]
|
|
15530
|
-
|
|
16119
|
+
}],
|
|
16120
|
+
style: tcStyle
|
|
16121
|
+
}, isVNPreEmptyStatus || isOptimizeMode && fixedHiddenColumn ? [] : [h('div', {
|
|
16122
|
+
attrs: {
|
|
16123
|
+
colid
|
|
16124
|
+
},
|
|
16125
|
+
class: 'vxe-cell--wrapper'
|
|
16126
|
+
}, column.renderHeader(h, cellParams))]),
|
|
15531
16127
|
/**
|
|
15532
16128
|
* 列宽拖动
|
|
15533
16129
|
*/
|
|
15534
|
-
!fixedHiddenColumn &&
|
|
15535
|
-
class: ['vxe-resizable', {
|
|
16130
|
+
!fixedHiddenColumn && showResizable ? h('div', {
|
|
16131
|
+
class: ['vxe-cell--col-resizable', {
|
|
15536
16132
|
'is--line': !border || border === 'none'
|
|
15537
16133
|
}],
|
|
15538
16134
|
on: {
|
|
15539
|
-
mousedown: evnt =>
|
|
15540
|
-
dblclick: evnt => $xeTable.
|
|
16135
|
+
mousedown: evnt => $xeTable.handleColResizeMousedownEvent(evnt, fixedType, cellParams),
|
|
16136
|
+
dblclick: evnt => $xeTable.handleColResizeDblclickEvent(evnt, cellParams)
|
|
15541
16137
|
}
|
|
15542
|
-
}) :
|
|
16138
|
+
}) : header_renderEmptyElement($xeTable)]);
|
|
15543
16139
|
});
|
|
15544
16140
|
};
|
|
15545
16141
|
function renderHeads(h, _vm, isGroup, isOptimizeMode, headerGroups) {
|
|
@@ -15777,152 +16373,18 @@ function renderHeads(h, _vm, isGroup, isOptimizeMode, headerGroups) {
|
|
|
15777
16373
|
}, renderHeads(h, this, isGroup, isOptimizeMode, renderHeaderList))]),
|
|
15778
16374
|
/**
|
|
15779
16375
|
* 其他
|
|
15780
|
-
*/
|
|
15781
|
-
h('div', {
|
|
15782
|
-
ref: 'refHeaderBorderRepair',
|
|
15783
|
-
class: 'vxe-table--header-border-line'
|
|
15784
|
-
})])]);
|
|
15785
|
-
},
|
|
15786
|
-
methods: {
|
|
15787
|
-
uploadColumn() {
|
|
15788
|
-
const {
|
|
15789
|
-
$parent: $xetable
|
|
15790
|
-
} = this;
|
|
15791
|
-
this.headerColumn = $xetable.isGroup ? convertHeaderColumnToRows(this.tableGroupColumn) : [];
|
|
15792
|
-
},
|
|
15793
|
-
resizeMousedownEvent(evnt, params) {
|
|
15794
|
-
const $xeTable = this.$parent;
|
|
15795
|
-
const tableInternalData = $xeTable;
|
|
15796
|
-
const {
|
|
15797
|
-
column
|
|
15798
|
-
} = params;
|
|
15799
|
-
const {
|
|
15800
|
-
$parent: $xetable,
|
|
15801
|
-
fixedType
|
|
15802
|
-
} = this;
|
|
15803
|
-
const {
|
|
15804
|
-
visibleColumn
|
|
15805
|
-
} = tableInternalData;
|
|
15806
|
-
const {
|
|
15807
|
-
refTableBody,
|
|
15808
|
-
refLeftContainer,
|
|
15809
|
-
refRightContainer
|
|
15810
|
-
} = $xetable.$refs;
|
|
15811
|
-
const tableEl = $xeTable.$el;
|
|
15812
|
-
const resizeBarElem = $xetable.$refs.refCellResizeBar;
|
|
15813
|
-
const resizeTipElem = $xetable.$refs.refCellResizeTip;
|
|
15814
|
-
const wrapperElem = this.$el;
|
|
15815
|
-
const {
|
|
15816
|
-
clientX: dragClientX
|
|
15817
|
-
} = evnt;
|
|
15818
|
-
const dragBtnElem = evnt.target;
|
|
15819
|
-
const cell = dragBtnElem.parentNode;
|
|
15820
|
-
const cellParams = Object.assign(params, {
|
|
15821
|
-
cell
|
|
15822
|
-
});
|
|
15823
|
-
const resizableOpts = $xeTable.computeResizableOpts;
|
|
15824
|
-
let dragLeft = 0;
|
|
15825
|
-
const tableBodyElem = refTableBody.$el;
|
|
15826
|
-
const pos = getOffsetPos(dragBtnElem, tableEl);
|
|
15827
|
-
const dragBtnWidth = dragBtnElem.clientWidth;
|
|
15828
|
-
const dragBtnOffsetWidth = Math.floor(dragBtnWidth / 2);
|
|
15829
|
-
const minInterval = getColReMinWidth(cellParams) - dragBtnOffsetWidth; // 列之间的最小间距
|
|
15830
|
-
let dragMinLeft = pos.left - cell.clientWidth + dragBtnWidth + minInterval;
|
|
15831
|
-
let dragPosLeft = pos.left + dragBtnOffsetWidth;
|
|
15832
|
-
const domMousemove = document.onmousemove;
|
|
15833
|
-
const domMouseup = document.onmouseup;
|
|
15834
|
-
const isLeftFixed = fixedType === 'left';
|
|
15835
|
-
const isRightFixed = fixedType === 'right';
|
|
15836
|
-
// 计算左右侧固定列偏移量
|
|
15837
|
-
let fixedOffsetWidth = 0;
|
|
15838
|
-
if (isLeftFixed || isRightFixed) {
|
|
15839
|
-
const siblingProp = isLeftFixed ? 'nextElementSibling' : 'previousElementSibling';
|
|
15840
|
-
let tempCellElem = cell[siblingProp];
|
|
15841
|
-
while (tempCellElem) {
|
|
15842
|
-
if (hasClass(tempCellElem, 'fixed--hidden')) {
|
|
15843
|
-
break;
|
|
15844
|
-
} else if (!hasClass(tempCellElem, 'col--group')) {
|
|
15845
|
-
fixedOffsetWidth += tempCellElem.offsetWidth;
|
|
15846
|
-
}
|
|
15847
|
-
tempCellElem = tempCellElem[siblingProp];
|
|
15848
|
-
}
|
|
15849
|
-
if (isRightFixed && refRightContainer) {
|
|
15850
|
-
dragPosLeft = refRightContainer.offsetLeft + fixedOffsetWidth;
|
|
15851
|
-
}
|
|
15852
|
-
}
|
|
15853
|
-
// 处理拖动事件
|
|
15854
|
-
const updateEvent = function (evnt) {
|
|
15855
|
-
evnt.stopPropagation();
|
|
15856
|
-
evnt.preventDefault();
|
|
15857
|
-
const offsetX = evnt.clientX - dragClientX;
|
|
15858
|
-
let left = dragPosLeft + offsetX;
|
|
15859
|
-
const scrollLeft = fixedType ? 0 : tableBodyElem.scrollLeft;
|
|
15860
|
-
if (isLeftFixed) {
|
|
15861
|
-
// 左固定列(不允许超过右侧固定列、不允许超过右边距)
|
|
15862
|
-
left = Math.min(left, (refRightContainer ? refRightContainer.offsetLeft : tableBodyElem.clientWidth) - fixedOffsetWidth - minInterval);
|
|
15863
|
-
} else if (isRightFixed) {
|
|
15864
|
-
// 右侧固定列(不允许超过左侧固定列、不允许超过左边距)
|
|
15865
|
-
dragMinLeft = (refLeftContainer ? refLeftContainer.clientWidth : 0) + fixedOffsetWidth + minInterval;
|
|
15866
|
-
left = Math.min(left, dragPosLeft + cell.clientWidth - minInterval);
|
|
15867
|
-
} else {
|
|
15868
|
-
dragMinLeft = Math.max(tableBodyElem.scrollLeft, dragMinLeft);
|
|
15869
|
-
// left = Math.min(left, tableBodyElem.clientWidth + tableBodyElem.scrollLeft - 40)
|
|
15870
|
-
}
|
|
15871
|
-
dragLeft = Math.max(left, dragMinLeft);
|
|
15872
|
-
const resizeBarLeft = dragLeft - scrollLeft;
|
|
15873
|
-
resizeBarElem.style.left = `${resizeBarLeft}px`;
|
|
15874
|
-
if (resizableOpts.showDragTip && resizeTipElem) {
|
|
15875
|
-
const tableWidth = tableEl.clientWidth;
|
|
15876
|
-
const wrapperRect = wrapperElem.getBoundingClientRect();
|
|
15877
|
-
const resizeBarWidth = resizeBarElem.clientWidth;
|
|
15878
|
-
const resizeTipWidth = resizeTipElem.clientWidth;
|
|
15879
|
-
const resizeTipHeight = resizeTipElem.clientHeight;
|
|
15880
|
-
let resizeTipLeft = -resizeTipWidth;
|
|
15881
|
-
if (resizeBarLeft < resizeTipWidth + resizeBarWidth) {
|
|
15882
|
-
resizeTipLeft = resizeTipWidth + resizeBarWidth - resizeBarLeft;
|
|
15883
|
-
} else if (resizeBarLeft > tableWidth) {
|
|
15884
|
-
resizeTipLeft += tableWidth - resizeBarLeft;
|
|
15885
|
-
}
|
|
15886
|
-
resizeTipElem.style.left = `${resizeTipLeft}px`;
|
|
15887
|
-
resizeTipElem.style.top = `${Math.min(tableEl.clientHeight - resizeTipHeight, Math.max(0, evnt.clientY - wrapperRect.y - resizeTipHeight / 2))}px`;
|
|
15888
|
-
resizeTipElem.textContent = header_getI18n('vxe.table.resizeColTip', [column.renderWidth + (isRightFixed ? dragPosLeft - dragLeft : dragLeft - dragPosLeft)]);
|
|
15889
|
-
}
|
|
15890
|
-
};
|
|
15891
|
-
$xetable._isResize = true;
|
|
15892
|
-
addClass($xetable.$el, 'drag--resize');
|
|
15893
|
-
resizeBarElem.style.display = 'block';
|
|
15894
|
-
document.onmousemove = updateEvent;
|
|
15895
|
-
document.onmouseup = function (evnt) {
|
|
15896
|
-
document.onmousemove = domMousemove;
|
|
15897
|
-
document.onmouseup = domMouseup;
|
|
15898
|
-
const resizeWidth = column.renderWidth + (isRightFixed ? dragPosLeft - dragLeft : dragLeft - dragPosLeft);
|
|
15899
|
-
column.resizeWidth = resizeWidth;
|
|
15900
|
-
if (resizableOpts.dragMode === 'fixed') {
|
|
15901
|
-
visibleColumn.forEach(item => {
|
|
15902
|
-
if (item.id !== column.id) {
|
|
15903
|
-
if (!item.resizeWidth) {
|
|
15904
|
-
item.resizeWidth = item.renderWidth;
|
|
15905
|
-
}
|
|
15906
|
-
}
|
|
15907
|
-
});
|
|
15908
|
-
}
|
|
15909
|
-
resizeBarElem.style.display = 'none';
|
|
15910
|
-
$xetable._isResize = false;
|
|
15911
|
-
$xetable._lastResizeTime = Date.now();
|
|
15912
|
-
$xetable.analyColumnWidth();
|
|
15913
|
-
$xetable.recalculate(true).then(() => {
|
|
15914
|
-
$xetable.saveCustomStore('update:visible');
|
|
15915
|
-
$xetable.updateCellAreas();
|
|
15916
|
-
$xetable.emitEvent('resizable-change', {
|
|
15917
|
-
...params,
|
|
15918
|
-
resizeWidth
|
|
15919
|
-
}, evnt);
|
|
15920
|
-
setTimeout(() => $xetable.recalculate(true), 300);
|
|
15921
|
-
});
|
|
15922
|
-
removeClass($xetable.$el, 'drag--resize');
|
|
15923
|
-
};
|
|
15924
|
-
updateEvent(evnt);
|
|
15925
|
-
$xetable.closeMenu();
|
|
16376
|
+
*/
|
|
16377
|
+
h('div', {
|
|
16378
|
+
ref: 'refHeaderBorderRepair',
|
|
16379
|
+
class: 'vxe-table--header-border-line'
|
|
16380
|
+
})])]);
|
|
16381
|
+
},
|
|
16382
|
+
methods: {
|
|
16383
|
+
uploadColumn() {
|
|
16384
|
+
const {
|
|
16385
|
+
$parent: $xetable
|
|
16386
|
+
} = this;
|
|
16387
|
+
this.headerColumn = $xetable.isGroup ? convertHeaderColumnToRows(this.tableGroupColumn) : [];
|
|
15926
16388
|
}
|
|
15927
16389
|
}
|
|
15928
16390
|
});
|
|
@@ -15990,6 +16452,10 @@ function footer_renderRows(h, _vm, tableColumn, footerTableData, row, $rowIndex,
|
|
|
15990
16452
|
} = tableInternalData;
|
|
15991
16453
|
const tooltipOpts = $xeTable.computeTooltipOpts;
|
|
15992
16454
|
const columnOpts = $xeTable.computeColumnOpts;
|
|
16455
|
+
const defaultRowHeight = $xeTable.computeDefaultRowHeight;
|
|
16456
|
+
const cellOpts = $xeTable.computeCellOpts;
|
|
16457
|
+
const footerCellOpts = $xeTable.computeFooterCellOpts;
|
|
16458
|
+
const currCellHeight = footerCellOpts.height || cellOpts.height || defaultRowHeight;
|
|
15993
16459
|
return tableColumn.map((column, $columnIndex) => {
|
|
15994
16460
|
const {
|
|
15995
16461
|
type,
|
|
@@ -16000,11 +16466,13 @@ function footer_renderRows(h, _vm, tableColumn, footerTableData, row, $rowIndex,
|
|
|
16000
16466
|
editRender,
|
|
16001
16467
|
cellRender
|
|
16002
16468
|
} = column;
|
|
16469
|
+
const colid = column.id;
|
|
16003
16470
|
const renderOpts = editRender || cellRender;
|
|
16004
16471
|
const compConf = renderOpts ? footer_renderer.get(renderOpts.name) : null;
|
|
16005
16472
|
const showAllTip = tooltipOpts.showAll;
|
|
16006
16473
|
const isColGroup = column.children && column.children.length;
|
|
16007
16474
|
const fixedHiddenColumn = fixedType ? column.fixed !== fixedType && !isColGroup : column.fixed && overflowX;
|
|
16475
|
+
const isPadding = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(footerCellOpts.padding) ? footerCellOpts.padding : cellOpts.padding;
|
|
16008
16476
|
const footOverflow = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(showFooterOverflow) ? allColumnFooterOverflow : showFooterOverflow;
|
|
16009
16477
|
const footAlign = footerAlign || (compConf ? compConf.tableFooterCellAlign : '') || allFooterAlign || align || (compConf ? compConf.tableCellAlign : '') || allAlign;
|
|
16010
16478
|
let showEllipsis = footOverflow === 'ellipsis';
|
|
@@ -16099,18 +16567,26 @@ function footer_renderRows(h, _vm, tableColumn, footerTableData, row, $rowIndex,
|
|
|
16099
16567
|
attrs.colspan = colspan;
|
|
16100
16568
|
}
|
|
16101
16569
|
}
|
|
16570
|
+
const isLastColumn = $columnIndex === tableColumn.length - 1;
|
|
16102
16571
|
const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto');
|
|
16103
|
-
let
|
|
16104
|
-
if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex || _columnIndex > scrollXStore.visibleEndIndex)) {
|
|
16105
|
-
|
|
16572
|
+
let isVNPreEmptyStatus = false;
|
|
16573
|
+
if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
|
|
16574
|
+
isVNPreEmptyStatus = true;
|
|
16575
|
+
}
|
|
16576
|
+
const tcStyle = {};
|
|
16577
|
+
if (hasEllipsis) {
|
|
16578
|
+
tcStyle.height = `${currCellHeight}px`;
|
|
16579
|
+
} else {
|
|
16580
|
+
tcStyle.minHeight = `${currCellHeight}px`;
|
|
16106
16581
|
}
|
|
16107
16582
|
return h('td', {
|
|
16108
16583
|
class: ['vxe-footer--column', column.id, {
|
|
16109
16584
|
[`col--${footAlign}`]: footAlign,
|
|
16110
16585
|
[`col--${type}`]: type,
|
|
16111
|
-
'col--last':
|
|
16586
|
+
'col--last': isLastColumn,
|
|
16112
16587
|
'fixed--width': !isAutoCellWidth,
|
|
16113
16588
|
'fixed--hidden': fixedHiddenColumn,
|
|
16589
|
+
'is--padding': isPadding,
|
|
16114
16590
|
'col--ellipsis': hasEllipsis,
|
|
16115
16591
|
'col--current': currentColumn === column
|
|
16116
16592
|
}, getClass(footerClassName, cellParams), getClass(footerCellClassName, cellParams)],
|
|
@@ -16123,8 +16599,14 @@ function footer_renderRows(h, _vm, tableColumn, footerTableData, row, $rowIndex,
|
|
|
16123
16599
|
'c--title': showTitle,
|
|
16124
16600
|
'c--tooltip': showTooltip,
|
|
16125
16601
|
'c--ellipsis': showEllipsis
|
|
16126
|
-
}]
|
|
16127
|
-
|
|
16602
|
+
}],
|
|
16603
|
+
style: tcStyle
|
|
16604
|
+
}, isVNPreEmptyStatus ? [] : [h('div', {
|
|
16605
|
+
attrs: {
|
|
16606
|
+
colid
|
|
16607
|
+
},
|
|
16608
|
+
class: 'vxe-cell--wrapper'
|
|
16609
|
+
}, column.renderFooter(h, cellParams))])]);
|
|
16128
16610
|
});
|
|
16129
16611
|
}
|
|
16130
16612
|
function footer_renderHeads(h, _vm, renderColumnList) {
|
|
@@ -16381,10 +16863,10 @@ const {
|
|
|
16381
16863
|
type: [Boolean, String],
|
|
16382
16864
|
default: () => props_getConfig().table.border
|
|
16383
16865
|
},
|
|
16384
|
-
//
|
|
16866
|
+
// 已废弃,被 cell-config.padding 替换
|
|
16385
16867
|
padding: {
|
|
16386
16868
|
type: Boolean,
|
|
16387
|
-
default:
|
|
16869
|
+
default: null
|
|
16388
16870
|
},
|
|
16389
16871
|
// 是否圆角边框
|
|
16390
16872
|
round: {
|
|
@@ -16530,6 +17012,10 @@ const {
|
|
|
16530
17012
|
columnConfig: Object,
|
|
16531
17013
|
// 单元格配置信息
|
|
16532
17014
|
cellConfig: Object,
|
|
17015
|
+
// 表头单元格配置信息
|
|
17016
|
+
headerCellConfig: Object,
|
|
17017
|
+
// 表尾单元格配置信息
|
|
17018
|
+
footerCellConfig: Object,
|
|
16533
17019
|
// 行配置信息
|
|
16534
17020
|
rowConfig: Object,
|
|
16535
17021
|
// 已废弃,被 rowDragConfig 替换
|
|
@@ -19322,6 +19808,8 @@ const {
|
|
|
19322
19808
|
* 快捷菜单事件处理
|
|
19323
19809
|
*/
|
|
19324
19810
|
handleGlobalContextmenuEvent(evnt) {
|
|
19811
|
+
const $xeTable = this;
|
|
19812
|
+
const internalData = $xeTable;
|
|
19325
19813
|
const {
|
|
19326
19814
|
$refs,
|
|
19327
19815
|
tId,
|
|
@@ -19342,7 +19830,7 @@ const {
|
|
|
19342
19830
|
evnt.preventDefault();
|
|
19343
19831
|
return;
|
|
19344
19832
|
}
|
|
19345
|
-
if (
|
|
19833
|
+
if (internalData._keyCtx) {
|
|
19346
19834
|
const type = 'body';
|
|
19347
19835
|
const params = {
|
|
19348
19836
|
type,
|
|
@@ -19655,10 +20143,12 @@ function insertTreeRow(_vm, newRecords, isAppend) {
|
|
|
19655
20143
|
index: -1,
|
|
19656
20144
|
_index: -1,
|
|
19657
20145
|
$index: -1,
|
|
20146
|
+
treeIndex: -1,
|
|
19658
20147
|
items: parentChilds,
|
|
19659
20148
|
parent: parentRow,
|
|
19660
20149
|
level: parentLevel + 1,
|
|
19661
20150
|
height: 0,
|
|
20151
|
+
resizeHeight: 0,
|
|
19662
20152
|
oTop: 0
|
|
19663
20153
|
};
|
|
19664
20154
|
fullDataRowIdData[rowid] = rest;
|
|
@@ -19678,10 +20168,12 @@ function insertTreeRow(_vm, newRecords, isAppend) {
|
|
|
19678
20168
|
index: -1,
|
|
19679
20169
|
_index: -1,
|
|
19680
20170
|
$index: -1,
|
|
20171
|
+
treeIndex: -1,
|
|
19681
20172
|
items: tableFullTreeData,
|
|
19682
20173
|
parent: null,
|
|
19683
20174
|
level: 0,
|
|
19684
20175
|
height: 0,
|
|
20176
|
+
resizeHeight: 0,
|
|
19685
20177
|
oTop: 0
|
|
19686
20178
|
};
|
|
19687
20179
|
fullDataRowIdData[rowid] = rest;
|
|
@@ -19735,10 +20227,12 @@ function handleInsertRowAt($xeTable, records, targetRow, isInsertNextRow) {
|
|
|
19735
20227
|
index: -1,
|
|
19736
20228
|
_index: -1,
|
|
19737
20229
|
$index: -1,
|
|
20230
|
+
treeIndex: -1,
|
|
19738
20231
|
items: afterFullData,
|
|
19739
20232
|
parent: null,
|
|
19740
20233
|
level: 0,
|
|
19741
20234
|
height: 0,
|
|
20235
|
+
resizeHeight: 0,
|
|
19742
20236
|
oTop: 0
|
|
19743
20237
|
};
|
|
19744
20238
|
fullDataRowIdData[rowid] = rest;
|
|
@@ -19771,10 +20265,12 @@ function handleInsertRowAt($xeTable, records, targetRow, isInsertNextRow) {
|
|
|
19771
20265
|
index: -1,
|
|
19772
20266
|
_index: -1,
|
|
19773
20267
|
$index: -1,
|
|
20268
|
+
treeIndex: -1,
|
|
19774
20269
|
items: afterFullData,
|
|
19775
20270
|
parent: null,
|
|
19776
20271
|
level: 0,
|
|
19777
20272
|
height: 0,
|
|
20273
|
+
resizeHeight: 0,
|
|
19778
20274
|
oTop: 0
|
|
19779
20275
|
};
|
|
19780
20276
|
fullDataRowIdData[rowid] = rest;
|
|
@@ -19830,10 +20326,12 @@ function handleInsertRowAt($xeTable, records, targetRow, isInsertNextRow) {
|
|
|
19830
20326
|
index: -1,
|
|
19831
20327
|
_index: -1,
|
|
19832
20328
|
$index: -1,
|
|
20329
|
+
treeIndex: -1,
|
|
19833
20330
|
items: parentMapChilds,
|
|
19834
20331
|
parent: parentRow,
|
|
19835
20332
|
level: parentLevel + 1,
|
|
19836
20333
|
height: 0,
|
|
20334
|
+
resizeHeight: 0,
|
|
19837
20335
|
oTop: 0
|
|
19838
20336
|
};
|
|
19839
20337
|
fullDataRowIdData[rowid] = rest;
|
|
@@ -19908,7 +20406,7 @@ function handleInsertRowAt($xeTable, records, targetRow, isInsertNextRow) {
|
|
|
19908
20406
|
const rowid = getRowid($xeTable, newRow);
|
|
19909
20407
|
insertMaps[rowid] = newRow;
|
|
19910
20408
|
});
|
|
19911
|
-
$xeTable.cacheRowMap();
|
|
20409
|
+
$xeTable.cacheRowMap(false);
|
|
19912
20410
|
$xeTable.updateScrollYStatus();
|
|
19913
20411
|
$xeTable.handleTableData(treeConfig && transform);
|
|
19914
20412
|
if (!(treeConfig && transform)) {
|
|
@@ -20120,7 +20618,7 @@ function handleInsertChildRowAt($xeTable, records, parentRow, targetRow, isInser
|
|
|
20120
20618
|
}
|
|
20121
20619
|
});
|
|
20122
20620
|
$xeTable.updateFooter();
|
|
20123
|
-
$xeTable.cacheRowMap();
|
|
20621
|
+
$xeTable.cacheRowMap(false);
|
|
20124
20622
|
$xeTable.handleTableData(treeConfig && transform);
|
|
20125
20623
|
if (!(treeConfig && transform)) {
|
|
20126
20624
|
$xeTable.updateAfterDataIndex();
|
|
@@ -21894,6 +22392,43 @@ function readLocalFile(options = {}) {
|
|
|
21894
22392
|
fileInput.click();
|
|
21895
22393
|
});
|
|
21896
22394
|
}
|
|
22395
|
+
function handleFilterColumns(exportOpts, column, columns) {
|
|
22396
|
+
return columns.some(item => {
|
|
22397
|
+
if (isColumnInfo(item)) {
|
|
22398
|
+
return column.id === item.id;
|
|
22399
|
+
} else if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(item)) {
|
|
22400
|
+
return column.field === item;
|
|
22401
|
+
} else {
|
|
22402
|
+
const colid = item.id || item.colId;
|
|
22403
|
+
const type = item.type;
|
|
22404
|
+
const field = item.field;
|
|
22405
|
+
if (colid) {
|
|
22406
|
+
return column.id === colid;
|
|
22407
|
+
} else if (field && type) {
|
|
22408
|
+
return column.field === field && column.type === type;
|
|
22409
|
+
} else if (field) {
|
|
22410
|
+
return column.field === field;
|
|
22411
|
+
} else if (type) {
|
|
22412
|
+
return column.type === type;
|
|
22413
|
+
}
|
|
22414
|
+
}
|
|
22415
|
+
return false;
|
|
22416
|
+
});
|
|
22417
|
+
}
|
|
22418
|
+
function handleFilterFields(exportOpts, column, includeFields, excludeFields) {
|
|
22419
|
+
if (excludeFields) {
|
|
22420
|
+
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().includes(excludeFields, column.field)) {
|
|
22421
|
+
return false;
|
|
22422
|
+
}
|
|
22423
|
+
}
|
|
22424
|
+
if (includeFields) {
|
|
22425
|
+
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().includes(includeFields, column.field)) {
|
|
22426
|
+
return true;
|
|
22427
|
+
}
|
|
22428
|
+
return false;
|
|
22429
|
+
}
|
|
22430
|
+
return exportOpts.original ? column.field : defaultFilterExportColumn(column);
|
|
22431
|
+
}
|
|
21897
22432
|
function handleExportAndPrint($xeTable, options, isPrint) {
|
|
21898
22433
|
const props = $xeTable;
|
|
21899
22434
|
const reactData = $xeTable;
|
|
@@ -21938,7 +22473,9 @@ function handleExportAndPrint($xeTable, options, isPrint) {
|
|
|
21938
22473
|
const checkMethod = customOpts.checkMethod;
|
|
21939
22474
|
const exportColumns = collectColumn.slice(0);
|
|
21940
22475
|
const {
|
|
21941
|
-
columns
|
|
22476
|
+
columns,
|
|
22477
|
+
excludeFields,
|
|
22478
|
+
includeFields
|
|
21942
22479
|
} = defOpts;
|
|
21943
22480
|
// 处理类型
|
|
21944
22481
|
const typeList = types.map(value => {
|
|
@@ -21962,33 +22499,19 @@ function handleExportAndPrint($xeTable, options, isPrint) {
|
|
|
21962
22499
|
// 默认选中
|
|
21963
22500
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(exportColumns, (column, index, items, path, parent) => {
|
|
21964
22501
|
const isColGroup = column.children && column.children.length;
|
|
21965
|
-
|
|
21966
|
-
|
|
21967
|
-
|
|
21968
|
-
|
|
21969
|
-
|
|
21970
|
-
|
|
21971
|
-
|
|
21972
|
-
const colid = item.id || item.colId;
|
|
21973
|
-
const type = item.type;
|
|
21974
|
-
const field = item.field;
|
|
21975
|
-
if (colid) {
|
|
21976
|
-
return column.id === colid;
|
|
21977
|
-
} else if (field && type) {
|
|
21978
|
-
return column.field === field && column.type === type;
|
|
21979
|
-
} else if (field) {
|
|
21980
|
-
return column.field === field;
|
|
21981
|
-
} else if (type) {
|
|
21982
|
-
return column.type === type;
|
|
21983
|
-
}
|
|
21984
|
-
}
|
|
21985
|
-
return false;
|
|
21986
|
-
}) : column.visible;
|
|
21987
|
-
column.halfChecked = false;
|
|
21988
|
-
column.disabled = parent && parent.disabled || (checkMethod ? !checkMethod({
|
|
21989
|
-
column
|
|
21990
|
-
}) : false);
|
|
22502
|
+
let isChecked = false;
|
|
22503
|
+
if (columns && columns.length) {
|
|
22504
|
+
isChecked = handleFilterColumns(defOpts, column, columns);
|
|
22505
|
+
} else if (excludeFields || includeFields) {
|
|
22506
|
+
isChecked = handleFilterFields(defOpts, column, includeFields, excludeFields);
|
|
22507
|
+
} else {
|
|
22508
|
+
isChecked = column.visible && (isColGroup || defaultFilterExportColumn(column));
|
|
21991
22509
|
}
|
|
22510
|
+
column.checked = isChecked;
|
|
22511
|
+
column.halfChecked = false;
|
|
22512
|
+
column.disabled = parent && parent.disabled || (checkMethod ? !checkMethod({
|
|
22513
|
+
column
|
|
22514
|
+
}) : false);
|
|
21992
22515
|
});
|
|
21993
22516
|
// 更新条件
|
|
21994
22517
|
Object.assign(exportStore, {
|
|
@@ -22610,6 +23133,7 @@ const convertToRows = originColumns => {
|
|
|
22610
23133
|
|
|
22611
23134
|
|
|
22612
23135
|
|
|
23136
|
+
|
|
22613
23137
|
function getTargetOffset(target, container) {
|
|
22614
23138
|
let offsetTop = 0;
|
|
22615
23139
|
let offsetLeft = 0;
|
|
@@ -22635,37 +23159,72 @@ function getTargetOffset(target, container) {
|
|
|
22635
23159
|
};
|
|
22636
23160
|
}
|
|
22637
23161
|
function getCheckboxRangeRows($xeTable, evnt, params, targetTrElem, trRect, offsetClientTop, moveRange) {
|
|
23162
|
+
const props = $xeTable;
|
|
22638
23163
|
const reactData = $xeTable;
|
|
22639
23164
|
const internalData = $xeTable;
|
|
23165
|
+
const {
|
|
23166
|
+
showOverflow
|
|
23167
|
+
} = props;
|
|
23168
|
+
const {
|
|
23169
|
+
fullAllDataRowIdData,
|
|
23170
|
+
isResizeCellHeight
|
|
23171
|
+
} = internalData;
|
|
23172
|
+
const rowOpts = $xeTable.computeRowOpts;
|
|
23173
|
+
const cellOpts = $xeTable.computeCellOpts;
|
|
23174
|
+
const defaultRowHeight = $xeTable.computeDefaultRowHeight;
|
|
23175
|
+
const {
|
|
23176
|
+
row
|
|
23177
|
+
} = params;
|
|
22640
23178
|
let countHeight = 0;
|
|
22641
23179
|
let rangeRows = [];
|
|
22642
23180
|
let moveSize = 0;
|
|
22643
23181
|
const isDown = moveRange > 0;
|
|
22644
23182
|
const {
|
|
22645
|
-
scrollYLoad
|
|
22646
|
-
rowHeight
|
|
23183
|
+
scrollYLoad
|
|
22647
23184
|
} = reactData;
|
|
22648
23185
|
const {
|
|
22649
23186
|
afterFullData
|
|
22650
23187
|
} = internalData;
|
|
23188
|
+
if (isDown) {
|
|
23189
|
+
moveSize = offsetClientTop + moveRange;
|
|
23190
|
+
} else {
|
|
23191
|
+
moveSize = trRect.height - offsetClientTop + Math.abs(moveRange);
|
|
23192
|
+
}
|
|
22651
23193
|
if (scrollYLoad) {
|
|
22652
|
-
|
|
22653
|
-
|
|
22654
|
-
|
|
22655
|
-
|
|
22656
|
-
|
|
22657
|
-
|
|
22658
|
-
|
|
22659
|
-
|
|
23194
|
+
const _rowIndex = $xeTable.getVTRowIndex(row);
|
|
23195
|
+
const isCustomCellHeight = isResizeCellHeight || cellOpts.height || rowOpts.height;
|
|
23196
|
+
if (!isCustomCellHeight && showOverflow) {
|
|
23197
|
+
if (isDown) {
|
|
23198
|
+
rangeRows = afterFullData.slice(_rowIndex, _rowIndex + Math.ceil(moveSize / defaultRowHeight));
|
|
23199
|
+
} else {
|
|
23200
|
+
rangeRows = afterFullData.slice(_rowIndex - Math.floor(moveSize / defaultRowHeight), _rowIndex + 1);
|
|
23201
|
+
}
|
|
22660
23202
|
} else {
|
|
22661
|
-
|
|
23203
|
+
if (isDown) {
|
|
23204
|
+
for (let i = _rowIndex; i < afterFullData.length; i++) {
|
|
23205
|
+
const item = afterFullData[i];
|
|
23206
|
+
const rowid = $xeTable.getRowid(item);
|
|
23207
|
+
const rowRest = fullAllDataRowIdData[rowid] || {};
|
|
23208
|
+
countHeight += rowRest.resizeHeight || cellOpts.height || rowOpts.height || defaultRowHeight;
|
|
23209
|
+
rangeRows.push(item);
|
|
23210
|
+
if (countHeight > moveSize) {
|
|
23211
|
+
return rangeRows;
|
|
23212
|
+
}
|
|
23213
|
+
}
|
|
23214
|
+
} else {
|
|
23215
|
+
for (let len = _rowIndex; len >= 0; len--) {
|
|
23216
|
+
const item = afterFullData[len];
|
|
23217
|
+
const rowid = $xeTable.getRowid(item);
|
|
23218
|
+
const rowRest = fullAllDataRowIdData[rowid] || {};
|
|
23219
|
+
countHeight += rowRest.resizeHeight || cellOpts.height || rowOpts.height || defaultRowHeight;
|
|
23220
|
+
rangeRows.push(item);
|
|
23221
|
+
if (countHeight > moveSize) {
|
|
23222
|
+
return rangeRows;
|
|
23223
|
+
}
|
|
23224
|
+
}
|
|
23225
|
+
}
|
|
22662
23226
|
}
|
|
22663
23227
|
} else {
|
|
22664
|
-
if (isDown) {
|
|
22665
|
-
moveSize = evnt.clientY - trRect.y;
|
|
22666
|
-
} else {
|
|
22667
|
-
moveSize = trRect.y - evnt.clientY + trRect.height;
|
|
22668
|
-
}
|
|
22669
23228
|
const siblingProp = isDown ? 'next' : 'previous';
|
|
22670
23229
|
while (targetTrElem && countHeight < moveSize) {
|
|
22671
23230
|
const rowNodeRest = $xeTable.getRowNode(targetTrElem);
|
|
@@ -22843,21 +23402,31 @@ function getCheckboxRangeRows($xeTable, evnt, params, targetTrElem, trRect, offs
|
|
|
22843
23402
|
},
|
|
22844
23403
|
handleCheckboxRangeEvent(evnt, params) {
|
|
22845
23404
|
const $xeTable = this;
|
|
23405
|
+
const internalData = $xeTable;
|
|
23406
|
+
const {
|
|
23407
|
+
elemStore
|
|
23408
|
+
} = internalData;
|
|
23409
|
+
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
23410
|
+
const leftScrollElem = getRefElem(elemStore['left-body-scroll']);
|
|
23411
|
+
const rightScrollElem = getRefElem(elemStore['right-body-scroll']);
|
|
22846
23412
|
const {
|
|
22847
23413
|
column,
|
|
22848
23414
|
cell
|
|
22849
23415
|
} = params;
|
|
22850
23416
|
if (column.type === 'checkbox') {
|
|
22851
|
-
|
|
22852
|
-
|
|
22853
|
-
|
|
22854
|
-
}
|
|
23417
|
+
let bodyWrapperElem = bodyScrollElem;
|
|
23418
|
+
if (leftScrollElem && column.fixed === 'left') {
|
|
23419
|
+
bodyWrapperElem = leftScrollElem;
|
|
23420
|
+
} else if (rightScrollElem && column.fixed === 'right') {
|
|
23421
|
+
bodyWrapperElem = rightScrollElem;
|
|
23422
|
+
}
|
|
23423
|
+
if (!bodyWrapperElem) {
|
|
23424
|
+
return;
|
|
23425
|
+
}
|
|
23426
|
+
const el = $xeTable.$refs.refElem;
|
|
22855
23427
|
const disX = evnt.clientX;
|
|
22856
23428
|
const disY = evnt.clientY;
|
|
22857
|
-
const bodyWrapperElem = elemStore[`${column.fixed || 'main'}-body-wrapper`] || elemStore['main-body-wrapper'];
|
|
22858
23429
|
const checkboxRangeElem = bodyWrapperElem.querySelector('.vxe-table--checkbox-range');
|
|
22859
|
-
const domMousemove = document.onmousemove;
|
|
22860
|
-
const domMouseup = document.onmouseup;
|
|
22861
23430
|
const trElem = cell.parentNode;
|
|
22862
23431
|
const selectRecords = this.getCheckboxRecords();
|
|
22863
23432
|
let lastRangeRows = [];
|
|
@@ -22968,7 +23537,7 @@ function getCheckboxRangeRows($xeTable, evnt, params, targetTrElem, trRect, offs
|
|
|
22968
23537
|
}
|
|
22969
23538
|
}, 50);
|
|
22970
23539
|
};
|
|
22971
|
-
addClass(
|
|
23540
|
+
addClass(el, 'drag--range');
|
|
22972
23541
|
document.onmousemove = evnt => {
|
|
22973
23542
|
evnt.preventDefault();
|
|
22974
23543
|
evnt.stopPropagation();
|
|
@@ -22998,10 +23567,10 @@ function getCheckboxRangeRows($xeTable, evnt, params, targetTrElem, trRect, offs
|
|
|
22998
23567
|
};
|
|
22999
23568
|
document.onmouseup = evnt => {
|
|
23000
23569
|
stopMouseScroll();
|
|
23001
|
-
removeClass(
|
|
23570
|
+
removeClass(el, 'drag--range');
|
|
23002
23571
|
checkboxRangeElem.removeAttribute('style');
|
|
23003
|
-
document.onmousemove =
|
|
23004
|
-
document.onmouseup =
|
|
23572
|
+
document.onmousemove = null;
|
|
23573
|
+
document.onmouseup = null;
|
|
23005
23574
|
triggerEvent('end', evnt);
|
|
23006
23575
|
};
|
|
23007
23576
|
triggerEvent('start', evnt);
|
|
@@ -24121,7 +24690,7 @@ const table_renderDragTip = (h, $xeTable) => {
|
|
|
24121
24690
|
}
|
|
24122
24691
|
return table_renderEmptyElement($xeTable);
|
|
24123
24692
|
};
|
|
24124
|
-
function
|
|
24693
|
+
function handleUpdateResize(_vm) {
|
|
24125
24694
|
const {
|
|
24126
24695
|
$el
|
|
24127
24696
|
} = _vm;
|
|
@@ -24129,6 +24698,120 @@ function handleUupdateResize(_vm) {
|
|
|
24129
24698
|
_vm.recalculate();
|
|
24130
24699
|
}
|
|
24131
24700
|
}
|
|
24701
|
+
function renderScrollX(h, $xeTable) {
|
|
24702
|
+
return h('div', {
|
|
24703
|
+
key: 'vsx',
|
|
24704
|
+
ref: 'refScrollXVirtualElem',
|
|
24705
|
+
class: 'vxe-table--scroll-x-virtual'
|
|
24706
|
+
}, [h('div', {
|
|
24707
|
+
ref: 'refScrollXLeftCornerElem',
|
|
24708
|
+
class: 'vxe-table--scroll-x-left-corner'
|
|
24709
|
+
}), h('div', {
|
|
24710
|
+
ref: 'refScrollXWrapperElem',
|
|
24711
|
+
class: 'vxe-table--scroll-x-wrapper'
|
|
24712
|
+
}, [h('div', {
|
|
24713
|
+
ref: 'refScrollXHandleElem',
|
|
24714
|
+
class: 'vxe-table--scroll-x-handle',
|
|
24715
|
+
on: {
|
|
24716
|
+
scroll: $xeTable.triggerVirtualScrollXEvent
|
|
24717
|
+
}
|
|
24718
|
+
}, [h('div', {
|
|
24719
|
+
ref: 'refScrollXSpaceElem',
|
|
24720
|
+
class: 'vxe-table--scroll-x-space'
|
|
24721
|
+
})])]), h('div', {
|
|
24722
|
+
ref: 'refScrollXRightCornerElem',
|
|
24723
|
+
class: 'vxe-table--scroll-x-right-corner'
|
|
24724
|
+
})]);
|
|
24725
|
+
}
|
|
24726
|
+
function renderScrollY(h, $xeTable) {
|
|
24727
|
+
return h('div', {
|
|
24728
|
+
ref: 'refScrollYVirtualElem',
|
|
24729
|
+
class: 'vxe-table--scroll-y-virtual'
|
|
24730
|
+
}, [h('div', {
|
|
24731
|
+
ref: 'refScrollYTopCornerElem',
|
|
24732
|
+
class: 'vxe-table--scroll-y-top-corner'
|
|
24733
|
+
}), h('div', {
|
|
24734
|
+
ref: 'refScrollYWrapperElem',
|
|
24735
|
+
class: 'vxe-table--scroll-y-wrapper'
|
|
24736
|
+
}, [h('div', {
|
|
24737
|
+
ref: 'refScrollYHandleElem',
|
|
24738
|
+
class: 'vxe-table--scroll-y-handle',
|
|
24739
|
+
on: {
|
|
24740
|
+
scroll: $xeTable.triggerVirtualScrollYEvent
|
|
24741
|
+
}
|
|
24742
|
+
}, [h('div', {
|
|
24743
|
+
ref: 'refScrollYSpaceElem',
|
|
24744
|
+
class: 'vxe-table--scroll-y-space'
|
|
24745
|
+
})])]), h('div', {
|
|
24746
|
+
ref: 'refScrollYBottomCornerElem',
|
|
24747
|
+
class: 'vxe-table--scroll-y-bottom-corner'
|
|
24748
|
+
})]);
|
|
24749
|
+
}
|
|
24750
|
+
function renderViewport(h, $xeTable) {
|
|
24751
|
+
const props = $xeTable;
|
|
24752
|
+
const reactData = $xeTable;
|
|
24753
|
+
const {
|
|
24754
|
+
showHeader,
|
|
24755
|
+
showFooter
|
|
24756
|
+
} = props;
|
|
24757
|
+
const {
|
|
24758
|
+
overflowX,
|
|
24759
|
+
tableData,
|
|
24760
|
+
tableColumn,
|
|
24761
|
+
tableGroupColumn,
|
|
24762
|
+
footerTableData,
|
|
24763
|
+
columnStore
|
|
24764
|
+
} = reactData;
|
|
24765
|
+
const {
|
|
24766
|
+
leftList,
|
|
24767
|
+
rightList
|
|
24768
|
+
} = columnStore;
|
|
24769
|
+
return h('div', {
|
|
24770
|
+
ref: 'refTableViewportElem',
|
|
24771
|
+
class: 'vxe-table--viewport-wrapper'
|
|
24772
|
+
}, [h('div', {
|
|
24773
|
+
class: 'vxe-table--main-wrapper'
|
|
24774
|
+
}, [
|
|
24775
|
+
/**
|
|
24776
|
+
* 表头
|
|
24777
|
+
*/
|
|
24778
|
+
showHeader ? h(header, {
|
|
24779
|
+
ref: 'refTableHeader',
|
|
24780
|
+
props: {
|
|
24781
|
+
tableData,
|
|
24782
|
+
tableColumn,
|
|
24783
|
+
tableGroupColumn
|
|
24784
|
+
}
|
|
24785
|
+
}) : table_renderEmptyElement($xeTable),
|
|
24786
|
+
/**
|
|
24787
|
+
* 表体
|
|
24788
|
+
*/
|
|
24789
|
+
h(body, {
|
|
24790
|
+
ref: 'refTableBody',
|
|
24791
|
+
props: {
|
|
24792
|
+
tableData,
|
|
24793
|
+
tableColumn
|
|
24794
|
+
}
|
|
24795
|
+
}),
|
|
24796
|
+
/**
|
|
24797
|
+
* 表尾
|
|
24798
|
+
*/
|
|
24799
|
+
showFooter ? h(footer, {
|
|
24800
|
+
ref: 'refTableFooter',
|
|
24801
|
+
props: {
|
|
24802
|
+
footerTableData,
|
|
24803
|
+
tableColumn
|
|
24804
|
+
}
|
|
24805
|
+
}) : table_renderEmptyElement($xeTable)]), h('div', {
|
|
24806
|
+
class: 'vxe-table--fixed-wrapper'
|
|
24807
|
+
}, [leftList && leftList.length && overflowX ? renderFixed(h, $xeTable, 'left') : table_renderEmptyElement($xeTable), rightList && rightList.length && overflowX ? renderFixed(h, $xeTable, 'right') : table_renderEmptyElement($xeTable)])]);
|
|
24808
|
+
}
|
|
24809
|
+
function renderBody(h, $xeTable) {
|
|
24810
|
+
const scrollbarYToLeft = $xeTable.computeScrollbarYToLeft;
|
|
24811
|
+
return h('div', {
|
|
24812
|
+
class: 'vxe-table--layout-wrapper'
|
|
24813
|
+
}, scrollbarYToLeft ? [renderScrollY(h, $xeTable), renderViewport(h, $xeTable)] : [renderViewport(h, $xeTable), renderScrollY(h, $xeTable)]);
|
|
24814
|
+
}
|
|
24132
24815
|
/* harmony default export */ var table = ({
|
|
24133
24816
|
name: 'VxeTable',
|
|
24134
24817
|
mixins: [table_globalMixins.sizeMixin, mixin, menu_mixin, edit_mixin, export_mixin, keyboard_mixin, validator_mixin, custom_mixin],
|
|
@@ -24155,8 +24838,7 @@ function handleUupdateResize(_vm) {
|
|
|
24155
24838
|
const xID = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().uniqueId();
|
|
24156
24839
|
return {
|
|
24157
24840
|
xID,
|
|
24158
|
-
tId:
|
|
24159
|
-
isCalcColumn: false,
|
|
24841
|
+
tId: xID,
|
|
24160
24842
|
// 低性能的静态列
|
|
24161
24843
|
staticColumns: [],
|
|
24162
24844
|
// 渲染的列分组
|
|
@@ -24367,15 +25049,19 @@ function handleUupdateResize(_vm) {
|
|
|
24367
25049
|
isFooter: false
|
|
24368
25050
|
},
|
|
24369
25051
|
scrollVMLoading: false,
|
|
24370
|
-
|
|
25052
|
+
calcCellHeightFlag: 0,
|
|
25053
|
+
resizeHeightFlag: 0,
|
|
24371
25054
|
isCustomStatus: false,
|
|
24372
25055
|
isDragRowMove: false,
|
|
24373
25056
|
dragRow: null,
|
|
24374
25057
|
isDragColMove: false,
|
|
24375
25058
|
dragCol: null,
|
|
24376
25059
|
dragTipText: '',
|
|
24377
|
-
|
|
24378
|
-
isLoading: false
|
|
25060
|
+
isDragResize: false,
|
|
25061
|
+
isLoading: false,
|
|
25062
|
+
reScrollFlag: 0,
|
|
25063
|
+
reLayoutFlag: 0,
|
|
25064
|
+
footFlag: 0
|
|
24379
25065
|
};
|
|
24380
25066
|
},
|
|
24381
25067
|
computed: {
|
|
@@ -24443,6 +25129,16 @@ function handleUupdateResize(_vm) {
|
|
|
24443
25129
|
const props = $xeTable;
|
|
24444
25130
|
return Object.assign({}, table_getConfig().table.scrollbarConfig, props.scrollbarConfig);
|
|
24445
25131
|
},
|
|
25132
|
+
computeScrollbarXToTop() {
|
|
25133
|
+
const $xeTable = this;
|
|
25134
|
+
const scrollbarOpts = $xeTable.computeScrollbarOpts;
|
|
25135
|
+
return !!(scrollbarOpts.x && scrollbarOpts.x.position === 'top');
|
|
25136
|
+
},
|
|
25137
|
+
computeScrollbarYToLeft() {
|
|
25138
|
+
const $xeTable = this;
|
|
25139
|
+
const scrollbarOpts = $xeTable.computeScrollbarOpts;
|
|
25140
|
+
return !!(scrollbarOpts.y && scrollbarOpts.y.position === 'left');
|
|
25141
|
+
},
|
|
24446
25142
|
computeScrollYThreshold() {
|
|
24447
25143
|
const $xeTable = this;
|
|
24448
25144
|
const sYOpts = $xeTable.computeSYOpts;
|
|
@@ -24469,7 +25165,7 @@ function handleUupdateResize(_vm) {
|
|
|
24469
25165
|
const $xeTable = this;
|
|
24470
25166
|
const vSize = $xeTable.computeSize;
|
|
24471
25167
|
const rowHeightMaps = $xeTable.computeRowHeightMaps;
|
|
24472
|
-
return rowHeightMaps[vSize || 'default'];
|
|
25168
|
+
return rowHeightMaps[vSize || 'default'] || 18;
|
|
24473
25169
|
},
|
|
24474
25170
|
columnOpts() {
|
|
24475
25171
|
return this.computeColumnOpts;
|
|
@@ -24478,7 +25174,19 @@ function handleUupdateResize(_vm) {
|
|
|
24478
25174
|
return Object.assign({}, table_getConfig().table.columnConfig, this.columnConfig);
|
|
24479
25175
|
},
|
|
24480
25176
|
computeCellOpts() {
|
|
24481
|
-
|
|
25177
|
+
const $xeTable = this;
|
|
25178
|
+
const props = $xeTable;
|
|
25179
|
+
return Object.assign({}, table_getConfig().table.cellConfig, props.cellConfig);
|
|
25180
|
+
},
|
|
25181
|
+
computeHeaderCellOpts() {
|
|
25182
|
+
const $xeTable = this;
|
|
25183
|
+
const props = $xeTable;
|
|
25184
|
+
return Object.assign({}, table_getConfig().table.headerCellConfig, props.headerCellConfig);
|
|
25185
|
+
},
|
|
25186
|
+
computeFooterCellOpts() {
|
|
25187
|
+
const $xeTable = this;
|
|
25188
|
+
const props = $xeTable;
|
|
25189
|
+
return Object.assign({}, table_getConfig().table.footerCellConfig, props.footerCellConfig);
|
|
24482
25190
|
},
|
|
24483
25191
|
rowOpts() {
|
|
24484
25192
|
return this.computeRowOpts;
|
|
@@ -24535,6 +25243,20 @@ function handleUupdateResize(_vm) {
|
|
|
24535
25243
|
...this.tooltipOpts
|
|
24536
25244
|
};
|
|
24537
25245
|
},
|
|
25246
|
+
computeTableTipConfig() {
|
|
25247
|
+
const $xeTable = this;
|
|
25248
|
+
const reactData = $xeTable;
|
|
25249
|
+
const {
|
|
25250
|
+
tooltipStore
|
|
25251
|
+
} = reactData;
|
|
25252
|
+
const tooltipOpts = $xeTable.computeTooltipOpts;
|
|
25253
|
+
return Object.assign({}, tooltipOpts, tooltipStore.currOpts);
|
|
25254
|
+
},
|
|
25255
|
+
computeValidTipConfig() {
|
|
25256
|
+
const $xeTable = this;
|
|
25257
|
+
const tooltipOpts = $xeTable.computeTooltipOpts;
|
|
25258
|
+
return Object.assign({}, tooltipOpts);
|
|
25259
|
+
},
|
|
24538
25260
|
validTipOpts() {
|
|
24539
25261
|
return Object.assign({
|
|
24540
25262
|
isArrow: false
|
|
@@ -24591,23 +25313,55 @@ function handleUupdateResize(_vm) {
|
|
|
24591
25313
|
return Object.assign({}, table_getConfig().table.fnrConfig, this.fnrConfig);
|
|
24592
25314
|
},
|
|
24593
25315
|
headerCtxMenu() {
|
|
24594
|
-
|
|
25316
|
+
return this.computeHeaderMenu;
|
|
25317
|
+
},
|
|
25318
|
+
computeHeaderMenu() {
|
|
25319
|
+
const $xeTable = this;
|
|
25320
|
+
const menuOpts = $xeTable.computeMenuOpts;
|
|
25321
|
+
const headerOpts = menuOpts.header;
|
|
24595
25322
|
return headerOpts && headerOpts.options ? headerOpts.options : [];
|
|
24596
25323
|
},
|
|
24597
25324
|
bodyCtxMenu() {
|
|
24598
|
-
|
|
25325
|
+
return this.computeBodyMenu;
|
|
25326
|
+
},
|
|
25327
|
+
computeBodyMenu() {
|
|
25328
|
+
const $xeTable = this;
|
|
25329
|
+
const menuOpts = $xeTable.computeMenuOpts;
|
|
25330
|
+
const bodyOpts = menuOpts.body;
|
|
24599
25331
|
return bodyOpts && bodyOpts.options ? bodyOpts.options : [];
|
|
24600
25332
|
},
|
|
24601
25333
|
footerCtxMenu() {
|
|
24602
|
-
|
|
25334
|
+
return this.computeFooterMenu;
|
|
25335
|
+
},
|
|
25336
|
+
computeFooterMenu() {
|
|
25337
|
+
const $xeTable = this;
|
|
25338
|
+
const menuOpts = $xeTable.computeMenuOpts;
|
|
25339
|
+
const footerOpts = menuOpts.footer;
|
|
24603
25340
|
return footerOpts && footerOpts.options ? footerOpts.options : [];
|
|
24604
25341
|
},
|
|
24605
25342
|
isCtxMenu() {
|
|
24606
|
-
return
|
|
25343
|
+
return this.computeIsMenu;
|
|
25344
|
+
},
|
|
25345
|
+
computeIsMenu() {
|
|
25346
|
+
const $xeTable = this;
|
|
25347
|
+
const props = $xeTable;
|
|
25348
|
+
const menuOpts = $xeTable.computeMenuOpts;
|
|
25349
|
+
const headerMenu = $xeTable.computeHeaderMenu;
|
|
25350
|
+
const bodyMenu = $xeTable.computeBodyMenu;
|
|
25351
|
+
const footerMenu = $xeTable.computeFooterMenu;
|
|
25352
|
+
return !!((props.contextMenu || props.menuConfig) && isEnableConf(menuOpts) && (headerMenu.length || bodyMenu.length || footerMenu.length));
|
|
24607
25353
|
},
|
|
24608
25354
|
ctxMenuList() {
|
|
25355
|
+
return this.computeMenuList;
|
|
25356
|
+
},
|
|
25357
|
+
computeMenuList() {
|
|
25358
|
+
const $xeTable = this;
|
|
25359
|
+
const reactData = $xeTable;
|
|
25360
|
+
const {
|
|
25361
|
+
ctxMenuStore
|
|
25362
|
+
} = reactData;
|
|
24609
25363
|
const rest = [];
|
|
24610
|
-
|
|
25364
|
+
ctxMenuStore.list.forEach(list => {
|
|
24611
25365
|
list.forEach(item => {
|
|
24612
25366
|
rest.push(item);
|
|
24613
25367
|
});
|
|
@@ -24820,7 +25574,7 @@ function handleUupdateResize(_vm) {
|
|
|
24820
25574
|
if (value && value.length >= 50000) {
|
|
24821
25575
|
warnLog('vxe.error.errLargeData', ['loadData(data), reloadData(data)']);
|
|
24822
25576
|
}
|
|
24823
|
-
this.loadTableData(value || []).then(() => {
|
|
25577
|
+
this.loadTableData(value || [], false).then(() => {
|
|
24824
25578
|
this.inited = true;
|
|
24825
25579
|
this.initStatus = true;
|
|
24826
25580
|
if (!initStatus) {
|
|
@@ -24848,33 +25602,50 @@ function handleUupdateResize(_vm) {
|
|
|
24848
25602
|
reColumnFlag() {
|
|
24849
25603
|
this.$nextTick().then(() => this.refreshColumn());
|
|
24850
25604
|
},
|
|
25605
|
+
computeSize() {
|
|
25606
|
+
this.reScrollFlag++;
|
|
25607
|
+
},
|
|
24851
25608
|
showHeader() {
|
|
24852
|
-
this
|
|
24853
|
-
this.recalculate(true).then(() => this.refreshScroll());
|
|
24854
|
-
});
|
|
25609
|
+
this.reScrollFlag++;
|
|
24855
25610
|
},
|
|
24856
25611
|
showFooter() {
|
|
24857
|
-
this
|
|
24858
|
-
|
|
25612
|
+
this.reScrollFlag++;
|
|
25613
|
+
},
|
|
25614
|
+
reScrollFlag() {
|
|
25615
|
+
const $xeTable = this;
|
|
25616
|
+
$xeTable.$nextTick(() => {
|
|
25617
|
+
$xeTable.recalculate(true).then(() => $xeTable.refreshScroll());
|
|
24859
25618
|
});
|
|
24860
25619
|
},
|
|
24861
25620
|
height() {
|
|
24862
|
-
this
|
|
25621
|
+
this.reLayoutFlag++;
|
|
24863
25622
|
},
|
|
24864
25623
|
maxHeight() {
|
|
24865
|
-
this
|
|
25624
|
+
this.reLayoutFlag++;
|
|
24866
25625
|
},
|
|
24867
|
-
|
|
24868
|
-
this
|
|
24869
|
-
|
|
24870
|
-
|
|
25626
|
+
computeScrollbarXToTop() {
|
|
25627
|
+
this.reLayoutFlag++;
|
|
25628
|
+
},
|
|
25629
|
+
computeScrollbarYToLeft() {
|
|
25630
|
+
this.reLayoutFlag++;
|
|
25631
|
+
},
|
|
25632
|
+
reLayoutFlag() {
|
|
25633
|
+
const $xeTable = this;
|
|
25634
|
+
$xeTable.$nextTick(() => $xeTable.recalculate(true));
|
|
25635
|
+
},
|
|
25636
|
+
footerData() {
|
|
25637
|
+
this.footFlag++;
|
|
25638
|
+
},
|
|
25639
|
+
footFlag() {
|
|
25640
|
+
const $xeTable = this;
|
|
25641
|
+
$xeTable.updateFooter();
|
|
24871
25642
|
},
|
|
24872
25643
|
syncResize(value) {
|
|
24873
25644
|
if (value) {
|
|
24874
|
-
|
|
25645
|
+
handleUpdateResize(this);
|
|
24875
25646
|
this.$nextTick(() => {
|
|
24876
|
-
|
|
24877
|
-
setTimeout(() =>
|
|
25647
|
+
handleUpdateResize(this);
|
|
25648
|
+
setTimeout(() => handleUpdateResize(this));
|
|
24878
25649
|
});
|
|
24879
25650
|
}
|
|
24880
25651
|
},
|
|
@@ -24986,11 +25757,14 @@ function handleUupdateResize(_vm) {
|
|
|
24986
25757
|
if (treeConfig && (treeOpts.showLine || treeOpts.line) && (!(this.rowKey || rowOpts.useKey) || !showOverflow)) {
|
|
24987
25758
|
warnLog('vxe.error.reqProp', ['row-config.useKey | show-overflow']);
|
|
24988
25759
|
}
|
|
25760
|
+
if (treeConfig && !treeOpts.transform && this.stripe) {
|
|
25761
|
+
warnLog('vxe.error.noTree', ['stripe']);
|
|
25762
|
+
}
|
|
24989
25763
|
if (this.showFooter && !(this.footerMethod || this.footerData)) {
|
|
24990
25764
|
warnLog('vxe.error.reqProp', ['footer-data | footer-method']);
|
|
24991
25765
|
}
|
|
24992
|
-
if (
|
|
24993
|
-
warnLog('vxe.error.
|
|
25766
|
+
if (rowOpts.height) {
|
|
25767
|
+
warnLog('vxe.error.delProp', ['row-config.height', 'cell-config.height']);
|
|
24994
25768
|
}
|
|
24995
25769
|
if (this.tooltipOpts.enabled) {
|
|
24996
25770
|
warnLog('vxe.error.delProp', ['tooltip-config.enabled', 'tooltip-config.showAll']);
|
|
@@ -25137,7 +25911,7 @@ function handleUupdateResize(_vm) {
|
|
|
25137
25911
|
endIndex: 1,
|
|
25138
25912
|
visibleSize: 0
|
|
25139
25913
|
});
|
|
25140
|
-
this.loadTableData(data).then(() => {
|
|
25914
|
+
this.loadTableData(data, true).then(() => {
|
|
25141
25915
|
if (data && data.length) {
|
|
25142
25916
|
this.inited = true;
|
|
25143
25917
|
this.initStatus = true;
|
|
@@ -25260,29 +26034,24 @@ function handleUupdateResize(_vm) {
|
|
|
25260
26034
|
editRules
|
|
25261
26035
|
} = props;
|
|
25262
26036
|
const {
|
|
25263
|
-
isCalcColumn,
|
|
25264
26037
|
isGroup,
|
|
25265
26038
|
overflowX,
|
|
25266
26039
|
overflowY,
|
|
25267
26040
|
scrollXLoad,
|
|
25268
26041
|
scrollYLoad,
|
|
25269
|
-
scrollbarHeight,
|
|
25270
26042
|
tableData,
|
|
25271
|
-
tableColumn,
|
|
25272
|
-
tableGroupColumn,
|
|
25273
|
-
footerTableData,
|
|
25274
26043
|
initStore,
|
|
25275
26044
|
columnStore,
|
|
25276
26045
|
filterStore,
|
|
25277
|
-
customStore
|
|
25278
|
-
tooltipStore
|
|
26046
|
+
customStore
|
|
25279
26047
|
} = reactData;
|
|
25280
26048
|
const {
|
|
25281
26049
|
leftList,
|
|
25282
26050
|
rightList
|
|
25283
26051
|
} = columnStore;
|
|
25284
26052
|
const loadingSlot = slots.loading;
|
|
25285
|
-
const
|
|
26053
|
+
const tableTipConfig = $xeTable.computeTableTipConfig;
|
|
26054
|
+
const validTipConfig = $xeTable.computeValidTipConfig;
|
|
25286
26055
|
const validOpts = $xeTable.computeValidOpts;
|
|
25287
26056
|
const checkboxOpts = $xeTable.computeCheckboxOpts;
|
|
25288
26057
|
const treeOpts = $xeTable.computeTreeOpts;
|
|
@@ -25298,9 +26067,11 @@ function handleUupdateResize(_vm) {
|
|
|
25298
26067
|
const resizableOpts = $xeTable.computeResizableOpts;
|
|
25299
26068
|
const isArea = mouseConfig && mouseOpts.area;
|
|
25300
26069
|
const columnDragOpts = $xeTable.computeColumnDragOpts;
|
|
26070
|
+
const scrollbarXToTop = $xeTable.computeScrollbarXToTop;
|
|
26071
|
+
const scrollbarYToLeft = $xeTable.computeScrollbarYToLeft;
|
|
25301
26072
|
return h('div', {
|
|
25302
26073
|
ref: 'refElem',
|
|
25303
|
-
class: ['vxe-table', 'vxe-table--render-default', `tid_${xID}`, `border--${tableBorder}`, {
|
|
26074
|
+
class: ['vxe-table', 'vxe-table--render-default', `tid_${xID}`, `border--${tableBorder}`, `sx-pos--${scrollbarXToTop ? 'top' : 'bottom'}`, `sy-pos--${scrollbarYToLeft ? 'left' : 'right'}`, {
|
|
25304
26075
|
[`size--${vSize}`]: vSize,
|
|
25305
26076
|
[`valid-msg--${validOpts.msgMode}`]: !!editRules,
|
|
25306
26077
|
'vxe-editable': !!editConfig,
|
|
@@ -25313,7 +26084,6 @@ function handleUupdateResize(_vm) {
|
|
|
25313
26084
|
'row--highlight': rowOpts.isHover || highlightHoverRow,
|
|
25314
26085
|
'column--highlight': columnOpts.isHover || highlightHoverColumn,
|
|
25315
26086
|
'checkbox--range': checkboxOpts.range,
|
|
25316
|
-
'column--calc': isCalcColumn,
|
|
25317
26087
|
'col--drag-cell': columnOpts.drag && columnDragOpts.trigger === 'cell',
|
|
25318
26088
|
'is--header': showHeader,
|
|
25319
26089
|
'is--footer': showFooter,
|
|
@@ -25322,7 +26092,6 @@ function handleUupdateResize(_vm) {
|
|
|
25322
26092
|
'is--fixed-left': leftList.length,
|
|
25323
26093
|
'is--fixed-right': rightList.length,
|
|
25324
26094
|
'is--animat': !!props.animat,
|
|
25325
|
-
'is--padding': props.padding,
|
|
25326
26095
|
'is--round': props.round,
|
|
25327
26096
|
'is--stripe': !treeConfig && stripe,
|
|
25328
26097
|
'is--loading': currLoading,
|
|
@@ -25348,82 +26117,7 @@ function handleUupdateResize(_vm) {
|
|
|
25348
26117
|
}, this.$slots.default), h('div', {
|
|
25349
26118
|
key: 'tw',
|
|
25350
26119
|
class: 'vxe-table--render-wrapper'
|
|
25351
|
-
}, [h(
|
|
25352
|
-
ref: 'refTableViewportElem',
|
|
25353
|
-
class: 'vxe-table--viewport-wrapper'
|
|
25354
|
-
}, [h('div', {
|
|
25355
|
-
class: 'vxe-table--main-wrapper'
|
|
25356
|
-
}, [
|
|
25357
|
-
/**
|
|
25358
|
-
* 表头
|
|
25359
|
-
*/
|
|
25360
|
-
showHeader ? h(header, {
|
|
25361
|
-
ref: 'refTableHeader',
|
|
25362
|
-
props: {
|
|
25363
|
-
tableData,
|
|
25364
|
-
tableColumn,
|
|
25365
|
-
tableGroupColumn,
|
|
25366
|
-
size: vSize
|
|
25367
|
-
}
|
|
25368
|
-
}) : table_renderEmptyElement($xeTable),
|
|
25369
|
-
/**
|
|
25370
|
-
* 表体
|
|
25371
|
-
*/
|
|
25372
|
-
h(body, {
|
|
25373
|
-
ref: 'refTableBody',
|
|
25374
|
-
props: {
|
|
25375
|
-
tableData,
|
|
25376
|
-
tableColumn,
|
|
25377
|
-
size: vSize
|
|
25378
|
-
}
|
|
25379
|
-
}),
|
|
25380
|
-
/**
|
|
25381
|
-
* 表尾
|
|
25382
|
-
*/
|
|
25383
|
-
showFooter ? h(footer, {
|
|
25384
|
-
ref: 'refTableFooter',
|
|
25385
|
-
props: {
|
|
25386
|
-
footerTableData,
|
|
25387
|
-
tableColumn,
|
|
25388
|
-
size: vSize
|
|
25389
|
-
}
|
|
25390
|
-
}) : table_renderEmptyElement($xeTable)]), h('div', {
|
|
25391
|
-
class: 'vxe-table--fixed-wrapper'
|
|
25392
|
-
}, [leftList && leftList.length && overflowX ? renderFixed(h, this, 'left') : table_renderEmptyElement($xeTable), rightList && rightList.length && overflowX ? renderFixed(h, this, 'right') : table_renderEmptyElement($xeTable)])]), h('div', {
|
|
25393
|
-
ref: 'refScrollYVirtualElem',
|
|
25394
|
-
class: 'vxe-table--scroll-y-virtual'
|
|
25395
|
-
}, [h('div', {
|
|
25396
|
-
ref: 'refScrollYTopCornerElem',
|
|
25397
|
-
class: 'vxe-table--scroll-y-top-corner'
|
|
25398
|
-
}), h('div', {
|
|
25399
|
-
ref: 'refScrollYHandleElem',
|
|
25400
|
-
class: 'vxe-table--scroll-y-handle',
|
|
25401
|
-
on: {
|
|
25402
|
-
scroll: this.scrollYEvent
|
|
25403
|
-
}
|
|
25404
|
-
}, [h('div', {
|
|
25405
|
-
ref: 'refScrollYSpaceElem',
|
|
25406
|
-
class: 'vxe-table--scroll-y-space'
|
|
25407
|
-
})]), h('div', {
|
|
25408
|
-
ref: 'refScrollYBottomCornerElem',
|
|
25409
|
-
class: 'vxe-table--scroll-y-bottom-corner'
|
|
25410
|
-
})])]), h('div', {
|
|
25411
|
-
key: 'vx',
|
|
25412
|
-
ref: 'refScrollXVirtualElem',
|
|
25413
|
-
class: 'vxe-table--scroll-x-virtual'
|
|
25414
|
-
}, [h('div', {
|
|
25415
|
-
ref: 'refScrollXHandleElem',
|
|
25416
|
-
class: 'vxe-table--scroll-x-handle',
|
|
25417
|
-
on: {
|
|
25418
|
-
scroll: this.scrollXEvent
|
|
25419
|
-
}
|
|
25420
|
-
}, [h('div', {
|
|
25421
|
-
ref: 'refScrollXSpaceElem',
|
|
25422
|
-
class: 'vxe-table--scroll-x-space'
|
|
25423
|
-
})]), h('div', {
|
|
25424
|
-
ref: 'refScrollXRightCornerElem',
|
|
25425
|
-
class: 'vxe-table--scroll-x-right-corner'
|
|
25426
|
-
})]),
|
|
26120
|
+
}, scrollbarXToTop ? [renderScrollX(h, $xeTable), renderBody(h, $xeTable)] : [renderBody(h, $xeTable), renderScrollX(h, $xeTable)]),
|
|
25427
26121
|
/**
|
|
25428
26122
|
* 空数据
|
|
25429
26123
|
*/
|
|
@@ -25445,14 +26139,21 @@ function handleUupdateResize(_vm) {
|
|
|
25445
26139
|
* 列宽线
|
|
25446
26140
|
*/
|
|
25447
26141
|
h('div', {
|
|
25448
|
-
key: '
|
|
25449
|
-
ref: '
|
|
25450
|
-
class: 'vxe-table--resizable-bar'
|
|
25451
|
-
|
|
25452
|
-
|
|
25453
|
-
|
|
26142
|
+
key: 'tcl',
|
|
26143
|
+
ref: 'refColResizeBar',
|
|
26144
|
+
class: 'vxe-table--resizable-col-bar'
|
|
26145
|
+
}, resizableOpts.showDragTip ? [h('div', {
|
|
26146
|
+
ref: 'refColResizeTip',
|
|
26147
|
+
class: 'vxe-table--resizable-number-tip'
|
|
26148
|
+
})] : []),
|
|
26149
|
+
/**
|
|
26150
|
+
* 行高线
|
|
26151
|
+
*/
|
|
26152
|
+
h('div', {
|
|
26153
|
+
key: 'trl',
|
|
26154
|
+
ref: 'refRowResizeBar',
|
|
26155
|
+
class: 'vxe-table--resizable-row-bar'
|
|
25454
26156
|
}, resizableOpts.showDragTip ? [h('div', {
|
|
25455
|
-
ref: 'refCellResizeTip',
|
|
25456
26157
|
class: 'vxe-table--resizable-number-tip'
|
|
25457
26158
|
})] : []),
|
|
25458
26159
|
/**
|
|
@@ -25554,7 +26255,12 @@ function handleUupdateResize(_vm) {
|
|
|
25554
26255
|
VxeUITooltipComponent ? h(VxeUITooltipComponent, {
|
|
25555
26256
|
key: 'btp',
|
|
25556
26257
|
ref: 'tooltip',
|
|
25557
|
-
props:
|
|
26258
|
+
props: {
|
|
26259
|
+
theme: tableTipConfig.theme,
|
|
26260
|
+
enterable: tableTipConfig.enterable,
|
|
26261
|
+
enterDelay: tableTipConfig.enterDelay,
|
|
26262
|
+
leaveDelay: tableTipConfig.leaveDelay
|
|
26263
|
+
}
|
|
25558
26264
|
}) : table_renderEmptyElement($xeTable),
|
|
25559
26265
|
/**
|
|
25560
26266
|
* 校验提示
|
|
@@ -25565,9 +26271,12 @@ function handleUupdateResize(_vm) {
|
|
|
25565
26271
|
class: [{
|
|
25566
26272
|
'old-cell-valid': editRules && table_getConfig().cellVaildMode === 'obsolete'
|
|
25567
26273
|
}, 'vxe-table--valid-error'],
|
|
25568
|
-
props:
|
|
25569
|
-
|
|
25570
|
-
|
|
26274
|
+
props: {
|
|
26275
|
+
theme: validTipConfig.theme,
|
|
26276
|
+
enterable: validTipConfig.enterable,
|
|
26277
|
+
enterDelay: validTipConfig.enterDelay,
|
|
26278
|
+
leaveDelay: validTipConfig.leaveDelay
|
|
26279
|
+
}
|
|
25571
26280
|
}) : table_renderEmptyElement($xeTable)])]);
|
|
25572
26281
|
},
|
|
25573
26282
|
methods: methods
|
|
@@ -29222,7 +29931,8 @@ const Toolbar = VxeToolbar;
|
|
|
29222
29931
|
customRestore: '恢复默认',
|
|
29223
29932
|
maxFixedCol: '最大冻结列的数量不能超过 {0} 个',
|
|
29224
29933
|
dragTip: '移动:{0}',
|
|
29225
|
-
resizeColTip: '{0} 像素'
|
|
29934
|
+
resizeColTip: '宽:{0} 像素',
|
|
29935
|
+
resizeRowTip: '高:{0} 像素'
|
|
29226
29936
|
},
|
|
29227
29937
|
grid: {
|
|
29228
29938
|
selectOneRecord: '请至少选择一条记录!',
|