vxe-table 3.12.10-beta.8 → 3.12.10
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 +4 -3
- 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 +105 -69
- package/es/table/module/keyboard/mixin.js +68 -25
- package/es/table/module/menu/mixin.js +3 -1
- package/es/table/src/body.js +135 -83
- package/es/table/src/cell.js +43 -57
- package/es/table/src/column.js +43 -8
- package/es/table/src/columnInfo.js +3 -0
- package/es/table/src/footer.js +50 -9
- package/es/table/src/header.js +70 -168
- package/es/table/src/methods.js +985 -502
- package/es/table/src/props.js +14 -4
- package/es/table/src/table.js +114 -33
- package/es/table/src/util.js +73 -57
- package/es/table/style.css +253 -189
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +26 -10
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +253 -189
- 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 +1782 -1056
- 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 +4 -3
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +4 -3
- 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 +7 -2
- package/lib/table/module/edit/mixin.min.js +1 -1
- package/lib/table/module/export/mixin.js +105 -64
- 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 +132 -79
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/cell.js +32 -42
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/column.js +12 -0
- package/lib/table/src/column.min.js +1 -1
- package/lib/table/src/columnInfo.js +3 -0
- package/lib/table/src/columnInfo.min.js +1 -1
- package/lib/table/src/footer.js +46 -7
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/header.js +52 -175
- package/lib/table/src/header.min.js +1 -1
- package/lib/table/src/methods.js +1096 -560
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/props.js +14 -4
- package/lib/table/src/props.min.js +1 -1
- package/lib/table/src/table.js +113 -36
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +87 -70
- package/lib/table/src/util.min.js +1 -1
- package/lib/table/style/style.css +253 -189
- package/lib/table/style/style.min.css +1 -1
- package/lib/ui/index.js +26 -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 +253 -189
- 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 +4 -3
- 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 +138 -80
- package/packages/table/module/keyboard/mixin.ts +65 -24
- package/packages/table/module/menu/mixin.ts +4 -1
- package/packages/table/src/body.ts +148 -86
- package/packages/table/src/cell.ts +45 -67
- package/packages/table/src/column.ts +48 -10
- package/packages/table/src/columnInfo.ts +3 -0
- package/packages/table/src/footer.ts +53 -10
- package/packages/table/src/header.ts +70 -169
- package/packages/table/src/methods.ts +1031 -515
- package/packages/table/src/props.ts +16 -6
- package/packages/table/src/table.ts +124 -33
- package/packages/table/src/util.ts +82 -62
- package/packages/ui/index.ts +25 -9
- package/styles/components/table.scss +319 -271
- 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.1736840896964.ttf → iconfont.1738985837413.ttf} +0 -0
- /package/es/{iconfont.1736840896964.woff → iconfont.1738985837413.woff} +0 -0
- /package/es/{iconfont.1736840896964.woff2 → iconfont.1738985837413.woff2} +0 -0
- /package/lib/{iconfont.1736840896964.ttf → iconfont.1738985837413.ttf} +0 -0
- /package/lib/{iconfont.1736840896964.woff → iconfont.1738985837413.woff} +0 -0
- /package/lib/{iconfont.1736840896964.woff2 → iconfont.1738985837413.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
|
|
2223
|
+
const version = "3.12.10";
|
|
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,15 @@ core_.VxeUI.setConfig({
|
|
|
2289
2292
|
columnConfig: {
|
|
2290
2293
|
maxFixedSize: 4
|
|
2291
2294
|
},
|
|
2295
|
+
cellConfig: {
|
|
2296
|
+
padding: true
|
|
2297
|
+
},
|
|
2298
|
+
headerCellConfig: {
|
|
2299
|
+
height: 'unset'
|
|
2300
|
+
},
|
|
2301
|
+
footerCellConfig: {
|
|
2302
|
+
height: 'unset'
|
|
2303
|
+
},
|
|
2292
2304
|
// menuConfig: {
|
|
2293
2305
|
// visibleMethod () {}
|
|
2294
2306
|
// },
|
|
@@ -2322,6 +2334,8 @@ core_.VxeUI.setConfig({
|
|
|
2322
2334
|
// orders: ['asc', 'desc', null],
|
|
2323
2335
|
// sortMethod: null,
|
|
2324
2336
|
showIcon: true,
|
|
2337
|
+
allowClear: true,
|
|
2338
|
+
allowBtn: true,
|
|
2325
2339
|
iconLayout: 'vertical'
|
|
2326
2340
|
},
|
|
2327
2341
|
filterConfig: {
|
|
@@ -2393,18 +2407,20 @@ core_.VxeUI.setConfig({
|
|
|
2393
2407
|
isReplace: true
|
|
2394
2408
|
},
|
|
2395
2409
|
virtualXConfig: {
|
|
2396
|
-
|
|
2397
|
-
gt: 60
|
|
2398
|
-
|
|
2410
|
+
enabled: true,
|
|
2411
|
+
gt: 60,
|
|
2412
|
+
preSize: 0,
|
|
2413
|
+
oSize: 1
|
|
2399
2414
|
},
|
|
2400
2415
|
virtualYConfig: {
|
|
2401
|
-
|
|
2402
|
-
gt: 100
|
|
2403
|
-
|
|
2416
|
+
enabled: true,
|
|
2417
|
+
gt: 100,
|
|
2418
|
+
preSize: 1,
|
|
2419
|
+
oSize: 2
|
|
2404
2420
|
},
|
|
2405
2421
|
scrollbarConfig: {
|
|
2406
|
-
width:
|
|
2407
|
-
height:
|
|
2422
|
+
// width: 0,
|
|
2423
|
+
// height: 0
|
|
2408
2424
|
}
|
|
2409
2425
|
},
|
|
2410
2426
|
// export: {
|
|
@@ -2824,7 +2840,7 @@ function isNodeElement(elem) {
|
|
|
2824
2840
|
const {
|
|
2825
2841
|
log: log_log
|
|
2826
2842
|
} = core_.VxeUI;
|
|
2827
|
-
const log_version = `table v${"3.12.10
|
|
2843
|
+
const log_version = `table v${"3.12.10"}`;
|
|
2828
2844
|
const warnLog = log_log.create('warn', log_version);
|
|
2829
2845
|
const errLog = log_log.create('error', log_version);
|
|
2830
2846
|
;// CONCATENATED MODULE: ./packages/table/src/columnInfo.ts
|
|
@@ -2914,6 +2930,8 @@ class ColumnInfo {
|
|
|
2914
2930
|
footerClassName: _vm.footerClassName,
|
|
2915
2931
|
formatter,
|
|
2916
2932
|
footerFormatter: _vm.footerFormatter,
|
|
2933
|
+
padding: _vm.padding,
|
|
2934
|
+
verticalAlign: _vm.verticalAlign,
|
|
2917
2935
|
sortable: _vm.sortable,
|
|
2918
2936
|
sortBy: _vm.sortBy,
|
|
2919
2937
|
sortType: _vm.sortType,
|
|
@@ -2927,6 +2945,7 @@ class ColumnInfo {
|
|
|
2927
2945
|
filterRender: _vm.filterRender,
|
|
2928
2946
|
treeNode: _vm.treeNode,
|
|
2929
2947
|
dragSort: _vm.dragSort,
|
|
2948
|
+
rowResize: _vm.rowResize,
|
|
2930
2949
|
cellType: _vm.cellType,
|
|
2931
2950
|
cellRender: _vm.cellRender,
|
|
2932
2951
|
editRender: _vm.editRender,
|
|
@@ -3120,9 +3139,15 @@ function getElementMarginWidth(elem) {
|
|
|
3120
3139
|
}
|
|
3121
3140
|
return 0;
|
|
3122
3141
|
}
|
|
3142
|
+
function getCellHeight(height) {
|
|
3143
|
+
if (height === 'unset') {
|
|
3144
|
+
return 0;
|
|
3145
|
+
}
|
|
3146
|
+
return height || 0;
|
|
3147
|
+
}
|
|
3123
3148
|
function handleFieldOrColumn(_vm, fieldOrColumn) {
|
|
3124
3149
|
if (fieldOrColumn) {
|
|
3125
|
-
return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(fieldOrColumn) ? _vm.getColumnByField(fieldOrColumn) : fieldOrColumn;
|
|
3150
|
+
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
3151
|
}
|
|
3127
3152
|
return null;
|
|
3128
3153
|
}
|
|
@@ -3207,6 +3232,7 @@ function getColReMinWidth(params) {
|
|
|
3207
3232
|
column,
|
|
3208
3233
|
cell
|
|
3209
3234
|
} = params;
|
|
3235
|
+
const internalData = $table;
|
|
3210
3236
|
const {
|
|
3211
3237
|
showHeaderOverflow: allColumnHeaderOverflow,
|
|
3212
3238
|
resizableOpts
|
|
@@ -3221,6 +3247,9 @@ function getColReMinWidth(params) {
|
|
|
3221
3247
|
return Math.max(1, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(customMinWidth));
|
|
3222
3248
|
}
|
|
3223
3249
|
}
|
|
3250
|
+
const {
|
|
3251
|
+
elemStore
|
|
3252
|
+
} = internalData;
|
|
3224
3253
|
const {
|
|
3225
3254
|
showHeaderOverflow,
|
|
3226
3255
|
minWidth: colMinWidth
|
|
@@ -3247,13 +3276,10 @@ function getColReMinWidth(params) {
|
|
|
3247
3276
|
}
|
|
3248
3277
|
// 如果设置最小宽
|
|
3249
3278
|
if (colMinWidth) {
|
|
3250
|
-
const
|
|
3251
|
-
|
|
3252
|
-
} = $table.$refs;
|
|
3253
|
-
const bodyElem = refTableBody ? refTableBody.$el : null;
|
|
3254
|
-
if (bodyElem) {
|
|
3279
|
+
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
3280
|
+
if (bodyScrollElem) {
|
|
3255
3281
|
if (isScale(colMinWidth)) {
|
|
3256
|
-
const bodyWidth =
|
|
3282
|
+
const bodyWidth = bodyScrollElem.clientWidth - 1;
|
|
3257
3283
|
const meanWidth = bodyWidth / 100;
|
|
3258
3284
|
return Math.max(mWidth, Math.floor(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toInteger(colMinWidth) * meanWidth));
|
|
3259
3285
|
} else if (isPx(colMinWidth)) {
|
|
@@ -3299,14 +3325,39 @@ function getOffsetSize($xeTable) {
|
|
|
3299
3325
|
}
|
|
3300
3326
|
function calcTreeLine(params, prevRow) {
|
|
3301
3327
|
const {
|
|
3302
|
-
$table
|
|
3328
|
+
$table,
|
|
3329
|
+
row
|
|
3303
3330
|
} = params;
|
|
3331
|
+
const tableProps = $table;
|
|
3304
3332
|
const tableReactData = $table;
|
|
3333
|
+
const tableInternalData = $table;
|
|
3334
|
+
const {
|
|
3335
|
+
showOverflow
|
|
3336
|
+
} = tableProps;
|
|
3337
|
+
const {
|
|
3338
|
+
scrollYLoad
|
|
3339
|
+
} = tableReactData;
|
|
3340
|
+
const {
|
|
3341
|
+
fullAllDataRowIdData
|
|
3342
|
+
} = tableInternalData;
|
|
3343
|
+
const rowOpts = $table.computeRowOpts;
|
|
3344
|
+
const cellOpts = $table.computeCellOpts;
|
|
3345
|
+
const defaultRowHeight = $table.computeDefaultRowHeight;
|
|
3346
|
+
const rowid = getRowid($table, row);
|
|
3347
|
+
const rowRest = fullAllDataRowIdData[rowid];
|
|
3348
|
+
const currCellHeight = rowRest.resizeHeight || cellOpts.height || rowOpts.height || defaultRowHeight;
|
|
3305
3349
|
let expandSize = 1;
|
|
3306
3350
|
if (prevRow) {
|
|
3307
3351
|
expandSize = countTreeExpand(prevRow, params);
|
|
3308
3352
|
}
|
|
3309
|
-
|
|
3353
|
+
let cellHeight = currCellHeight;
|
|
3354
|
+
const vnHeight = rowRest.height;
|
|
3355
|
+
if (scrollYLoad) {
|
|
3356
|
+
if (!showOverflow) {
|
|
3357
|
+
cellHeight = vnHeight || currCellHeight;
|
|
3358
|
+
}
|
|
3359
|
+
}
|
|
3360
|
+
return cellHeight * expandSize - (prevRow ? 1 : 12 - getOffsetSize($table));
|
|
3310
3361
|
}
|
|
3311
3362
|
function mergeBodyMethod(mergeList, _rowIndex, _columnIndex) {
|
|
3312
3363
|
for (let mIndex = 0; mIndex < mergeList.length; mIndex++) {
|
|
@@ -3381,43 +3432,32 @@ function createColumn($xeTable, options, renderOptions) {
|
|
|
3381
3432
|
return isColumnInfo(options) ? options : new ColumnInfo($xeTable, options, renderOptions);
|
|
3382
3433
|
}
|
|
3383
3434
|
function rowToVisible($xeTable, row) {
|
|
3435
|
+
const tableProps = $xeTable;
|
|
3384
3436
|
const reactData = $xeTable;
|
|
3385
3437
|
const internalData = $xeTable;
|
|
3386
|
-
const tableProps = $xeTable;
|
|
3387
3438
|
const {
|
|
3388
3439
|
showOverflow
|
|
3389
3440
|
} = tableProps;
|
|
3390
|
-
const refTableBody = $xeTable.$refs.refTableBody;
|
|
3391
3441
|
const {
|
|
3392
|
-
columnStore,
|
|
3393
3442
|
scrollYLoad
|
|
3394
3443
|
} = reactData;
|
|
3395
3444
|
const {
|
|
3445
|
+
elemStore,
|
|
3396
3446
|
afterFullData,
|
|
3397
|
-
|
|
3398
|
-
|
|
3447
|
+
fullAllDataRowIdData,
|
|
3448
|
+
isResizeCellHeight
|
|
3399
3449
|
} = internalData;
|
|
3400
|
-
const
|
|
3401
|
-
|
|
3402
|
-
|
|
3403
|
-
const
|
|
3404
|
-
|
|
3405
|
-
|
|
3406
|
-
} = columnStore;
|
|
3407
|
-
const bodyElem = refTableBody ? refTableBody.$el : null;
|
|
3450
|
+
const rowOpts = $xeTable.computeRowOpts;
|
|
3451
|
+
const cellOpts = $xeTable.computeCellOpts;
|
|
3452
|
+
const defaultRowHeight = $xeTable.computeDefaultRowHeight;
|
|
3453
|
+
const leftFixedWidth = $xeTable.computeLeftFixedWidth;
|
|
3454
|
+
const rightFixedWidth = $xeTable.computeRightFixedWidth;
|
|
3455
|
+
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
3408
3456
|
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}"]`);
|
|
3457
|
+
if (bodyScrollElem) {
|
|
3458
|
+
const bodyHeight = bodyScrollElem.clientHeight;
|
|
3459
|
+
const bodyScrollTop = bodyScrollElem.scrollTop;
|
|
3460
|
+
const trElem = bodyScrollElem.querySelector(`[rowid="${rowid}"]`);
|
|
3421
3461
|
if (trElem) {
|
|
3422
3462
|
const trOffsetParent = trElem.offsetParent;
|
|
3423
3463
|
const trOffsetTop = trElem.offsetTop + (trOffsetParent ? trOffsetParent.offsetTop : 0);
|
|
@@ -3431,12 +3471,13 @@ function rowToVisible($xeTable, row) {
|
|
|
3431
3471
|
} else {
|
|
3432
3472
|
// 如果是虚拟渲染滚动
|
|
3433
3473
|
if (scrollYLoad) {
|
|
3434
|
-
|
|
3435
|
-
|
|
3474
|
+
const isCustomCellHeight = isResizeCellHeight || cellOpts.height || rowOpts.height;
|
|
3475
|
+
if (!isCustomCellHeight && showOverflow) {
|
|
3476
|
+
return $xeTable.scrollTo(null, ($xeTable.findRowIndexOf(afterFullData, row) - 1) * defaultRowHeight);
|
|
3436
3477
|
}
|
|
3437
3478
|
let scrollTop = 0;
|
|
3438
3479
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
3439
|
-
const rHeight = rowRest ? rowRest.height ||
|
|
3480
|
+
const rHeight = rowRest ? rowRest.resizeHeight || cellOpts.height || rowOpts.height || defaultRowHeight : defaultRowHeight;
|
|
3440
3481
|
for (let i = 0; i < afterFullData.length; i++) {
|
|
3441
3482
|
const currRow = afterFullData[i];
|
|
3442
3483
|
const currRowid = getRowid($xeTable, currRow);
|
|
@@ -3444,60 +3485,53 @@ function rowToVisible($xeTable, row) {
|
|
|
3444
3485
|
break;
|
|
3445
3486
|
}
|
|
3446
3487
|
const rowRest = fullAllDataRowIdData[currRowid];
|
|
3447
|
-
scrollTop += rowRest ? rowRest.height ||
|
|
3488
|
+
scrollTop += rowRest ? rowRest.resizeHeight || cellOpts.height || rowOpts.height || defaultRowHeight : defaultRowHeight;
|
|
3448
3489
|
}
|
|
3449
3490
|
if (scrollTop < bodyScrollTop) {
|
|
3450
|
-
return $xeTable.scrollTo(null, scrollTop -
|
|
3491
|
+
return $xeTable.scrollTo(null, scrollTop - leftFixedWidth - 1);
|
|
3451
3492
|
}
|
|
3452
|
-
return $xeTable.scrollTo(null, scrollTop + rHeight - (bodyHeight -
|
|
3493
|
+
return $xeTable.scrollTo(null, scrollTop + rHeight - (bodyHeight - rightFixedWidth - 1));
|
|
3453
3494
|
}
|
|
3454
3495
|
}
|
|
3455
3496
|
}
|
|
3456
3497
|
return Promise.resolve();
|
|
3457
3498
|
}
|
|
3458
3499
|
function colToVisible($xeTable, column, row) {
|
|
3500
|
+
const reactData = $xeTable;
|
|
3501
|
+
const internalData = $xeTable;
|
|
3459
3502
|
const {
|
|
3460
|
-
|
|
3461
|
-
|
|
3462
|
-
visibleColumn
|
|
3463
|
-
} = $xeTable;
|
|
3464
|
-
const refTableBody = $xeTable.$refs.refTableBody;
|
|
3503
|
+
scrollXLoad
|
|
3504
|
+
} = reactData;
|
|
3465
3505
|
const {
|
|
3466
|
-
|
|
3467
|
-
|
|
3468
|
-
} =
|
|
3469
|
-
const
|
|
3506
|
+
elemStore,
|
|
3507
|
+
visibleColumn
|
|
3508
|
+
} = internalData;
|
|
3509
|
+
const leftFixedWidth = $xeTable.computeLeftFixedWidth;
|
|
3510
|
+
const rightFixedWidth = $xeTable.computeRightFixedWidth;
|
|
3511
|
+
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
3470
3512
|
if (column.fixed) {
|
|
3471
3513
|
return Promise.resolve();
|
|
3472
3514
|
}
|
|
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;
|
|
3515
|
+
if (bodyScrollElem) {
|
|
3516
|
+
const bodyWidth = bodyScrollElem.clientWidth;
|
|
3517
|
+
const bodyScrollLeft = bodyScrollElem.scrollLeft;
|
|
3484
3518
|
let tdElem = null;
|
|
3485
3519
|
if (row) {
|
|
3486
3520
|
const rowid = getRowid($xeTable, row);
|
|
3487
|
-
tdElem =
|
|
3521
|
+
tdElem = bodyScrollElem.querySelector(`[rowid="${rowid}"] .${column.id}`);
|
|
3488
3522
|
}
|
|
3489
3523
|
if (!tdElem) {
|
|
3490
|
-
tdElem =
|
|
3524
|
+
tdElem = bodyScrollElem.querySelector(`.${column.id}`);
|
|
3491
3525
|
}
|
|
3492
3526
|
if (tdElem) {
|
|
3493
3527
|
const tdOffsetParent = tdElem.offsetParent;
|
|
3494
3528
|
const tdOffsetLeft = tdElem.offsetLeft + (tdOffsetParent ? tdOffsetParent.offsetLeft : 0);
|
|
3495
3529
|
const cellWidth = tdElem.clientWidth;
|
|
3496
3530
|
// 检测是否在可视区中
|
|
3497
|
-
if (tdOffsetLeft < bodyScrollLeft +
|
|
3498
|
-
return $xeTable.scrollTo(tdOffsetLeft -
|
|
3499
|
-
} else if (tdOffsetLeft + cellWidth - bodyScrollLeft > bodyWidth -
|
|
3500
|
-
return $xeTable.scrollTo(tdOffsetLeft + cellWidth - (bodyWidth -
|
|
3531
|
+
if (tdOffsetLeft < bodyScrollLeft + leftFixedWidth) {
|
|
3532
|
+
return $xeTable.scrollTo(tdOffsetLeft - leftFixedWidth - 1);
|
|
3533
|
+
} else if (tdOffsetLeft + cellWidth - bodyScrollLeft > bodyWidth - rightFixedWidth) {
|
|
3534
|
+
return $xeTable.scrollTo(tdOffsetLeft + cellWidth - (bodyWidth - rightFixedWidth - 1));
|
|
3501
3535
|
}
|
|
3502
3536
|
} else {
|
|
3503
3537
|
// 检测是否在虚拟渲染可视区中
|
|
@@ -3505,15 +3539,16 @@ function colToVisible($xeTable, column, row) {
|
|
|
3505
3539
|
let scrollLeft = 0;
|
|
3506
3540
|
const cellWidth = column.renderWidth;
|
|
3507
3541
|
for (let i = 0; i < visibleColumn.length; i++) {
|
|
3508
|
-
|
|
3542
|
+
const currCol = visibleColumn[i];
|
|
3543
|
+
if (currCol === column || currCol.id === column.id) {
|
|
3509
3544
|
break;
|
|
3510
3545
|
}
|
|
3511
|
-
scrollLeft +=
|
|
3546
|
+
scrollLeft += currCol.renderWidth;
|
|
3512
3547
|
}
|
|
3513
3548
|
if (scrollLeft < bodyScrollLeft) {
|
|
3514
|
-
return $xeTable.scrollTo(scrollLeft -
|
|
3549
|
+
return $xeTable.scrollTo(scrollLeft - leftFixedWidth - 1);
|
|
3515
3550
|
}
|
|
3516
|
-
return $xeTable.scrollTo(scrollLeft + cellWidth - (bodyWidth -
|
|
3551
|
+
return $xeTable.scrollTo(scrollLeft + cellWidth - (bodyWidth - rightFixedWidth - 1));
|
|
3517
3552
|
}
|
|
3518
3553
|
}
|
|
3519
3554
|
}
|
|
@@ -3757,7 +3792,7 @@ function renderTitleContent(h, params, content) {
|
|
|
3757
3792
|
const ons = {};
|
|
3758
3793
|
if (showTitle || showTooltip || showAllTip) {
|
|
3759
3794
|
ons.mouseenter = evnt => {
|
|
3760
|
-
if (tableReactData.
|
|
3795
|
+
if (tableReactData.isDragResize) {
|
|
3761
3796
|
return;
|
|
3762
3797
|
}
|
|
3763
3798
|
if (showTitle) {
|
|
@@ -3769,7 +3804,7 @@ function renderTitleContent(h, params, content) {
|
|
|
3769
3804
|
}
|
|
3770
3805
|
if (showTooltip || showAllTip) {
|
|
3771
3806
|
ons.mouseleave = evnt => {
|
|
3772
|
-
if (tableReactData.
|
|
3807
|
+
if (tableReactData.isDragResize) {
|
|
3773
3808
|
return;
|
|
3774
3809
|
}
|
|
3775
3810
|
if (showTooltip || showAllTip) {
|
|
@@ -3788,18 +3823,6 @@ function renderTitleContent(h, params, content) {
|
|
|
3788
3823
|
on: ons
|
|
3789
3824
|
}, getSlotVNs(content))];
|
|
3790
3825
|
}
|
|
3791
|
-
function formatFooterLabel(footerFormatter, params) {
|
|
3792
|
-
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(footerFormatter)) {
|
|
3793
|
-
return `${footerFormatter(params)}`;
|
|
3794
|
-
}
|
|
3795
|
-
const isArr = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(footerFormatter);
|
|
3796
|
-
const gFormatOpts = isArr ? cell_formats.get(footerFormatter[0]) : cell_formats.get(footerFormatter);
|
|
3797
|
-
const footerFormatMethod = gFormatOpts ? gFormatOpts.tableFooterCellFormatMethod : null;
|
|
3798
|
-
if (footerFormatMethod) {
|
|
3799
|
-
return `${isArr ? footerFormatMethod(params, ...footerFormatter.slice(1)) : footerFormatMethod(params)}`;
|
|
3800
|
-
}
|
|
3801
|
-
return '';
|
|
3802
|
-
}
|
|
3803
3826
|
function getFooterContent(h, params) {
|
|
3804
3827
|
const {
|
|
3805
3828
|
$table,
|
|
@@ -3818,33 +3841,36 @@ function getFooterContent(h, params) {
|
|
|
3818
3841
|
if (slots && slots.footer) {
|
|
3819
3842
|
return $table.callSlot(slots.footer, params, h);
|
|
3820
3843
|
}
|
|
3844
|
+
let itemValue = '';
|
|
3845
|
+
// 兼容老模式
|
|
3846
|
+
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(items)) {
|
|
3847
|
+
itemValue = items[_columnIndex];
|
|
3848
|
+
} else {
|
|
3849
|
+
itemValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, column.field);
|
|
3850
|
+
}
|
|
3851
|
+
const footParams = Object.assign(params, {
|
|
3852
|
+
itemValue
|
|
3853
|
+
});
|
|
3854
|
+
if (footerFormatter) {
|
|
3855
|
+
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(footerFormatter)) {
|
|
3856
|
+
return `${footerFormatter(footParams)}`;
|
|
3857
|
+
}
|
|
3858
|
+
const isArr = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(footerFormatter);
|
|
3859
|
+
const gFormatOpts = isArr ? cell_formats.get(footerFormatter[0]) : cell_formats.get(footerFormatter);
|
|
3860
|
+
const footerFormatMethod = gFormatOpts ? gFormatOpts.tableFooterCellFormatMethod : null;
|
|
3861
|
+
if (footerFormatMethod) {
|
|
3862
|
+
return `${isArr ? footerFormatMethod(footParams, ...footerFormatter.slice(1)) : footerFormatMethod(footParams)}`;
|
|
3863
|
+
}
|
|
3864
|
+
return '';
|
|
3865
|
+
}
|
|
3821
3866
|
if (renderOpts) {
|
|
3822
3867
|
const compConf = cell_renderer.get(renderOpts.name);
|
|
3823
3868
|
const rtFooter = compConf ? compConf.renderTableFooter || compConf.renderFooter : null;
|
|
3824
3869
|
if (rtFooter) {
|
|
3825
|
-
return getSlotVNs(rtFooter.call($table, h, renderOpts,
|
|
3870
|
+
return getSlotVNs(rtFooter.call($table, h, renderOpts, footParams));
|
|
3826
3871
|
}
|
|
3827
3872
|
}
|
|
3828
|
-
|
|
3829
|
-
// 兼容老模式
|
|
3830
|
-
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(items)) {
|
|
3831
|
-
itemValue = items[_columnIndex];
|
|
3832
|
-
return [footerFormatter ? formatFooterLabel(footerFormatter, {
|
|
3833
|
-
itemValue,
|
|
3834
|
-
column,
|
|
3835
|
-
row,
|
|
3836
|
-
items,
|
|
3837
|
-
_columnIndex
|
|
3838
|
-
}) : formatText(itemValue, 1)];
|
|
3839
|
-
}
|
|
3840
|
-
itemValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, column.field);
|
|
3841
|
-
return [footerFormatter ? formatFooterLabel(footerFormatter, {
|
|
3842
|
-
itemValue,
|
|
3843
|
-
column,
|
|
3844
|
-
row,
|
|
3845
|
-
items,
|
|
3846
|
-
_columnIndex
|
|
3847
|
-
}) : formatText(itemValue, 1)];
|
|
3873
|
+
return [formatText(itemValue, 1)];
|
|
3848
3874
|
}
|
|
3849
3875
|
function getDefaultCellLabel(params) {
|
|
3850
3876
|
const {
|
|
@@ -4017,9 +4043,7 @@ const Cell = {
|
|
|
4017
4043
|
return Cell.renderTreeIcon(h, params, Cell.renderDefaultCell.call(this, h, params));
|
|
4018
4044
|
},
|
|
4019
4045
|
renderDefaultFooter(h, params) {
|
|
4020
|
-
return
|
|
4021
|
-
class: 'vxe-cell--item'
|
|
4022
|
-
}, getFooterContent(h, params))];
|
|
4046
|
+
return getFooterContent(h, params);
|
|
4023
4047
|
},
|
|
4024
4048
|
/**
|
|
4025
4049
|
* 树节点
|
|
@@ -4583,6 +4607,7 @@ const Cell = {
|
|
|
4583
4607
|
const sortOpts = $table.computeSortOpts;
|
|
4584
4608
|
const {
|
|
4585
4609
|
showIcon,
|
|
4610
|
+
allowBtn,
|
|
4586
4611
|
iconLayout,
|
|
4587
4612
|
iconAsc,
|
|
4588
4613
|
iconDesc,
|
|
@@ -4598,12 +4623,12 @@ const Cell = {
|
|
|
4598
4623
|
attrs: {
|
|
4599
4624
|
title: cell_getI18n('vxe.table.sortAsc')
|
|
4600
4625
|
},
|
|
4601
|
-
on: {
|
|
4626
|
+
on: allowBtn ? {
|
|
4602
4627
|
click(evnt) {
|
|
4603
4628
|
evnt.stopPropagation();
|
|
4604
4629
|
$table.triggerSortEvent(evnt, column, 'asc');
|
|
4605
4630
|
}
|
|
4606
|
-
}
|
|
4631
|
+
} : undefined
|
|
4607
4632
|
}), h('i', {
|
|
4608
4633
|
class: ['vxe-sort--desc-btn', iconDesc || cell_getIcon().TABLE_SORT_DESC, {
|
|
4609
4634
|
'sort--active': column.order === 'desc'
|
|
@@ -4611,12 +4636,12 @@ const Cell = {
|
|
|
4611
4636
|
attrs: {
|
|
4612
4637
|
title: cell_getI18n('vxe.table.sortDesc')
|
|
4613
4638
|
},
|
|
4614
|
-
on: {
|
|
4639
|
+
on: allowBtn ? {
|
|
4615
4640
|
click(evnt) {
|
|
4616
4641
|
evnt.stopPropagation();
|
|
4617
4642
|
$table.triggerSortEvent(evnt, column, 'desc');
|
|
4618
4643
|
}
|
|
4619
|
-
}
|
|
4644
|
+
} : undefined
|
|
4620
4645
|
})])];
|
|
4621
4646
|
}
|
|
4622
4647
|
return [];
|
|
@@ -4839,6 +4864,16 @@ const columnProps = {
|
|
|
4839
4864
|
formatter: [Function, Array, String],
|
|
4840
4865
|
// 格式化表尾显示内容
|
|
4841
4866
|
footerFormatter: [Function, Array, String],
|
|
4867
|
+
// 是否显示间距
|
|
4868
|
+
padding: {
|
|
4869
|
+
type: Boolean,
|
|
4870
|
+
default: null
|
|
4871
|
+
},
|
|
4872
|
+
// 垂直对齐方式
|
|
4873
|
+
verticalAlign: {
|
|
4874
|
+
type: String,
|
|
4875
|
+
default: null
|
|
4876
|
+
},
|
|
4842
4877
|
// 是否允许排序
|
|
4843
4878
|
sortable: Boolean,
|
|
4844
4879
|
// 在 v3 中废弃
|
|
@@ -4874,6 +4909,8 @@ const columnProps = {
|
|
|
4874
4909
|
treeNode: Boolean,
|
|
4875
4910
|
// 设置为拖拽排序
|
|
4876
4911
|
dragSort: Boolean,
|
|
4912
|
+
// 设置为行高拖拽
|
|
4913
|
+
rowResize: Boolean,
|
|
4877
4914
|
// 是否可视
|
|
4878
4915
|
visible: {
|
|
4879
4916
|
type: Boolean,
|
|
@@ -5410,6 +5447,7 @@ function updateAfterListIndex($xeTable) {
|
|
|
5410
5447
|
parent: null,
|
|
5411
5448
|
level: 0,
|
|
5412
5449
|
height: 0,
|
|
5450
|
+
resizeHeight: 0,
|
|
5413
5451
|
oTop: 0
|
|
5414
5452
|
};
|
|
5415
5453
|
fullAllDataRowIdData[rowid] = rest;
|
|
@@ -5461,6 +5499,7 @@ function updateAfterDataIndex($xeTable) {
|
|
|
5461
5499
|
parent: null,
|
|
5462
5500
|
level: 0,
|
|
5463
5501
|
height: 0,
|
|
5502
|
+
resizeHeight: 0,
|
|
5464
5503
|
oTop: 0
|
|
5465
5504
|
};
|
|
5466
5505
|
fullAllDataRowIdData[rowid] = rest;
|
|
@@ -5524,7 +5563,6 @@ function updateStyle($xeTable) {
|
|
|
5524
5563
|
const internalData = $xeTable;
|
|
5525
5564
|
const {
|
|
5526
5565
|
border,
|
|
5527
|
-
showOverflow: allColumnOverflow,
|
|
5528
5566
|
showHeaderOverflow: allColumnHeaderOverflow,
|
|
5529
5567
|
showFooterOverflow: allColumnFooterOverflow,
|
|
5530
5568
|
mouseConfig,
|
|
@@ -5537,7 +5575,9 @@ function updateStyle($xeTable) {
|
|
|
5537
5575
|
tableColumn,
|
|
5538
5576
|
scrollXLoad,
|
|
5539
5577
|
scrollYLoad,
|
|
5578
|
+
overflowX,
|
|
5540
5579
|
scrollbarWidth,
|
|
5580
|
+
overflowY,
|
|
5541
5581
|
scrollbarHeight,
|
|
5542
5582
|
columnStore,
|
|
5543
5583
|
editStore,
|
|
@@ -5561,6 +5601,8 @@ function updateStyle($xeTable) {
|
|
|
5561
5601
|
return;
|
|
5562
5602
|
}
|
|
5563
5603
|
const containerList = ['main', 'left', 'right'];
|
|
5604
|
+
const osbWidth = overflowY ? scrollbarWidth : 0;
|
|
5605
|
+
const osbHeight = overflowX ? scrollbarHeight : 0;
|
|
5564
5606
|
const emptyPlaceholderElem = $xeTable.$refs.refEmptyPlaceholder;
|
|
5565
5607
|
const cellOffsetWidth = $xeTable.computeCellOffsetWidth;
|
|
5566
5608
|
const mouseOpts = $xeTable.computeMouseOpts;
|
|
@@ -5568,16 +5610,16 @@ function updateStyle($xeTable) {
|
|
|
5568
5610
|
const bodyTableElem = getRefElem(elemStore['main-body-table']);
|
|
5569
5611
|
if (emptyPlaceholderElem) {
|
|
5570
5612
|
emptyPlaceholderElem.style.top = `${headerHeight}px`;
|
|
5571
|
-
emptyPlaceholderElem.style.height = bodyWrapperElem ? `${bodyWrapperElem.offsetHeight -
|
|
5613
|
+
emptyPlaceholderElem.style.height = bodyWrapperElem ? `${bodyWrapperElem.offsetHeight - osbHeight}px` : '';
|
|
5572
5614
|
}
|
|
5573
5615
|
let bodyHeight = 0;
|
|
5574
5616
|
let bodyMaxHeight = 0;
|
|
5575
|
-
const bodyMinHeight = customMinHeight - headerHeight - footerHeight -
|
|
5617
|
+
const bodyMinHeight = customMinHeight - headerHeight - footerHeight - osbHeight;
|
|
5576
5618
|
if (customMaxHeight) {
|
|
5577
|
-
bodyMaxHeight = Math.max(bodyMinHeight, customMaxHeight - headerHeight - footerHeight -
|
|
5619
|
+
bodyMaxHeight = Math.max(bodyMinHeight, customMaxHeight - headerHeight - footerHeight - osbHeight);
|
|
5578
5620
|
}
|
|
5579
5621
|
if (customHeight) {
|
|
5580
|
-
bodyHeight = customHeight - headerHeight - footerHeight -
|
|
5622
|
+
bodyHeight = customHeight - headerHeight - footerHeight - osbHeight;
|
|
5581
5623
|
}
|
|
5582
5624
|
if (!bodyHeight) {
|
|
5583
5625
|
if (bodyTableElem) {
|
|
@@ -5595,27 +5637,27 @@ function updateStyle($xeTable) {
|
|
|
5595
5637
|
const scrollbarXToTop = $xeTable.computeScrollbarXToTop;
|
|
5596
5638
|
const scrollXVirtualEl = $xeTable.$refs.refScrollXVirtualElem;
|
|
5597
5639
|
if (scrollXVirtualEl) {
|
|
5598
|
-
scrollXVirtualEl.style.height = `${
|
|
5599
|
-
scrollXVirtualEl.style.visibility =
|
|
5640
|
+
scrollXVirtualEl.style.height = `${osbHeight}px`;
|
|
5641
|
+
scrollXVirtualEl.style.visibility = overflowX ? 'visible' : 'hidden';
|
|
5600
5642
|
}
|
|
5601
5643
|
const xWrapperEl = $xeTable.$refs.refScrollXWrapperElem;
|
|
5602
5644
|
if (xWrapperEl) {
|
|
5603
|
-
xWrapperEl.style.left = scrollbarXToTop ? `${
|
|
5604
|
-
xWrapperEl.style.width = `${el.clientWidth -
|
|
5645
|
+
xWrapperEl.style.left = scrollbarXToTop ? `${osbWidth}px` : '';
|
|
5646
|
+
xWrapperEl.style.width = `${el.clientWidth - osbWidth}px`;
|
|
5605
5647
|
}
|
|
5606
5648
|
if (xLeftCornerEl) {
|
|
5607
|
-
xLeftCornerEl.style.width = scrollbarXToTop ? `${
|
|
5608
|
-
xLeftCornerEl.style.display = scrollbarXToTop ?
|
|
5649
|
+
xLeftCornerEl.style.width = scrollbarXToTop ? `${osbWidth}px` : '';
|
|
5650
|
+
xLeftCornerEl.style.display = scrollbarXToTop ? osbWidth && osbHeight ? 'block' : '' : '';
|
|
5609
5651
|
}
|
|
5610
5652
|
if (xRightCornerEl) {
|
|
5611
|
-
xRightCornerEl.style.width = scrollbarXToTop ? '' : `${
|
|
5612
|
-
xRightCornerEl.style.display = scrollbarXToTop ? '' :
|
|
5653
|
+
xRightCornerEl.style.width = scrollbarXToTop ? '' : `${osbWidth}px`;
|
|
5654
|
+
xRightCornerEl.style.display = scrollbarXToTop ? '' : osbWidth && osbHeight ? 'block' : '';
|
|
5613
5655
|
}
|
|
5614
5656
|
const scrollYVirtualEl = $xeTable.$refs.refScrollYVirtualElem;
|
|
5615
5657
|
if (scrollYVirtualEl) {
|
|
5616
|
-
scrollYVirtualEl.style.width = `${
|
|
5658
|
+
scrollYVirtualEl.style.width = `${osbWidth}px`;
|
|
5617
5659
|
scrollYVirtualEl.style.height = `${bodyHeight + headerHeight + footerHeight}px`;
|
|
5618
|
-
scrollYVirtualEl.style.visibility =
|
|
5660
|
+
scrollYVirtualEl.style.visibility = overflowY ? 'visible' : 'hidden';
|
|
5619
5661
|
}
|
|
5620
5662
|
const yTopCornerEl = $xeTable.$refs.refScrollYTopCornerElem;
|
|
5621
5663
|
if (yTopCornerEl) {
|
|
@@ -5734,14 +5776,14 @@ function updateStyle($xeTable) {
|
|
|
5734
5776
|
if (wrapperElem) {
|
|
5735
5777
|
wrapperElem.style.top = `${headerHeight}px`;
|
|
5736
5778
|
}
|
|
5737
|
-
fixedWrapperElem.style.height = `${customHeight > 0 ? customHeight : tableHeight + headerHeight + footerHeight +
|
|
5779
|
+
fixedWrapperElem.style.height = `${customHeight > 0 ? customHeight : tableHeight + headerHeight + footerHeight + osbHeight}px`;
|
|
5738
5780
|
fixedWrapperElem.style.width = `${fixedColumn.reduce((previous, column) => previous + column.renderWidth, 0)}px`;
|
|
5739
5781
|
}
|
|
5740
5782
|
let tWidth = tableWidth;
|
|
5741
5783
|
let renderColumnList = tableColumn;
|
|
5742
5784
|
let isOptimizeMode = false;
|
|
5743
5785
|
// 如果是使用优化模式
|
|
5744
|
-
if (scrollXLoad || scrollYLoad ||
|
|
5786
|
+
if (scrollXLoad || scrollYLoad || isAllOverflow) {
|
|
5745
5787
|
if (expandColumn || spanMethod || footerSpanMethod) {
|
|
5746
5788
|
// 如果不支持优化模式
|
|
5747
5789
|
} else {
|
|
@@ -5763,7 +5805,7 @@ function updateStyle($xeTable) {
|
|
|
5763
5805
|
if (tableElem) {
|
|
5764
5806
|
tableElem.style.width = tWidth ? `${tWidth}px` : '';
|
|
5765
5807
|
// 兼容性处理
|
|
5766
|
-
tableElem.style.paddingRight =
|
|
5808
|
+
tableElem.style.paddingRight = osbWidth && fixedType && (browse['-moz'] || browse.safari) ? `${osbWidth}px` : '';
|
|
5767
5809
|
}
|
|
5768
5810
|
const emptyBlockElem = getRefElem(elemStore[`${name}-${layout}-emptyBlock`]);
|
|
5769
5811
|
if (emptyBlockElem) {
|
|
@@ -5798,7 +5840,7 @@ function updateStyle($xeTable) {
|
|
|
5798
5840
|
// 如果是固定列
|
|
5799
5841
|
if (fixedWrapperElem) {
|
|
5800
5842
|
if (wrapperElem) {
|
|
5801
|
-
wrapperElem.style.top = `${customHeight > 0 ? customHeight - footerHeight -
|
|
5843
|
+
wrapperElem.style.top = `${customHeight > 0 ? customHeight - footerHeight - osbHeight : tableHeight + headerHeight}px`;
|
|
5802
5844
|
}
|
|
5803
5845
|
}
|
|
5804
5846
|
}
|
|
@@ -5825,7 +5867,7 @@ function updateStyle($xeTable) {
|
|
|
5825
5867
|
} else if (layout === 'footer') {
|
|
5826
5868
|
cellOverflow = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isUndefined(showFooterOverflow) || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNull(showFooterOverflow) ? allColumnFooterOverflow : showFooterOverflow;
|
|
5827
5869
|
} else {
|
|
5828
|
-
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) ?
|
|
5870
|
+
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) ? isAllOverflow : showOverflow;
|
|
5829
5871
|
}
|
|
5830
5872
|
const showEllipsis = cellOverflow === 'ellipsis';
|
|
5831
5873
|
const showTitle = cellOverflow === 'title';
|
|
@@ -5869,62 +5911,69 @@ function updateStyle($xeTable) {
|
|
|
5869
5911
|
return $xeTable.$nextTick();
|
|
5870
5912
|
}
|
|
5871
5913
|
function computeRowHeight($xeTable) {
|
|
5914
|
+
const reactData = $xeTable;
|
|
5915
|
+
const {
|
|
5916
|
+
isAllOverflow
|
|
5917
|
+
} = reactData;
|
|
5872
5918
|
const tableHeader = $xeTable.$refs.refTableHeader;
|
|
5873
5919
|
const tableBody = $xeTable.$refs.refTableBody;
|
|
5874
5920
|
const tableBodyElem = tableBody ? tableBody.$el : null;
|
|
5875
5921
|
const defaultRowHeight = $xeTable.computeDefaultRowHeight;
|
|
5876
5922
|
let rowHeight = 0;
|
|
5877
|
-
if (
|
|
5878
|
-
|
|
5879
|
-
|
|
5880
|
-
|
|
5881
|
-
|
|
5882
|
-
firstTrElem
|
|
5923
|
+
if (isAllOverflow) {
|
|
5924
|
+
if (tableBodyElem) {
|
|
5925
|
+
const tableHeaderElem = tableHeader ? tableHeader.$el : null;
|
|
5926
|
+
let firstTrElem;
|
|
5927
|
+
firstTrElem = tableBodyElem.querySelector('tr');
|
|
5928
|
+
if (!firstTrElem && tableHeaderElem) {
|
|
5929
|
+
firstTrElem = tableHeaderElem.querySelector('tr');
|
|
5930
|
+
}
|
|
5931
|
+
if (firstTrElem) {
|
|
5932
|
+
rowHeight = firstTrElem.clientHeight;
|
|
5933
|
+
}
|
|
5883
5934
|
}
|
|
5884
|
-
if (
|
|
5885
|
-
rowHeight =
|
|
5935
|
+
if (!rowHeight) {
|
|
5936
|
+
rowHeight = defaultRowHeight;
|
|
5886
5937
|
}
|
|
5887
|
-
}
|
|
5888
|
-
if (!rowHeight) {
|
|
5938
|
+
} else {
|
|
5889
5939
|
rowHeight = defaultRowHeight;
|
|
5890
5940
|
}
|
|
5891
5941
|
// 最低支持 18px 行高
|
|
5892
5942
|
return Math.max(18, rowHeight);
|
|
5893
5943
|
}
|
|
5894
|
-
function handleVirtualYVisible($xeTable) {
|
|
5895
|
-
const props = $xeTable;
|
|
5944
|
+
function handleVirtualYVisible($xeTable, currScrollTop) {
|
|
5896
5945
|
const reactData = $xeTable;
|
|
5897
5946
|
const internalData = $xeTable;
|
|
5898
5947
|
const {
|
|
5899
|
-
|
|
5900
|
-
} = props;
|
|
5901
|
-
const {
|
|
5902
|
-
rowHeight
|
|
5948
|
+
isAllOverflow
|
|
5903
5949
|
} = reactData;
|
|
5904
5950
|
const {
|
|
5905
5951
|
elemStore,
|
|
5952
|
+
isResizeCellHeight,
|
|
5906
5953
|
afterFullData,
|
|
5907
5954
|
fullAllDataRowIdData
|
|
5908
5955
|
} = internalData;
|
|
5956
|
+
const rowOpts = $xeTable.computeRowOpts;
|
|
5957
|
+
const cellOpts = $xeTable.computeCellOpts;
|
|
5958
|
+
const defaultRowHeight = $xeTable.computeDefaultRowHeight;
|
|
5909
5959
|
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
5910
5960
|
if (bodyScrollElem) {
|
|
5911
|
-
const
|
|
5912
|
-
|
|
5913
|
-
clientHeight
|
|
5914
|
-
} = bodyScrollElem;
|
|
5961
|
+
const clientHeight = bodyScrollElem.clientHeight;
|
|
5962
|
+
const scrollTop = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(currScrollTop) ? currScrollTop : bodyScrollElem.scrollTop;
|
|
5915
5963
|
const endHeight = scrollTop + clientHeight;
|
|
5916
5964
|
let toVisibleIndex = -1;
|
|
5917
5965
|
let offsetTop = 0;
|
|
5918
5966
|
let visibleSize = 0;
|
|
5919
|
-
|
|
5920
|
-
|
|
5921
|
-
|
|
5967
|
+
const isCustomCellHeight = isResizeCellHeight || cellOpts.height || rowOpts.height;
|
|
5968
|
+
if (!isCustomCellHeight && isAllOverflow) {
|
|
5969
|
+
toVisibleIndex = Math.floor(scrollTop / defaultRowHeight);
|
|
5970
|
+
visibleSize = Math.ceil(clientHeight / defaultRowHeight) + 1;
|
|
5922
5971
|
} else {
|
|
5923
5972
|
for (let rIndex = 0, rLen = afterFullData.length; rIndex < rLen; rIndex++) {
|
|
5924
5973
|
const row = afterFullData[rIndex];
|
|
5925
5974
|
const rowid = getRowid($xeTable, row);
|
|
5926
|
-
const rowRest = fullAllDataRowIdData[rowid];
|
|
5927
|
-
offsetTop += rowRest
|
|
5975
|
+
const rowRest = fullAllDataRowIdData[rowid] || {};
|
|
5976
|
+
offsetTop += rowRest.resizeHeight || rowRest.height || cellOpts.height || rowOpts.height || defaultRowHeight;
|
|
5928
5977
|
if (toVisibleIndex === -1 && scrollTop < offsetTop) {
|
|
5929
5978
|
toVisibleIndex = rIndex;
|
|
5930
5979
|
}
|
|
@@ -6212,7 +6261,7 @@ function autoCellWidth($xeTable) {
|
|
|
6212
6261
|
}
|
|
6213
6262
|
const tableHeight = bodyElem.offsetHeight;
|
|
6214
6263
|
const overflowY = yHandleEl.scrollHeight > yHandleEl.clientHeight;
|
|
6215
|
-
reactData.scrollbarWidth =
|
|
6264
|
+
reactData.scrollbarWidth = Math.max(scrollbarOpts.width || 0, yHandleEl.offsetWidth - yHandleEl.clientWidth);
|
|
6216
6265
|
reactData.overflowY = overflowY;
|
|
6217
6266
|
internalData.tableWidth = tableWidth;
|
|
6218
6267
|
internalData.tableHeight = tableHeight;
|
|
@@ -6221,7 +6270,7 @@ function autoCellWidth($xeTable) {
|
|
|
6221
6270
|
const headerHeight = headerTableElem ? headerTableElem.clientHeight : 0;
|
|
6222
6271
|
const overflowX = tableWidth > bodyWidth;
|
|
6223
6272
|
const footerHeight = footerTableElem ? footerTableElem.clientHeight : 0;
|
|
6224
|
-
reactData.scrollbarHeight =
|
|
6273
|
+
reactData.scrollbarHeight = Math.max(scrollbarOpts.height || 0, xHandleEl.offsetHeight - xHandleEl.clientHeight);
|
|
6225
6274
|
internalData.headerHeight = headerHeight;
|
|
6226
6275
|
internalData.footerHeight = footerHeight;
|
|
6227
6276
|
reactData.overflowX = overflowX;
|
|
@@ -6231,68 +6280,43 @@ function autoCellWidth($xeTable) {
|
|
|
6231
6280
|
$xeTable.checkScrolling();
|
|
6232
6281
|
}
|
|
6233
6282
|
}
|
|
6234
|
-
|
|
6235
|
-
|
|
6236
|
-
|
|
6237
|
-
|
|
6238
|
-
|
|
6239
|
-
|
|
6240
|
-
|
|
6241
|
-
|
|
6242
|
-
|
|
6243
|
-
|
|
6244
|
-
|
|
6245
|
-
|
|
6246
|
-
// }, 80)
|
|
6247
|
-
// }
|
|
6283
|
+
const calcCellAutoHeight = (rowRest, wrapperEl) => {
|
|
6284
|
+
const cellElemList = wrapperEl.querySelectorAll(`.vxe-cell--wrapper[rowid="${rowRest.rowid}"]`);
|
|
6285
|
+
let colHeight = rowRest.height;
|
|
6286
|
+
for (let i = 0; i < cellElemList.length; i++) {
|
|
6287
|
+
const cellElem = cellElemList[i];
|
|
6288
|
+
const tdEl = cellElem.parentElement;
|
|
6289
|
+
const topBottomPadding = Math.ceil(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(tdEl.style.paddingTop) + external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(tdEl.style.paddingBottom));
|
|
6290
|
+
const cellHeight = cellElem ? cellElem.clientHeight : 0;
|
|
6291
|
+
colHeight = Math.max(colHeight - topBottomPadding, Math.ceil(cellHeight));
|
|
6292
|
+
}
|
|
6293
|
+
return colHeight;
|
|
6294
|
+
};
|
|
6248
6295
|
const calcCellHeight = $xeTable => {
|
|
6249
|
-
const props = $xeTable;
|
|
6250
6296
|
const reactData = $xeTable;
|
|
6251
6297
|
const internalData = $xeTable;
|
|
6252
|
-
const {
|
|
6253
|
-
showOverflow
|
|
6254
|
-
} = props;
|
|
6255
6298
|
const {
|
|
6256
6299
|
tableData,
|
|
6300
|
+
isAllOverflow,
|
|
6301
|
+
scrollYLoad,
|
|
6257
6302
|
scrollXLoad
|
|
6258
6303
|
} = reactData;
|
|
6259
6304
|
const {
|
|
6260
6305
|
fullAllDataRowIdData
|
|
6261
6306
|
} = internalData;
|
|
6307
|
+
const defaultRowHeight = $xeTable.computeDefaultRowHeight;
|
|
6262
6308
|
const el = $xeTable.$refs.refElem;
|
|
6263
|
-
if (!
|
|
6264
|
-
let paddingTop = 0;
|
|
6265
|
-
let paddingBottom = 0;
|
|
6266
|
-
let calcPadding = false;
|
|
6309
|
+
if (!isAllOverflow && scrollYLoad && el) {
|
|
6267
6310
|
tableData.forEach(row => {
|
|
6268
6311
|
const rowid = getRowid($xeTable, row);
|
|
6269
6312
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
6270
|
-
|
|
6271
|
-
|
|
6272
|
-
|
|
6273
|
-
for (let i = 0; i < cellList.length; i++) {
|
|
6274
|
-
const cellElem = cellList[i];
|
|
6275
|
-
const tdEl = cellElem.parentElement;
|
|
6276
|
-
if (!tdEl || !tdEl.clientWidth) {
|
|
6277
|
-
break;
|
|
6278
|
-
}
|
|
6279
|
-
if (!calcPadding) {
|
|
6280
|
-
paddingTop = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(getComputedStyle(tdEl).paddingTop);
|
|
6281
|
-
paddingBottom = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(getComputedStyle(tdEl).paddingBottom);
|
|
6282
|
-
calcPadding = true;
|
|
6283
|
-
}
|
|
6284
|
-
let cellHeight = paddingTop + paddingBottom;
|
|
6285
|
-
if (cellElem) {
|
|
6286
|
-
cellHeight += cellElem.clientHeight;
|
|
6287
|
-
}
|
|
6288
|
-
height = Math.max(height, cellHeight);
|
|
6289
|
-
}
|
|
6290
|
-
rowRest.height = scrollXLoad ? Math.max(rowRest.height, height) : height;
|
|
6313
|
+
if (rowRest) {
|
|
6314
|
+
const height = calcCellAutoHeight(rowRest, el);
|
|
6315
|
+
rowRest.height = Math.max(defaultRowHeight, scrollXLoad ? Math.max(rowRest.height, height) : height);
|
|
6291
6316
|
}
|
|
6292
6317
|
});
|
|
6293
|
-
reactData.
|
|
6318
|
+
reactData.calcCellHeightFlag++;
|
|
6294
6319
|
}
|
|
6295
|
-
// updateCellOffset()
|
|
6296
6320
|
};
|
|
6297
6321
|
function getOrderField(_vm, column) {
|
|
6298
6322
|
const {
|
|
@@ -6319,6 +6343,18 @@ function getOrderField(_vm, column) {
|
|
|
6319
6343
|
return cellValue;
|
|
6320
6344
|
};
|
|
6321
6345
|
}
|
|
6346
|
+
function handleTargetEnterEvent($xeTable, isClear) {
|
|
6347
|
+
const internalData = $xeTable;
|
|
6348
|
+
const $tooltip = $xeTable.$refs.refTooltip;
|
|
6349
|
+
clearTimeout(internalData.tooltipTimeout);
|
|
6350
|
+
if (isClear) {
|
|
6351
|
+
$xeTable.closeTooltip();
|
|
6352
|
+
} else {
|
|
6353
|
+
if ($tooltip && $tooltip.setActived) {
|
|
6354
|
+
$tooltip.setActived(true);
|
|
6355
|
+
}
|
|
6356
|
+
}
|
|
6357
|
+
}
|
|
6322
6358
|
function clearDragStatus($xeTable) {
|
|
6323
6359
|
const reactData = $xeTable;
|
|
6324
6360
|
const {
|
|
@@ -6429,13 +6465,17 @@ function showDropTip($xeTable, evnt, trEl, thEl, showLine, dragPos) {
|
|
|
6429
6465
|
return;
|
|
6430
6466
|
}
|
|
6431
6467
|
const {
|
|
6468
|
+
overflowX,
|
|
6432
6469
|
scrollbarWidth,
|
|
6470
|
+
overflowY,
|
|
6433
6471
|
scrollbarHeight
|
|
6434
6472
|
} = reactData;
|
|
6435
6473
|
const {
|
|
6436
6474
|
prevDragToChild
|
|
6437
6475
|
} = internalData;
|
|
6438
6476
|
const wrapperRect = el.getBoundingClientRect();
|
|
6477
|
+
const osbWidth = overflowY ? scrollbarWidth : 0;
|
|
6478
|
+
const osbHeight = overflowX ? scrollbarHeight : 0;
|
|
6439
6479
|
const tableWidth = el.clientWidth;
|
|
6440
6480
|
const tableHeight = el.clientHeight;
|
|
6441
6481
|
if (trEl) {
|
|
@@ -6446,14 +6486,14 @@ function showDropTip($xeTable, evnt, trEl, thEl, showLine, dragPos) {
|
|
|
6446
6486
|
const trRect = trEl.getBoundingClientRect();
|
|
6447
6487
|
let trHeight = trEl.clientHeight;
|
|
6448
6488
|
const offsetTop = Math.max(1, trRect.y - wrapperRect.y);
|
|
6449
|
-
if (offsetTop + trHeight > tableHeight -
|
|
6450
|
-
trHeight = tableHeight - offsetTop -
|
|
6489
|
+
if (offsetTop + trHeight > tableHeight - osbHeight) {
|
|
6490
|
+
trHeight = tableHeight - offsetTop - osbHeight;
|
|
6451
6491
|
}
|
|
6452
6492
|
rdLineEl.style.display = 'block';
|
|
6453
|
-
rdLineEl.style.left = `${scrollbarYToLeft ?
|
|
6493
|
+
rdLineEl.style.left = `${scrollbarYToLeft ? osbWidth : 0}px`;
|
|
6454
6494
|
rdLineEl.style.top = `${offsetTop}px`;
|
|
6455
6495
|
rdLineEl.style.height = `${trHeight}px`;
|
|
6456
|
-
rdLineEl.style.width = `${tableWidth -
|
|
6496
|
+
rdLineEl.style.width = `${tableWidth - osbWidth}px`;
|
|
6457
6497
|
rdLineEl.setAttribute('drag-pos', dragPos);
|
|
6458
6498
|
rdLineEl.setAttribute('drag-to-child', prevDragToChild ? 'y' : 'n');
|
|
6459
6499
|
} else {
|
|
@@ -6478,7 +6518,7 @@ function showDropTip($xeTable, evnt, trEl, thEl, showLine, dragPos) {
|
|
|
6478
6518
|
thWidth -= startX - offsetLeft;
|
|
6479
6519
|
offsetLeft = startX;
|
|
6480
6520
|
}
|
|
6481
|
-
const endX = tableWidth - rightContainerWidth - (rightContainerWidth ? 0 :
|
|
6521
|
+
const endX = tableWidth - rightContainerWidth - (rightContainerWidth ? 0 : osbWidth);
|
|
6482
6522
|
if (offsetLeft + thWidth > endX) {
|
|
6483
6523
|
thWidth = endX - offsetLeft;
|
|
6484
6524
|
}
|
|
@@ -6489,7 +6529,7 @@ function showDropTip($xeTable, evnt, trEl, thEl, showLine, dragPos) {
|
|
|
6489
6529
|
if (prevDragToChild) {
|
|
6490
6530
|
cdLineEl.style.height = `${thRect.height}px`;
|
|
6491
6531
|
} else {
|
|
6492
|
-
cdLineEl.style.height = `${tableHeight - offsetTop - (scrollbarXToTop ? 0 :
|
|
6532
|
+
cdLineEl.style.height = `${tableHeight - offsetTop - (scrollbarXToTop ? 0 : osbHeight)}px`;
|
|
6493
6533
|
}
|
|
6494
6534
|
cdLineEl.setAttribute('drag-pos', dragPos);
|
|
6495
6535
|
cdLineEl.setAttribute('drag-to-child', prevDragToChild ? 'y' : 'n');
|
|
@@ -6520,6 +6560,49 @@ function hideDropTip($xeTable) {
|
|
|
6520
6560
|
cdLineEl.style.display = '';
|
|
6521
6561
|
}
|
|
6522
6562
|
}
|
|
6563
|
+
/**
|
|
6564
|
+
* 处理显示 tooltip
|
|
6565
|
+
* @param {Event} evnt 事件
|
|
6566
|
+
* @param {Row} row 行对象
|
|
6567
|
+
*/
|
|
6568
|
+
function handleTooltip($xeTable, evnt, tdEl, overflowElem, tipElem, params) {
|
|
6569
|
+
const reactData = $xeTable;
|
|
6570
|
+
if (!overflowElem) {
|
|
6571
|
+
return $xeTable.$nextTick();
|
|
6572
|
+
}
|
|
6573
|
+
params.cell = tdEl;
|
|
6574
|
+
const {
|
|
6575
|
+
tooltipStore
|
|
6576
|
+
} = reactData;
|
|
6577
|
+
const tooltipOpts = $xeTable.computeTooltipOpts;
|
|
6578
|
+
const {
|
|
6579
|
+
column,
|
|
6580
|
+
row
|
|
6581
|
+
} = params;
|
|
6582
|
+
const {
|
|
6583
|
+
showAll,
|
|
6584
|
+
contentMethod
|
|
6585
|
+
} = tooltipOpts;
|
|
6586
|
+
const customContent = contentMethod ? contentMethod(params) : null;
|
|
6587
|
+
const useCustom = contentMethod && !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(customContent);
|
|
6588
|
+
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();
|
|
6589
|
+
const isCellOverflow = overflowElem.scrollWidth > overflowElem.clientWidth;
|
|
6590
|
+
if (content && (showAll || useCustom || isCellOverflow)) {
|
|
6591
|
+
Object.assign(tooltipStore, {
|
|
6592
|
+
row,
|
|
6593
|
+
column,
|
|
6594
|
+
visible: true,
|
|
6595
|
+
currOpts: {}
|
|
6596
|
+
});
|
|
6597
|
+
$xeTable.$nextTick(() => {
|
|
6598
|
+
const $tooltip = $xeTable.$refs.refTooltip;
|
|
6599
|
+
if ($tooltip && $tooltip.open) {
|
|
6600
|
+
$tooltip.open(isCellOverflow ? overflowElem : tipElem || overflowElem, formatText(content));
|
|
6601
|
+
}
|
|
6602
|
+
});
|
|
6603
|
+
}
|
|
6604
|
+
return $xeTable.$nextTick();
|
|
6605
|
+
}
|
|
6523
6606
|
function handleScrollToRowColumn($xeTable, fieldOrColumn, row) {
|
|
6524
6607
|
const internalData = $xeTable;
|
|
6525
6608
|
const {
|
|
@@ -6544,16 +6627,16 @@ function computeScrollLoad($xeTable) {
|
|
|
6544
6627
|
scrollXStore,
|
|
6545
6628
|
scrollYStore
|
|
6546
6629
|
} = internalData;
|
|
6547
|
-
const
|
|
6548
|
-
const
|
|
6630
|
+
const virtualYOpts = $xeTable.computeVirtualYOpts;
|
|
6631
|
+
const virtualXOpts = $xeTable.computeVirtualXOpts;
|
|
6549
6632
|
// 计算 X 逻辑
|
|
6550
6633
|
if (scrollXLoad) {
|
|
6551
6634
|
const {
|
|
6552
6635
|
toVisibleIndex: toXVisibleIndex,
|
|
6553
6636
|
visibleSize: visibleXSize
|
|
6554
6637
|
} = handleVirtualXVisible($xeTable);
|
|
6555
|
-
const offsetXSize = Math.max(0,
|
|
6556
|
-
scrollXStore.preloadSize =
|
|
6638
|
+
const offsetXSize = Math.max(0, virtualXOpts.oSize ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(virtualXOpts.oSize) : 0);
|
|
6639
|
+
scrollXStore.preloadSize = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(virtualXOpts.preSize);
|
|
6557
6640
|
scrollXStore.offsetSize = offsetXSize;
|
|
6558
6641
|
scrollXStore.visibleSize = visibleXSize;
|
|
6559
6642
|
scrollXStore.endIndex = Math.max(scrollXStore.startIndex + scrollXStore.visibleSize + offsetXSize, scrollXStore.endIndex);
|
|
@@ -6565,7 +6648,6 @@ function computeScrollLoad($xeTable) {
|
|
|
6565
6648
|
} else {
|
|
6566
6649
|
$xeTable.updateScrollXSpace();
|
|
6567
6650
|
}
|
|
6568
|
-
calcCellHeight($xeTable);
|
|
6569
6651
|
// 计算 Y 逻辑
|
|
6570
6652
|
const rowHeight = computeRowHeight($xeTable);
|
|
6571
6653
|
scrollYStore.rowHeight = rowHeight;
|
|
@@ -6575,8 +6657,8 @@ function computeScrollLoad($xeTable) {
|
|
|
6575
6657
|
visibleSize: visibleYSize
|
|
6576
6658
|
} = handleVirtualYVisible($xeTable);
|
|
6577
6659
|
if (scrollYLoad) {
|
|
6578
|
-
const offsetYSize = Math.max(0,
|
|
6579
|
-
scrollYStore.preloadSize =
|
|
6660
|
+
const offsetYSize = Math.max(0, virtualYOpts.oSize ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(virtualYOpts.oSize) : 0);
|
|
6661
|
+
scrollYStore.preloadSize = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(virtualYOpts.preSize);
|
|
6580
6662
|
scrollYStore.offsetSize = offsetYSize;
|
|
6581
6663
|
scrollYStore.visibleSize = visibleYSize;
|
|
6582
6664
|
scrollYStore.endIndex = Math.max(scrollYStore.startIndex + visibleYSize + offsetYSize, scrollYStore.endIndex);
|
|
@@ -6852,11 +6934,10 @@ function handleColumn($xeTable, collectColumn) {
|
|
|
6852
6934
|
internalData.collectColumn = collectColumn;
|
|
6853
6935
|
const tableFullColumn = getColumnList(collectColumn);
|
|
6854
6936
|
internalData.tableFullColumn = tableFullColumn;
|
|
6855
|
-
reactData.
|
|
6937
|
+
reactData.isColLoading = true;
|
|
6856
6938
|
reactData.isDragColMove = false;
|
|
6857
6939
|
initColumnSort($xeTable);
|
|
6858
6940
|
return Promise.resolve(restoreCustomStorage($xeTable)).then(() => {
|
|
6859
|
-
reactData.isLoading = false;
|
|
6860
6941
|
cacheColumnMap($xeTable);
|
|
6861
6942
|
parseColumns($xeTable, true).then(() => {
|
|
6862
6943
|
if (reactData.scrollXLoad) {
|
|
@@ -6881,6 +6962,7 @@ function handleColumn($xeTable, collectColumn) {
|
|
|
6881
6962
|
if ($xeTable.handleUpdateCustomColumn) {
|
|
6882
6963
|
$xeTable.handleUpdateCustomColumn();
|
|
6883
6964
|
}
|
|
6965
|
+
reactData.isColLoading = false;
|
|
6884
6966
|
return $xeTable.recalculate();
|
|
6885
6967
|
});
|
|
6886
6968
|
});
|
|
@@ -6888,15 +6970,12 @@ function handleColumn($xeTable, collectColumn) {
|
|
|
6888
6970
|
/**
|
|
6889
6971
|
* 纵向 Y 可视渲染处理
|
|
6890
6972
|
*/
|
|
6891
|
-
function loadScrollYData($xeTable) {
|
|
6892
|
-
const props = $xeTable;
|
|
6973
|
+
function loadScrollYData($xeTable, scrollTop) {
|
|
6893
6974
|
const reactData = $xeTable;
|
|
6894
6975
|
const internalData = $xeTable;
|
|
6895
6976
|
const {
|
|
6896
|
-
|
|
6897
|
-
|
|
6898
|
-
const {
|
|
6899
|
-
mergeList
|
|
6977
|
+
mergeList,
|
|
6978
|
+
isAllOverflow
|
|
6900
6979
|
} = reactData;
|
|
6901
6980
|
const {
|
|
6902
6981
|
scrollYStore
|
|
@@ -6907,11 +6986,11 @@ function loadScrollYData($xeTable) {
|
|
|
6907
6986
|
endIndex,
|
|
6908
6987
|
offsetSize
|
|
6909
6988
|
} = scrollYStore;
|
|
6910
|
-
const autoOffsetYSize =
|
|
6989
|
+
const autoOffsetYSize = isAllOverflow ? offsetSize : offsetSize + 1;
|
|
6911
6990
|
const {
|
|
6912
6991
|
toVisibleIndex,
|
|
6913
6992
|
visibleSize
|
|
6914
|
-
} = handleVirtualYVisible($xeTable);
|
|
6993
|
+
} = handleVirtualYVisible($xeTable, scrollTop);
|
|
6915
6994
|
const offsetItem = {
|
|
6916
6995
|
startIndex: Math.max(0, toVisibleIndex - 1 - offsetSize - preloadSize),
|
|
6917
6996
|
endIndex: toVisibleIndex + visibleSize + autoOffsetYSize + preloadSize
|
|
@@ -6931,6 +7010,54 @@ function loadScrollYData($xeTable) {
|
|
|
6931
7010
|
}
|
|
6932
7011
|
}
|
|
6933
7012
|
}
|
|
7013
|
+
function lazyScrollXData($xeTable) {
|
|
7014
|
+
const internalData = $xeTable;
|
|
7015
|
+
const {
|
|
7016
|
+
lxTimeout,
|
|
7017
|
+
lxRunTime,
|
|
7018
|
+
scrollXStore
|
|
7019
|
+
} = internalData;
|
|
7020
|
+
const {
|
|
7021
|
+
visibleSize
|
|
7022
|
+
} = scrollXStore;
|
|
7023
|
+
const fpsTime = Math.max(5, Math.min(10, Math.floor(visibleSize / 3)));
|
|
7024
|
+
if (lxTimeout) {
|
|
7025
|
+
clearTimeout(lxTimeout);
|
|
7026
|
+
}
|
|
7027
|
+
if (!lxRunTime || lxRunTime + fpsTime < Date.now()) {
|
|
7028
|
+
internalData.lxRunTime = Date.now();
|
|
7029
|
+
loadScrollXData($xeTable);
|
|
7030
|
+
}
|
|
7031
|
+
internalData.lxTimeout = setTimeout(() => {
|
|
7032
|
+
internalData.lxTimeout = undefined;
|
|
7033
|
+
internalData.lxRunTime = undefined;
|
|
7034
|
+
loadScrollXData($xeTable);
|
|
7035
|
+
}, fpsTime);
|
|
7036
|
+
}
|
|
7037
|
+
function lazyScrollYData($xeTable) {
|
|
7038
|
+
const internalData = $xeTable;
|
|
7039
|
+
const {
|
|
7040
|
+
lyTimeout,
|
|
7041
|
+
lyRunTime,
|
|
7042
|
+
scrollYStore
|
|
7043
|
+
} = internalData;
|
|
7044
|
+
const {
|
|
7045
|
+
visibleSize
|
|
7046
|
+
} = scrollYStore;
|
|
7047
|
+
const fpsTime = Math.floor(Math.max(4, Math.min(10, visibleSize / 3)));
|
|
7048
|
+
if (lyTimeout) {
|
|
7049
|
+
clearTimeout(lyTimeout);
|
|
7050
|
+
}
|
|
7051
|
+
if (!lyRunTime || lyRunTime + fpsTime < Date.now()) {
|
|
7052
|
+
internalData.lyRunTime = Date.now();
|
|
7053
|
+
loadScrollYData($xeTable);
|
|
7054
|
+
}
|
|
7055
|
+
internalData.lyTimeout = setTimeout(() => {
|
|
7056
|
+
internalData.lyTimeout = undefined;
|
|
7057
|
+
internalData.lyRunTime = undefined;
|
|
7058
|
+
loadScrollYData($xeTable);
|
|
7059
|
+
}, fpsTime);
|
|
7060
|
+
}
|
|
6934
7061
|
function checkLastSyncScroll($xeTable, isRollX, isRollY) {
|
|
6935
7062
|
const reactData = $xeTable;
|
|
6936
7063
|
const internalData = $xeTable;
|
|
@@ -6947,27 +7074,63 @@ function checkLastSyncScroll($xeTable, isRollX, isRollY) {
|
|
|
6947
7074
|
internalData.lcsTimeout = setTimeout(() => {
|
|
6948
7075
|
internalData.lcsRunTime = Date.now();
|
|
6949
7076
|
internalData.lcsTimeout = undefined;
|
|
7077
|
+
internalData.intoRunScroll = false;
|
|
6950
7078
|
internalData.inVirtualScroll = false;
|
|
6951
7079
|
internalData.inWheelScroll = false;
|
|
6952
7080
|
internalData.inHeaderScroll = false;
|
|
6953
7081
|
internalData.inBodyScroll = false;
|
|
6954
7082
|
internalData.inFooterScroll = false;
|
|
6955
7083
|
internalData.scrollRenderType = '';
|
|
7084
|
+
calcCellHeight($xeTable);
|
|
6956
7085
|
if (isRollX && scrollXLoad) {
|
|
6957
|
-
$xeTable.updateScrollXData()
|
|
6958
|
-
calcCellHeight($xeTable);
|
|
6959
|
-
loadScrollXData($xeTable);
|
|
6960
|
-
});
|
|
7086
|
+
$xeTable.updateScrollXData();
|
|
6961
7087
|
}
|
|
6962
7088
|
if (isRollY && scrollYLoad) {
|
|
6963
7089
|
$xeTable.updateScrollYData().then(() => {
|
|
6964
7090
|
calcCellHeight($xeTable);
|
|
6965
|
-
|
|
7091
|
+
$xeTable.updateScrollYSpace();
|
|
6966
7092
|
});
|
|
6967
7093
|
}
|
|
6968
7094
|
$xeTable.updateCellAreas();
|
|
6969
7095
|
}, 200);
|
|
6970
7096
|
}
|
|
7097
|
+
const getWheelSpeed = lastScrollTime => {
|
|
7098
|
+
let multiple = 1;
|
|
7099
|
+
const currTime = Date.now();
|
|
7100
|
+
if (lastScrollTime + 25 > currTime) {
|
|
7101
|
+
multiple = 1.18;
|
|
7102
|
+
} else if (lastScrollTime + 30 > currTime) {
|
|
7103
|
+
multiple = 1.15;
|
|
7104
|
+
} else if (lastScrollTime + 40 > currTime) {
|
|
7105
|
+
multiple = 1.12;
|
|
7106
|
+
} else if (lastScrollTime + 55 > currTime) {
|
|
7107
|
+
multiple = 1.09;
|
|
7108
|
+
} else if (lastScrollTime + 75 > currTime) {
|
|
7109
|
+
multiple = 1.06;
|
|
7110
|
+
} else if (lastScrollTime + 100 > currTime) {
|
|
7111
|
+
multiple = 1.03;
|
|
7112
|
+
}
|
|
7113
|
+
return multiple;
|
|
7114
|
+
};
|
|
7115
|
+
const wheelScrollTo = (diffNum, cb) => {
|
|
7116
|
+
const duration = Math.abs(diffNum);
|
|
7117
|
+
const startTime = performance.now();
|
|
7118
|
+
let countTop = 0;
|
|
7119
|
+
const step = timestamp => {
|
|
7120
|
+
let progress = (timestamp - startTime) / duration;
|
|
7121
|
+
if (progress > 1) {
|
|
7122
|
+
progress = 1;
|
|
7123
|
+
}
|
|
7124
|
+
const easedProgress = Math.pow(progress, 2);
|
|
7125
|
+
const offsetTop = Math.floor(diffNum * easedProgress) - countTop;
|
|
7126
|
+
countTop += offsetTop;
|
|
7127
|
+
cb(offsetTop);
|
|
7128
|
+
if (progress < 1) {
|
|
7129
|
+
requestAnimationFrame(step);
|
|
7130
|
+
}
|
|
7131
|
+
};
|
|
7132
|
+
requestAnimationFrame(step);
|
|
7133
|
+
};
|
|
6971
7134
|
function updateHeight($xeTable) {
|
|
6972
7135
|
const internalData = $xeTable;
|
|
6973
7136
|
internalData.customHeight = calcTableHeight($xeTable, 'height');
|
|
@@ -6975,63 +7138,66 @@ function updateHeight($xeTable) {
|
|
|
6975
7138
|
internalData.customMaxHeight = calcTableHeight($xeTable, 'maxHeight');
|
|
6976
7139
|
}
|
|
6977
7140
|
function calcColumnAutoWidth(column, wrapperEl) {
|
|
6978
|
-
const
|
|
6979
|
-
|
|
6980
|
-
|
|
6981
|
-
if (firstCellEl) {
|
|
6982
|
-
const cellStyle = getComputedStyle(firstCellEl);
|
|
6983
|
-
|
|
6984
|
-
}
|
|
6985
|
-
let colWidth = column.renderAutoWidth -
|
|
6986
|
-
|
|
6987
|
-
const
|
|
6988
|
-
|
|
6989
|
-
|
|
6990
|
-
|
|
6991
|
-
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(cellEl.children, btnEl => {
|
|
6992
|
-
titleWidth += btnEl.offsetWidth + 1;
|
|
6993
|
-
});
|
|
6994
|
-
} else {
|
|
6995
|
-
const labelEl = cellEl.firstElementChild;
|
|
6996
|
-
if (labelEl) {
|
|
6997
|
-
titleWidth = labelEl.offsetWidth;
|
|
6998
|
-
}
|
|
6999
|
-
}
|
|
7000
|
-
if (titleWidth) {
|
|
7001
|
-
colWidth = Math.max(colWidth, Math.ceil(titleWidth) + 4);
|
|
7002
|
-
}
|
|
7003
|
-
});
|
|
7004
|
-
return colWidth + paddingSize;
|
|
7141
|
+
const cellElemList = wrapperEl.querySelectorAll(`.vxe-cell--wrapper[colid="${column.id}"]`);
|
|
7142
|
+
let leftRightPadding = 0;
|
|
7143
|
+
const firstCellEl = cellElemList[0];
|
|
7144
|
+
if (firstCellEl && firstCellEl.parentElement) {
|
|
7145
|
+
const cellStyle = getComputedStyle(firstCellEl.parentElement);
|
|
7146
|
+
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));
|
|
7147
|
+
}
|
|
7148
|
+
let colWidth = column.renderAutoWidth - leftRightPadding;
|
|
7149
|
+
for (let i = 0; i < cellElemList.length; i++) {
|
|
7150
|
+
const celEl = cellElemList[i];
|
|
7151
|
+
colWidth = Math.max(colWidth, celEl ? Math.ceil(celEl.scrollWidth) + 4 : 0);
|
|
7152
|
+
}
|
|
7153
|
+
return colWidth + leftRightPadding;
|
|
7005
7154
|
}
|
|
7006
7155
|
function calcCellWidth($xeTable) {
|
|
7007
|
-
const reactData = $xeTable;
|
|
7008
7156
|
const internalData = $xeTable;
|
|
7009
7157
|
const autoWidthColumnList = $xeTable.computeAutoWidthColumnList;
|
|
7010
|
-
|
|
7011
|
-
|
|
7012
|
-
|
|
7013
|
-
|
|
7014
|
-
|
|
7015
|
-
|
|
7016
|
-
|
|
7017
|
-
|
|
7018
|
-
|
|
7019
|
-
|
|
7020
|
-
|
|
7021
|
-
|
|
7022
|
-
|
|
7023
|
-
|
|
7024
|
-
|
|
7025
|
-
|
|
7026
|
-
|
|
7027
|
-
|
|
7028
|
-
reactData.isCalcColumn = false;
|
|
7029
|
-
});
|
|
7158
|
+
const {
|
|
7159
|
+
fullColumnIdData
|
|
7160
|
+
} = internalData;
|
|
7161
|
+
const el = $xeTable.$refs.refElem;
|
|
7162
|
+
if (el) {
|
|
7163
|
+
el.setAttribute('data-calc-col', 'Y');
|
|
7164
|
+
autoWidthColumnList.forEach(column => {
|
|
7165
|
+
const colid = column.id;
|
|
7166
|
+
const colRest = fullColumnIdData[colid];
|
|
7167
|
+
const colWidth = calcColumnAutoWidth(column, el);
|
|
7168
|
+
if (colRest) {
|
|
7169
|
+
colRest.width = Math.max(colWidth, colRest.width);
|
|
7170
|
+
}
|
|
7171
|
+
column.renderAutoWidth = colWidth;
|
|
7172
|
+
});
|
|
7173
|
+
$xeTable.analyColumnWidth();
|
|
7174
|
+
el.removeAttribute('data-calc-col');
|
|
7175
|
+
}
|
|
7030
7176
|
}
|
|
7031
|
-
const
|
|
7032
|
-
|
|
7033
|
-
|
|
7034
|
-
|
|
7177
|
+
const handleUpdateColResize = ($xeTable, evnt, params) => {
|
|
7178
|
+
$xeTable.analyColumnWidth();
|
|
7179
|
+
$xeTable.recalculate(true).then(() => {
|
|
7180
|
+
$xeTable.saveCustomStore('update:width');
|
|
7181
|
+
$xeTable.updateCellAreas();
|
|
7182
|
+
$xeTable.dispatchEvent('column-resizable-change', params, evnt);
|
|
7183
|
+
// 已废弃 resizable-change
|
|
7184
|
+
$xeTable.dispatchEvent('resizable-change', params, evnt);
|
|
7185
|
+
setTimeout(() => $xeTable.recalculate(true), 300);
|
|
7186
|
+
});
|
|
7187
|
+
};
|
|
7188
|
+
const handleUpdateRowResize = ($xeTable, evnt, params) => {
|
|
7189
|
+
const reactData = $xeTable;
|
|
7190
|
+
reactData.resizeHeightFlag++;
|
|
7191
|
+
$xeTable.recalculate(true).then(() => {
|
|
7192
|
+
$xeTable.updateCellAreas();
|
|
7193
|
+
$xeTable.dispatchEvent('row-resizable-change', params, evnt);
|
|
7194
|
+
setTimeout(() => $xeTable.recalculate(true), 300);
|
|
7195
|
+
});
|
|
7196
|
+
};
|
|
7197
|
+
const Methods = {
|
|
7198
|
+
callSlot(slotFunc, params, h, vNodes) {
|
|
7199
|
+
if (slotFunc) {
|
|
7200
|
+
const {
|
|
7035
7201
|
$xegrid
|
|
7036
7202
|
} = this;
|
|
7037
7203
|
if ($xegrid) {
|
|
@@ -7092,7 +7258,7 @@ const Methods = {
|
|
|
7092
7258
|
warnLog('vxe.error.delFunc', ['syncData', 'getData']);
|
|
7093
7259
|
return this.$nextTick().then(() => {
|
|
7094
7260
|
this.tableData = [];
|
|
7095
|
-
return this.$nextTick().then(() => this.loadTableData(this.tableFullData));
|
|
7261
|
+
return this.$nextTick().then(() => this.loadTableData(this.tableFullData, true));
|
|
7096
7262
|
});
|
|
7097
7263
|
},
|
|
7098
7264
|
/**
|
|
@@ -7154,11 +7320,12 @@ const Methods = {
|
|
|
7154
7320
|
* 加载表格数据
|
|
7155
7321
|
* @param {Array} datas 数据
|
|
7156
7322
|
*/
|
|
7157
|
-
loadTableData(datas) {
|
|
7323
|
+
loadTableData(datas, isReset) {
|
|
7158
7324
|
const $xeTable = this;
|
|
7325
|
+
const reactData = $xeTable;
|
|
7326
|
+
const internalData = $xeTable;
|
|
7159
7327
|
const {
|
|
7160
7328
|
keepSource,
|
|
7161
|
-
showOverflow,
|
|
7162
7329
|
treeConfig,
|
|
7163
7330
|
treeOpts,
|
|
7164
7331
|
editStore,
|
|
@@ -7171,7 +7338,6 @@ const Methods = {
|
|
|
7171
7338
|
sYOpts
|
|
7172
7339
|
} = this;
|
|
7173
7340
|
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
7174
|
-
const rowOpts = $xeTable.computeRowOpts;
|
|
7175
7341
|
let treeData = [];
|
|
7176
7342
|
let fullData = datas ? datas.slice(0) : [];
|
|
7177
7343
|
if (treeConfig) {
|
|
@@ -7214,42 +7380,30 @@ const Methods = {
|
|
|
7214
7380
|
scrollYStore.endIndex = 1;
|
|
7215
7381
|
scrollXStore.startIndex = 0;
|
|
7216
7382
|
scrollXStore.endIndex = 1;
|
|
7383
|
+
reactData.isRowLoading = true;
|
|
7384
|
+
reactData.scrollVMLoading = false;
|
|
7217
7385
|
editStore.insertMaps = {};
|
|
7218
|
-
editStore.removeList = [];
|
|
7219
7386
|
editStore.removeMaps = {};
|
|
7220
7387
|
const sYLoad = updateScrollYStatus($xeTable, fullData);
|
|
7221
|
-
|
|
7388
|
+
reactData.isDragColMove = false;
|
|
7389
|
+
reactData.isDragRowMove = false;
|
|
7222
7390
|
// 全量数据
|
|
7223
|
-
|
|
7224
|
-
|
|
7391
|
+
internalData.tableFullData = fullData;
|
|
7392
|
+
internalData.tableFullTreeData = treeData;
|
|
7225
7393
|
// 缓存数据
|
|
7226
|
-
|
|
7394
|
+
$xeTable.cacheRowMap(true, isReset);
|
|
7227
7395
|
// 原始数据
|
|
7228
|
-
|
|
7396
|
+
internalData.tableSynchData = datas;
|
|
7397
|
+
if (isReset) {
|
|
7398
|
+
internalData.isResizeCellHeight = false;
|
|
7399
|
+
reactData.rowExpandedMaps = {};
|
|
7400
|
+
reactData.rowExpandLazyLoadedMaps = {};
|
|
7401
|
+
reactData.treeExpandedMaps = {};
|
|
7402
|
+
reactData.treeExpandLazyLoadedMaps = {};
|
|
7403
|
+
}
|
|
7229
7404
|
// 克隆原数据,用于显示编辑状态,与编辑值做对比
|
|
7230
7405
|
if (keepSource) {
|
|
7231
|
-
|
|
7232
|
-
}
|
|
7233
|
-
if (sYLoad) {
|
|
7234
|
-
if (showOverflow) {
|
|
7235
|
-
if (!rowOpts.height) {
|
|
7236
|
-
const errColumn = this.tableFullColumn.find(column => column.showOverflow === false);
|
|
7237
|
-
if (errColumn) {
|
|
7238
|
-
errLog('vxe.error.errProp', [`column[field="${errColumn.field}"].show-overflow=false`, 'show-overflow=true']);
|
|
7239
|
-
}
|
|
7240
|
-
}
|
|
7241
|
-
}
|
|
7242
|
-
if (true) {
|
|
7243
|
-
if (!(this.height || this.maxHeight)) {
|
|
7244
|
-
errLog('vxe.error.reqProp', ['table.height | table.max-height | table.scroll-y={enabled: false}']);
|
|
7245
|
-
}
|
|
7246
|
-
// if (!this.showOverflow) {
|
|
7247
|
-
// warnLog('vxe.error.reqProp', ['table.show-overflow'])
|
|
7248
|
-
// }
|
|
7249
|
-
if (this.spanMethod) {
|
|
7250
|
-
warnLog('vxe.error.scrollErrProp', ['table.span-method']);
|
|
7251
|
-
}
|
|
7252
|
-
}
|
|
7406
|
+
$xeTable.cacheSourceMap(fullData);
|
|
7253
7407
|
}
|
|
7254
7408
|
if (this.clearCellAreas && this.mouseConfig) {
|
|
7255
7409
|
this.clearCellAreas();
|
|
@@ -7269,6 +7423,27 @@ const Methods = {
|
|
|
7269
7423
|
if (sYLoad) {
|
|
7270
7424
|
scrollYStore.endIndex = scrollYStore.visibleSize;
|
|
7271
7425
|
}
|
|
7426
|
+
if (sYLoad) {
|
|
7427
|
+
// if (showOverflow) {
|
|
7428
|
+
// if (!rowOpts.height) {
|
|
7429
|
+
// const errColumn = this.tableFullColumn.find((column: any) => column.showOverflow === false)
|
|
7430
|
+
// if (errColumn) {
|
|
7431
|
+
// errLog('vxe.error.errProp', [`column[field="${errColumn.field}"].show-overflow=false`, 'show-overflow=true'])
|
|
7432
|
+
// }
|
|
7433
|
+
// }
|
|
7434
|
+
// }
|
|
7435
|
+
if (true) {
|
|
7436
|
+
if (!(this.height || this.maxHeight)) {
|
|
7437
|
+
errLog('vxe.error.reqProp', ['table.height | table.max-height | table.scroll-y={enabled: false}']);
|
|
7438
|
+
}
|
|
7439
|
+
// if (!this.showOverflow) {
|
|
7440
|
+
// warnLog('vxe.error.reqProp', ['table.show-overflow'])
|
|
7441
|
+
// }
|
|
7442
|
+
if (this.spanMethod) {
|
|
7443
|
+
warnLog('vxe.error.scrollErrProp', ['table.span-method']);
|
|
7444
|
+
}
|
|
7445
|
+
}
|
|
7446
|
+
}
|
|
7272
7447
|
this.handleReserveStatus();
|
|
7273
7448
|
this.checkSelectionStatus();
|
|
7274
7449
|
return new Promise(resolve => {
|
|
@@ -7282,6 +7457,8 @@ const Methods = {
|
|
|
7282
7457
|
if (sYOpts.scrollToTopOnChange) {
|
|
7283
7458
|
targetScrollTop = 0;
|
|
7284
7459
|
}
|
|
7460
|
+
reactData.isRowLoading = false;
|
|
7461
|
+
calcCellHeight($xeTable);
|
|
7285
7462
|
// 是否变更虚拟滚动
|
|
7286
7463
|
if (oldScrollYLoad === sYLoad) {
|
|
7287
7464
|
restoreScrollLocation(this, targetScrollLeft, targetScrollTop).then(() => {
|
|
@@ -7306,7 +7483,7 @@ const Methods = {
|
|
|
7306
7483
|
const {
|
|
7307
7484
|
initStatus
|
|
7308
7485
|
} = this;
|
|
7309
|
-
return this.loadTableData(datas).then(() => {
|
|
7486
|
+
return this.loadTableData(datas, false).then(() => {
|
|
7310
7487
|
this.inited = true;
|
|
7311
7488
|
this.initStatus = true;
|
|
7312
7489
|
if (!initStatus) {
|
|
@@ -7323,7 +7500,7 @@ const Methods = {
|
|
|
7323
7500
|
return this.clearAll().then(() => {
|
|
7324
7501
|
this.inited = true;
|
|
7325
7502
|
this.initStatus = true;
|
|
7326
|
-
return this.loadTableData(datas);
|
|
7503
|
+
return this.loadTableData(datas, true);
|
|
7327
7504
|
}).then(() => {
|
|
7328
7505
|
this.handleLoadDefaults();
|
|
7329
7506
|
return this.recalculate();
|
|
@@ -7406,9 +7583,8 @@ const Methods = {
|
|
|
7406
7583
|
},
|
|
7407
7584
|
/**
|
|
7408
7585
|
* 更新数据行的 Map
|
|
7409
|
-
* 牺牲数据组装的耗时,用来换取使用过程中的流畅
|
|
7410
7586
|
*/
|
|
7411
|
-
cacheRowMap(isSource) {
|
|
7587
|
+
cacheRowMap(isReset, isSource) {
|
|
7412
7588
|
const {
|
|
7413
7589
|
treeConfig,
|
|
7414
7590
|
treeOpts,
|
|
@@ -7434,7 +7610,7 @@ const Methods = {
|
|
|
7434
7610
|
row[childrenField] = null;
|
|
7435
7611
|
}
|
|
7436
7612
|
let cacheItem = fullAllDataRowIdData[rowid];
|
|
7437
|
-
if (!cacheItem) {
|
|
7613
|
+
if (isReset || !cacheItem) {
|
|
7438
7614
|
cacheItem = {
|
|
7439
7615
|
row,
|
|
7440
7616
|
rowid,
|
|
@@ -7447,6 +7623,7 @@ const Methods = {
|
|
|
7447
7623
|
parent: parentRow,
|
|
7448
7624
|
level,
|
|
7449
7625
|
height: 0,
|
|
7626
|
+
resizeHeight: 0,
|
|
7450
7627
|
oTop: 0
|
|
7451
7628
|
};
|
|
7452
7629
|
}
|
|
@@ -7552,6 +7729,7 @@ const Methods = {
|
|
|
7552
7729
|
parent: parentRow,
|
|
7553
7730
|
level: parentLevel + nodes.length,
|
|
7554
7731
|
height: 0,
|
|
7732
|
+
resizeHeight: 0,
|
|
7555
7733
|
oTop: 0
|
|
7556
7734
|
};
|
|
7557
7735
|
fullDataRowIdData[rowid] = rest;
|
|
@@ -7944,20 +8122,38 @@ const Methods = {
|
|
|
7944
8122
|
return this.$nextTick();
|
|
7945
8123
|
},
|
|
7946
8124
|
getCellElement(row, fieldOrColumn) {
|
|
7947
|
-
const
|
|
8125
|
+
const $xeTable = this;
|
|
8126
|
+
const internalData = $xeTable;
|
|
8127
|
+
const {
|
|
8128
|
+
elemStore
|
|
8129
|
+
} = internalData;
|
|
8130
|
+
const column = handleFieldOrColumn($xeTable, fieldOrColumn);
|
|
7948
8131
|
if (!column) {
|
|
7949
8132
|
return null;
|
|
7950
8133
|
}
|
|
7951
|
-
const
|
|
7952
|
-
|
|
7953
|
-
|
|
7954
|
-
const
|
|
7955
|
-
let bodyElem
|
|
8134
|
+
const rowid = getRowid($xeTable, row);
|
|
8135
|
+
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
8136
|
+
const leftScrollElem = getRefElem(elemStore['left-body-scroll']);
|
|
8137
|
+
const rightScrollElem = getRefElem(elemStore['right-body-scroll']);
|
|
8138
|
+
let bodyElem;
|
|
7956
8139
|
if (column) {
|
|
7957
|
-
|
|
7958
|
-
|
|
7959
|
-
|
|
7960
|
-
|
|
8140
|
+
if (column.fixed) {
|
|
8141
|
+
if (column.fixed === 'left') {
|
|
8142
|
+
if (leftScrollElem) {
|
|
8143
|
+
bodyElem = leftScrollElem;
|
|
8144
|
+
}
|
|
8145
|
+
} else {
|
|
8146
|
+
if (rightScrollElem) {
|
|
8147
|
+
bodyElem = rightScrollElem;
|
|
8148
|
+
}
|
|
8149
|
+
}
|
|
8150
|
+
}
|
|
8151
|
+
if (!bodyElem) {
|
|
8152
|
+
bodyElem = bodyScrollElem;
|
|
8153
|
+
}
|
|
8154
|
+
if (bodyElem) {
|
|
8155
|
+
return bodyElem.querySelector(`.vxe-body--row[rowid="${rowid}"] .${column.id}`);
|
|
8156
|
+
}
|
|
7961
8157
|
}
|
|
7962
8158
|
return null;
|
|
7963
8159
|
},
|
|
@@ -8484,7 +8680,11 @@ const Methods = {
|
|
|
8484
8680
|
* @param {String/Number} rowid 行主键
|
|
8485
8681
|
*/
|
|
8486
8682
|
getRowById(cellValue) {
|
|
8487
|
-
const
|
|
8683
|
+
const $xeTable = this;
|
|
8684
|
+
const internalData = $xeTable;
|
|
8685
|
+
const {
|
|
8686
|
+
fullDataRowIdData
|
|
8687
|
+
} = internalData;
|
|
8488
8688
|
const rowid = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(cellValue) ? '' : encodeURIComponent(cellValue);
|
|
8489
8689
|
return fullDataRowIdData[rowid] ? fullDataRowIdData[rowid].row : null;
|
|
8490
8690
|
},
|
|
@@ -8492,14 +8692,9 @@ const Methods = {
|
|
|
8492
8692
|
* 根据行获取行的唯一主键
|
|
8493
8693
|
* @param {Row} row 行对象
|
|
8494
8694
|
*/
|
|
8495
|
-
getRowid(
|
|
8695
|
+
getRowid(row) {
|
|
8496
8696
|
const $xeTable = this;
|
|
8497
|
-
|
|
8498
|
-
const {
|
|
8499
|
-
fullDataRowIdData
|
|
8500
|
-
} = internalData;
|
|
8501
|
-
const rowid = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(cellValue) ? '' : encodeURIComponent(cellValue || '');
|
|
8502
|
-
return fullDataRowIdData[rowid] ? fullDataRowIdData[rowid].row : null;
|
|
8697
|
+
return getRowid($xeTable, row);
|
|
8503
8698
|
},
|
|
8504
8699
|
/**
|
|
8505
8700
|
* 获取处理后的表格数据
|
|
@@ -8703,29 +8898,41 @@ const Methods = {
|
|
|
8703
8898
|
},
|
|
8704
8899
|
setColumnWidth(fieldOrColumn, width) {
|
|
8705
8900
|
const $xeTable = this;
|
|
8901
|
+
const internalData = $xeTable;
|
|
8902
|
+
const {
|
|
8903
|
+
elemStore
|
|
8904
|
+
} = internalData;
|
|
8706
8905
|
let status = false;
|
|
8707
8906
|
const cols = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(fieldOrColumn) ? fieldOrColumn : [fieldOrColumn];
|
|
8708
|
-
|
|
8709
|
-
|
|
8710
|
-
|
|
8711
|
-
|
|
8712
|
-
|
|
8713
|
-
|
|
8714
|
-
|
|
8715
|
-
|
|
8716
|
-
|
|
8717
|
-
|
|
8718
|
-
|
|
8719
|
-
|
|
8720
|
-
|
|
8721
|
-
|
|
8907
|
+
let cWidth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toInteger(width);
|
|
8908
|
+
if (isScale(width)) {
|
|
8909
|
+
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
8910
|
+
const bodyWidth = bodyScrollElem ? bodyScrollElem.clientWidth - 1 : 0;
|
|
8911
|
+
cWidth = Math.floor(cWidth * bodyWidth);
|
|
8912
|
+
}
|
|
8913
|
+
if (cWidth) {
|
|
8914
|
+
cols.forEach(item => {
|
|
8915
|
+
const column = handleFieldOrColumn($xeTable, item);
|
|
8916
|
+
if (column) {
|
|
8917
|
+
column.resizeWidth = cWidth;
|
|
8918
|
+
if (!status) {
|
|
8919
|
+
status = true;
|
|
8920
|
+
}
|
|
8722
8921
|
}
|
|
8922
|
+
});
|
|
8923
|
+
if (status) {
|
|
8924
|
+
return $xeTable.refreshColumn().then(() => {
|
|
8925
|
+
return {
|
|
8926
|
+
status
|
|
8927
|
+
};
|
|
8928
|
+
});
|
|
8723
8929
|
}
|
|
8724
|
-
});
|
|
8725
|
-
if (status) {
|
|
8726
|
-
return $xeTable.refreshColumn();
|
|
8727
8930
|
}
|
|
8728
|
-
return $xeTable.$nextTick()
|
|
8931
|
+
return $xeTable.$nextTick().then(() => {
|
|
8932
|
+
return {
|
|
8933
|
+
status
|
|
8934
|
+
};
|
|
8935
|
+
});
|
|
8729
8936
|
},
|
|
8730
8937
|
getColumnWidth(fieldOrColumn) {
|
|
8731
8938
|
const column = handleFieldOrColumn(this, fieldOrColumn);
|
|
@@ -9052,7 +9259,162 @@ const Methods = {
|
|
|
9052
9259
|
remainList
|
|
9053
9260
|
});
|
|
9054
9261
|
},
|
|
9055
|
-
|
|
9262
|
+
handleColResizeMousedownEvent(evnt, fixedType, params) {
|
|
9263
|
+
const $xeTable = this;
|
|
9264
|
+
const reactData = $xeTable;
|
|
9265
|
+
const internalData = $xeTable;
|
|
9266
|
+
evnt.stopPropagation();
|
|
9267
|
+
evnt.preventDefault();
|
|
9268
|
+
const {
|
|
9269
|
+
column
|
|
9270
|
+
} = params;
|
|
9271
|
+
const {
|
|
9272
|
+
overflowX,
|
|
9273
|
+
scrollbarHeight
|
|
9274
|
+
} = reactData;
|
|
9275
|
+
const {
|
|
9276
|
+
elemStore,
|
|
9277
|
+
visibleColumn
|
|
9278
|
+
} = internalData;
|
|
9279
|
+
const resizableOpts = $xeTable.computeResizableOpts;
|
|
9280
|
+
const osbHeight = overflowX ? scrollbarHeight : 0;
|
|
9281
|
+
const tableEl = $xeTable.$refs.refElem;
|
|
9282
|
+
const leftContainerElem = $xeTable.$refs.refLeftContainer;
|
|
9283
|
+
const rightContainerElem = $xeTable.$refs.refRightContainer;
|
|
9284
|
+
const resizeBarElem = $xeTable.$refs.refColResizeBar;
|
|
9285
|
+
if (!resizeBarElem) {
|
|
9286
|
+
return;
|
|
9287
|
+
}
|
|
9288
|
+
const resizeTipElem = resizeBarElem.firstElementChild;
|
|
9289
|
+
const scrollbarXToTop = $xeTable.computeScrollbarXToTop;
|
|
9290
|
+
const {
|
|
9291
|
+
clientX: dragClientX
|
|
9292
|
+
} = evnt;
|
|
9293
|
+
const wrapperElem = $xeTable.$refs.refElem;
|
|
9294
|
+
const dragBtnElem = evnt.target;
|
|
9295
|
+
let resizeColumn = column;
|
|
9296
|
+
if (column.children && column.children.length) {
|
|
9297
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(column.children, childColumn => {
|
|
9298
|
+
resizeColumn = childColumn;
|
|
9299
|
+
});
|
|
9300
|
+
}
|
|
9301
|
+
const cell = dragBtnElem.parentNode;
|
|
9302
|
+
const cellParams = Object.assign(params, {
|
|
9303
|
+
cell
|
|
9304
|
+
});
|
|
9305
|
+
let dragLeft = 0;
|
|
9306
|
+
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
9307
|
+
if (!bodyScrollElem) {
|
|
9308
|
+
return;
|
|
9309
|
+
}
|
|
9310
|
+
const pos = getOffsetPos(dragBtnElem, wrapperElem);
|
|
9311
|
+
const dragBtnWidth = dragBtnElem.clientWidth;
|
|
9312
|
+
const dragBtnOffsetWidth = Math.floor(dragBtnWidth / 2);
|
|
9313
|
+
const minInterval = getColReMinWidth(cellParams) - dragBtnOffsetWidth; // 列之间的最小间距
|
|
9314
|
+
let dragMinLeft = pos.left - cell.clientWidth + dragBtnWidth + minInterval;
|
|
9315
|
+
let dragPosLeft = pos.left + dragBtnOffsetWidth;
|
|
9316
|
+
const isLeftFixed = fixedType === 'left';
|
|
9317
|
+
const isRightFixed = fixedType === 'right';
|
|
9318
|
+
// 计算左右侧固定列偏移量
|
|
9319
|
+
let fixedOffsetWidth = 0;
|
|
9320
|
+
if (isLeftFixed || isRightFixed) {
|
|
9321
|
+
const siblingProp = isLeftFixed ? 'nextElementSibling' : 'previousElementSibling';
|
|
9322
|
+
let tempCellElem = cell[siblingProp];
|
|
9323
|
+
while (tempCellElem) {
|
|
9324
|
+
if (hasClass(tempCellElem, 'fixed--hidden')) {
|
|
9325
|
+
break;
|
|
9326
|
+
} else if (!hasClass(tempCellElem, 'col--group')) {
|
|
9327
|
+
fixedOffsetWidth += tempCellElem.offsetWidth;
|
|
9328
|
+
}
|
|
9329
|
+
tempCellElem = tempCellElem[siblingProp];
|
|
9330
|
+
}
|
|
9331
|
+
if (isRightFixed && rightContainerElem) {
|
|
9332
|
+
dragPosLeft = rightContainerElem.offsetLeft + fixedOffsetWidth;
|
|
9333
|
+
}
|
|
9334
|
+
}
|
|
9335
|
+
// 处理拖动事件
|
|
9336
|
+
const updateEvent = evnt => {
|
|
9337
|
+
evnt.stopPropagation();
|
|
9338
|
+
evnt.preventDefault();
|
|
9339
|
+
const tableHeight = tableEl.clientHeight;
|
|
9340
|
+
const offsetX = evnt.clientX - dragClientX;
|
|
9341
|
+
let left = dragPosLeft + offsetX;
|
|
9342
|
+
const scrollLeft = fixedType ? 0 : bodyScrollElem.scrollLeft;
|
|
9343
|
+
if (isLeftFixed) {
|
|
9344
|
+
// 左固定列(不允许超过右侧固定列、不允许超过右边距)
|
|
9345
|
+
left = Math.min(left, (rightContainerElem ? rightContainerElem.offsetLeft : bodyScrollElem.clientWidth) - fixedOffsetWidth - minInterval);
|
|
9346
|
+
} else if (isRightFixed) {
|
|
9347
|
+
// 右侧固定列(不允许超过左侧固定列、不允许超过左边距)
|
|
9348
|
+
dragMinLeft = (leftContainerElem ? leftContainerElem.clientWidth : 0) + fixedOffsetWidth + minInterval;
|
|
9349
|
+
left = Math.min(left, dragPosLeft + cell.clientWidth - minInterval);
|
|
9350
|
+
} else {
|
|
9351
|
+
dragMinLeft = Math.max(bodyScrollElem.scrollLeft, dragMinLeft);
|
|
9352
|
+
// left = Math.min(left, bodyScrollElem.clientWidth + bodyScrollElem.scrollLeft - 40)
|
|
9353
|
+
}
|
|
9354
|
+
dragLeft = Math.max(left, dragMinLeft);
|
|
9355
|
+
const resizeBarLeft = Math.max(1, dragLeft - scrollLeft);
|
|
9356
|
+
resizeBarElem.style.left = `${resizeBarLeft}px`;
|
|
9357
|
+
resizeBarElem.style.top = `${scrollbarXToTop ? osbHeight : 0}px`;
|
|
9358
|
+
resizeBarElem.style.height = `${scrollbarXToTop ? tableHeight - osbHeight : tableHeight}px`;
|
|
9359
|
+
if (resizableOpts.showDragTip && resizeTipElem) {
|
|
9360
|
+
resizeTipElem.textContent = methods_getI18n('vxe.table.resizeColTip', [resizeColumn.renderWidth + (isRightFixed ? dragPosLeft - dragLeft : dragLeft - dragPosLeft)]);
|
|
9361
|
+
const tableWidth = tableEl.clientWidth;
|
|
9362
|
+
const wrapperRect = wrapperElem.getBoundingClientRect();
|
|
9363
|
+
const resizeBarWidth = resizeBarElem.clientWidth;
|
|
9364
|
+
const resizeTipWidth = resizeTipElem.clientWidth;
|
|
9365
|
+
const resizeTipHeight = resizeTipElem.clientHeight;
|
|
9366
|
+
let resizeTipLeft = -resizeTipWidth;
|
|
9367
|
+
if (resizeBarLeft < resizeTipWidth + resizeBarWidth) {
|
|
9368
|
+
resizeTipLeft = 0;
|
|
9369
|
+
} else if (resizeBarLeft > tableWidth) {
|
|
9370
|
+
resizeTipLeft += tableWidth - resizeBarLeft;
|
|
9371
|
+
}
|
|
9372
|
+
resizeTipElem.style.left = `${resizeTipLeft}px`;
|
|
9373
|
+
resizeTipElem.style.top = `${Math.min(tableHeight - resizeTipHeight, Math.max(0, evnt.clientY - wrapperRect.y - resizeTipHeight / 2))}px`;
|
|
9374
|
+
}
|
|
9375
|
+
reactData.isDragResize = true;
|
|
9376
|
+
};
|
|
9377
|
+
reactData.isDragResize = true;
|
|
9378
|
+
addClass(tableEl, 'col-drag--resize');
|
|
9379
|
+
resizeBarElem.style.display = 'block';
|
|
9380
|
+
document.onmousemove = updateEvent;
|
|
9381
|
+
document.onmouseup = function (evnt) {
|
|
9382
|
+
document.onmousemove = null;
|
|
9383
|
+
document.onmouseup = null;
|
|
9384
|
+
resizeBarElem.style.display = 'none';
|
|
9385
|
+
internalData._lastResizeTime = Date.now();
|
|
9386
|
+
setTimeout(() => {
|
|
9387
|
+
reactData.isDragResize = false;
|
|
9388
|
+
}, 50);
|
|
9389
|
+
const resizeWidth = resizeColumn.renderWidth + (isRightFixed ? dragPosLeft - dragLeft : dragLeft - dragPosLeft);
|
|
9390
|
+
const resizeParams = {
|
|
9391
|
+
...params,
|
|
9392
|
+
resizeWidth,
|
|
9393
|
+
resizeColumn
|
|
9394
|
+
};
|
|
9395
|
+
if (resizableOpts.dragMode === 'fixed') {
|
|
9396
|
+
visibleColumn.forEach(item => {
|
|
9397
|
+
if (item.id !== resizeColumn.id) {
|
|
9398
|
+
if (!item.resizeWidth) {
|
|
9399
|
+
item.resizeWidth = item.renderWidth;
|
|
9400
|
+
}
|
|
9401
|
+
}
|
|
9402
|
+
});
|
|
9403
|
+
}
|
|
9404
|
+
if ($xeTable.handleColResizeCellAreaEvent) {
|
|
9405
|
+
$xeTable.handleColResizeCellAreaEvent(evnt, resizeParams);
|
|
9406
|
+
} else {
|
|
9407
|
+
resizeColumn.resizeWidth = resizeWidth;
|
|
9408
|
+
handleUpdateColResize($xeTable, evnt, resizeParams);
|
|
9409
|
+
}
|
|
9410
|
+
removeClass(tableEl, 'col-drag--resize');
|
|
9411
|
+
};
|
|
9412
|
+
updateEvent(evnt);
|
|
9413
|
+
if ($xeTable.closeMenu) {
|
|
9414
|
+
$xeTable.closeMenu();
|
|
9415
|
+
}
|
|
9416
|
+
},
|
|
9417
|
+
handleColResizeDblclickEvent(evnt, params) {
|
|
9056
9418
|
const $xeTable = this;
|
|
9057
9419
|
const reactData = $xeTable;
|
|
9058
9420
|
const internalData = $xeTable;
|
|
@@ -9062,6 +9424,8 @@ const Methods = {
|
|
|
9062
9424
|
} = resizableOpts;
|
|
9063
9425
|
const el = $xeTable.$refs.refElem;
|
|
9064
9426
|
if (isDblclickAutoWidth && el) {
|
|
9427
|
+
evnt.stopPropagation();
|
|
9428
|
+
evnt.preventDefault();
|
|
9065
9429
|
const {
|
|
9066
9430
|
fullColumnIdData
|
|
9067
9431
|
} = internalData;
|
|
@@ -9082,24 +9446,306 @@ const Methods = {
|
|
|
9082
9446
|
cell
|
|
9083
9447
|
});
|
|
9084
9448
|
const colMinWidth = getColReMinWidth(cellParams);
|
|
9449
|
+
el.setAttribute('data-calc-col', 'Y');
|
|
9085
9450
|
let resizeWidth = calcColumnAutoWidth(resizeColumn, el);
|
|
9451
|
+
el.removeAttribute('data-calc-col');
|
|
9086
9452
|
if (colRest) {
|
|
9087
9453
|
resizeWidth = Math.max(resizeWidth, colRest.width);
|
|
9088
9454
|
}
|
|
9089
|
-
|
|
9090
|
-
|
|
9455
|
+
resizeWidth = Math.max(colMinWidth, resizeWidth);
|
|
9456
|
+
const resizeParams = {
|
|
9457
|
+
...params,
|
|
9458
|
+
resizeWidth,
|
|
9459
|
+
resizeColumn
|
|
9460
|
+
};
|
|
9461
|
+
reactData.isDragResize = false;
|
|
9091
9462
|
internalData._lastResizeTime = Date.now();
|
|
9092
|
-
$xeTable.
|
|
9093
|
-
|
|
9094
|
-
|
|
9095
|
-
|
|
9096
|
-
$xeTable
|
|
9463
|
+
if ($xeTable.handleColResizeDblclickCellAreaEvent) {
|
|
9464
|
+
$xeTable.handleColResizeDblclickCellAreaEvent(evnt, resizeParams);
|
|
9465
|
+
} else {
|
|
9466
|
+
resizeColumn.resizeWidth = resizeWidth;
|
|
9467
|
+
handleUpdateColResize($xeTable, evnt, resizeParams);
|
|
9468
|
+
}
|
|
9469
|
+
}
|
|
9470
|
+
},
|
|
9471
|
+
handleRowResizeMousedownEvent(evnt, params) {
|
|
9472
|
+
const $xeTable = this;
|
|
9473
|
+
const reactData = $xeTable;
|
|
9474
|
+
const internalData = $xeTable;
|
|
9475
|
+
evnt.stopPropagation();
|
|
9476
|
+
evnt.preventDefault();
|
|
9477
|
+
const {
|
|
9478
|
+
row
|
|
9479
|
+
} = params;
|
|
9480
|
+
const {
|
|
9481
|
+
overflowX,
|
|
9482
|
+
scrollbarWidth,
|
|
9483
|
+
overflowY,
|
|
9484
|
+
scrollbarHeight
|
|
9485
|
+
} = reactData;
|
|
9486
|
+
const {
|
|
9487
|
+
elemStore,
|
|
9488
|
+
fullAllDataRowIdData
|
|
9489
|
+
} = internalData;
|
|
9490
|
+
const osbWidth = overflowY ? scrollbarWidth : 0;
|
|
9491
|
+
const osbHeight = overflowX ? scrollbarHeight : 0;
|
|
9492
|
+
const scrollbarYToLeft = $xeTable.computeScrollbarYToLeft;
|
|
9493
|
+
const resizableOpts = $xeTable.computeResizableOpts;
|
|
9494
|
+
const rowOpts = $xeTable.computeRowOpts;
|
|
9495
|
+
const cellOpts = $xeTable.computeCellOpts;
|
|
9496
|
+
const tableEl = $xeTable.$refs.refElem;
|
|
9497
|
+
const resizeBarElem = $xeTable.$refs.refRowResizeBar;
|
|
9498
|
+
if (!resizeBarElem) {
|
|
9499
|
+
return;
|
|
9500
|
+
}
|
|
9501
|
+
const {
|
|
9502
|
+
clientY: dragClientY
|
|
9503
|
+
} = evnt;
|
|
9504
|
+
const resizeTipElem = resizeBarElem.firstElementChild;
|
|
9505
|
+
const dragBtnElem = evnt.currentTarget;
|
|
9506
|
+
const tdEl = dragBtnElem.parentNode;
|
|
9507
|
+
const trEl = tdEl.parentNode;
|
|
9508
|
+
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
9509
|
+
if (!bodyScrollElem) {
|
|
9510
|
+
return;
|
|
9511
|
+
}
|
|
9512
|
+
const rowid = getRowid($xeTable, row);
|
|
9513
|
+
const rowRest = fullAllDataRowIdData[rowid];
|
|
9514
|
+
if (!rowRest) {
|
|
9515
|
+
return;
|
|
9516
|
+
}
|
|
9517
|
+
const defaultRowHeight = $xeTable.computeDefaultRowHeight;
|
|
9518
|
+
const currCellHeight = rowRest.resizeHeight || cellOpts.height || rowOpts.height || defaultRowHeight;
|
|
9519
|
+
const tableRect = tableEl.getBoundingClientRect();
|
|
9520
|
+
const trRect = trEl.getBoundingClientRect();
|
|
9521
|
+
const targetOffsetY = dragClientY - trRect.y - trEl.clientHeight;
|
|
9522
|
+
let resizeHeight = currCellHeight;
|
|
9523
|
+
const cellEl = tdEl.querySelector('.vxe-cell');
|
|
9524
|
+
let cellMinHeight = 0;
|
|
9525
|
+
if (cellEl) {
|
|
9526
|
+
const cellStyle = getComputedStyle(cellEl);
|
|
9527
|
+
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)));
|
|
9528
|
+
}
|
|
9529
|
+
const minTop = trRect.y - tableRect.y + cellMinHeight;
|
|
9530
|
+
// 处理拖动事件
|
|
9531
|
+
const updateEvent = evnt => {
|
|
9532
|
+
evnt.stopPropagation();
|
|
9533
|
+
evnt.preventDefault();
|
|
9534
|
+
const tableWidth = tableEl.clientWidth - osbWidth;
|
|
9535
|
+
const tableHeight = tableEl.clientHeight - osbHeight;
|
|
9536
|
+
let dragTop = evnt.clientY - tableRect.y - targetOffsetY;
|
|
9537
|
+
if (dragTop < minTop) {
|
|
9538
|
+
dragTop = minTop;
|
|
9539
|
+
} else {
|
|
9540
|
+
resizeHeight = Math.max(cellMinHeight, currCellHeight + evnt.clientY - dragClientY);
|
|
9541
|
+
}
|
|
9542
|
+
resizeBarElem.style.left = `${scrollbarYToLeft ? osbWidth : 0}px`;
|
|
9543
|
+
resizeBarElem.style.top = `${dragTop}px`;
|
|
9544
|
+
resizeBarElem.style.width = `${tableWidth}px`;
|
|
9545
|
+
if (resizableOpts.showDragTip && resizeTipElem) {
|
|
9546
|
+
resizeTipElem.textContent = methods_getI18n('vxe.table.resizeRowTip', [resizeHeight]);
|
|
9547
|
+
const resizeTipWidth = resizeTipElem.clientWidth;
|
|
9548
|
+
const resizeTipHeight = resizeTipElem.clientHeight;
|
|
9549
|
+
let resizeBarLeft = Math.max(2, evnt.clientX - tableRect.x);
|
|
9550
|
+
let resizeBarTop = 0;
|
|
9551
|
+
if (resizeBarLeft + resizeTipWidth >= tableWidth - 2) {
|
|
9552
|
+
resizeBarLeft = tableWidth - resizeTipWidth - 2;
|
|
9553
|
+
}
|
|
9554
|
+
if (dragTop + resizeTipHeight >= tableHeight) {
|
|
9555
|
+
resizeBarTop = tableHeight - (dragTop + resizeTipHeight);
|
|
9556
|
+
}
|
|
9557
|
+
resizeTipElem.style.left = `${resizeBarLeft}px`;
|
|
9558
|
+
resizeTipElem.style.top = `${resizeBarTop}px`;
|
|
9559
|
+
}
|
|
9560
|
+
reactData.isDragResize = true;
|
|
9561
|
+
};
|
|
9562
|
+
reactData.isDragResize = true;
|
|
9563
|
+
addClass(tableEl, 'row-drag--resize');
|
|
9564
|
+
resizeBarElem.style.display = 'block';
|
|
9565
|
+
document.onmousemove = updateEvent;
|
|
9566
|
+
document.onmouseup = function (evnt) {
|
|
9567
|
+
document.onmousemove = null;
|
|
9568
|
+
document.onmouseup = null;
|
|
9569
|
+
resizeBarElem.style.display = 'none';
|
|
9570
|
+
internalData._lastResizeTime = Date.now();
|
|
9571
|
+
setTimeout(() => {
|
|
9572
|
+
reactData.isDragResize = false;
|
|
9573
|
+
}, 50);
|
|
9574
|
+
if (resizeHeight !== currCellHeight) {
|
|
9575
|
+
const resizeParams = {
|
|
9097
9576
|
...params,
|
|
9098
|
-
|
|
9099
|
-
|
|
9100
|
-
|
|
9577
|
+
resizeHeight,
|
|
9578
|
+
resizeRow: row
|
|
9579
|
+
};
|
|
9580
|
+
internalData.isResizeCellHeight = true;
|
|
9581
|
+
if ($xeTable.handleRowResizeCellAreaEvent) {
|
|
9582
|
+
$xeTable.handleRowResizeCellAreaEvent(evnt, resizeParams);
|
|
9583
|
+
} else {
|
|
9584
|
+
rowRest.resizeHeight = resizeHeight;
|
|
9585
|
+
handleUpdateRowResize($xeTable, evnt, resizeParams);
|
|
9586
|
+
}
|
|
9587
|
+
}
|
|
9588
|
+
removeClass(tableEl, 'row-drag--resize');
|
|
9589
|
+
};
|
|
9590
|
+
updateEvent(evnt);
|
|
9591
|
+
},
|
|
9592
|
+
handleRowResizeDblclickEvent(evnt, params) {
|
|
9593
|
+
const $xeTable = this;
|
|
9594
|
+
const reactData = $xeTable;
|
|
9595
|
+
const internalData = $xeTable;
|
|
9596
|
+
const resizableOpts = $xeTable.computeResizableOpts;
|
|
9597
|
+
const {
|
|
9598
|
+
isDblclickAutoHeight
|
|
9599
|
+
} = resizableOpts;
|
|
9600
|
+
const el = $xeTable.$refs.refElem;
|
|
9601
|
+
if (isDblclickAutoHeight && el) {
|
|
9602
|
+
evnt.stopPropagation();
|
|
9603
|
+
evnt.preventDefault();
|
|
9604
|
+
const {
|
|
9605
|
+
editStore
|
|
9606
|
+
} = reactData;
|
|
9607
|
+
const {
|
|
9608
|
+
fullAllDataRowIdData
|
|
9609
|
+
} = internalData;
|
|
9610
|
+
const {
|
|
9611
|
+
actived
|
|
9612
|
+
} = editStore;
|
|
9613
|
+
const {
|
|
9614
|
+
row
|
|
9615
|
+
} = params;
|
|
9616
|
+
const rowid = getRowid($xeTable, row);
|
|
9617
|
+
const rowRest = fullAllDataRowIdData[rowid];
|
|
9618
|
+
if (!rowRest) {
|
|
9619
|
+
return;
|
|
9620
|
+
}
|
|
9621
|
+
const handleRsHeight = () => {
|
|
9622
|
+
const resizeHeight = calcCellAutoHeight(rowRest, el);
|
|
9623
|
+
const resizeParams = {
|
|
9624
|
+
...params,
|
|
9625
|
+
resizeHeight,
|
|
9626
|
+
resizeRow: row
|
|
9627
|
+
};
|
|
9628
|
+
reactData.isDragResize = false;
|
|
9629
|
+
internalData._lastResizeTime = Date.now();
|
|
9630
|
+
if ($xeTable.handleRowResizeDblclickCellAreaEvent) {
|
|
9631
|
+
$xeTable.handleRowResizeDblclickCellAreaEvent(evnt, resizeParams);
|
|
9632
|
+
} else {
|
|
9633
|
+
rowRest.resizeHeight = resizeHeight;
|
|
9634
|
+
handleUpdateRowResize($xeTable, evnt, resizeParams);
|
|
9635
|
+
}
|
|
9636
|
+
};
|
|
9637
|
+
if (actived.row || actived.column) {
|
|
9638
|
+
$xeTable.clearEdit().then(handleRsHeight);
|
|
9639
|
+
} else {
|
|
9640
|
+
handleRsHeight();
|
|
9641
|
+
}
|
|
9642
|
+
}
|
|
9643
|
+
},
|
|
9644
|
+
setRowHeightConf(heightConf) {
|
|
9645
|
+
const $xeTable = this;
|
|
9646
|
+
const reactData = $xeTable;
|
|
9647
|
+
const internalData = $xeTable;
|
|
9648
|
+
const {
|
|
9649
|
+
fullAllDataRowIdData
|
|
9650
|
+
} = internalData;
|
|
9651
|
+
let status = false;
|
|
9652
|
+
if (heightConf) {
|
|
9653
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(heightConf, (height, rowid) => {
|
|
9654
|
+
const rowRest = fullAllDataRowIdData[rowid];
|
|
9655
|
+
if (rowRest) {
|
|
9656
|
+
const rHeight = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toInteger(height);
|
|
9657
|
+
if (rHeight) {
|
|
9658
|
+
rowRest.resizeHeight = rHeight;
|
|
9659
|
+
if (!status) {
|
|
9660
|
+
status = true;
|
|
9661
|
+
}
|
|
9662
|
+
}
|
|
9663
|
+
}
|
|
9664
|
+
});
|
|
9665
|
+
if (status) {
|
|
9666
|
+
internalData.isResizeCellHeight = true;
|
|
9667
|
+
reactData.resizeHeightFlag++;
|
|
9668
|
+
}
|
|
9669
|
+
}
|
|
9670
|
+
return $xeTable.$nextTick().then(() => {
|
|
9671
|
+
return {
|
|
9672
|
+
status
|
|
9673
|
+
};
|
|
9674
|
+
});
|
|
9675
|
+
},
|
|
9676
|
+
getRowHeightConf(isFull) {
|
|
9677
|
+
const $xeTable = this;
|
|
9678
|
+
const internalData = $xeTable;
|
|
9679
|
+
const {
|
|
9680
|
+
fullAllDataRowIdData,
|
|
9681
|
+
afterFullData
|
|
9682
|
+
} = internalData;
|
|
9683
|
+
const rowOpts = $xeTable.computeRowOpts;
|
|
9684
|
+
const cellOpts = $xeTable.computeCellOpts;
|
|
9685
|
+
const defaultRowHeight = $xeTable.computeDefaultRowHeight;
|
|
9686
|
+
const rest = {};
|
|
9687
|
+
afterFullData.forEach(row => {
|
|
9688
|
+
const rowid = getRowid($xeTable, row);
|
|
9689
|
+
const rowRest = fullAllDataRowIdData[rowid];
|
|
9690
|
+
if (rowRest) {
|
|
9691
|
+
const resizeHeight = rowRest.resizeHeight;
|
|
9692
|
+
if (resizeHeight || isFull) {
|
|
9693
|
+
const currCellHeight = resizeHeight || rowRest.height || cellOpts.height || rowOpts.height || defaultRowHeight;
|
|
9694
|
+
rest[rowid] = currCellHeight;
|
|
9695
|
+
}
|
|
9696
|
+
}
|
|
9697
|
+
});
|
|
9698
|
+
return rest;
|
|
9699
|
+
},
|
|
9700
|
+
setRowHeight(rowOrId, height) {
|
|
9701
|
+
const $xeTable = this;
|
|
9702
|
+
const reactData = $xeTable;
|
|
9703
|
+
const internalData = $xeTable;
|
|
9704
|
+
const {
|
|
9705
|
+
fullAllDataRowIdData
|
|
9706
|
+
} = internalData;
|
|
9707
|
+
let status = false;
|
|
9708
|
+
const rows = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(rowOrId) ? rowOrId : [rowOrId];
|
|
9709
|
+
let rHeight = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toInteger(height);
|
|
9710
|
+
if (isScale(height)) {
|
|
9711
|
+
const tableBody = $xeTable.$refs.refTableBody;
|
|
9712
|
+
const bodyElem = tableBody ? tableBody.$el : null;
|
|
9713
|
+
const bodyHeight = bodyElem ? bodyElem.clientHeight - 1 : 0;
|
|
9714
|
+
rHeight = Math.floor(rHeight * bodyHeight);
|
|
9715
|
+
}
|
|
9716
|
+
if (rHeight) {
|
|
9717
|
+
rows.forEach(row => {
|
|
9718
|
+
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);
|
|
9719
|
+
const rowRest = fullAllDataRowIdData[rowid];
|
|
9720
|
+
if (rowRest) {
|
|
9721
|
+
rowRest.resizeHeight = rHeight;
|
|
9722
|
+
if (!status) {
|
|
9723
|
+
status = true;
|
|
9724
|
+
}
|
|
9725
|
+
}
|
|
9101
9726
|
});
|
|
9727
|
+
if (status) {
|
|
9728
|
+
internalData.isResizeCellHeight = true;
|
|
9729
|
+
reactData.resizeHeightFlag++;
|
|
9730
|
+
}
|
|
9731
|
+
}
|
|
9732
|
+
return $xeTable.$nextTick();
|
|
9733
|
+
},
|
|
9734
|
+
getRowHeight(rowOrId) {
|
|
9735
|
+
const $xeTable = this;
|
|
9736
|
+
const internalData = $xeTable;
|
|
9737
|
+
const {
|
|
9738
|
+
fullAllDataRowIdData
|
|
9739
|
+
} = internalData;
|
|
9740
|
+
const rowOpts = $xeTable.computeRowOpts;
|
|
9741
|
+
const cellOpts = $xeTable.computeCellOpts;
|
|
9742
|
+
const defaultRowHeight = $xeTable.computeDefaultRowHeight;
|
|
9743
|
+
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);
|
|
9744
|
+
const rowRest = fullAllDataRowIdData[rowid];
|
|
9745
|
+
if (rowRest) {
|
|
9746
|
+
return rowRest.resizeHeight || rowRest.height || cellOpts.height || rowOpts.height || defaultRowHeight;
|
|
9102
9747
|
}
|
|
9748
|
+
return 0;
|
|
9103
9749
|
},
|
|
9104
9750
|
/**
|
|
9105
9751
|
* 刷新滚动操作,手动同步滚动相关位置(对于某些特殊的操作,比如滚动条错位、固定列不同步)
|
|
@@ -9535,10 +10181,10 @@ const Methods = {
|
|
|
9535
10181
|
}
|
|
9536
10182
|
} else if (isContextMenu) {
|
|
9537
10183
|
// 如果按下上下文键
|
|
9538
|
-
|
|
10184
|
+
internalData._keyCtx = selected.row && selected.column && bodyCtxMenu.length;
|
|
9539
10185
|
clearTimeout(internalData.keyCtxTimeout);
|
|
9540
10186
|
internalData.keyCtxTimeout = setTimeout(() => {
|
|
9541
|
-
|
|
10187
|
+
internalData._keyCtx = false;
|
|
9542
10188
|
}, 1000);
|
|
9543
10189
|
} else if (isEnter && !hasAltKey && keyboardConfig && keyboardOpts.isEnter && (selected.row || actived.row || treeConfig && (rowOpts.isCurrent || highlightCurrentRow) && currentRow)) {
|
|
9544
10190
|
const {
|
|
@@ -9819,53 +10465,45 @@ const Methods = {
|
|
|
9819
10465
|
this.updateCellAreas();
|
|
9820
10466
|
this.recalculate(true);
|
|
9821
10467
|
},
|
|
9822
|
-
handleTargetEnterEvent(isClear) {
|
|
9823
|
-
const $tooltip = this.$refs.tooltip;
|
|
9824
|
-
clearTimeout(this.tooltipTimeout);
|
|
9825
|
-
if (isClear) {
|
|
9826
|
-
this.closeTooltip();
|
|
9827
|
-
} else {
|
|
9828
|
-
if ($tooltip) {
|
|
9829
|
-
$tooltip.setActived(true);
|
|
9830
|
-
}
|
|
9831
|
-
}
|
|
9832
|
-
},
|
|
9833
10468
|
handleTargetLeaveEvent() {
|
|
9834
|
-
const
|
|
9835
|
-
|
|
9836
|
-
|
|
10469
|
+
const $xeTable = this;
|
|
10470
|
+
const internalData = $xeTable;
|
|
10471
|
+
const tooltipOpts = $xeTable.computeTooltipOpts;
|
|
10472
|
+
let $tooltip = $xeTable.$refs.refTooltip;
|
|
10473
|
+
if ($tooltip && $tooltip.setActived) {
|
|
9837
10474
|
$tooltip.setActived(false);
|
|
9838
10475
|
}
|
|
9839
10476
|
if (tooltipOpts.enterable) {
|
|
9840
|
-
|
|
9841
|
-
$tooltip =
|
|
9842
|
-
if ($tooltip && !$tooltip.isActived()) {
|
|
9843
|
-
|
|
10477
|
+
internalData.tooltipTimeout = setTimeout(() => {
|
|
10478
|
+
$tooltip = $xeTable.$refs.refTooltip;
|
|
10479
|
+
if ($tooltip && $tooltip.isActived && !$tooltip.isActived()) {
|
|
10480
|
+
$xeTable.closeTooltip();
|
|
9844
10481
|
}
|
|
9845
10482
|
}, tooltipOpts.leaveDelay);
|
|
9846
10483
|
} else {
|
|
9847
|
-
|
|
10484
|
+
$xeTable.closeTooltip();
|
|
9848
10485
|
}
|
|
9849
10486
|
},
|
|
9850
10487
|
triggerHeaderTitleEvent(evnt, iconParams, params) {
|
|
10488
|
+
const $xeTable = this;
|
|
10489
|
+
const reactData = $xeTable;
|
|
9851
10490
|
const tipContent = iconParams.content || iconParams.message;
|
|
9852
10491
|
if (tipContent) {
|
|
9853
10492
|
const {
|
|
9854
|
-
$refs,
|
|
9855
10493
|
tooltipStore
|
|
9856
|
-
} =
|
|
10494
|
+
} = reactData;
|
|
9857
10495
|
const {
|
|
9858
10496
|
column
|
|
9859
10497
|
} = params;
|
|
9860
10498
|
const content = getFuncText(tipContent);
|
|
9861
|
-
|
|
10499
|
+
handleTargetEnterEvent($xeTable, true);
|
|
9862
10500
|
tooltipStore.row = null;
|
|
9863
10501
|
tooltipStore.column = column;
|
|
9864
10502
|
tooltipStore.visible = true;
|
|
9865
10503
|
tooltipStore.currOpts = iconParams;
|
|
9866
|
-
|
|
9867
|
-
const $tooltip = $refs.
|
|
9868
|
-
if ($tooltip) {
|
|
10504
|
+
$xeTable.$nextTick(() => {
|
|
10505
|
+
const $tooltip = $xeTable.$refs.refTooltip;
|
|
10506
|
+
if ($tooltip && $tooltip.open) {
|
|
9869
10507
|
$tooltip.open(evnt.currentTarget, content);
|
|
9870
10508
|
}
|
|
9871
10509
|
});
|
|
@@ -9875,28 +10513,48 @@ const Methods = {
|
|
|
9875
10513
|
* 触发表头 tooltip 事件
|
|
9876
10514
|
*/
|
|
9877
10515
|
triggerHeaderTooltipEvent(evnt, params) {
|
|
10516
|
+
const $xeTable = this;
|
|
10517
|
+
const reactData = $xeTable;
|
|
9878
10518
|
const {
|
|
9879
10519
|
tooltipStore
|
|
9880
|
-
} =
|
|
10520
|
+
} = reactData;
|
|
9881
10521
|
const {
|
|
9882
10522
|
column
|
|
9883
10523
|
} = params;
|
|
10524
|
+
handleTargetEnterEvent($xeTable, true);
|
|
9884
10525
|
const titleElem = evnt.currentTarget;
|
|
9885
|
-
|
|
10526
|
+
if (!titleElem) {
|
|
10527
|
+
return;
|
|
10528
|
+
}
|
|
10529
|
+
const cellEl = titleElem.parentElement;
|
|
10530
|
+
if (!cellEl) {
|
|
10531
|
+
return;
|
|
10532
|
+
}
|
|
10533
|
+
const thEl = cellEl.parentElement;
|
|
10534
|
+
if (!thEl) {
|
|
10535
|
+
return;
|
|
10536
|
+
}
|
|
9886
10537
|
if (tooltipStore.column !== column || !tooltipStore.visible) {
|
|
9887
|
-
|
|
10538
|
+
handleTooltip($xeTable, evnt, thEl, cellEl, null, params);
|
|
9888
10539
|
}
|
|
9889
10540
|
},
|
|
9890
10541
|
/**
|
|
9891
10542
|
* 触发单元格 tooltip 事件
|
|
9892
10543
|
*/
|
|
9893
10544
|
triggerBodyTooltipEvent(evnt, params) {
|
|
10545
|
+
const $xeTable = this;
|
|
10546
|
+
const props = $xeTable;
|
|
10547
|
+
const reactData = $xeTable;
|
|
10548
|
+
const {
|
|
10549
|
+
editConfig
|
|
10550
|
+
} = props;
|
|
10551
|
+
const {
|
|
10552
|
+
editStore
|
|
10553
|
+
} = reactData;
|
|
9894
10554
|
const {
|
|
9895
|
-
editConfig,
|
|
9896
|
-
editOpts,
|
|
9897
|
-
editStore,
|
|
9898
10555
|
tooltipStore
|
|
9899
|
-
} =
|
|
10556
|
+
} = reactData;
|
|
10557
|
+
const editOpts = $xeTable.computeEditOpts;
|
|
9900
10558
|
const {
|
|
9901
10559
|
actived
|
|
9902
10560
|
} = editStore;
|
|
@@ -9904,8 +10562,8 @@ const Methods = {
|
|
|
9904
10562
|
row,
|
|
9905
10563
|
column
|
|
9906
10564
|
} = params;
|
|
9907
|
-
const
|
|
9908
|
-
|
|
10565
|
+
const tdEl = evnt.currentTarget;
|
|
10566
|
+
handleTargetEnterEvent($xeTable, tooltipStore.column !== column || tooltipStore.row !== row);
|
|
9909
10567
|
// 单元格处于编辑状态时不触发提示框
|
|
9910
10568
|
if (column.editRender && isEnableConf(editConfig)) {
|
|
9911
10569
|
// 如果是行编辑模式
|
|
@@ -9918,80 +10576,26 @@ const Methods = {
|
|
|
9918
10576
|
}
|
|
9919
10577
|
}
|
|
9920
10578
|
if (tooltipStore.column !== column || tooltipStore.row !== row || !tooltipStore.visible) {
|
|
9921
|
-
|
|
9922
|
-
let tipElem;
|
|
9923
|
-
if (column.treeNode) {
|
|
9924
|
-
overflowElem = cell.querySelector('.vxe-tree-cell');
|
|
9925
|
-
if (column.type === 'html') {
|
|
9926
|
-
tipElem = cell.querySelector('.vxe-cell--html');
|
|
9927
|
-
}
|
|
9928
|
-
} else {
|
|
9929
|
-
tipElem = cell.querySelector(column.type === 'html' ? '.vxe-cell--html' : '.vxe-cell--label');
|
|
9930
|
-
}
|
|
9931
|
-
this.handleTooltip(evnt, cell, overflowElem || cell.children[0], tipElem, params);
|
|
10579
|
+
handleTooltip($xeTable, evnt, tdEl, tdEl.querySelector('.vxe-cell--wrapper'), null, params);
|
|
9932
10580
|
}
|
|
9933
10581
|
},
|
|
9934
10582
|
/**
|
|
9935
10583
|
* 触发表尾 tooltip 事件
|
|
9936
10584
|
*/
|
|
9937
10585
|
triggerFooterTooltipEvent(evnt, params) {
|
|
10586
|
+
const $xeTable = this;
|
|
10587
|
+
const reactData = $xeTable;
|
|
9938
10588
|
const {
|
|
9939
10589
|
column
|
|
9940
10590
|
} = params;
|
|
9941
10591
|
const {
|
|
9942
10592
|
tooltipStore
|
|
9943
|
-
} =
|
|
10593
|
+
} = reactData;
|
|
9944
10594
|
const cell = evnt.currentTarget;
|
|
9945
|
-
|
|
10595
|
+
handleTargetEnterEvent($xeTable, tooltipStore.column !== column || !!tooltipStore.row);
|
|
9946
10596
|
if (tooltipStore.column !== column || !tooltipStore.visible) {
|
|
9947
|
-
|
|
9948
|
-
}
|
|
9949
|
-
},
|
|
9950
|
-
/**
|
|
9951
|
-
* 处理显示 tooltip
|
|
9952
|
-
* @param {Event} evnt 事件
|
|
9953
|
-
* @param {ColumnInfo} column 列配置
|
|
9954
|
-
* @param {Row} row 行对象
|
|
9955
|
-
*/
|
|
9956
|
-
handleTooltip(evnt, cell, overflowElem, tipElem, params) {
|
|
9957
|
-
const $xeTable = this;
|
|
9958
|
-
if (!overflowElem) {
|
|
9959
|
-
return $xeTable.$nextTick();
|
|
9960
|
-
}
|
|
9961
|
-
params.cell = cell;
|
|
9962
|
-
const {
|
|
9963
|
-
$refs,
|
|
9964
|
-
tooltipOpts,
|
|
9965
|
-
tooltipStore
|
|
9966
|
-
} = this;
|
|
9967
|
-
const {
|
|
9968
|
-
column,
|
|
9969
|
-
row
|
|
9970
|
-
} = params;
|
|
9971
|
-
const {
|
|
9972
|
-
showAll,
|
|
9973
|
-
enabled,
|
|
9974
|
-
contentMethod
|
|
9975
|
-
} = tooltipOpts;
|
|
9976
|
-
const customContent = contentMethod ? contentMethod(params) : null;
|
|
9977
|
-
const useCustom = contentMethod && !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(customContent);
|
|
9978
|
-
const content = useCustom ? customContent : (column.type === 'html' ? overflowElem.innerText : overflowElem.textContent).trim();
|
|
9979
|
-
const isCellOverflow = overflowElem.scrollWidth > overflowElem.clientWidth;
|
|
9980
|
-
if (content && (showAll || enabled || useCustom || isCellOverflow)) {
|
|
9981
|
-
Object.assign(tooltipStore, {
|
|
9982
|
-
row,
|
|
9983
|
-
column,
|
|
9984
|
-
visible: true,
|
|
9985
|
-
currOpts: {}
|
|
9986
|
-
});
|
|
9987
|
-
this.$nextTick(() => {
|
|
9988
|
-
const $tooltip = $refs.tooltip;
|
|
9989
|
-
if ($tooltip) {
|
|
9990
|
-
$tooltip.open(isCellOverflow ? overflowElem : tipElem || overflowElem, formatText(content));
|
|
9991
|
-
}
|
|
9992
|
-
});
|
|
10597
|
+
handleTooltip($xeTable, evnt, cell, cell.querySelector('.vxe-cell--wrapper') || cell.children[0], null, params);
|
|
9993
10598
|
}
|
|
9994
|
-
return this.$nextTick();
|
|
9995
10599
|
},
|
|
9996
10600
|
openTooltip(target, content) {
|
|
9997
10601
|
const {
|
|
@@ -10007,12 +10611,13 @@ const Methods = {
|
|
|
10007
10611
|
* 关闭 tooltip
|
|
10008
10612
|
*/
|
|
10009
10613
|
closeTooltip() {
|
|
10614
|
+
const $xeTable = this;
|
|
10615
|
+
const reactData = $xeTable;
|
|
10010
10616
|
const {
|
|
10011
|
-
$refs,
|
|
10012
10617
|
tooltipStore
|
|
10013
|
-
} =
|
|
10014
|
-
const tooltip = $refs.
|
|
10015
|
-
const commTip = $refs.refCommTooltip;
|
|
10618
|
+
} = reactData;
|
|
10619
|
+
const tooltip = $xeTable.$refs.refTooltip;
|
|
10620
|
+
const commTip = $xeTable.$refs.refCommTooltip;
|
|
10016
10621
|
if (tooltipStore.visible) {
|
|
10017
10622
|
Object.assign(tooltipStore, {
|
|
10018
10623
|
row: null,
|
|
@@ -11235,10 +11840,13 @@ const Methods = {
|
|
|
11235
11840
|
this.hoverRow = null;
|
|
11236
11841
|
},
|
|
11237
11842
|
triggerHeaderCellClickEvent(evnt, params) {
|
|
11843
|
+
const $xeTable = this;
|
|
11844
|
+
const internalData = $xeTable;
|
|
11238
11845
|
const {
|
|
11239
|
-
_lastResizeTime
|
|
11240
|
-
|
|
11241
|
-
|
|
11846
|
+
_lastResizeTime
|
|
11847
|
+
} = internalData;
|
|
11848
|
+
const sortOpts = $xeTable.computeSortOpts;
|
|
11849
|
+
const columnOpts = $xeTable.computeColumnOpts;
|
|
11242
11850
|
const {
|
|
11243
11851
|
column
|
|
11244
11852
|
} = params;
|
|
@@ -11247,18 +11855,18 @@ const Methods = {
|
|
|
11247
11855
|
const triggerSort = getEventTargetNode(evnt, cell, 'vxe-cell--sort').flag;
|
|
11248
11856
|
const triggerFilter = getEventTargetNode(evnt, cell, 'vxe-cell--filter').flag;
|
|
11249
11857
|
if (sortOpts.trigger === 'cell' && !(triggerResizable || triggerSort || triggerFilter)) {
|
|
11250
|
-
|
|
11858
|
+
$xeTable.triggerSortEvent(evnt, column, getNextSortOrder($xeTable, column));
|
|
11251
11859
|
}
|
|
11252
|
-
|
|
11860
|
+
$xeTable.dispatchEvent('header-cell-click', Object.assign({
|
|
11253
11861
|
triggerResizable,
|
|
11254
11862
|
triggerSort,
|
|
11255
11863
|
triggerFilter,
|
|
11256
11864
|
cell
|
|
11257
11865
|
}, params), evnt);
|
|
11258
|
-
if (
|
|
11259
|
-
|
|
11866
|
+
if (columnOpts.isCurrent || $xeTable.highlightCurrentColumn) {
|
|
11867
|
+
$xeTable.triggerCurrentColumnEvent(evnt, params);
|
|
11260
11868
|
}
|
|
11261
|
-
return
|
|
11869
|
+
return $xeTable.$nextTick();
|
|
11262
11870
|
},
|
|
11263
11871
|
triggerHeaderCellDblclickEvent(evnt, params) {
|
|
11264
11872
|
this.emitEvent('header-cell-dblclick', Object.assign({
|
|
@@ -11310,18 +11918,26 @@ const Methods = {
|
|
|
11310
11918
|
*/
|
|
11311
11919
|
triggerCellClickEvent(evnt, params) {
|
|
11312
11920
|
const $xeTable = this;
|
|
11921
|
+
const props = $xeTable;
|
|
11922
|
+
const reactData = $xeTable;
|
|
11313
11923
|
const {
|
|
11314
11924
|
highlightCurrentRow,
|
|
11925
|
+
editConfig
|
|
11926
|
+
} = props;
|
|
11927
|
+
const {
|
|
11315
11928
|
editStore,
|
|
11316
|
-
|
|
11317
|
-
|
|
11318
|
-
|
|
11319
|
-
|
|
11320
|
-
|
|
11321
|
-
|
|
11322
|
-
|
|
11323
|
-
|
|
11324
|
-
|
|
11929
|
+
isDragResize
|
|
11930
|
+
} = reactData;
|
|
11931
|
+
if (isDragResize) {
|
|
11932
|
+
return;
|
|
11933
|
+
}
|
|
11934
|
+
const expandOpts = $xeTable.computeExpandOpts;
|
|
11935
|
+
const editOpts = $xeTable.computeEditOpts;
|
|
11936
|
+
const treeOpts = $xeTable.computeTreeOpts;
|
|
11937
|
+
const radioOpts = $xeTable.computeRadioOpts;
|
|
11938
|
+
const checkboxOpts = $xeTable.computeCheckboxOpts;
|
|
11939
|
+
const keyboardOpts = $xeTable.computeKeyboardOpts;
|
|
11940
|
+
const rowOpts = $xeTable.computeRowOpts;
|
|
11325
11941
|
const {
|
|
11326
11942
|
actived,
|
|
11327
11943
|
focused
|
|
@@ -11420,11 +12036,20 @@ const Methods = {
|
|
|
11420
12036
|
* 如果是双击模式,则激活为编辑状态
|
|
11421
12037
|
*/
|
|
11422
12038
|
triggerCellDblclickEvent(evnt, params) {
|
|
12039
|
+
const $xeTable = this;
|
|
12040
|
+
const props = $xeTable;
|
|
12041
|
+
const reactData = $xeTable;
|
|
12042
|
+
const {
|
|
12043
|
+
editConfig
|
|
12044
|
+
} = props;
|
|
11423
12045
|
const {
|
|
11424
12046
|
editStore,
|
|
11425
|
-
|
|
11426
|
-
|
|
11427
|
-
|
|
12047
|
+
isDragResize
|
|
12048
|
+
} = reactData;
|
|
12049
|
+
if (isDragResize) {
|
|
12050
|
+
return;
|
|
12051
|
+
}
|
|
12052
|
+
const editOpts = $xeTable.computeEditOpts;
|
|
11428
12053
|
const {
|
|
11429
12054
|
actived
|
|
11430
12055
|
} = editStore;
|
|
@@ -11512,6 +12137,10 @@ const Methods = {
|
|
|
11512
12137
|
triggerSortEvent(evnt, column, order) {
|
|
11513
12138
|
const $xeTable = this;
|
|
11514
12139
|
const sortOpts = $xeTable.computeSortOpts;
|
|
12140
|
+
const {
|
|
12141
|
+
multiple,
|
|
12142
|
+
allowClear
|
|
12143
|
+
} = sortOpts;
|
|
11515
12144
|
const {
|
|
11516
12145
|
field,
|
|
11517
12146
|
sortable,
|
|
@@ -11519,7 +12148,9 @@ const Methods = {
|
|
|
11519
12148
|
} = column;
|
|
11520
12149
|
if (sortable || remoteSort) {
|
|
11521
12150
|
if (!order || column.order === order) {
|
|
11522
|
-
|
|
12151
|
+
if (allowClear) {
|
|
12152
|
+
$xeTable.clearSort(multiple ? column : null);
|
|
12153
|
+
}
|
|
11523
12154
|
} else {
|
|
11524
12155
|
$xeTable.sort({
|
|
11525
12156
|
field,
|
|
@@ -11654,7 +12285,8 @@ const Methods = {
|
|
|
11654
12285
|
isPeerDrag,
|
|
11655
12286
|
isCrossDrag,
|
|
11656
12287
|
isSelfToChildDrag,
|
|
11657
|
-
dragEndMethod
|
|
12288
|
+
dragEndMethod,
|
|
12289
|
+
dragToChildMethod
|
|
11658
12290
|
} = rowDragOpts;
|
|
11659
12291
|
const treeOpts = $xeTable.computeTreeOpts;
|
|
11660
12292
|
const {
|
|
@@ -11673,13 +12305,15 @@ const Methods = {
|
|
|
11673
12305
|
if (prevDragRow && dragRow) {
|
|
11674
12306
|
// 判断是否有拖动
|
|
11675
12307
|
if (prevDragRow !== dragRow) {
|
|
11676
|
-
|
|
12308
|
+
const dragParams = {
|
|
11677
12309
|
oldRow: dragRow,
|
|
11678
12310
|
newRow: prevDragRow,
|
|
11679
12311
|
dragPos: prevDragPos,
|
|
11680
12312
|
dragToChild: !!prevDragToChild,
|
|
11681
12313
|
offsetIndex: dragOffsetIndex
|
|
11682
|
-
}
|
|
12314
|
+
};
|
|
12315
|
+
const isDragToChildFlag = isSelfToChildDrag && dragToChildMethod ? dragToChildMethod(dragParams) : prevDragToChild;
|
|
12316
|
+
return Promise.resolve(dEndMethod ? dEndMethod(dragParams) : true).then(status => {
|
|
11683
12317
|
if (!status) {
|
|
11684
12318
|
return;
|
|
11685
12319
|
}
|
|
@@ -11757,7 +12391,9 @@ const Methods = {
|
|
|
11757
12391
|
// 根到根
|
|
11758
12392
|
}
|
|
11759
12393
|
const fullList = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toTreeArray(internalData.afterTreeFullData, {
|
|
11760
|
-
|
|
12394
|
+
key: rowField,
|
|
12395
|
+
parentKey: parentField,
|
|
12396
|
+
children: mapChildrenField
|
|
11761
12397
|
});
|
|
11762
12398
|
// 移出
|
|
11763
12399
|
const otfIndex = $xeTable.findRowIndexOf(fullList, dragRow);
|
|
@@ -11772,12 +12408,12 @@ const Methods = {
|
|
|
11772
12408
|
childRow[parentField] = dragRow[parentField];
|
|
11773
12409
|
});
|
|
11774
12410
|
}
|
|
11775
|
-
dragRow[parentField] =
|
|
12411
|
+
dragRow[parentField] = isDragToChildFlag ? prevDragRow[rowField] : prevDragRow[parentField];
|
|
11776
12412
|
internalData.tableFullTreeData = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toArrayTree(fullList, {
|
|
11777
|
-
key:
|
|
11778
|
-
parentKey:
|
|
12413
|
+
key: rowField,
|
|
12414
|
+
parentKey: parentField,
|
|
11779
12415
|
children: childrenField,
|
|
11780
|
-
mapChildren:
|
|
12416
|
+
mapChildren: mapChildrenField
|
|
11781
12417
|
});
|
|
11782
12418
|
}
|
|
11783
12419
|
}
|
|
@@ -11797,7 +12433,7 @@ const Methods = {
|
|
|
11797
12433
|
}
|
|
11798
12434
|
reactData.isDragRowMove = true;
|
|
11799
12435
|
$xeTable.handleTableData(treeConfig && transform);
|
|
11800
|
-
$xeTable.cacheRowMap();
|
|
12436
|
+
$xeTable.cacheRowMap(false);
|
|
11801
12437
|
updateScrollYStatus($xeTable);
|
|
11802
12438
|
if (!(treeConfig && transform)) {
|
|
11803
12439
|
updateAfterDataIndex($xeTable);
|
|
@@ -11814,7 +12450,7 @@ const Methods = {
|
|
|
11814
12450
|
oldRow: dragRow,
|
|
11815
12451
|
newRow: prevDragRow,
|
|
11816
12452
|
dragPos: prevDragPos,
|
|
11817
|
-
dragToChild:
|
|
12453
|
+
dragToChild: isDragToChildFlag,
|
|
11818
12454
|
offsetIndex: dragOffsetIndex,
|
|
11819
12455
|
_index: {
|
|
11820
12456
|
newIndex: nafIndex,
|
|
@@ -11850,18 +12486,16 @@ const Methods = {
|
|
|
11850
12486
|
prevDragRow,
|
|
11851
12487
|
prevDragPos
|
|
11852
12488
|
} = internalData;
|
|
11853
|
-
if (treeConfig && prevDragToChild) {
|
|
12489
|
+
if (treeConfig && lazy && prevDragToChild) {
|
|
11854
12490
|
// 懒加载
|
|
11855
|
-
|
|
11856
|
-
|
|
11857
|
-
|
|
11858
|
-
if (
|
|
11859
|
-
if (rowRest && rowRest.treeLoaded) {
|
|
11860
|
-
$xeTable.handleRowDragSwapEvent(evnt, true, dragRow, prevDragRow, prevDragPos, prevDragToChild);
|
|
11861
|
-
}
|
|
11862
|
-
} else {
|
|
12491
|
+
const newRowid = getRowid($xeTable, prevDragRow);
|
|
12492
|
+
const rowRest = fullAllDataRowIdData[newRowid];
|
|
12493
|
+
if (prevDragRow[hasChildField]) {
|
|
12494
|
+
if (rowRest && rowRest.treeLoaded) {
|
|
11863
12495
|
$xeTable.handleRowDragSwapEvent(evnt, true, dragRow, prevDragRow, prevDragPos, prevDragToChild);
|
|
11864
12496
|
}
|
|
12497
|
+
} else {
|
|
12498
|
+
$xeTable.handleRowDragSwapEvent(evnt, true, dragRow, prevDragRow, prevDragPos, prevDragToChild);
|
|
11865
12499
|
}
|
|
11866
12500
|
} else {
|
|
11867
12501
|
$xeTable.handleRowDragSwapEvent(evnt, true, dragRow, prevDragRow, prevDragPos, prevDragToChild);
|
|
@@ -12005,7 +12639,8 @@ const Methods = {
|
|
|
12005
12639
|
isCrossDrag,
|
|
12006
12640
|
isSelfToChildDrag,
|
|
12007
12641
|
isToChildDrag,
|
|
12008
|
-
dragEndMethod
|
|
12642
|
+
dragEndMethod,
|
|
12643
|
+
dragToChildMethod
|
|
12009
12644
|
} = columnDragOpts;
|
|
12010
12645
|
const {
|
|
12011
12646
|
collectColumn
|
|
@@ -12016,13 +12651,15 @@ const Methods = {
|
|
|
12016
12651
|
if (prevDragCol !== dragCol) {
|
|
12017
12652
|
const oldColumn = dragCol;
|
|
12018
12653
|
const newColumn = prevDragCol;
|
|
12019
|
-
|
|
12654
|
+
const dragParams = {
|
|
12020
12655
|
oldColumn,
|
|
12021
12656
|
newColumn,
|
|
12022
12657
|
dragPos: prevDragPos,
|
|
12023
12658
|
dragToChild: !!prevDragToChild,
|
|
12024
12659
|
offsetIndex: dragOffsetIndex
|
|
12025
|
-
}
|
|
12660
|
+
};
|
|
12661
|
+
const isDragToChildFlag = isSelfToChildDrag && dragToChildMethod ? dragToChildMethod(dragParams) : prevDragToChild;
|
|
12662
|
+
return Promise.resolve(dragEndMethod ? dragEndMethod(dragParams) : true).then(status => {
|
|
12026
12663
|
if (!status) {
|
|
12027
12664
|
return;
|
|
12028
12665
|
}
|
|
@@ -12118,7 +12755,7 @@ const Methods = {
|
|
|
12118
12755
|
parent: nParent
|
|
12119
12756
|
} = newMatchRest;
|
|
12120
12757
|
// 转子级
|
|
12121
|
-
if (isCrossDrag && isToChildDrag &&
|
|
12758
|
+
if (isCrossDrag && isToChildDrag && isDragToChildFlag) {
|
|
12122
12759
|
oldColumn.parentId = newColumn.id;
|
|
12123
12760
|
newColumn.children = (newColumn.children || []).concat([oldColumn]);
|
|
12124
12761
|
} else {
|
|
@@ -12149,7 +12786,7 @@ const Methods = {
|
|
|
12149
12786
|
oldColumn,
|
|
12150
12787
|
newColumn,
|
|
12151
12788
|
dragPos: prevDragPos,
|
|
12152
|
-
dragToChild:
|
|
12789
|
+
dragToChild: isDragToChildFlag,
|
|
12153
12790
|
offsetIndex: dragOffsetIndex,
|
|
12154
12791
|
_index: {
|
|
12155
12792
|
newIndex: nafIndex,
|
|
@@ -13413,17 +14050,22 @@ const Methods = {
|
|
|
13413
14050
|
* 获取表格的滚动状态
|
|
13414
14051
|
*/
|
|
13415
14052
|
getScroll() {
|
|
14053
|
+
const $xeTable = this;
|
|
14054
|
+
const reactData = $xeTable;
|
|
14055
|
+
const internalData = $xeTable;
|
|
13416
14056
|
const {
|
|
13417
|
-
$refs,
|
|
13418
14057
|
scrollXLoad,
|
|
13419
14058
|
scrollYLoad
|
|
13420
|
-
} =
|
|
13421
|
-
const
|
|
14059
|
+
} = reactData;
|
|
14060
|
+
const {
|
|
14061
|
+
elemStore
|
|
14062
|
+
} = internalData;
|
|
14063
|
+
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
13422
14064
|
return {
|
|
13423
14065
|
virtualX: scrollXLoad,
|
|
13424
14066
|
virtualY: scrollYLoad,
|
|
13425
|
-
scrollTop:
|
|
13426
|
-
scrollLeft:
|
|
14067
|
+
scrollTop: bodyScrollElem ? bodyScrollElem.scrollTop : 0,
|
|
14068
|
+
scrollLeft: bodyScrollElem ? bodyScrollElem.scrollLeft : 0
|
|
13427
14069
|
};
|
|
13428
14070
|
},
|
|
13429
14071
|
handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, params) {
|
|
@@ -13532,60 +14174,6 @@ const Methods = {
|
|
|
13532
14174
|
}
|
|
13533
14175
|
$xeTable.dispatchEvent('scroll', evntParams, evnt);
|
|
13534
14176
|
},
|
|
13535
|
-
lazyScrollXData() {
|
|
13536
|
-
const $xeTable = this;
|
|
13537
|
-
const internalData = $xeTable;
|
|
13538
|
-
const {
|
|
13539
|
-
lxTimeout,
|
|
13540
|
-
lxRunTime,
|
|
13541
|
-
scrollXStore
|
|
13542
|
-
} = internalData;
|
|
13543
|
-
const {
|
|
13544
|
-
visibleSize
|
|
13545
|
-
} = scrollXStore;
|
|
13546
|
-
const fpsTime = Math.max(5, Math.min(80, Math.floor(visibleSize * 3)));
|
|
13547
|
-
if (lxTimeout) {
|
|
13548
|
-
clearTimeout(lxTimeout);
|
|
13549
|
-
}
|
|
13550
|
-
if (!lxRunTime || lxRunTime + fpsTime < Date.now()) {
|
|
13551
|
-
internalData.lxRunTime = Date.now();
|
|
13552
|
-
loadScrollXData($xeTable);
|
|
13553
|
-
}
|
|
13554
|
-
internalData.lxTimeout = setTimeout(() => {
|
|
13555
|
-
internalData.lxTimeout = undefined;
|
|
13556
|
-
internalData.lxRunTime = undefined;
|
|
13557
|
-
loadScrollXData($xeTable);
|
|
13558
|
-
}, fpsTime);
|
|
13559
|
-
},
|
|
13560
|
-
lazyScrollYData() {
|
|
13561
|
-
const $xeTable = this;
|
|
13562
|
-
const props = $xeTable;
|
|
13563
|
-
const internalData = $xeTable;
|
|
13564
|
-
const {
|
|
13565
|
-
showOverflow
|
|
13566
|
-
} = props;
|
|
13567
|
-
const {
|
|
13568
|
-
lyTimeout,
|
|
13569
|
-
lyRunTime,
|
|
13570
|
-
scrollYStore
|
|
13571
|
-
} = internalData;
|
|
13572
|
-
const {
|
|
13573
|
-
visibleSize
|
|
13574
|
-
} = scrollYStore;
|
|
13575
|
-
const fpsTime = showOverflow ? 5 : Math.max(5, Math.min(80, Math.floor(visibleSize / 2)));
|
|
13576
|
-
if (lyTimeout) {
|
|
13577
|
-
clearTimeout(lyTimeout);
|
|
13578
|
-
}
|
|
13579
|
-
if (!lyRunTime || lyRunTime + fpsTime < Date.now()) {
|
|
13580
|
-
internalData.lyRunTime = Date.now();
|
|
13581
|
-
loadScrollYData($xeTable);
|
|
13582
|
-
}
|
|
13583
|
-
internalData.lyTimeout = setTimeout(() => {
|
|
13584
|
-
internalData.lyTimeout = undefined;
|
|
13585
|
-
internalData.lyRunTime = undefined;
|
|
13586
|
-
loadScrollYData($xeTable);
|
|
13587
|
-
}, fpsTime);
|
|
13588
|
-
},
|
|
13589
14177
|
/**
|
|
13590
14178
|
* 横向 X 可视渲染事件处理
|
|
13591
14179
|
*/
|
|
@@ -13595,7 +14183,7 @@ const Methods = {
|
|
|
13595
14183
|
if (sXOpts.immediate) {
|
|
13596
14184
|
loadScrollXData($xeTable);
|
|
13597
14185
|
} else {
|
|
13598
|
-
$xeTable
|
|
14186
|
+
lazyScrollXData($xeTable);
|
|
13599
14187
|
}
|
|
13600
14188
|
},
|
|
13601
14189
|
/**
|
|
@@ -13607,7 +14195,7 @@ const Methods = {
|
|
|
13607
14195
|
if (sYOpts.immediate) {
|
|
13608
14196
|
loadScrollYData($xeTable);
|
|
13609
14197
|
} else {
|
|
13610
|
-
$xeTable
|
|
14198
|
+
lazyScrollYData($xeTable);
|
|
13611
14199
|
}
|
|
13612
14200
|
},
|
|
13613
14201
|
triggerBodyScrollEvent(evnt, fixedType) {
|
|
@@ -13615,6 +14203,7 @@ const Methods = {
|
|
|
13615
14203
|
const internalData = $xeTable;
|
|
13616
14204
|
const {
|
|
13617
14205
|
elemStore,
|
|
14206
|
+
intoRunScroll,
|
|
13618
14207
|
lastScrollTop,
|
|
13619
14208
|
lastScrollLeft,
|
|
13620
14209
|
inWheelScroll,
|
|
@@ -13634,6 +14223,9 @@ const Methods = {
|
|
|
13634
14223
|
if (inWheelScroll || inVirtualScroll || inHeaderScroll || inFooterScroll) {
|
|
13635
14224
|
return;
|
|
13636
14225
|
}
|
|
14226
|
+
if (intoRunScroll) {
|
|
14227
|
+
return;
|
|
14228
|
+
}
|
|
13637
14229
|
if (!bodyScrollElem) {
|
|
13638
14230
|
return;
|
|
13639
14231
|
}
|
|
@@ -13692,6 +14284,7 @@ const Methods = {
|
|
|
13692
14284
|
const internalData = $xeTable;
|
|
13693
14285
|
const {
|
|
13694
14286
|
elemStore,
|
|
14287
|
+
intoRunScroll,
|
|
13695
14288
|
inWheelScroll,
|
|
13696
14289
|
inVirtualScroll,
|
|
13697
14290
|
inBodyScroll,
|
|
@@ -13702,16 +14295,10 @@ const Methods = {
|
|
|
13702
14295
|
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
13703
14296
|
const headerScrollElem = getRefElem(elemStore['main-header-scroll']);
|
|
13704
14297
|
const footerScrollElem = getRefElem(elemStore['main-footer-scroll']);
|
|
13705
|
-
if (inWheelScroll) {
|
|
13706
|
-
return;
|
|
13707
|
-
}
|
|
13708
|
-
if (inVirtualScroll) {
|
|
14298
|
+
if (inWheelScroll || inVirtualScroll || inBodyScroll || inFooterScroll) {
|
|
13709
14299
|
return;
|
|
13710
14300
|
}
|
|
13711
|
-
if (
|
|
13712
|
-
return;
|
|
13713
|
-
}
|
|
13714
|
-
if (inFooterScroll) {
|
|
14301
|
+
if (intoRunScroll) {
|
|
13715
14302
|
return;
|
|
13716
14303
|
}
|
|
13717
14304
|
if (!headerScrollElem) {
|
|
@@ -13742,6 +14329,7 @@ const Methods = {
|
|
|
13742
14329
|
const internalData = $xeTable;
|
|
13743
14330
|
const {
|
|
13744
14331
|
elemStore,
|
|
14332
|
+
intoRunScroll,
|
|
13745
14333
|
inWheelScroll,
|
|
13746
14334
|
inVirtualScroll,
|
|
13747
14335
|
inHeaderScroll,
|
|
@@ -13752,16 +14340,10 @@ const Methods = {
|
|
|
13752
14340
|
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
13753
14341
|
const headerScrollElem = getRefElem(elemStore['main-header-scroll']);
|
|
13754
14342
|
const footerScrollElem = getRefElem(elemStore['main-footer-scroll']);
|
|
13755
|
-
if (inWheelScroll) {
|
|
14343
|
+
if (inWheelScroll || inVirtualScroll || inHeaderScroll || inBodyScroll) {
|
|
13756
14344
|
return;
|
|
13757
14345
|
}
|
|
13758
|
-
if (
|
|
13759
|
-
return;
|
|
13760
|
-
}
|
|
13761
|
-
if (inHeaderScroll) {
|
|
13762
|
-
return;
|
|
13763
|
-
}
|
|
13764
|
-
if (inBodyScroll) {
|
|
14346
|
+
if (intoRunScroll) {
|
|
13765
14347
|
return;
|
|
13766
14348
|
}
|
|
13767
14349
|
if (!footerScrollElem) {
|
|
@@ -13793,9 +14375,13 @@ const Methods = {
|
|
|
13793
14375
|
const reactData = $xeTable;
|
|
13794
14376
|
const internalData = $xeTable;
|
|
13795
14377
|
const {
|
|
14378
|
+
target,
|
|
13796
14379
|
deltaY,
|
|
13797
14380
|
deltaX
|
|
13798
14381
|
} = evnt;
|
|
14382
|
+
if (target && /^textarea$/i.test(target.tagName)) {
|
|
14383
|
+
return;
|
|
14384
|
+
}
|
|
13799
14385
|
const {
|
|
13800
14386
|
highlightHoverRow
|
|
13801
14387
|
} = tableProps;
|
|
@@ -13819,26 +14405,13 @@ const Methods = {
|
|
|
13819
14405
|
if (!bodyScrollElem) {
|
|
13820
14406
|
return;
|
|
13821
14407
|
}
|
|
13822
|
-
|
|
13823
|
-
|
|
13824
|
-
|
|
13825
|
-
} else if (reactData.lastScrollTime + 30 > Date.now()) {
|
|
13826
|
-
multiple = 1.15;
|
|
13827
|
-
} else if (reactData.lastScrollTime + 40 > Date.now()) {
|
|
13828
|
-
multiple = 1.12;
|
|
13829
|
-
} else if (reactData.lastScrollTime + 55 > Date.now()) {
|
|
13830
|
-
multiple = 1.09;
|
|
13831
|
-
} else if (reactData.lastScrollTime + 75 > Date.now()) {
|
|
13832
|
-
multiple = 1.06;
|
|
13833
|
-
} else if (reactData.lastScrollTime + 100 > Date.now()) {
|
|
13834
|
-
multiple = 1.03;
|
|
13835
|
-
}
|
|
13836
|
-
const deltaTop = deltaY * multiple;
|
|
13837
|
-
const deltaLeft = deltaX * multiple;
|
|
14408
|
+
const wheelSpeed = getWheelSpeed(reactData.lastScrollTime);
|
|
14409
|
+
const deltaTop = deltaY * wheelSpeed;
|
|
14410
|
+
const deltaLeft = deltaX * wheelSpeed;
|
|
13838
14411
|
const isTopWheel = deltaTop < 0;
|
|
13839
|
-
const currScrollTop =
|
|
14412
|
+
const currScrollTop = bodyScrollElem.scrollTop;
|
|
13840
14413
|
// 如果滚动位置已经是顶部或底部,则不需要触发
|
|
13841
|
-
if (isTopWheel ? currScrollTop <= 0 : currScrollTop >=
|
|
14414
|
+
if (isTopWheel ? currScrollTop <= 0 : currScrollTop >= bodyScrollElem.scrollHeight - bodyScrollElem.clientHeight) {
|
|
13842
14415
|
return;
|
|
13843
14416
|
}
|
|
13844
14417
|
const scrollTop = bodyScrollElem.scrollTop + deltaTop;
|
|
@@ -13851,16 +14424,29 @@ const Methods = {
|
|
|
13851
14424
|
if (rowOpts.isHover || highlightHoverRow) {
|
|
13852
14425
|
$xeTable.clearHoverRow();
|
|
13853
14426
|
}
|
|
13854
|
-
|
|
13855
|
-
|
|
13856
|
-
|
|
13857
|
-
|
|
13858
|
-
|
|
13859
|
-
|
|
13860
|
-
|
|
13861
|
-
|
|
13862
|
-
|
|
14427
|
+
wheelScrollTo(scrollTop - bodyScrollElem.scrollTop, offsetTop => {
|
|
14428
|
+
const currTopNum = bodyScrollElem.scrollTop + offsetTop;
|
|
14429
|
+
internalData.inWheelScroll = true;
|
|
14430
|
+
setScrollTop(yHandleEl, currTopNum);
|
|
14431
|
+
setScrollTop(bodyScrollElem, currTopNum);
|
|
14432
|
+
setScrollTop(leftScrollElem, currTopNum);
|
|
14433
|
+
setScrollTop(rightScrollElem, currTopNum);
|
|
14434
|
+
$xeTable.triggerScrollYEvent(evnt);
|
|
14435
|
+
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, currTopNum, scrollLeft, {
|
|
14436
|
+
type: 'table',
|
|
14437
|
+
fixed: ''
|
|
14438
|
+
});
|
|
13863
14439
|
});
|
|
14440
|
+
// internalData.inWheelScroll = true
|
|
14441
|
+
// setScrollTop(yHandleEl, scrollTop)
|
|
14442
|
+
// setScrollTop(bodyScrollElem, scrollTop)
|
|
14443
|
+
// setScrollTop(leftScrollElem, scrollTop)
|
|
14444
|
+
// setScrollTop(rightScrollElem, scrollTop)
|
|
14445
|
+
// loadScrollYData($xeTable, scrollTop)
|
|
14446
|
+
// $xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
|
|
14447
|
+
// type: 'footer',
|
|
14448
|
+
// fixed: ''
|
|
14449
|
+
// })
|
|
13864
14450
|
}
|
|
13865
14451
|
},
|
|
13866
14452
|
triggerVirtualScrollXEvent(evnt) {
|
|
@@ -13949,17 +14535,15 @@ const Methods = {
|
|
|
13949
14535
|
},
|
|
13950
14536
|
updateScrollXData() {
|
|
13951
14537
|
const $xeTable = this;
|
|
13952
|
-
const
|
|
14538
|
+
const reactData = $xeTable;
|
|
13953
14539
|
const {
|
|
13954
|
-
|
|
13955
|
-
} =
|
|
14540
|
+
isAllOverflow
|
|
14541
|
+
} = reactData;
|
|
13956
14542
|
handleTableColumn($xeTable);
|
|
13957
|
-
// calcCellHeight()
|
|
13958
14543
|
return $xeTable.$nextTick().then(() => {
|
|
13959
|
-
// calcCellHeight()
|
|
13960
14544
|
handleTableColumn($xeTable);
|
|
13961
14545
|
$xeTable.updateScrollXSpace();
|
|
13962
|
-
if (!
|
|
14546
|
+
if (!isAllOverflow) {
|
|
13963
14547
|
$xeTable.updateScrollYSpace();
|
|
13964
14548
|
}
|
|
13965
14549
|
});
|
|
@@ -14023,9 +14607,7 @@ const Methods = {
|
|
|
14023
14607
|
updateScrollYData() {
|
|
14024
14608
|
const $xeTable = this;
|
|
14025
14609
|
$xeTable.handleTableData();
|
|
14026
|
-
// calcCellHeight()
|
|
14027
14610
|
return $xeTable.$nextTick().then(() => {
|
|
14028
|
-
// calcCellHeight()
|
|
14029
14611
|
$xeTable.handleTableData();
|
|
14030
14612
|
$xeTable.updateScrollYSpace();
|
|
14031
14613
|
});
|
|
@@ -14033,49 +14615,46 @@ const Methods = {
|
|
|
14033
14615
|
// 更新纵向 Y 可视渲染上下剩余空间大小
|
|
14034
14616
|
updateScrollYSpace() {
|
|
14035
14617
|
const $xeTable = this;
|
|
14036
|
-
const props = $xeTable;
|
|
14037
14618
|
const reactData = $xeTable;
|
|
14038
14619
|
const internalData = $xeTable;
|
|
14039
14620
|
const {
|
|
14040
|
-
|
|
14041
|
-
|
|
14042
|
-
const {
|
|
14043
|
-
scrollYLoad,
|
|
14044
|
-
rowHeight
|
|
14621
|
+
isAllOverflow,
|
|
14622
|
+
scrollYLoad
|
|
14045
14623
|
} = reactData;
|
|
14046
14624
|
const {
|
|
14047
14625
|
scrollYStore,
|
|
14048
14626
|
elemStore,
|
|
14627
|
+
isResizeCellHeight,
|
|
14049
14628
|
afterFullData,
|
|
14050
14629
|
fullAllDataRowIdData
|
|
14051
14630
|
} = internalData;
|
|
14052
14631
|
const {
|
|
14053
14632
|
startIndex
|
|
14054
14633
|
} = scrollYStore;
|
|
14634
|
+
const rowOpts = $xeTable.computeRowOpts;
|
|
14635
|
+
const cellOpts = $xeTable.computeCellOpts;
|
|
14636
|
+
const defaultRowHeight = $xeTable.computeDefaultRowHeight;
|
|
14055
14637
|
const bodyTableElem = getRefElem(elemStore['main-body-table']);
|
|
14056
14638
|
const containerList = ['main', 'left', 'right'];
|
|
14057
14639
|
let topSpaceHeight = 0;
|
|
14058
14640
|
let ySpaceHeight = 0;
|
|
14059
14641
|
if (scrollYLoad) {
|
|
14060
|
-
|
|
14061
|
-
|
|
14062
|
-
|
|
14642
|
+
const isCustomCellHeight = isResizeCellHeight || cellOpts.height || rowOpts.height;
|
|
14643
|
+
if (!isCustomCellHeight && isAllOverflow) {
|
|
14644
|
+
ySpaceHeight = afterFullData.length * defaultRowHeight;
|
|
14645
|
+
topSpaceHeight = Math.max(0, startIndex * defaultRowHeight);
|
|
14063
14646
|
} else {
|
|
14064
14647
|
for (let i = 0; i < afterFullData.length; i++) {
|
|
14065
14648
|
const row = afterFullData[i];
|
|
14066
14649
|
const rowid = getRowid($xeTable, row);
|
|
14067
|
-
const rowRest = fullAllDataRowIdData[rowid];
|
|
14068
|
-
|
|
14069
|
-
ySpaceHeight += rowRest.height || rowHeight;
|
|
14070
|
-
}
|
|
14650
|
+
const rowRest = fullAllDataRowIdData[rowid] || {};
|
|
14651
|
+
ySpaceHeight += rowRest.resizeHeight || rowRest.height || cellOpts.height || rowOpts.height || defaultRowHeight;
|
|
14071
14652
|
}
|
|
14072
14653
|
for (let i = 0; i < startIndex; i++) {
|
|
14073
14654
|
const row = afterFullData[i];
|
|
14074
14655
|
const rowid = getRowid($xeTable, row);
|
|
14075
|
-
const rowRest = fullAllDataRowIdData[rowid];
|
|
14076
|
-
|
|
14077
|
-
topSpaceHeight += rowRest.height || rowHeight;
|
|
14078
|
-
}
|
|
14656
|
+
const rowRest = fullAllDataRowIdData[rowid] || {};
|
|
14657
|
+
topSpaceHeight += rowRest.resizeHeight || rowRest.height || cellOpts.height || rowOpts.height || defaultRowHeight;
|
|
14079
14658
|
}
|
|
14080
14659
|
}
|
|
14081
14660
|
} else {
|
|
@@ -14100,7 +14679,7 @@ const Methods = {
|
|
|
14100
14679
|
if (scrollYSpaceEl) {
|
|
14101
14680
|
scrollYSpaceEl.style.height = ySpaceHeight ? `${ySpaceHeight}px` : '';
|
|
14102
14681
|
}
|
|
14103
|
-
$xeTable.$nextTick(() => {
|
|
14682
|
+
return $xeTable.$nextTick().then(() => {
|
|
14104
14683
|
updateStyle($xeTable);
|
|
14105
14684
|
});
|
|
14106
14685
|
},
|
|
@@ -14171,12 +14750,9 @@ const Methods = {
|
|
|
14171
14750
|
*/
|
|
14172
14751
|
scrollToRow(row, fieldOrColumn) {
|
|
14173
14752
|
const $xeTable = this;
|
|
14174
|
-
const props = $xeTable;
|
|
14175
14753
|
const reactData = $xeTable;
|
|
14176
14754
|
const {
|
|
14177
|
-
|
|
14178
|
-
} = props;
|
|
14179
|
-
const {
|
|
14755
|
+
isAllOverflow,
|
|
14180
14756
|
scrollYLoad,
|
|
14181
14757
|
scrollXLoad
|
|
14182
14758
|
} = reactData;
|
|
@@ -14193,7 +14769,7 @@ const Methods = {
|
|
|
14193
14769
|
}
|
|
14194
14770
|
return Promise.all(rest).then(() => {
|
|
14195
14771
|
if (row) {
|
|
14196
|
-
if (!
|
|
14772
|
+
if (!isAllOverflow && (scrollYLoad || scrollXLoad)) {
|
|
14197
14773
|
calcCellHeight($xeTable);
|
|
14198
14774
|
calcCellWidth($xeTable);
|
|
14199
14775
|
}
|
|
@@ -14564,11 +15140,11 @@ const isVMScrollProcess = $xeTable => {
|
|
|
14564
15140
|
} = tableProps;
|
|
14565
15141
|
const {
|
|
14566
15142
|
lastScrollTime,
|
|
14567
|
-
|
|
15143
|
+
isDragResize
|
|
14568
15144
|
} = tableReactData;
|
|
14569
|
-
return !!(
|
|
15145
|
+
return !!(isDragResize || lastScrollTime && Date.now() < lastScrollTime + delayHover);
|
|
14570
15146
|
};
|
|
14571
|
-
function renderLine(h, _vm, params) {
|
|
15147
|
+
function renderLine(h, _vm, params, cellHeight) {
|
|
14572
15148
|
const $xeTable = _vm.$parent;
|
|
14573
15149
|
const tableProps = $xeTable;
|
|
14574
15150
|
const tableInternalData = $xeTable;
|
|
@@ -14604,11 +15180,13 @@ function renderLine(h, _vm, params) {
|
|
|
14604
15180
|
const isFirstRow = $xeTable.eqRow(afterFullData[0], row);
|
|
14605
15181
|
if (treeConfig && treeNode && (treeOpts.showLine || treeOpts.line)) {
|
|
14606
15182
|
return [h('div', {
|
|
15183
|
+
key: 'tl',
|
|
14607
15184
|
class: 'vxe-tree--line-wrapper'
|
|
14608
15185
|
}, [h('div', {
|
|
14609
15186
|
class: 'vxe-tree--line',
|
|
14610
15187
|
style: {
|
|
14611
15188
|
height: `${isFirstRow ? 1 : calcTreeLine(params, prevRow)}px`,
|
|
15189
|
+
bottom: `-${Math.floor(cellHeight / 2)}px`,
|
|
14612
15190
|
left: `${rLevel * treeOpts.indent + (rLevel ? 2 - getOffsetSize($xeTable) : 0) + 16}px`
|
|
14613
15191
|
}
|
|
14614
15192
|
})])];
|
|
@@ -14628,8 +15206,9 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
|
|
|
14628
15206
|
} = tableInternalData;
|
|
14629
15207
|
const {
|
|
14630
15208
|
columnKey,
|
|
15209
|
+
resizable: allResizable,
|
|
15210
|
+
border,
|
|
14631
15211
|
height,
|
|
14632
|
-
showOverflow: allColumnOverflow,
|
|
14633
15212
|
cellClassName: allCellClassName,
|
|
14634
15213
|
cellStyle,
|
|
14635
15214
|
align: allAlign,
|
|
@@ -14637,7 +15216,8 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
|
|
|
14637
15216
|
mouseConfig,
|
|
14638
15217
|
editConfig,
|
|
14639
15218
|
editRules,
|
|
14640
|
-
tooltipConfig
|
|
15219
|
+
tooltipConfig,
|
|
15220
|
+
padding: allPadding
|
|
14641
15221
|
} = tableProps;
|
|
14642
15222
|
const {
|
|
14643
15223
|
tableData,
|
|
@@ -14645,7 +15225,8 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
|
|
|
14645
15225
|
currentColumn,
|
|
14646
15226
|
scrollXLoad,
|
|
14647
15227
|
scrollYLoad,
|
|
14648
|
-
|
|
15228
|
+
calcCellHeightFlag,
|
|
15229
|
+
resizeHeightFlag,
|
|
14649
15230
|
mergeList,
|
|
14650
15231
|
editStore,
|
|
14651
15232
|
isAllOverflow,
|
|
@@ -14661,9 +15242,15 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
|
|
|
14661
15242
|
const checkboxOpts = $xeTable.computeCheckboxOpts;
|
|
14662
15243
|
const editOpts = $xeTable.computeEditOpts;
|
|
14663
15244
|
const tooltipOpts = $xeTable.computeTooltipOpts;
|
|
15245
|
+
const {
|
|
15246
|
+
isAllColumnDrag,
|
|
15247
|
+
isAllRowDrag
|
|
15248
|
+
} = $xeTable.resizableOpts;
|
|
14664
15249
|
const rowOpts = $xeTable.computeRowOpts;
|
|
14665
15250
|
const rowDragOpts = $xeTable.computeRowDragOpts;
|
|
14666
15251
|
const defaultRowHeight = $xeTable.computeDefaultRowHeight;
|
|
15252
|
+
const customCellHeight = cellOpts.height || rowOpts.height;
|
|
15253
|
+
const currCellHeight = customCellHeight || defaultRowHeight;
|
|
14667
15254
|
const {
|
|
14668
15255
|
disabledMethod: dragDisabledMethod,
|
|
14669
15256
|
isCrossDrag,
|
|
@@ -14683,17 +15270,18 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
|
|
|
14683
15270
|
showOverflow,
|
|
14684
15271
|
className,
|
|
14685
15272
|
treeNode,
|
|
15273
|
+
rowResize,
|
|
15274
|
+
padding,
|
|
15275
|
+
verticalAlign,
|
|
14686
15276
|
slots
|
|
14687
15277
|
} = column;
|
|
14688
15278
|
const {
|
|
14689
|
-
verticalAlign
|
|
15279
|
+
verticalAlign: allVerticalAlign
|
|
14690
15280
|
} = cellOpts;
|
|
14691
15281
|
const {
|
|
14692
15282
|
actived
|
|
14693
15283
|
} = editStore;
|
|
14694
|
-
const
|
|
14695
|
-
height: customRHeight
|
|
14696
|
-
} = rowOpts;
|
|
15284
|
+
const rowRest = fullAllDataRowIdData[rowid];
|
|
14697
15285
|
const colid = column.id;
|
|
14698
15286
|
const renderOpts = editRender || cellRender;
|
|
14699
15287
|
const compConf = renderOpts ? body_renderer.get(renderOpts.name) : null;
|
|
@@ -14703,23 +15291,27 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
|
|
|
14703
15291
|
const columnIndex = $xeTable.getColumnIndex(column);
|
|
14704
15292
|
const _columnIndex = $xeTable.getVTColumnIndex(column);
|
|
14705
15293
|
const isEdit = isEnableConf(editRender);
|
|
15294
|
+
const resizeHeight = resizeHeightFlag ? rowRest.resizeHeight : 0;
|
|
14706
15295
|
let fixedHiddenColumn = fixedType ? column.fixed !== fixedType : column.fixed && overflowX;
|
|
14707
|
-
const
|
|
15296
|
+
const isCellPadding = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(padding) ? allPadding === null ? cellOpts.padding : allPadding : padding;
|
|
15297
|
+
const cellOverflow = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(showOverflow) ? isAllOverflow : showOverflow;
|
|
14708
15298
|
const showEllipsis = cellOverflow === 'ellipsis';
|
|
14709
15299
|
const showTitle = cellOverflow === 'title';
|
|
14710
15300
|
const showTooltip = cellOverflow === true || cellOverflow === 'tooltip';
|
|
14711
|
-
|
|
14712
|
-
const
|
|
15301
|
+
const hasEllipsis = isAllOverflow || showTitle || showTooltip || showEllipsis;
|
|
15302
|
+
const showResizable = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(column.resizable) ? column.resizable : columnOpts.resizable || allResizable;
|
|
15303
|
+
const isCsHeight = !!customCellHeight;
|
|
15304
|
+
const isRsHeight = resizeHeight > 0;
|
|
14713
15305
|
let isDirty;
|
|
14714
15306
|
const tdOns = {};
|
|
14715
|
-
const rest = fullAllDataRowIdData[rowid];
|
|
14716
15307
|
const cellAlign = align || (compConf ? compConf.tableCellAlign : '') || allAlign;
|
|
15308
|
+
const cellVerticalAlign = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(verticalAlign) ? allVerticalAlign : verticalAlign;
|
|
14717
15309
|
const errorValidItem = validErrorMaps[`${rowid}:${colid}`];
|
|
14718
15310
|
const showValidTip = editRules && validOpts.showMessage && (validOpts.message === 'default' ? height || tableData.length > 1 : validOpts.message === 'inline');
|
|
14719
|
-
const
|
|
15311
|
+
const tdAttrs = {
|
|
14720
15312
|
colid
|
|
14721
15313
|
};
|
|
14722
|
-
const
|
|
15314
|
+
const cellParams = {
|
|
14723
15315
|
$table: $xeTable,
|
|
14724
15316
|
$grid: $xeTable.xegrid,
|
|
14725
15317
|
isEdit: false,
|
|
@@ -14747,7 +15339,7 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
|
|
|
14747
15339
|
isRowDragCell = rowDragOpts.trigger === 'row' || column.dragSort && rowDragOpts.trigger === 'cell';
|
|
14748
15340
|
}
|
|
14749
15341
|
if (isRowDragCell) {
|
|
14750
|
-
isDisabledDrag = !!(dragDisabledMethod && dragDisabledMethod(
|
|
15342
|
+
isDisabledDrag = !!(dragDisabledMethod && dragDisabledMethod(cellParams));
|
|
14751
15343
|
}
|
|
14752
15344
|
// hover 进入事件
|
|
14753
15345
|
if (showTitle || showTooltip || showAllTip || tooltipConfig) {
|
|
@@ -14759,11 +15351,11 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
|
|
|
14759
15351
|
updateCellTitle(evnt.currentTarget, column);
|
|
14760
15352
|
} else if (showTooltip || showAllTip) {
|
|
14761
15353
|
// 如果配置了显示 tooltip
|
|
14762
|
-
$xeTable.triggerBodyTooltipEvent(evnt,
|
|
15354
|
+
$xeTable.triggerBodyTooltipEvent(evnt, cellParams);
|
|
14763
15355
|
}
|
|
14764
15356
|
$xeTable.dispatchEvent('cell-mouseenter', Object.assign({
|
|
14765
15357
|
cell: evnt.currentTarget
|
|
14766
|
-
},
|
|
15358
|
+
}, cellParams), evnt);
|
|
14767
15359
|
};
|
|
14768
15360
|
}
|
|
14769
15361
|
// hover 退出事件
|
|
@@ -14777,13 +15369,13 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
|
|
|
14777
15369
|
}
|
|
14778
15370
|
$xeTable.dispatchEvent('cell-mouseleave', Object.assign({
|
|
14779
15371
|
cell: evnt.currentTarget
|
|
14780
|
-
},
|
|
15372
|
+
}, cellParams), evnt);
|
|
14781
15373
|
};
|
|
14782
15374
|
}
|
|
14783
15375
|
// 按下事件处理
|
|
14784
15376
|
if (isRowDragCell || checkboxOpts.range || mouseConfig) {
|
|
14785
15377
|
tdOns.mousedown = evnt => {
|
|
14786
|
-
$xeTable.triggerCellMousedownEvent(evnt,
|
|
15378
|
+
$xeTable.triggerCellMousedownEvent(evnt, cellParams);
|
|
14787
15379
|
};
|
|
14788
15380
|
}
|
|
14789
15381
|
// 拖拽列事件
|
|
@@ -14792,11 +15384,11 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
|
|
|
14792
15384
|
}
|
|
14793
15385
|
// 点击事件处理
|
|
14794
15386
|
tdOns.click = evnt => {
|
|
14795
|
-
$xeTable.triggerCellClickEvent(evnt,
|
|
15387
|
+
$xeTable.triggerCellClickEvent(evnt, cellParams);
|
|
14796
15388
|
};
|
|
14797
15389
|
// 双击事件处理
|
|
14798
15390
|
tdOns.dblclick = evnt => {
|
|
14799
|
-
$xeTable.triggerCellDblclickEvent(evnt,
|
|
15391
|
+
$xeTable.triggerCellDblclickEvent(evnt, cellParams);
|
|
14800
15392
|
};
|
|
14801
15393
|
// 合并行或列
|
|
14802
15394
|
if (mergeList.length) {
|
|
@@ -14810,10 +15402,10 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
|
|
|
14810
15402
|
return null;
|
|
14811
15403
|
}
|
|
14812
15404
|
if (rowspan > 1) {
|
|
14813
|
-
|
|
15405
|
+
tdAttrs.rowspan = rowspan;
|
|
14814
15406
|
}
|
|
14815
15407
|
if (colspan > 1) {
|
|
14816
|
-
|
|
15408
|
+
tdAttrs.colspan = colspan;
|
|
14817
15409
|
}
|
|
14818
15410
|
}
|
|
14819
15411
|
} else if (spanMethod) {
|
|
@@ -14821,20 +15413,20 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
|
|
|
14821
15413
|
const {
|
|
14822
15414
|
rowspan = 1,
|
|
14823
15415
|
colspan = 1
|
|
14824
|
-
} = spanMethod(
|
|
15416
|
+
} = spanMethod(cellParams) || {};
|
|
14825
15417
|
if (!rowspan || !colspan) {
|
|
14826
15418
|
return null;
|
|
14827
15419
|
}
|
|
14828
15420
|
if (rowspan > 1) {
|
|
14829
|
-
|
|
15421
|
+
tdAttrs.rowspan = rowspan;
|
|
14830
15422
|
}
|
|
14831
15423
|
if (colspan > 1) {
|
|
14832
|
-
|
|
15424
|
+
tdAttrs.colspan = colspan;
|
|
14833
15425
|
}
|
|
14834
15426
|
}
|
|
14835
15427
|
// 如果被合并不可隐藏
|
|
14836
15428
|
if (fixedHiddenColumn && mergeList) {
|
|
14837
|
-
if (
|
|
15429
|
+
if (tdAttrs.colspan > 1 || tdAttrs.rowspan > 1) {
|
|
14838
15430
|
fixedHiddenColumn = false;
|
|
14839
15431
|
}
|
|
14840
15432
|
}
|
|
@@ -14842,42 +15434,73 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
|
|
|
14842
15434
|
if (!fixedHiddenColumn && editConfig && (editRender || cellRender) && (editOpts.showStatus || editOpts.showUpdateStatus)) {
|
|
14843
15435
|
isDirty = $xeTable.isUpdateByRow(row, column.field);
|
|
14844
15436
|
}
|
|
15437
|
+
const isVNAutoHeight = scrollYLoad && !hasEllipsis;
|
|
15438
|
+
let cellHeight = currCellHeight;
|
|
15439
|
+
const vnHeight = calcCellHeightFlag ? rowRest.height : 0;
|
|
15440
|
+
if (resizeHeight) {
|
|
15441
|
+
cellHeight = resizeHeight;
|
|
15442
|
+
} else {
|
|
15443
|
+
if (scrollYLoad) {
|
|
15444
|
+
if (!hasEllipsis) {
|
|
15445
|
+
cellHeight = vnHeight || currCellHeight;
|
|
15446
|
+
}
|
|
15447
|
+
}
|
|
15448
|
+
}
|
|
15449
|
+
const isLastColumn = $columnIndex === columns.length - 1;
|
|
15450
|
+
const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto');
|
|
15451
|
+
let isVNPreEmptyStatus = false;
|
|
15452
|
+
if (scrollYLoad && (_rowIndex < scrollYStore.visibleStartIndex - scrollYStore.preloadSize || _rowIndex > scrollYStore.visibleEndIndex + scrollYStore.preloadSize)) {
|
|
15453
|
+
isVNPreEmptyStatus = true;
|
|
15454
|
+
} else if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
|
|
15455
|
+
isVNPreEmptyStatus = true;
|
|
15456
|
+
}
|
|
15457
|
+
const tcStyle = {};
|
|
15458
|
+
if (scrollYLoad || hasEllipsis || isCsHeight || isRsHeight) {
|
|
15459
|
+
tcStyle.height = `${cellHeight}px`;
|
|
15460
|
+
} else {
|
|
15461
|
+
tcStyle.minHeight = `${cellHeight}px`;
|
|
15462
|
+
}
|
|
14845
15463
|
const tdVNs = [];
|
|
14846
|
-
if (fixedHiddenColumn &&
|
|
15464
|
+
if (fixedHiddenColumn && isAllOverflow) {
|
|
14847
15465
|
tdVNs.push(h('div', {
|
|
15466
|
+
key: 'tc',
|
|
14848
15467
|
class: ['vxe-cell', {
|
|
14849
15468
|
'c--title': showTitle,
|
|
14850
15469
|
'c--tooltip': showTooltip,
|
|
14851
15470
|
'c--ellipsis': showEllipsis
|
|
14852
15471
|
}],
|
|
14853
|
-
style:
|
|
14854
|
-
maxHeight: hasEllipsis && (customRHeight || defaultRowHeight) ? `${customRHeight || defaultRowHeight}px` : ''
|
|
14855
|
-
}
|
|
15472
|
+
style: tcStyle
|
|
14856
15473
|
}));
|
|
14857
15474
|
} else {
|
|
14858
15475
|
// 渲染单元格
|
|
14859
|
-
tdVNs.push(...renderLine(h, _vm,
|
|
15476
|
+
tdVNs.push(...renderLine(h, _vm, cellParams, cellHeight), h('div', {
|
|
15477
|
+
key: 'tc',
|
|
14860
15478
|
class: ['vxe-cell', {
|
|
14861
15479
|
'c--title': showTitle,
|
|
14862
15480
|
'c--tooltip': showTooltip,
|
|
14863
15481
|
'c--ellipsis': showEllipsis
|
|
14864
15482
|
}],
|
|
14865
|
-
style:
|
|
14866
|
-
maxHeight: hasEllipsis && (customRHeight || defaultRowHeight) ? `${customRHeight || defaultRowHeight}px` : ''
|
|
14867
|
-
},
|
|
15483
|
+
style: tcStyle,
|
|
14868
15484
|
attrs: {
|
|
14869
15485
|
title: showTitle ? $xeTable.getCellLabel(row, column) : null
|
|
14870
15486
|
}
|
|
14871
|
-
},
|
|
15487
|
+
}, isVNPreEmptyStatus ? [] : [h('div', {
|
|
15488
|
+
attrs: {
|
|
15489
|
+
colid,
|
|
15490
|
+
rowid
|
|
15491
|
+
},
|
|
15492
|
+
class: 'vxe-cell--wrapper'
|
|
15493
|
+
}, column.renderCell(h, cellParams))]));
|
|
14872
15494
|
if (showValidTip && errorValidItem) {
|
|
14873
15495
|
const errRule = errorValidItem.rule;
|
|
14874
15496
|
const validSlot = slots ? slots.valid : null;
|
|
14875
15497
|
const validParams = {
|
|
14876
|
-
...
|
|
15498
|
+
...cellParams,
|
|
14877
15499
|
...errorValidItem,
|
|
14878
15500
|
rule: errorValidItem
|
|
14879
15501
|
};
|
|
14880
15502
|
tdVNs.push(h('div', {
|
|
15503
|
+
key: 'tcv',
|
|
14881
15504
|
class: ['vxe-cell--valid-error-tip', getClass(validOpts.className, errorValidItem)],
|
|
14882
15505
|
style: errRule && errRule.maxWidth ? {
|
|
14883
15506
|
width: `${errRule.maxWidth}px`
|
|
@@ -14889,57 +15512,59 @@ function renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel,
|
|
|
14889
15512
|
}, errorValidItem.content)]])]));
|
|
14890
15513
|
}
|
|
14891
15514
|
}
|
|
14892
|
-
let
|
|
14893
|
-
const vnHeight = isCalcCellHeight ? rest.height : 0;
|
|
14894
|
-
if (hasEllipsis) {
|
|
14895
|
-
if (customRHeight) {
|
|
14896
|
-
cellHeight = `${customRHeight}px`;
|
|
14897
|
-
} else if (!isAllOverflow) {
|
|
14898
|
-
cellHeight = `${vnHeight || defaultRowHeight || 18}px`;
|
|
14899
|
-
}
|
|
14900
|
-
} else {
|
|
14901
|
-
cellHeight = `${vnHeight || defaultRowHeight || 18}px`;
|
|
14902
|
-
}
|
|
15515
|
+
let showAreaRowStatus = false;
|
|
14903
15516
|
if (mouseConfig && mouseOpts.area && selectCellToRow) {
|
|
14904
|
-
if (
|
|
14905
|
-
|
|
14906
|
-
class: 'vxe-cell--area-status'
|
|
14907
|
-
}));
|
|
15517
|
+
if (!_columnIndex && selectCellToRow === true || selectCellToRow === column.field) {
|
|
15518
|
+
showAreaRowStatus = true;
|
|
14908
15519
|
}
|
|
14909
15520
|
}
|
|
14910
|
-
|
|
14911
|
-
|
|
14912
|
-
|
|
14913
|
-
|
|
14914
|
-
|
|
14915
|
-
|
|
14916
|
-
|
|
15521
|
+
if (!fixedHiddenColumn && showResizable && isAllColumnDrag) {
|
|
15522
|
+
tdVNs.push(h('div', {
|
|
15523
|
+
key: 'tcc',
|
|
15524
|
+
class: ['vxe-cell--col-resizable', {
|
|
15525
|
+
'is--line': !border || border === 'none'
|
|
15526
|
+
}],
|
|
15527
|
+
on: {
|
|
15528
|
+
mousedown: evnt => $xeTable.handleColResizeMousedownEvent(evnt, fixedType, cellParams),
|
|
15529
|
+
dblclick: evnt => $xeTable.handleColResizeDblclickEvent(evnt, cellParams)
|
|
15530
|
+
}
|
|
15531
|
+
}));
|
|
15532
|
+
}
|
|
15533
|
+
if ((rowResize || isAllRowDrag) && rowOpts.resizable) {
|
|
15534
|
+
tdVNs.push(h('div', {
|
|
15535
|
+
key: 'tcr',
|
|
15536
|
+
class: 'vxe-cell--row-resizable',
|
|
15537
|
+
on: {
|
|
15538
|
+
mousedown: evnt => $xeTable.handleRowResizeMousedownEvent(evnt, cellParams),
|
|
15539
|
+
dblclick: evnt => $xeTable.handleRowResizeDblclickEvent(evnt, cellParams)
|
|
15540
|
+
}
|
|
15541
|
+
}));
|
|
14917
15542
|
}
|
|
14918
15543
|
return h('td', {
|
|
14919
|
-
class: ['vxe-body--column',
|
|
14920
|
-
[`col--${cellAlign}`]: cellAlign,
|
|
14921
|
-
[`col--vertical-${verticalAlign}`]: verticalAlign,
|
|
14922
|
-
[`col--${type}`]: type,
|
|
15544
|
+
class: ['vxe-body--column', colid, cellVerticalAlign ? `col--vertical-${cellVerticalAlign}` : '', cellAlign ? `col--${cellAlign}` : '', type ? `col--${type}` : '', {
|
|
14923
15545
|
'col--last': isLastColumn,
|
|
14924
15546
|
'col--tree-node': treeNode,
|
|
14925
15547
|
'col--edit': isEdit,
|
|
14926
15548
|
'col--ellipsis': hasEllipsis,
|
|
15549
|
+
'col--cs-height': isCsHeight,
|
|
15550
|
+
'col--rs-height': isRsHeight,
|
|
15551
|
+
'col--to-row': showAreaRowStatus,
|
|
15552
|
+
'col--auto-height': isVNAutoHeight,
|
|
14927
15553
|
'fixed--width': !isAutoCellWidth,
|
|
14928
15554
|
'fixed--hidden': fixedHiddenColumn,
|
|
15555
|
+
'is--padding': isCellPadding,
|
|
14929
15556
|
'is--drag-cell': isRowDragCell && (isCrossDrag || isPeerDrag || !rowLevel),
|
|
14930
15557
|
'is--drag-disabled': isDisabledDrag,
|
|
14931
15558
|
'col--dirty': isDirty,
|
|
14932
15559
|
'col--active': editConfig && isEdit && actived.row === row && (actived.column === column || editOpts.mode === 'row'),
|
|
14933
15560
|
'col--valid-error': !!errorValidItem,
|
|
14934
15561
|
'col--current': currentColumn === column
|
|
14935
|
-
}, getClass(compCellClassName,
|
|
15562
|
+
}, getClass(compCellClassName, cellParams), getClass(className, cellParams), getClass(allCellClassName, cellParams)],
|
|
14936
15563
|
key: columnKey || scrollXLoad || scrollYLoad || columnOpts.useKey || rowOpts.useKey || columnOpts.drag ? column.id : $columnIndex,
|
|
14937
|
-
attrs,
|
|
14938
|
-
style: Object.assign({
|
|
14939
|
-
height: cellHeight
|
|
14940
|
-
}, 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),
|
|
15564
|
+
attrs: tdAttrs,
|
|
15565
|
+
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),
|
|
14941
15566
|
on: tdOns
|
|
14942
|
-
},
|
|
15567
|
+
}, isOptimizeMode && fixedHiddenColumn ? [] : tdVNs);
|
|
14943
15568
|
}
|
|
14944
15569
|
function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
|
|
14945
15570
|
const $xeTable = _vm.$parent;
|
|
@@ -14952,15 +15577,16 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
|
|
|
14952
15577
|
highlightHoverRow,
|
|
14953
15578
|
rowClassName,
|
|
14954
15579
|
rowStyle,
|
|
14955
|
-
showOverflow: allColumnOverflow,
|
|
14956
15580
|
editConfig,
|
|
14957
15581
|
treeConfig
|
|
14958
15582
|
} = tableProps;
|
|
14959
15583
|
const {
|
|
14960
15584
|
hasFixedColumn,
|
|
14961
15585
|
treeExpandedMaps,
|
|
15586
|
+
isColLoading,
|
|
14962
15587
|
scrollXLoad,
|
|
14963
15588
|
scrollYLoad,
|
|
15589
|
+
isAllOverflow,
|
|
14964
15590
|
rowExpandedMaps,
|
|
14965
15591
|
expandColumn,
|
|
14966
15592
|
selectRadioRow,
|
|
@@ -15065,7 +15691,7 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
|
|
|
15065
15691
|
const tdVNs = tableColumn.map((column, $columnIndex) => {
|
|
15066
15692
|
return renderTdColumn(h, _vm, seq, rowid, fixedType, isOptimizeMode, rowLevel, row, rowIndex, $rowIndex, _rowIndex, column, $columnIndex, tableColumn, tableData);
|
|
15067
15693
|
});
|
|
15068
|
-
rows.push(columnOpts.drag && columnDragOpts.animation ? h('transition-group', {
|
|
15694
|
+
rows.push(!isColLoading && columnOpts.drag && columnDragOpts.animation ? h('transition-group', {
|
|
15069
15695
|
props: {
|
|
15070
15696
|
tag: 'tr',
|
|
15071
15697
|
name: `vxe-header--col-list${isDragColMove ? '' : '-disabled'}`
|
|
@@ -15103,7 +15729,7 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
|
|
|
15103
15729
|
const {
|
|
15104
15730
|
showOverflow
|
|
15105
15731
|
} = expandColumn;
|
|
15106
|
-
const hasEllipsis = 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) ?
|
|
15732
|
+
const hasEllipsis = 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) ? isAllOverflow : showOverflow;
|
|
15107
15733
|
const expandParams = {
|
|
15108
15734
|
$table: $xeTable,
|
|
15109
15735
|
seq,
|
|
@@ -15215,7 +15841,6 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
|
|
|
15215
15841
|
tableColumn
|
|
15216
15842
|
} = props;
|
|
15217
15843
|
const {
|
|
15218
|
-
showOverflow: allColumnOverflow,
|
|
15219
15844
|
spanMethod,
|
|
15220
15845
|
footerSpanMethod,
|
|
15221
15846
|
mouseConfig
|
|
@@ -15223,6 +15848,8 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
|
|
|
15223
15848
|
const {
|
|
15224
15849
|
isGroup,
|
|
15225
15850
|
tableData,
|
|
15851
|
+
isRowLoading,
|
|
15852
|
+
isColLoading,
|
|
15226
15853
|
scrollXLoad,
|
|
15227
15854
|
scrollYLoad,
|
|
15228
15855
|
isAllOverflow,
|
|
@@ -15246,7 +15873,7 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
|
|
|
15246
15873
|
let renderColumnList = tableColumn;
|
|
15247
15874
|
let isOptimizeMode = false;
|
|
15248
15875
|
// 如果是使用优化模式
|
|
15249
|
-
if (scrollXLoad || scrollYLoad ||
|
|
15876
|
+
if (scrollXLoad || scrollYLoad || isAllOverflow) {
|
|
15250
15877
|
if (expandColumn || spanMethod || footerSpanMethod) {
|
|
15251
15878
|
// 如果不支持优化模式
|
|
15252
15879
|
} else {
|
|
@@ -15370,9 +15997,9 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
|
|
|
15370
15997
|
});
|
|
15371
15998
|
})),
|
|
15372
15999
|
/**
|
|
15373
|
-
|
|
15374
|
-
|
|
15375
|
-
rowOpts.drag && rowDragOpts.animation ? h('transition-group', {
|
|
16000
|
+
* 内容
|
|
16001
|
+
*/
|
|
16002
|
+
!(isRowLoading || isColLoading) && rowOpts.drag && rowDragOpts.animation ? h('transition-group', {
|
|
15376
16003
|
ref: 'refBodyTBody',
|
|
15377
16004
|
props: {
|
|
15378
16005
|
tag: 'tbody',
|
|
@@ -15407,6 +16034,8 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
|
|
|
15407
16034
|
class: 'vxe-table--cell-multi-area'
|
|
15408
16035
|
}), h('span', {
|
|
15409
16036
|
class: 'vxe-table--cell-active-area'
|
|
16037
|
+
}), h('span', {
|
|
16038
|
+
class: 'vxe-table--cell-row-status-area'
|
|
15410
16039
|
})]) : body_renderEmptyElement($xeTable), !fixedType ? h('div', {
|
|
15411
16040
|
class: 'vxe-table--empty-block',
|
|
15412
16041
|
ref: 'emptyBlock'
|
|
@@ -15420,9 +16049,7 @@ function renderRows(h, _vm, fixedType, isOptimizeMode, tableData, tableColumn) {
|
|
|
15420
16049
|
|
|
15421
16050
|
|
|
15422
16051
|
|
|
15423
|
-
|
|
15424
16052
|
const {
|
|
15425
|
-
getI18n: header_getI18n,
|
|
15426
16053
|
renderer: header_renderer,
|
|
15427
16054
|
renderEmptyElement: header_renderEmptyElement
|
|
15428
16055
|
} = core_.VxeUI;
|
|
@@ -15459,6 +16086,10 @@ const header_renderRows = (h, _vm, isGroup, isOptimizeMode, cols, $rowIndex) =>
|
|
|
15459
16086
|
} = tableInternalData;
|
|
15460
16087
|
const columnOpts = $xeTable.computeColumnOpts;
|
|
15461
16088
|
const columnDragOpts = $xeTable.computeColumnDragOpts;
|
|
16089
|
+
const cellOpts = $xeTable.computeCellOpts;
|
|
16090
|
+
const defaultRowHeight = $xeTable.computeDefaultRowHeight;
|
|
16091
|
+
const headerCellOpts = $xeTable.computeHeaderCellOpts;
|
|
16092
|
+
const currCellHeight = getCellHeight(headerCellOpts.height || cellOpts.height) || defaultRowHeight;
|
|
15462
16093
|
const {
|
|
15463
16094
|
disabledMethod: dragDisabledMethod,
|
|
15464
16095
|
isCrossDrag,
|
|
@@ -15481,6 +16112,7 @@ const header_renderRows = (h, _vm, isGroup, isOptimizeMode, cols, $rowIndex) =>
|
|
|
15481
16112
|
const compConf = renderOpts ? header_renderer.get(renderOpts.name) : null;
|
|
15482
16113
|
const isColGroup = column.children && column.children.length;
|
|
15483
16114
|
const fixedHiddenColumn = fixedType ? column.fixed !== fixedType && !isColGroup : column.fixed && overflowX;
|
|
16115
|
+
const isPadding = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(headerCellOpts.padding) ? headerCellOpts.padding : cellOpts.padding;
|
|
15484
16116
|
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;
|
|
15485
16117
|
const headAlign = headerAlign || (compConf ? compConf.tableHeaderCellAlign : '') || allHeaderAlign || align || (compConf ? compConf.tableCellAlign : '') || allAlign;
|
|
15486
16118
|
let showEllipsis = headOverflow === 'ellipsis';
|
|
@@ -15495,7 +16127,7 @@ const header_renderRows = (h, _vm, isGroup, isOptimizeMode, cols, $rowIndex) =>
|
|
|
15495
16127
|
}
|
|
15496
16128
|
const columnIndex = $xeTable.getColumnIndex(column);
|
|
15497
16129
|
const _columnIndex = $xeTable.getVTColumnIndex(column);
|
|
15498
|
-
const
|
|
16130
|
+
const cellParams = {
|
|
15499
16131
|
$table: $xeTable,
|
|
15500
16132
|
$grid: $xeGrid,
|
|
15501
16133
|
$rowIndex,
|
|
@@ -15515,8 +16147,8 @@ const header_renderRows = (h, _vm, isGroup, isOptimizeMode, cols, $rowIndex) =>
|
|
|
15515
16147
|
rowspan: column.rowSpan > 1 ? column.rowSpan : null
|
|
15516
16148
|
};
|
|
15517
16149
|
const thOns = {
|
|
15518
|
-
click: evnt => $xeTable.triggerHeaderCellClickEvent(evnt,
|
|
15519
|
-
dblclick: evnt => $xeTable.triggerHeaderCellDblclickEvent(evnt,
|
|
16150
|
+
click: evnt => $xeTable.triggerHeaderCellClickEvent(evnt, cellParams),
|
|
16151
|
+
dblclick: evnt => $xeTable.triggerHeaderCellDblclickEvent(evnt, cellParams)
|
|
15520
16152
|
};
|
|
15521
16153
|
// 虚拟滚动不支持动态高度
|
|
15522
16154
|
if (scrollXLoad && !hasEllipsis) {
|
|
@@ -15525,11 +16157,11 @@ const header_renderRows = (h, _vm, isGroup, isOptimizeMode, cols, $rowIndex) =>
|
|
|
15525
16157
|
const isColDragCell = columnOpts.drag && columnDragOpts.trigger === 'cell';
|
|
15526
16158
|
let isDisabledDrag = false;
|
|
15527
16159
|
if (isColDragCell) {
|
|
15528
|
-
isDisabledDrag = !!(dragDisabledMethod && dragDisabledMethod(
|
|
16160
|
+
isDisabledDrag = !!(dragDisabledMethod && dragDisabledMethod(cellParams));
|
|
15529
16161
|
}
|
|
15530
16162
|
// 按下事件处理
|
|
15531
16163
|
if (mouseConfig || isColDragCell) {
|
|
15532
|
-
thOns.mousedown = evnt => $xeTable.triggerHeaderCellMousedownEvent(evnt,
|
|
16164
|
+
thOns.mousedown = evnt => $xeTable.triggerHeaderCellMousedownEvent(evnt, cellParams);
|
|
15533
16165
|
}
|
|
15534
16166
|
// 拖拽列事件
|
|
15535
16167
|
if (columnOpts.drag) {
|
|
@@ -15543,9 +16175,15 @@ const header_renderRows = (h, _vm, isGroup, isOptimizeMode, cols, $rowIndex) =>
|
|
|
15543
16175
|
const isLastColumn = $columnIndex === cols.length - 1;
|
|
15544
16176
|
const showResizable = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(column.resizable) ? column.resizable : columnOpts.resizable || allResizable;
|
|
15545
16177
|
const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto');
|
|
15546
|
-
let
|
|
15547
|
-
if (scrollXLoad && !
|
|
15548
|
-
|
|
16178
|
+
let isVNPreEmptyStatus = false;
|
|
16179
|
+
if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
|
|
16180
|
+
isVNPreEmptyStatus = true;
|
|
16181
|
+
}
|
|
16182
|
+
const tcStyle = {};
|
|
16183
|
+
if (hasEllipsis) {
|
|
16184
|
+
tcStyle.height = `${currCellHeight}px`;
|
|
16185
|
+
} else {
|
|
16186
|
+
tcStyle.minHeight = `${currCellHeight}px`;
|
|
15549
16187
|
}
|
|
15550
16188
|
return h('th', {
|
|
15551
16189
|
class: ['vxe-header--column', colid, {
|
|
@@ -15557,15 +16195,16 @@ const header_renderRows = (h, _vm, isGroup, isOptimizeMode, cols, $rowIndex) =>
|
|
|
15557
16195
|
'col--ellipsis': hasEllipsis,
|
|
15558
16196
|
'fixed--width': !isAutoCellWidth,
|
|
15559
16197
|
'fixed--hidden': fixedHiddenColumn,
|
|
16198
|
+
'is--padding': isPadding,
|
|
15560
16199
|
'is--sortable': column.sortable,
|
|
15561
16200
|
'col--filter': !!filters,
|
|
15562
16201
|
'is--filter-active': hasFilter,
|
|
15563
16202
|
'is--drag-active': !column.fixed && !isDisabledDrag && (isCrossDrag || isPeerDrag || !column.parentId),
|
|
15564
16203
|
'is--drag-disabled': isDisabledDrag,
|
|
15565
16204
|
'col--current': currentColumn === column
|
|
15566
|
-
}, getClass(headerClassName,
|
|
16205
|
+
}, getClass(headerClassName, cellParams), getClass(headerCellClassName, cellParams)],
|
|
15567
16206
|
attrs: thAttrs,
|
|
15568
|
-
style: headerCellStyle ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(headerCellStyle) ? headerCellStyle(
|
|
16207
|
+
style: headerCellStyle ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(headerCellStyle) ? headerCellStyle(cellParams) : headerCellStyle : undefined,
|
|
15569
16208
|
on: thOns,
|
|
15570
16209
|
key: columnKey || scrollXLoad || scrollYLoad || columnOpts.useKey || columnOpts.drag || isColGroup ? colid : $columnIndex
|
|
15571
16210
|
}, [h('div', {
|
|
@@ -15573,18 +16212,24 @@ const header_renderRows = (h, _vm, isGroup, isOptimizeMode, cols, $rowIndex) =>
|
|
|
15573
16212
|
'c--title': showTitle,
|
|
15574
16213
|
'c--tooltip': showTooltip,
|
|
15575
16214
|
'c--ellipsis': showEllipsis
|
|
15576
|
-
}]
|
|
15577
|
-
|
|
16215
|
+
}],
|
|
16216
|
+
style: tcStyle
|
|
16217
|
+
}, isVNPreEmptyStatus || isOptimizeMode && fixedHiddenColumn ? [] : [h('div', {
|
|
16218
|
+
attrs: {
|
|
16219
|
+
colid
|
|
16220
|
+
},
|
|
16221
|
+
class: 'vxe-cell--wrapper'
|
|
16222
|
+
}, column.renderHeader(h, cellParams))]),
|
|
15578
16223
|
/**
|
|
15579
16224
|
* 列宽拖动
|
|
15580
16225
|
*/
|
|
15581
16226
|
!fixedHiddenColumn && showResizable ? h('div', {
|
|
15582
|
-
class: ['vxe-resizable', {
|
|
16227
|
+
class: ['vxe-cell--col-resizable', {
|
|
15583
16228
|
'is--line': !border || border === 'none'
|
|
15584
16229
|
}],
|
|
15585
16230
|
on: {
|
|
15586
|
-
mousedown: evnt =>
|
|
15587
|
-
dblclick: evnt => $xeTable.
|
|
16231
|
+
mousedown: evnt => $xeTable.handleColResizeMousedownEvent(evnt, fixedType, cellParams),
|
|
16232
|
+
dblclick: evnt => $xeTable.handleColResizeDblclickEvent(evnt, cellParams)
|
|
15588
16233
|
}
|
|
15589
16234
|
}) : header_renderEmptyElement($xeTable)]);
|
|
15590
16235
|
});
|
|
@@ -15604,6 +16249,7 @@ function renderHeads(h, _vm, isGroup, isOptimizeMode, headerGroups) {
|
|
|
15604
16249
|
headerRowStyle
|
|
15605
16250
|
} = tableProps;
|
|
15606
16251
|
const {
|
|
16252
|
+
isColLoading,
|
|
15607
16253
|
isDragColMove
|
|
15608
16254
|
} = tableReactData;
|
|
15609
16255
|
return headerGroups.map((cols, $rowIndex) => {
|
|
@@ -15613,7 +16259,7 @@ function renderHeads(h, _vm, isGroup, isOptimizeMode, headerGroups) {
|
|
|
15613
16259
|
fixed: fixedType,
|
|
15614
16260
|
type: cellType
|
|
15615
16261
|
};
|
|
15616
|
-
if (columnOpts.drag && columnDragOpts.animation) {
|
|
16262
|
+
if (!isColLoading && columnOpts.drag && columnDragOpts.animation) {
|
|
15617
16263
|
return h('transition-group', {
|
|
15618
16264
|
key: $rowIndex,
|
|
15619
16265
|
props: {
|
|
@@ -15713,6 +16359,7 @@ function renderHeads(h, _vm, isGroup, isOptimizeMode, headerGroups) {
|
|
|
15713
16359
|
headerColumn
|
|
15714
16360
|
} = this;
|
|
15715
16361
|
const {
|
|
16362
|
+
mouseConfig,
|
|
15716
16363
|
showHeaderOverflow: allColumnHeaderOverflow,
|
|
15717
16364
|
spanMethod,
|
|
15718
16365
|
footerSpanMethod
|
|
@@ -15727,6 +16374,7 @@ function renderHeads(h, _vm, isGroup, isOptimizeMode, headerGroups) {
|
|
|
15727
16374
|
visibleColumn,
|
|
15728
16375
|
fullColumnIdData
|
|
15729
16376
|
} = tableInternalData;
|
|
16377
|
+
const mouseOpts = $xeTable.computeMouseOpts;
|
|
15730
16378
|
let renderHeaderList = headerColumn;
|
|
15731
16379
|
let renderColumnList = tableColumn;
|
|
15732
16380
|
let isOptimizeMode = false;
|
|
@@ -15821,14 +16469,21 @@ function renderHeads(h, _vm, isGroup, isOptimizeMode, headerGroups) {
|
|
|
15821
16469
|
*/
|
|
15822
16470
|
h('thead', {
|
|
15823
16471
|
ref: 'refHeaderTHead'
|
|
15824
|
-
}, renderHeads(h, this, isGroup, isOptimizeMode, renderHeaderList))
|
|
15825
|
-
|
|
15826
|
-
|
|
15827
|
-
|
|
15828
|
-
h('
|
|
15829
|
-
|
|
15830
|
-
|
|
15831
|
-
|
|
16472
|
+
}, renderHeads(h, this, isGroup, isOptimizeMode, renderHeaderList)), mouseConfig && mouseOpts.area ? h('div', {
|
|
16473
|
+
class: 'vxe-table--cell-area'
|
|
16474
|
+
}, [h('span', {
|
|
16475
|
+
class: 'vxe-table--cell-main-area'
|
|
16476
|
+
}), h('span', {
|
|
16477
|
+
class: 'vxe-table--cell-copy-area'
|
|
16478
|
+
}), h('span', {
|
|
16479
|
+
class: 'vxe-table--cell-extend-area'
|
|
16480
|
+
}), h('span', {
|
|
16481
|
+
class: 'vxe-table--cell-multi-area'
|
|
16482
|
+
}), h('span', {
|
|
16483
|
+
class: 'vxe-table--cell-active-area'
|
|
16484
|
+
}), h('span', {
|
|
16485
|
+
class: 'vxe-table--cell-col-status-area'
|
|
16486
|
+
})]) : header_renderEmptyElement($xeTable)])])]);
|
|
15832
16487
|
},
|
|
15833
16488
|
methods: {
|
|
15834
16489
|
uploadColumn() {
|
|
@@ -15836,156 +16491,6 @@ function renderHeads(h, _vm, isGroup, isOptimizeMode, headerGroups) {
|
|
|
15836
16491
|
$parent: $xetable
|
|
15837
16492
|
} = this;
|
|
15838
16493
|
this.headerColumn = $xetable.isGroup ? convertHeaderColumnToRows(this.tableGroupColumn) : [];
|
|
15839
|
-
},
|
|
15840
|
-
resizeMousedownEvent(evnt, params) {
|
|
15841
|
-
const _vm = this;
|
|
15842
|
-
const props = _vm;
|
|
15843
|
-
const $xeTable = this.$parent;
|
|
15844
|
-
const tableReactData = $xeTable;
|
|
15845
|
-
const tableInternalData = $xeTable;
|
|
15846
|
-
const {
|
|
15847
|
-
column
|
|
15848
|
-
} = params;
|
|
15849
|
-
const {
|
|
15850
|
-
fixedType
|
|
15851
|
-
} = props;
|
|
15852
|
-
const {
|
|
15853
|
-
scrollbarHeight
|
|
15854
|
-
} = tableReactData;
|
|
15855
|
-
const {
|
|
15856
|
-
elemStore,
|
|
15857
|
-
visibleColumn
|
|
15858
|
-
} = tableInternalData;
|
|
15859
|
-
const resizableOpts = $xeTable.computeResizableOpts;
|
|
15860
|
-
const tableEl = $xeTable.$refs.refElem;
|
|
15861
|
-
const leftContainerElem = $xeTable.$refs.refLeftContainer;
|
|
15862
|
-
const rightContainerElem = $xeTable.$refs.refRightContainer;
|
|
15863
|
-
const resizeBarElem = $xeTable.$refs.refCellResizeBar;
|
|
15864
|
-
const resizeTipElem = $xeTable.$refs.refCellResizeTip;
|
|
15865
|
-
const scrollbarXToTop = $xeTable.computeScrollbarXToTop;
|
|
15866
|
-
const {
|
|
15867
|
-
clientX: dragClientX
|
|
15868
|
-
} = evnt;
|
|
15869
|
-
const wrapperElem = _vm.$el;
|
|
15870
|
-
const dragBtnElem = evnt.target;
|
|
15871
|
-
let resizeColumn = column;
|
|
15872
|
-
if (column.children && column.children.length) {
|
|
15873
|
-
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(column.children, childColumn => {
|
|
15874
|
-
resizeColumn = childColumn;
|
|
15875
|
-
});
|
|
15876
|
-
}
|
|
15877
|
-
const cell = dragBtnElem.parentNode;
|
|
15878
|
-
const cellParams = Object.assign(params, {
|
|
15879
|
-
cell
|
|
15880
|
-
});
|
|
15881
|
-
let dragLeft = 0;
|
|
15882
|
-
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
15883
|
-
if (!bodyScrollElem) {
|
|
15884
|
-
return;
|
|
15885
|
-
}
|
|
15886
|
-
const pos = getOffsetPos(dragBtnElem, tableEl);
|
|
15887
|
-
const dragBtnWidth = dragBtnElem.clientWidth;
|
|
15888
|
-
const dragBtnOffsetWidth = Math.floor(dragBtnWidth / 2);
|
|
15889
|
-
const minInterval = getColReMinWidth(cellParams) - dragBtnOffsetWidth; // 列之间的最小间距
|
|
15890
|
-
let dragMinLeft = pos.left - cell.clientWidth + dragBtnWidth + minInterval;
|
|
15891
|
-
let dragPosLeft = pos.left + dragBtnOffsetWidth;
|
|
15892
|
-
const domMousemove = document.onmousemove;
|
|
15893
|
-
const domMouseup = document.onmouseup;
|
|
15894
|
-
const isLeftFixed = fixedType === 'left';
|
|
15895
|
-
const isRightFixed = fixedType === 'right';
|
|
15896
|
-
// 计算左右侧固定列偏移量
|
|
15897
|
-
let fixedOffsetWidth = 0;
|
|
15898
|
-
if (isLeftFixed || isRightFixed) {
|
|
15899
|
-
const siblingProp = isLeftFixed ? 'nextElementSibling' : 'previousElementSibling';
|
|
15900
|
-
let tempCellElem = cell[siblingProp];
|
|
15901
|
-
while (tempCellElem) {
|
|
15902
|
-
if (hasClass(tempCellElem, 'fixed--hidden')) {
|
|
15903
|
-
break;
|
|
15904
|
-
} else if (!hasClass(tempCellElem, 'col--group')) {
|
|
15905
|
-
fixedOffsetWidth += tempCellElem.offsetWidth;
|
|
15906
|
-
}
|
|
15907
|
-
tempCellElem = tempCellElem[siblingProp];
|
|
15908
|
-
}
|
|
15909
|
-
if (isRightFixed && rightContainerElem) {
|
|
15910
|
-
dragPosLeft = rightContainerElem.offsetLeft + fixedOffsetWidth;
|
|
15911
|
-
}
|
|
15912
|
-
}
|
|
15913
|
-
// 处理拖动事件
|
|
15914
|
-
const updateEvent = function (evnt) {
|
|
15915
|
-
evnt.stopPropagation();
|
|
15916
|
-
evnt.preventDefault();
|
|
15917
|
-
const tableHeight = tableEl.clientHeight;
|
|
15918
|
-
const offsetX = evnt.clientX - dragClientX;
|
|
15919
|
-
let left = dragPosLeft + offsetX;
|
|
15920
|
-
const scrollLeft = fixedType ? 0 : bodyScrollElem.scrollLeft;
|
|
15921
|
-
if (isLeftFixed) {
|
|
15922
|
-
// 左固定列(不允许超过右侧固定列、不允许超过右边距)
|
|
15923
|
-
left = Math.min(left, (rightContainerElem ? rightContainerElem.offsetLeft : bodyScrollElem.clientWidth) - fixedOffsetWidth - minInterval);
|
|
15924
|
-
} else if (isRightFixed) {
|
|
15925
|
-
// 右侧固定列(不允许超过左侧固定列、不允许超过左边距)
|
|
15926
|
-
dragMinLeft = (leftContainerElem ? leftContainerElem.clientWidth : 0) + fixedOffsetWidth + minInterval;
|
|
15927
|
-
left = Math.min(left, dragPosLeft + cell.clientWidth - minInterval);
|
|
15928
|
-
} else {
|
|
15929
|
-
dragMinLeft = Math.max(bodyScrollElem.scrollLeft, dragMinLeft);
|
|
15930
|
-
// left = Math.min(left, bodyScrollElem.clientWidth + bodyScrollElem.scrollLeft - 40)
|
|
15931
|
-
}
|
|
15932
|
-
dragLeft = Math.max(left, dragMinLeft);
|
|
15933
|
-
const resizeBarLeft = Math.max(1, dragLeft - scrollLeft);
|
|
15934
|
-
resizeBarElem.style.left = `${resizeBarLeft}px`;
|
|
15935
|
-
resizeBarElem.style.top = `${scrollbarXToTop ? scrollbarHeight : 0}px`;
|
|
15936
|
-
resizeBarElem.style.height = `${scrollbarXToTop ? tableHeight - scrollbarHeight : tableHeight}px`;
|
|
15937
|
-
if (resizableOpts.showDragTip && resizeTipElem) {
|
|
15938
|
-
const tableWidth = tableEl.clientWidth;
|
|
15939
|
-
const wrapperRect = wrapperElem.getBoundingClientRect();
|
|
15940
|
-
const resizeBarWidth = resizeBarElem.clientWidth;
|
|
15941
|
-
const resizeTipWidth = resizeTipElem.clientWidth;
|
|
15942
|
-
const resizeTipHeight = resizeTipElem.clientHeight;
|
|
15943
|
-
let resizeTipLeft = -resizeTipWidth;
|
|
15944
|
-
if (resizeBarLeft < resizeTipWidth + resizeBarWidth) {
|
|
15945
|
-
resizeTipLeft = 0;
|
|
15946
|
-
} else if (resizeBarLeft > tableWidth) {
|
|
15947
|
-
resizeTipLeft += tableWidth - resizeBarLeft;
|
|
15948
|
-
}
|
|
15949
|
-
resizeTipElem.style.left = `${resizeTipLeft}px`;
|
|
15950
|
-
resizeTipElem.style.top = `${Math.min(tableHeight - resizeTipHeight, Math.max(0, evnt.clientY - wrapperRect.y - resizeTipHeight / 2))}px`;
|
|
15951
|
-
resizeTipElem.textContent = header_getI18n('vxe.table.resizeColTip', [resizeColumn.renderWidth + (isRightFixed ? dragPosLeft - dragLeft : dragLeft - dragPosLeft)]);
|
|
15952
|
-
}
|
|
15953
|
-
};
|
|
15954
|
-
tableReactData._isResize = true;
|
|
15955
|
-
addClass(tableEl, 'drag--resize');
|
|
15956
|
-
resizeBarElem.style.display = 'block';
|
|
15957
|
-
document.onmousemove = updateEvent;
|
|
15958
|
-
document.onmouseup = function (evnt) {
|
|
15959
|
-
document.onmousemove = domMousemove;
|
|
15960
|
-
document.onmouseup = domMouseup;
|
|
15961
|
-
const resizeWidth = resizeColumn.renderWidth + (isRightFixed ? dragPosLeft - dragLeft : dragLeft - dragPosLeft);
|
|
15962
|
-
resizeColumn.resizeWidth = resizeWidth;
|
|
15963
|
-
if (resizableOpts.dragMode === 'fixed') {
|
|
15964
|
-
visibleColumn.forEach(item => {
|
|
15965
|
-
if (item.id !== resizeColumn.id) {
|
|
15966
|
-
if (!item.resizeWidth) {
|
|
15967
|
-
item.resizeWidth = item.renderWidth;
|
|
15968
|
-
}
|
|
15969
|
-
}
|
|
15970
|
-
});
|
|
15971
|
-
}
|
|
15972
|
-
resizeBarElem.style.display = 'none';
|
|
15973
|
-
tableReactData._isResize = false;
|
|
15974
|
-
tableInternalData._lastResizeTime = Date.now();
|
|
15975
|
-
$xeTable.analyColumnWidth();
|
|
15976
|
-
$xeTable.recalculate(true).then(() => {
|
|
15977
|
-
$xeTable.saveCustomStore('update:visible');
|
|
15978
|
-
$xeTable.updateCellAreas();
|
|
15979
|
-
$xeTable.dispatchEvent('resizable-change', {
|
|
15980
|
-
...params,
|
|
15981
|
-
resizeWidth
|
|
15982
|
-
}, evnt);
|
|
15983
|
-
setTimeout(() => $xeTable.recalculate(true), 300);
|
|
15984
|
-
});
|
|
15985
|
-
removeClass(tableEl, 'drag--resize');
|
|
15986
|
-
};
|
|
15987
|
-
updateEvent(evnt);
|
|
15988
|
-
$xeTable.closeMenu();
|
|
15989
16494
|
}
|
|
15990
16495
|
}
|
|
15991
16496
|
});
|
|
@@ -15994,6 +16499,7 @@ function renderHeads(h, _vm, isGroup, isOptimizeMode, headerGroups) {
|
|
|
15994
16499
|
|
|
15995
16500
|
|
|
15996
16501
|
|
|
16502
|
+
|
|
15997
16503
|
const footer_renderType = 'footer';
|
|
15998
16504
|
const {
|
|
15999
16505
|
renderer: footer_renderer,
|
|
@@ -16033,6 +16539,8 @@ function footer_renderRows(h, _vm, tableColumn, footerTableData, row, $rowIndex,
|
|
|
16033
16539
|
fixedType
|
|
16034
16540
|
} = props;
|
|
16035
16541
|
const {
|
|
16542
|
+
resizable: allResizable,
|
|
16543
|
+
border,
|
|
16036
16544
|
footerCellClassName,
|
|
16037
16545
|
footerCellStyle,
|
|
16038
16546
|
footerAlign: allFooterAlign,
|
|
@@ -16052,7 +16560,14 @@ function footer_renderRows(h, _vm, tableColumn, footerTableData, row, $rowIndex,
|
|
|
16052
16560
|
scrollXStore
|
|
16053
16561
|
} = tableInternalData;
|
|
16054
16562
|
const tooltipOpts = $xeTable.computeTooltipOpts;
|
|
16563
|
+
const {
|
|
16564
|
+
isAllColumnDrag
|
|
16565
|
+
} = $xeTable.resizableOpts;
|
|
16055
16566
|
const columnOpts = $xeTable.computeColumnOpts;
|
|
16567
|
+
const defaultRowHeight = $xeTable.computeDefaultRowHeight;
|
|
16568
|
+
const cellOpts = $xeTable.computeCellOpts;
|
|
16569
|
+
const footerCellOpts = $xeTable.computeFooterCellOpts;
|
|
16570
|
+
const currCellHeight = getCellHeight(footerCellOpts.height || cellOpts.height) || defaultRowHeight;
|
|
16056
16571
|
return tableColumn.map((column, $columnIndex) => {
|
|
16057
16572
|
const {
|
|
16058
16573
|
type,
|
|
@@ -16063,19 +16578,22 @@ function footer_renderRows(h, _vm, tableColumn, footerTableData, row, $rowIndex,
|
|
|
16063
16578
|
editRender,
|
|
16064
16579
|
cellRender
|
|
16065
16580
|
} = column;
|
|
16581
|
+
const colid = column.id;
|
|
16066
16582
|
const renderOpts = editRender || cellRender;
|
|
16067
16583
|
const compConf = renderOpts ? footer_renderer.get(renderOpts.name) : null;
|
|
16068
16584
|
const showAllTip = tooltipOpts.showAll;
|
|
16069
16585
|
const isColGroup = column.children && column.children.length;
|
|
16070
16586
|
const fixedHiddenColumn = fixedType ? column.fixed !== fixedType && !isColGroup : column.fixed && overflowX;
|
|
16587
|
+
const isPadding = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(footerCellOpts.padding) ? footerCellOpts.padding : cellOpts.padding;
|
|
16071
16588
|
const footOverflow = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(showFooterOverflow) ? allColumnFooterOverflow : showFooterOverflow;
|
|
16072
16589
|
const footAlign = footerAlign || (compConf ? compConf.tableFooterCellAlign : '') || allFooterAlign || align || (compConf ? compConf.tableCellAlign : '') || allAlign;
|
|
16073
16590
|
let showEllipsis = footOverflow === 'ellipsis';
|
|
16074
16591
|
const showTitle = footOverflow === 'title';
|
|
16075
16592
|
const showTooltip = footOverflow === true || footOverflow === 'tooltip';
|
|
16076
16593
|
let hasEllipsis = showTitle || showTooltip || showEllipsis;
|
|
16594
|
+
const showResizable = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(column.resizable) ? column.resizable : columnOpts.resizable || allResizable;
|
|
16077
16595
|
const attrs = {
|
|
16078
|
-
colid
|
|
16596
|
+
colid
|
|
16079
16597
|
};
|
|
16080
16598
|
const tfOns = {};
|
|
16081
16599
|
const columnIndex = $xeTable.getColumnIndex(column);
|
|
@@ -16164,9 +16682,15 @@ function footer_renderRows(h, _vm, tableColumn, footerTableData, row, $rowIndex,
|
|
|
16164
16682
|
}
|
|
16165
16683
|
const isLastColumn = $columnIndex === tableColumn.length - 1;
|
|
16166
16684
|
const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto');
|
|
16167
|
-
let
|
|
16168
|
-
if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex || _columnIndex > scrollXStore.visibleEndIndex)) {
|
|
16169
|
-
|
|
16685
|
+
let isVNPreEmptyStatus = false;
|
|
16686
|
+
if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
|
|
16687
|
+
isVNPreEmptyStatus = true;
|
|
16688
|
+
}
|
|
16689
|
+
const tcStyle = {};
|
|
16690
|
+
if (hasEllipsis) {
|
|
16691
|
+
tcStyle.height = `${currCellHeight}px`;
|
|
16692
|
+
} else {
|
|
16693
|
+
tcStyle.minHeight = `${currCellHeight}px`;
|
|
16170
16694
|
}
|
|
16171
16695
|
return h('td', {
|
|
16172
16696
|
class: ['vxe-footer--column', column.id, {
|
|
@@ -16175,6 +16699,7 @@ function footer_renderRows(h, _vm, tableColumn, footerTableData, row, $rowIndex,
|
|
|
16175
16699
|
'col--last': isLastColumn,
|
|
16176
16700
|
'fixed--width': !isAutoCellWidth,
|
|
16177
16701
|
'fixed--hidden': fixedHiddenColumn,
|
|
16702
|
+
'is--padding': isPadding,
|
|
16178
16703
|
'col--ellipsis': hasEllipsis,
|
|
16179
16704
|
'col--current': currentColumn === column
|
|
16180
16705
|
}, getClass(footerClassName, cellParams), getClass(footerCellClassName, cellParams)],
|
|
@@ -16187,8 +16712,26 @@ function footer_renderRows(h, _vm, tableColumn, footerTableData, row, $rowIndex,
|
|
|
16187
16712
|
'c--title': showTitle,
|
|
16188
16713
|
'c--tooltip': showTooltip,
|
|
16189
16714
|
'c--ellipsis': showEllipsis
|
|
16190
|
-
}]
|
|
16191
|
-
|
|
16715
|
+
}],
|
|
16716
|
+
style: tcStyle
|
|
16717
|
+
}, isVNPreEmptyStatus ? [] : [h('div', {
|
|
16718
|
+
attrs: {
|
|
16719
|
+
colid
|
|
16720
|
+
},
|
|
16721
|
+
class: 'vxe-cell--wrapper'
|
|
16722
|
+
}, column.renderFooter(h, cellParams))]),
|
|
16723
|
+
/**
|
|
16724
|
+
* 列宽拖动
|
|
16725
|
+
*/
|
|
16726
|
+
!fixedHiddenColumn && showResizable && isAllColumnDrag ? h('div', {
|
|
16727
|
+
class: ['vxe-cell--col-resizable', {
|
|
16728
|
+
'is--line': !border || border === 'none'
|
|
16729
|
+
}],
|
|
16730
|
+
on: {
|
|
16731
|
+
mousedown: evnt => $xeTable.handleColResizeMousedownEvent(evnt, fixedType, cellParams),
|
|
16732
|
+
dblclick: evnt => $xeTable.handleColResizeDblclickEvent(evnt, cellParams)
|
|
16733
|
+
}
|
|
16734
|
+
}) : footer_renderEmptyElement($xeTable)]);
|
|
16192
16735
|
});
|
|
16193
16736
|
}
|
|
16194
16737
|
function footer_renderHeads(h, _vm, renderColumnList) {
|
|
@@ -16205,6 +16748,7 @@ function footer_renderHeads(h, _vm, renderColumnList) {
|
|
|
16205
16748
|
footerRowStyle
|
|
16206
16749
|
} = tableProps;
|
|
16207
16750
|
const {
|
|
16751
|
+
isColLoading,
|
|
16208
16752
|
isDragColMove
|
|
16209
16753
|
} = tableReactData;
|
|
16210
16754
|
const columnOpts = $xeTable.computeColumnOpts;
|
|
@@ -16219,7 +16763,7 @@ function footer_renderHeads(h, _vm, renderColumnList) {
|
|
|
16219
16763
|
fixed: fixedType,
|
|
16220
16764
|
type: footer_renderType
|
|
16221
16765
|
};
|
|
16222
|
-
if (columnOpts.drag && columnDragOpts.animation) {
|
|
16766
|
+
if (!isColLoading && columnOpts.drag && columnDragOpts.animation) {
|
|
16223
16767
|
return h('transition-group', {
|
|
16224
16768
|
key: $rowIndex,
|
|
16225
16769
|
props: {
|
|
@@ -16445,10 +16989,10 @@ const {
|
|
|
16445
16989
|
type: [Boolean, String],
|
|
16446
16990
|
default: () => props_getConfig().table.border
|
|
16447
16991
|
},
|
|
16448
|
-
//
|
|
16992
|
+
// 已废弃,被 cell-config.padding 替换
|
|
16449
16993
|
padding: {
|
|
16450
16994
|
type: Boolean,
|
|
16451
|
-
default:
|
|
16995
|
+
default: null
|
|
16452
16996
|
},
|
|
16453
16997
|
// 是否圆角边框
|
|
16454
16998
|
round: {
|
|
@@ -16497,12 +17041,18 @@ const {
|
|
|
16497
17041
|
type: Boolean,
|
|
16498
17042
|
default: () => props_getConfig().table.highlightHoverRow
|
|
16499
17043
|
},
|
|
16500
|
-
|
|
17044
|
+
/**
|
|
17045
|
+
* (即将废弃)是否要高亮当前选中列
|
|
17046
|
+
* @deprecated
|
|
17047
|
+
*/
|
|
16501
17048
|
highlightCurrentColumn: {
|
|
16502
17049
|
type: Boolean,
|
|
16503
17050
|
default: () => props_getConfig().table.highlightCurrentColumn
|
|
16504
17051
|
},
|
|
16505
|
-
|
|
17052
|
+
/**
|
|
17053
|
+
* (即将废弃)鼠标移到列是否要高亮显示
|
|
17054
|
+
* @deprecated
|
|
17055
|
+
*/
|
|
16506
17056
|
highlightHoverColumn: {
|
|
16507
17057
|
type: Boolean,
|
|
16508
17058
|
default: () => props_getConfig().table.highlightHoverColumn
|
|
@@ -16594,6 +17144,10 @@ const {
|
|
|
16594
17144
|
columnConfig: Object,
|
|
16595
17145
|
// 单元格配置信息
|
|
16596
17146
|
cellConfig: Object,
|
|
17147
|
+
// 表头单元格配置信息
|
|
17148
|
+
headerCellConfig: Object,
|
|
17149
|
+
// 表尾单元格配置信息
|
|
17150
|
+
footerCellConfig: Object,
|
|
16597
17151
|
// 行配置信息
|
|
16598
17152
|
rowConfig: Object,
|
|
16599
17153
|
// 已废弃,被 rowDragConfig 替换
|
|
@@ -19386,6 +19940,8 @@ const {
|
|
|
19386
19940
|
* 快捷菜单事件处理
|
|
19387
19941
|
*/
|
|
19388
19942
|
handleGlobalContextmenuEvent(evnt) {
|
|
19943
|
+
const $xeTable = this;
|
|
19944
|
+
const internalData = $xeTable;
|
|
19389
19945
|
const {
|
|
19390
19946
|
$refs,
|
|
19391
19947
|
tId,
|
|
@@ -19406,7 +19962,7 @@ const {
|
|
|
19406
19962
|
evnt.preventDefault();
|
|
19407
19963
|
return;
|
|
19408
19964
|
}
|
|
19409
|
-
if (
|
|
19965
|
+
if (internalData._keyCtx) {
|
|
19410
19966
|
const type = 'body';
|
|
19411
19967
|
const params = {
|
|
19412
19968
|
type,
|
|
@@ -19724,6 +20280,7 @@ function insertTreeRow(_vm, newRecords, isAppend) {
|
|
|
19724
20280
|
parent: parentRow,
|
|
19725
20281
|
level: parentLevel + 1,
|
|
19726
20282
|
height: 0,
|
|
20283
|
+
resizeHeight: 0,
|
|
19727
20284
|
oTop: 0
|
|
19728
20285
|
};
|
|
19729
20286
|
fullDataRowIdData[rowid] = rest;
|
|
@@ -19748,6 +20305,7 @@ function insertTreeRow(_vm, newRecords, isAppend) {
|
|
|
19748
20305
|
parent: null,
|
|
19749
20306
|
level: 0,
|
|
19750
20307
|
height: 0,
|
|
20308
|
+
resizeHeight: 0,
|
|
19751
20309
|
oTop: 0
|
|
19752
20310
|
};
|
|
19753
20311
|
fullDataRowIdData[rowid] = rest;
|
|
@@ -19806,6 +20364,7 @@ function handleInsertRowAt($xeTable, records, targetRow, isInsertNextRow) {
|
|
|
19806
20364
|
parent: null,
|
|
19807
20365
|
level: 0,
|
|
19808
20366
|
height: 0,
|
|
20367
|
+
resizeHeight: 0,
|
|
19809
20368
|
oTop: 0
|
|
19810
20369
|
};
|
|
19811
20370
|
fullDataRowIdData[rowid] = rest;
|
|
@@ -19843,6 +20402,7 @@ function handleInsertRowAt($xeTable, records, targetRow, isInsertNextRow) {
|
|
|
19843
20402
|
parent: null,
|
|
19844
20403
|
level: 0,
|
|
19845
20404
|
height: 0,
|
|
20405
|
+
resizeHeight: 0,
|
|
19846
20406
|
oTop: 0
|
|
19847
20407
|
};
|
|
19848
20408
|
fullDataRowIdData[rowid] = rest;
|
|
@@ -19903,6 +20463,7 @@ function handleInsertRowAt($xeTable, records, targetRow, isInsertNextRow) {
|
|
|
19903
20463
|
parent: parentRow,
|
|
19904
20464
|
level: parentLevel + 1,
|
|
19905
20465
|
height: 0,
|
|
20466
|
+
resizeHeight: 0,
|
|
19906
20467
|
oTop: 0
|
|
19907
20468
|
};
|
|
19908
20469
|
fullDataRowIdData[rowid] = rest;
|
|
@@ -19977,7 +20538,7 @@ function handleInsertRowAt($xeTable, records, targetRow, isInsertNextRow) {
|
|
|
19977
20538
|
const rowid = getRowid($xeTable, newRow);
|
|
19978
20539
|
insertMaps[rowid] = newRow;
|
|
19979
20540
|
});
|
|
19980
|
-
$xeTable.cacheRowMap();
|
|
20541
|
+
$xeTable.cacheRowMap(false);
|
|
19981
20542
|
$xeTable.updateScrollYStatus();
|
|
19982
20543
|
$xeTable.handleTableData(treeConfig && transform);
|
|
19983
20544
|
if (!(treeConfig && transform)) {
|
|
@@ -20189,7 +20750,7 @@ function handleInsertChildRowAt($xeTable, records, parentRow, targetRow, isInser
|
|
|
20189
20750
|
}
|
|
20190
20751
|
});
|
|
20191
20752
|
$xeTable.updateFooter();
|
|
20192
|
-
$xeTable.cacheRowMap();
|
|
20753
|
+
$xeTable.cacheRowMap(false);
|
|
20193
20754
|
$xeTable.handleTableData(treeConfig && transform);
|
|
20194
20755
|
if (!(treeConfig && transform)) {
|
|
20195
20756
|
$xeTable.updateAfterDataIndex();
|
|
@@ -21563,7 +22124,21 @@ function getTxtCellValue(val, vMaps) {
|
|
|
21563
22124
|
const rest = replaceTxtCell(val, vMaps);
|
|
21564
22125
|
return rest.replace(/^"+$/g, qVal => '"'.repeat(Math.ceil(qVal.length / 2)));
|
|
21565
22126
|
}
|
|
21566
|
-
function
|
|
22127
|
+
function toExportField(tableConf, field) {
|
|
22128
|
+
const {
|
|
22129
|
+
fieldMaps,
|
|
22130
|
+
titleMaps
|
|
22131
|
+
} = tableConf;
|
|
22132
|
+
// title 转 field
|
|
22133
|
+
if (!fieldMaps[field]) {
|
|
22134
|
+
const teCol = titleMaps[field];
|
|
22135
|
+
if (teCol && teCol.field) {
|
|
22136
|
+
field = teCol.field;
|
|
22137
|
+
}
|
|
22138
|
+
}
|
|
22139
|
+
return field;
|
|
22140
|
+
}
|
|
22141
|
+
function parseCsvAndTxt(tableConf, content, cellSeparator) {
|
|
21567
22142
|
const list = content.split(enterSymbol);
|
|
21568
22143
|
const rows = [];
|
|
21569
22144
|
let fields = [];
|
|
@@ -21584,11 +22159,11 @@ function parseCsvAndTxt(columns, content, cellSeparator) {
|
|
|
21584
22159
|
});
|
|
21585
22160
|
const cells = rVal.split(cellSeparator);
|
|
21586
22161
|
if (!fields.length) {
|
|
21587
|
-
fields = cells.map(val => getTxtCellValue(val.trim(), vMaps));
|
|
22162
|
+
fields = cells.map(val => toExportField(tableConf, getTxtCellValue(val.trim(), vMaps)));
|
|
21588
22163
|
} else {
|
|
21589
22164
|
cells.forEach((val, colIndex) => {
|
|
21590
22165
|
if (colIndex < fields.length) {
|
|
21591
|
-
item[fields[colIndex]] = getTxtCellValue(val, vMaps);
|
|
22166
|
+
item[fields[colIndex]] = getTxtCellValue(val.trim(), vMaps);
|
|
21592
22167
|
}
|
|
21593
22168
|
});
|
|
21594
22169
|
rows.push(item);
|
|
@@ -21601,13 +22176,13 @@ function parseCsvAndTxt(columns, content, cellSeparator) {
|
|
|
21601
22176
|
rows
|
|
21602
22177
|
};
|
|
21603
22178
|
}
|
|
21604
|
-
function parseCsv(
|
|
21605
|
-
return parseCsvAndTxt(
|
|
22179
|
+
function parseCsv(tableConf, content) {
|
|
22180
|
+
return parseCsvAndTxt(tableConf, content, ',');
|
|
21606
22181
|
}
|
|
21607
|
-
function parseTxt(
|
|
21608
|
-
return parseCsvAndTxt(
|
|
22182
|
+
function parseTxt(tableConf, content) {
|
|
22183
|
+
return parseCsvAndTxt(tableConf, content, '\t');
|
|
21609
22184
|
}
|
|
21610
|
-
function parseHTML(
|
|
22185
|
+
function parseHTML(tableConf, content) {
|
|
21611
22186
|
const domParser = new DOMParser();
|
|
21612
22187
|
const xmlDoc = domParser.parseFromString(content, 'text/html');
|
|
21613
22188
|
const bodyNodes = getElementsByTagName(xmlDoc, 'body');
|
|
@@ -21620,7 +22195,7 @@ function parseHTML(columns, content) {
|
|
|
21620
22195
|
if (theadNodes.length) {
|
|
21621
22196
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(getElementsByTagName(theadNodes[0], 'tr'), rowNode => {
|
|
21622
22197
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(getElementsByTagName(rowNode, 'th'), cellNode => {
|
|
21623
|
-
fields.push(cellNode.textContent);
|
|
22198
|
+
fields.push(toExportField(tableConf, cellNode.textContent || ''));
|
|
21624
22199
|
});
|
|
21625
22200
|
});
|
|
21626
22201
|
const tbodyNodes = getElementsByTagName(tableNodes[0], 'tbody');
|
|
@@ -21643,7 +22218,7 @@ function parseHTML(columns, content) {
|
|
|
21643
22218
|
rows
|
|
21644
22219
|
};
|
|
21645
22220
|
}
|
|
21646
|
-
function parseXML(
|
|
22221
|
+
function parseXML(tableConf, content) {
|
|
21647
22222
|
const domParser = new DOMParser();
|
|
21648
22223
|
const xmlDoc = domParser.parseFromString(content, 'application/xml');
|
|
21649
22224
|
const sheetNodes = getElementsByTagName(xmlDoc, 'Worksheet');
|
|
@@ -21655,7 +22230,7 @@ function parseXML(columns, content) {
|
|
|
21655
22230
|
const rowNodes = getElementsByTagName(tableNodes[0], 'Row');
|
|
21656
22231
|
if (rowNodes.length) {
|
|
21657
22232
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(getElementsByTagName(rowNodes[0], 'Cell'), cellNode => {
|
|
21658
|
-
fields.push(cellNode.textContent);
|
|
22233
|
+
fields.push(toExportField(tableConf, cellNode.textContent || ''));
|
|
21659
22234
|
});
|
|
21660
22235
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(rowNodes, (rowNode, index) => {
|
|
21661
22236
|
if (index) {
|
|
@@ -21677,60 +22252,62 @@ function parseXML(columns, content) {
|
|
|
21677
22252
|
rows
|
|
21678
22253
|
};
|
|
21679
22254
|
}
|
|
21680
|
-
|
|
21681
|
-
|
|
21682
|
-
* @param {Array} fields 字段名列表
|
|
21683
|
-
* @param {Array} rows 数据列表
|
|
21684
|
-
*/
|
|
21685
|
-
function checkImportData(columns, fields) {
|
|
21686
|
-
const tableFields = [];
|
|
21687
|
-
columns.forEach(column => {
|
|
21688
|
-
const field = column.field;
|
|
21689
|
-
if (field) {
|
|
21690
|
-
tableFields.push(field);
|
|
21691
|
-
}
|
|
21692
|
-
});
|
|
21693
|
-
return fields.some(field => tableFields.indexOf(field) > -1);
|
|
21694
|
-
}
|
|
21695
|
-
function handleImport($xetable, content, opts) {
|
|
22255
|
+
function handleImport($xeTable, content, opts) {
|
|
22256
|
+
const internalData = $xeTable;
|
|
21696
22257
|
const {
|
|
21697
22258
|
tableFullColumn,
|
|
21698
22259
|
_importResolve,
|
|
21699
22260
|
_importReject
|
|
21700
|
-
} =
|
|
22261
|
+
} = internalData;
|
|
21701
22262
|
let rest = {
|
|
21702
22263
|
fields: [],
|
|
21703
22264
|
rows: []
|
|
21704
22265
|
};
|
|
22266
|
+
const tableFieldMaps = {};
|
|
22267
|
+
const tableTitleMaps = {};
|
|
22268
|
+
tableFullColumn.forEach(column => {
|
|
22269
|
+
const field = column.field;
|
|
22270
|
+
const title = column.getTitle();
|
|
22271
|
+
if (field) {
|
|
22272
|
+
tableFieldMaps[field] = column;
|
|
22273
|
+
}
|
|
22274
|
+
if (title) {
|
|
22275
|
+
tableTitleMaps[column.getTitle()] = column;
|
|
22276
|
+
}
|
|
22277
|
+
});
|
|
22278
|
+
const tableConf = {
|
|
22279
|
+
fieldMaps: tableFieldMaps,
|
|
22280
|
+
titleMaps: tableTitleMaps
|
|
22281
|
+
};
|
|
21705
22282
|
switch (opts.type) {
|
|
21706
22283
|
case 'csv':
|
|
21707
|
-
rest = parseCsv(
|
|
22284
|
+
rest = parseCsv(tableConf, content);
|
|
21708
22285
|
break;
|
|
21709
22286
|
case 'txt':
|
|
21710
|
-
rest = parseTxt(
|
|
22287
|
+
rest = parseTxt(tableConf, content);
|
|
21711
22288
|
break;
|
|
21712
22289
|
case 'html':
|
|
21713
|
-
rest = parseHTML(
|
|
22290
|
+
rest = parseHTML(tableConf, content);
|
|
21714
22291
|
break;
|
|
21715
22292
|
case 'xml':
|
|
21716
|
-
rest = parseXML(
|
|
22293
|
+
rest = parseXML(tableConf, content);
|
|
21717
22294
|
break;
|
|
21718
22295
|
}
|
|
21719
22296
|
const {
|
|
21720
22297
|
fields,
|
|
21721
22298
|
rows
|
|
21722
22299
|
} = rest;
|
|
21723
|
-
const status =
|
|
22300
|
+
const status = fields.some(field => tableFieldMaps[field] || tableTitleMaps[field]);
|
|
21724
22301
|
if (status) {
|
|
21725
|
-
$
|
|
22302
|
+
$xeTable.createData(rows).then(data => {
|
|
21726
22303
|
let loadRest;
|
|
21727
22304
|
if (opts.mode === 'insert' || opts.mode === 'insertBottom') {
|
|
21728
|
-
loadRest = $
|
|
22305
|
+
loadRest = $xeTable.insertAt(data, -1);
|
|
21729
22306
|
}
|
|
21730
22307
|
if (opts.mode === 'insertTop') {
|
|
21731
|
-
loadRest = $
|
|
22308
|
+
loadRest = $xeTable.insert(data);
|
|
21732
22309
|
} else {
|
|
21733
|
-
loadRest = $
|
|
22310
|
+
loadRest = $xeTable.reloadData(data);
|
|
21734
22311
|
}
|
|
21735
22312
|
if (opts.message !== false) {
|
|
21736
22313
|
// 检测弹窗模块
|
|
@@ -21963,6 +22540,43 @@ function readLocalFile(options = {}) {
|
|
|
21963
22540
|
fileInput.click();
|
|
21964
22541
|
});
|
|
21965
22542
|
}
|
|
22543
|
+
function handleFilterColumns(exportOpts, column, columns) {
|
|
22544
|
+
return columns.some(item => {
|
|
22545
|
+
if (isColumnInfo(item)) {
|
|
22546
|
+
return column.id === item.id;
|
|
22547
|
+
} else if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(item)) {
|
|
22548
|
+
return column.field === item;
|
|
22549
|
+
} else {
|
|
22550
|
+
const colid = item.id || item.colId;
|
|
22551
|
+
const type = item.type;
|
|
22552
|
+
const field = item.field;
|
|
22553
|
+
if (colid) {
|
|
22554
|
+
return column.id === colid;
|
|
22555
|
+
} else if (field && type) {
|
|
22556
|
+
return column.field === field && column.type === type;
|
|
22557
|
+
} else if (field) {
|
|
22558
|
+
return column.field === field;
|
|
22559
|
+
} else if (type) {
|
|
22560
|
+
return column.type === type;
|
|
22561
|
+
}
|
|
22562
|
+
}
|
|
22563
|
+
return false;
|
|
22564
|
+
});
|
|
22565
|
+
}
|
|
22566
|
+
function handleFilterFields(exportOpts, column, includeFields, excludeFields) {
|
|
22567
|
+
if (excludeFields) {
|
|
22568
|
+
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().includes(excludeFields, column.field)) {
|
|
22569
|
+
return false;
|
|
22570
|
+
}
|
|
22571
|
+
}
|
|
22572
|
+
if (includeFields) {
|
|
22573
|
+
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().includes(includeFields, column.field)) {
|
|
22574
|
+
return true;
|
|
22575
|
+
}
|
|
22576
|
+
return false;
|
|
22577
|
+
}
|
|
22578
|
+
return exportOpts.original ? column.field : defaultFilterExportColumn(column);
|
|
22579
|
+
}
|
|
21966
22580
|
function handleExportAndPrint($xeTable, options, isPrint) {
|
|
21967
22581
|
const props = $xeTable;
|
|
21968
22582
|
const reactData = $xeTable;
|
|
@@ -22007,7 +22621,9 @@ function handleExportAndPrint($xeTable, options, isPrint) {
|
|
|
22007
22621
|
const checkMethod = customOpts.checkMethod;
|
|
22008
22622
|
const exportColumns = collectColumn.slice(0);
|
|
22009
22623
|
const {
|
|
22010
|
-
columns
|
|
22624
|
+
columns,
|
|
22625
|
+
excludeFields,
|
|
22626
|
+
includeFields
|
|
22011
22627
|
} = defOpts;
|
|
22012
22628
|
// 处理类型
|
|
22013
22629
|
const typeList = types.map(value => {
|
|
@@ -22031,33 +22647,19 @@ function handleExportAndPrint($xeTable, options, isPrint) {
|
|
|
22031
22647
|
// 默认选中
|
|
22032
22648
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(exportColumns, (column, index, items, path, parent) => {
|
|
22033
22649
|
const isColGroup = column.children && column.children.length;
|
|
22034
|
-
|
|
22035
|
-
|
|
22036
|
-
|
|
22037
|
-
|
|
22038
|
-
|
|
22039
|
-
|
|
22040
|
-
|
|
22041
|
-
const colid = item.id || item.colId;
|
|
22042
|
-
const type = item.type;
|
|
22043
|
-
const field = item.field;
|
|
22044
|
-
if (colid) {
|
|
22045
|
-
return column.id === colid;
|
|
22046
|
-
} else if (field && type) {
|
|
22047
|
-
return column.field === field && column.type === type;
|
|
22048
|
-
} else if (field) {
|
|
22049
|
-
return column.field === field;
|
|
22050
|
-
} else if (type) {
|
|
22051
|
-
return column.type === type;
|
|
22052
|
-
}
|
|
22053
|
-
}
|
|
22054
|
-
return false;
|
|
22055
|
-
}) : column.visible;
|
|
22056
|
-
column.halfChecked = false;
|
|
22057
|
-
column.disabled = parent && parent.disabled || (checkMethod ? !checkMethod({
|
|
22058
|
-
column
|
|
22059
|
-
}) : false);
|
|
22650
|
+
let isChecked = false;
|
|
22651
|
+
if (columns && columns.length) {
|
|
22652
|
+
isChecked = handleFilterColumns(defOpts, column, columns);
|
|
22653
|
+
} else if (excludeFields || includeFields) {
|
|
22654
|
+
isChecked = handleFilterFields(defOpts, column, includeFields, excludeFields);
|
|
22655
|
+
} else {
|
|
22656
|
+
isChecked = column.visible && (isColGroup || defaultFilterExportColumn(column));
|
|
22060
22657
|
}
|
|
22658
|
+
column.checked = isChecked;
|
|
22659
|
+
column.halfChecked = false;
|
|
22660
|
+
column.disabled = parent && parent.disabled || (checkMethod ? !checkMethod({
|
|
22661
|
+
column
|
|
22662
|
+
}) : false);
|
|
22061
22663
|
});
|
|
22062
22664
|
// 更新条件
|
|
22063
22665
|
Object.assign(exportStore, {
|
|
@@ -22679,6 +23281,7 @@ const convertToRows = originColumns => {
|
|
|
22679
23281
|
|
|
22680
23282
|
|
|
22681
23283
|
|
|
23284
|
+
|
|
22682
23285
|
function getTargetOffset(target, container) {
|
|
22683
23286
|
let offsetTop = 0;
|
|
22684
23287
|
let offsetLeft = 0;
|
|
@@ -22704,37 +23307,72 @@ function getTargetOffset(target, container) {
|
|
|
22704
23307
|
};
|
|
22705
23308
|
}
|
|
22706
23309
|
function getCheckboxRangeRows($xeTable, evnt, params, targetTrElem, trRect, offsetClientTop, moveRange) {
|
|
23310
|
+
const props = $xeTable;
|
|
22707
23311
|
const reactData = $xeTable;
|
|
22708
23312
|
const internalData = $xeTable;
|
|
23313
|
+
const {
|
|
23314
|
+
showOverflow
|
|
23315
|
+
} = props;
|
|
23316
|
+
const {
|
|
23317
|
+
fullAllDataRowIdData,
|
|
23318
|
+
isResizeCellHeight
|
|
23319
|
+
} = internalData;
|
|
23320
|
+
const rowOpts = $xeTable.computeRowOpts;
|
|
23321
|
+
const cellOpts = $xeTable.computeCellOpts;
|
|
23322
|
+
const defaultRowHeight = $xeTable.computeDefaultRowHeight;
|
|
23323
|
+
const {
|
|
23324
|
+
row
|
|
23325
|
+
} = params;
|
|
22709
23326
|
let countHeight = 0;
|
|
22710
23327
|
let rangeRows = [];
|
|
22711
23328
|
let moveSize = 0;
|
|
22712
23329
|
const isDown = moveRange > 0;
|
|
22713
23330
|
const {
|
|
22714
|
-
scrollYLoad
|
|
22715
|
-
rowHeight
|
|
23331
|
+
scrollYLoad
|
|
22716
23332
|
} = reactData;
|
|
22717
23333
|
const {
|
|
22718
23334
|
afterFullData
|
|
22719
23335
|
} = internalData;
|
|
23336
|
+
if (isDown) {
|
|
23337
|
+
moveSize = offsetClientTop + moveRange;
|
|
23338
|
+
} else {
|
|
23339
|
+
moveSize = trRect.height - offsetClientTop + Math.abs(moveRange);
|
|
23340
|
+
}
|
|
22720
23341
|
if (scrollYLoad) {
|
|
22721
|
-
|
|
22722
|
-
|
|
22723
|
-
|
|
22724
|
-
|
|
22725
|
-
|
|
22726
|
-
|
|
22727
|
-
|
|
22728
|
-
|
|
23342
|
+
const _rowIndex = $xeTable.getVTRowIndex(row);
|
|
23343
|
+
const isCustomCellHeight = isResizeCellHeight || cellOpts.height || rowOpts.height;
|
|
23344
|
+
if (!isCustomCellHeight && showOverflow) {
|
|
23345
|
+
if (isDown) {
|
|
23346
|
+
rangeRows = afterFullData.slice(_rowIndex, _rowIndex + Math.ceil(moveSize / defaultRowHeight));
|
|
23347
|
+
} else {
|
|
23348
|
+
rangeRows = afterFullData.slice(_rowIndex - Math.floor(moveSize / defaultRowHeight), _rowIndex + 1);
|
|
23349
|
+
}
|
|
22729
23350
|
} else {
|
|
22730
|
-
|
|
23351
|
+
if (isDown) {
|
|
23352
|
+
for (let i = _rowIndex; i < afterFullData.length; i++) {
|
|
23353
|
+
const item = afterFullData[i];
|
|
23354
|
+
const rowid = $xeTable.getRowid(item);
|
|
23355
|
+
const rowRest = fullAllDataRowIdData[rowid] || {};
|
|
23356
|
+
countHeight += rowRest.resizeHeight || cellOpts.height || rowOpts.height || defaultRowHeight;
|
|
23357
|
+
rangeRows.push(item);
|
|
23358
|
+
if (countHeight > moveSize) {
|
|
23359
|
+
return rangeRows;
|
|
23360
|
+
}
|
|
23361
|
+
}
|
|
23362
|
+
} else {
|
|
23363
|
+
for (let len = _rowIndex; len >= 0; len--) {
|
|
23364
|
+
const item = afterFullData[len];
|
|
23365
|
+
const rowid = $xeTable.getRowid(item);
|
|
23366
|
+
const rowRest = fullAllDataRowIdData[rowid] || {};
|
|
23367
|
+
countHeight += rowRest.resizeHeight || cellOpts.height || rowOpts.height || defaultRowHeight;
|
|
23368
|
+
rangeRows.push(item);
|
|
23369
|
+
if (countHeight > moveSize) {
|
|
23370
|
+
return rangeRows;
|
|
23371
|
+
}
|
|
23372
|
+
}
|
|
23373
|
+
}
|
|
22731
23374
|
}
|
|
22732
23375
|
} else {
|
|
22733
|
-
if (isDown) {
|
|
22734
|
-
moveSize = evnt.clientY - trRect.y;
|
|
22735
|
-
} else {
|
|
22736
|
-
moveSize = trRect.y - evnt.clientY + trRect.height;
|
|
22737
|
-
}
|
|
22738
23376
|
const siblingProp = isDown ? 'next' : 'previous';
|
|
22739
23377
|
while (targetTrElem && countHeight < moveSize) {
|
|
22740
23378
|
const rowNodeRest = $xeTable.getRowNode(targetTrElem);
|
|
@@ -22912,21 +23550,31 @@ function getCheckboxRangeRows($xeTable, evnt, params, targetTrElem, trRect, offs
|
|
|
22912
23550
|
},
|
|
22913
23551
|
handleCheckboxRangeEvent(evnt, params) {
|
|
22914
23552
|
const $xeTable = this;
|
|
23553
|
+
const internalData = $xeTable;
|
|
23554
|
+
const {
|
|
23555
|
+
elemStore
|
|
23556
|
+
} = internalData;
|
|
23557
|
+
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
23558
|
+
const leftScrollElem = getRefElem(elemStore['left-body-scroll']);
|
|
23559
|
+
const rightScrollElem = getRefElem(elemStore['right-body-scroll']);
|
|
22915
23560
|
const {
|
|
22916
23561
|
column,
|
|
22917
23562
|
cell
|
|
22918
23563
|
} = params;
|
|
22919
23564
|
if (column.type === 'checkbox') {
|
|
22920
|
-
|
|
22921
|
-
|
|
22922
|
-
|
|
22923
|
-
}
|
|
23565
|
+
let bodyWrapperElem = bodyScrollElem;
|
|
23566
|
+
if (leftScrollElem && column.fixed === 'left') {
|
|
23567
|
+
bodyWrapperElem = leftScrollElem;
|
|
23568
|
+
} else if (rightScrollElem && column.fixed === 'right') {
|
|
23569
|
+
bodyWrapperElem = rightScrollElem;
|
|
23570
|
+
}
|
|
23571
|
+
if (!bodyWrapperElem) {
|
|
23572
|
+
return;
|
|
23573
|
+
}
|
|
23574
|
+
const el = $xeTable.$refs.refElem;
|
|
22924
23575
|
const disX = evnt.clientX;
|
|
22925
23576
|
const disY = evnt.clientY;
|
|
22926
|
-
const bodyWrapperElem = elemStore[`${column.fixed || 'main'}-body-wrapper`] || elemStore['main-body-wrapper'];
|
|
22927
23577
|
const checkboxRangeElem = bodyWrapperElem.querySelector('.vxe-table--checkbox-range');
|
|
22928
|
-
const domMousemove = document.onmousemove;
|
|
22929
|
-
const domMouseup = document.onmouseup;
|
|
22930
23578
|
const trElem = cell.parentNode;
|
|
22931
23579
|
const selectRecords = this.getCheckboxRecords();
|
|
22932
23580
|
let lastRangeRows = [];
|
|
@@ -23037,7 +23685,7 @@ function getCheckboxRangeRows($xeTable, evnt, params, targetTrElem, trRect, offs
|
|
|
23037
23685
|
}
|
|
23038
23686
|
}, 50);
|
|
23039
23687
|
};
|
|
23040
|
-
addClass(
|
|
23688
|
+
addClass(el, 'drag--range');
|
|
23041
23689
|
document.onmousemove = evnt => {
|
|
23042
23690
|
evnt.preventDefault();
|
|
23043
23691
|
evnt.stopPropagation();
|
|
@@ -23067,10 +23715,10 @@ function getCheckboxRangeRows($xeTable, evnt, params, targetTrElem, trRect, offs
|
|
|
23067
23715
|
};
|
|
23068
23716
|
document.onmouseup = evnt => {
|
|
23069
23717
|
stopMouseScroll();
|
|
23070
|
-
removeClass(
|
|
23718
|
+
removeClass(el, 'drag--range');
|
|
23071
23719
|
checkboxRangeElem.removeAttribute('style');
|
|
23072
|
-
document.onmousemove =
|
|
23073
|
-
document.onmouseup =
|
|
23720
|
+
document.onmousemove = null;
|
|
23721
|
+
document.onmouseup = null;
|
|
23074
23722
|
triggerEvent('end', evnt);
|
|
23075
23723
|
};
|
|
23076
23724
|
triggerEvent('start', evnt);
|
|
@@ -24190,7 +24838,7 @@ const table_renderDragTip = (h, $xeTable) => {
|
|
|
24190
24838
|
}
|
|
24191
24839
|
return table_renderEmptyElement($xeTable);
|
|
24192
24840
|
};
|
|
24193
|
-
function
|
|
24841
|
+
function handleUpdateResize(_vm) {
|
|
24194
24842
|
const {
|
|
24195
24843
|
$el
|
|
24196
24844
|
} = _vm;
|
|
@@ -24338,8 +24986,7 @@ function renderBody(h, $xeTable) {
|
|
|
24338
24986
|
const xID = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().uniqueId();
|
|
24339
24987
|
return {
|
|
24340
24988
|
xID,
|
|
24341
|
-
tId:
|
|
24342
|
-
isCalcColumn: false,
|
|
24989
|
+
tId: xID,
|
|
24343
24990
|
// 低性能的静态列
|
|
24344
24991
|
staticColumns: [],
|
|
24345
24992
|
// 渲染的列分组
|
|
@@ -24550,15 +25197,17 @@ function renderBody(h, $xeTable) {
|
|
|
24550
25197
|
isFooter: false
|
|
24551
25198
|
},
|
|
24552
25199
|
scrollVMLoading: false,
|
|
24553
|
-
|
|
25200
|
+
calcCellHeightFlag: 0,
|
|
25201
|
+
resizeHeightFlag: 0,
|
|
24554
25202
|
isCustomStatus: false,
|
|
24555
25203
|
isDragRowMove: false,
|
|
24556
25204
|
dragRow: null,
|
|
24557
25205
|
isDragColMove: false,
|
|
24558
25206
|
dragCol: null,
|
|
24559
25207
|
dragTipText: '',
|
|
24560
|
-
|
|
24561
|
-
|
|
25208
|
+
isDragResize: false,
|
|
25209
|
+
isRowLoading: false,
|
|
25210
|
+
isColLoading: false,
|
|
24562
25211
|
reScrollFlag: 0,
|
|
24563
25212
|
reLayoutFlag: 0,
|
|
24564
25213
|
footFlag: 0
|
|
@@ -24665,7 +25314,7 @@ function renderBody(h, $xeTable) {
|
|
|
24665
25314
|
const $xeTable = this;
|
|
24666
25315
|
const vSize = $xeTable.computeSize;
|
|
24667
25316
|
const rowHeightMaps = $xeTable.computeRowHeightMaps;
|
|
24668
|
-
return rowHeightMaps[vSize || 'default'];
|
|
25317
|
+
return rowHeightMaps[vSize || 'default'] || 18;
|
|
24669
25318
|
},
|
|
24670
25319
|
columnOpts() {
|
|
24671
25320
|
return this.computeColumnOpts;
|
|
@@ -24674,7 +25323,19 @@ function renderBody(h, $xeTable) {
|
|
|
24674
25323
|
return Object.assign({}, table_getConfig().table.columnConfig, this.columnConfig);
|
|
24675
25324
|
},
|
|
24676
25325
|
computeCellOpts() {
|
|
24677
|
-
|
|
25326
|
+
const $xeTable = this;
|
|
25327
|
+
const props = $xeTable;
|
|
25328
|
+
return Object.assign({}, table_getConfig().table.cellConfig, props.cellConfig);
|
|
25329
|
+
},
|
|
25330
|
+
computeHeaderCellOpts() {
|
|
25331
|
+
const $xeTable = this;
|
|
25332
|
+
const props = $xeTable;
|
|
25333
|
+
return Object.assign({}, table_getConfig().table.headerCellConfig, props.headerCellConfig);
|
|
25334
|
+
},
|
|
25335
|
+
computeFooterCellOpts() {
|
|
25336
|
+
const $xeTable = this;
|
|
25337
|
+
const props = $xeTable;
|
|
25338
|
+
return Object.assign({}, table_getConfig().table.footerCellConfig, props.footerCellConfig);
|
|
24678
25339
|
},
|
|
24679
25340
|
rowOpts() {
|
|
24680
25341
|
return this.computeRowOpts;
|
|
@@ -24731,6 +25392,20 @@ function renderBody(h, $xeTable) {
|
|
|
24731
25392
|
...this.tooltipOpts
|
|
24732
25393
|
};
|
|
24733
25394
|
},
|
|
25395
|
+
computeTableTipConfig() {
|
|
25396
|
+
const $xeTable = this;
|
|
25397
|
+
const reactData = $xeTable;
|
|
25398
|
+
const {
|
|
25399
|
+
tooltipStore
|
|
25400
|
+
} = reactData;
|
|
25401
|
+
const tooltipOpts = $xeTable.computeTooltipOpts;
|
|
25402
|
+
return Object.assign({}, tooltipOpts, tooltipStore.currOpts);
|
|
25403
|
+
},
|
|
25404
|
+
computeValidTipConfig() {
|
|
25405
|
+
const $xeTable = this;
|
|
25406
|
+
const tooltipOpts = $xeTable.computeTooltipOpts;
|
|
25407
|
+
return Object.assign({}, tooltipOpts);
|
|
25408
|
+
},
|
|
24734
25409
|
validTipOpts() {
|
|
24735
25410
|
return Object.assign({
|
|
24736
25411
|
isArrow: false
|
|
@@ -24787,23 +25462,55 @@ function renderBody(h, $xeTable) {
|
|
|
24787
25462
|
return Object.assign({}, table_getConfig().table.fnrConfig, this.fnrConfig);
|
|
24788
25463
|
},
|
|
24789
25464
|
headerCtxMenu() {
|
|
24790
|
-
|
|
25465
|
+
return this.computeHeaderMenu;
|
|
25466
|
+
},
|
|
25467
|
+
computeHeaderMenu() {
|
|
25468
|
+
const $xeTable = this;
|
|
25469
|
+
const menuOpts = $xeTable.computeMenuOpts;
|
|
25470
|
+
const headerOpts = menuOpts.header;
|
|
24791
25471
|
return headerOpts && headerOpts.options ? headerOpts.options : [];
|
|
24792
25472
|
},
|
|
24793
25473
|
bodyCtxMenu() {
|
|
24794
|
-
|
|
25474
|
+
return this.computeBodyMenu;
|
|
25475
|
+
},
|
|
25476
|
+
computeBodyMenu() {
|
|
25477
|
+
const $xeTable = this;
|
|
25478
|
+
const menuOpts = $xeTable.computeMenuOpts;
|
|
25479
|
+
const bodyOpts = menuOpts.body;
|
|
24795
25480
|
return bodyOpts && bodyOpts.options ? bodyOpts.options : [];
|
|
24796
25481
|
},
|
|
24797
25482
|
footerCtxMenu() {
|
|
24798
|
-
|
|
25483
|
+
return this.computeFooterMenu;
|
|
25484
|
+
},
|
|
25485
|
+
computeFooterMenu() {
|
|
25486
|
+
const $xeTable = this;
|
|
25487
|
+
const menuOpts = $xeTable.computeMenuOpts;
|
|
25488
|
+
const footerOpts = menuOpts.footer;
|
|
24799
25489
|
return footerOpts && footerOpts.options ? footerOpts.options : [];
|
|
24800
25490
|
},
|
|
24801
25491
|
isCtxMenu() {
|
|
24802
|
-
return
|
|
25492
|
+
return this.computeIsMenu;
|
|
25493
|
+
},
|
|
25494
|
+
computeIsMenu() {
|
|
25495
|
+
const $xeTable = this;
|
|
25496
|
+
const props = $xeTable;
|
|
25497
|
+
const menuOpts = $xeTable.computeMenuOpts;
|
|
25498
|
+
const headerMenu = $xeTable.computeHeaderMenu;
|
|
25499
|
+
const bodyMenu = $xeTable.computeBodyMenu;
|
|
25500
|
+
const footerMenu = $xeTable.computeFooterMenu;
|
|
25501
|
+
return !!((props.contextMenu || props.menuConfig) && isEnableConf(menuOpts) && (headerMenu.length || bodyMenu.length || footerMenu.length));
|
|
24803
25502
|
},
|
|
24804
25503
|
ctxMenuList() {
|
|
25504
|
+
return this.computeMenuList;
|
|
25505
|
+
},
|
|
25506
|
+
computeMenuList() {
|
|
25507
|
+
const $xeTable = this;
|
|
25508
|
+
const reactData = $xeTable;
|
|
25509
|
+
const {
|
|
25510
|
+
ctxMenuStore
|
|
25511
|
+
} = reactData;
|
|
24805
25512
|
const rest = [];
|
|
24806
|
-
|
|
25513
|
+
ctxMenuStore.list.forEach(list => {
|
|
24807
25514
|
list.forEach(item => {
|
|
24808
25515
|
rest.push(item);
|
|
24809
25516
|
});
|
|
@@ -25016,7 +25723,7 @@ function renderBody(h, $xeTable) {
|
|
|
25016
25723
|
if (value && value.length >= 50000) {
|
|
25017
25724
|
warnLog('vxe.error.errLargeData', ['loadData(data), reloadData(data)']);
|
|
25018
25725
|
}
|
|
25019
|
-
this.loadTableData(value || []).then(() => {
|
|
25726
|
+
this.loadTableData(value || [], true).then(() => {
|
|
25020
25727
|
this.inited = true;
|
|
25021
25728
|
this.initStatus = true;
|
|
25022
25729
|
if (!initStatus) {
|
|
@@ -25084,10 +25791,10 @@ function renderBody(h, $xeTable) {
|
|
|
25084
25791
|
},
|
|
25085
25792
|
syncResize(value) {
|
|
25086
25793
|
if (value) {
|
|
25087
|
-
|
|
25794
|
+
handleUpdateResize(this);
|
|
25088
25795
|
this.$nextTick(() => {
|
|
25089
|
-
|
|
25090
|
-
setTimeout(() =>
|
|
25796
|
+
handleUpdateResize(this);
|
|
25797
|
+
setTimeout(() => handleUpdateResize(this));
|
|
25091
25798
|
});
|
|
25092
25799
|
}
|
|
25093
25800
|
},
|
|
@@ -25199,11 +25906,14 @@ function renderBody(h, $xeTable) {
|
|
|
25199
25906
|
if (treeConfig && (treeOpts.showLine || treeOpts.line) && (!(this.rowKey || rowOpts.useKey) || !showOverflow)) {
|
|
25200
25907
|
warnLog('vxe.error.reqProp', ['row-config.useKey | show-overflow']);
|
|
25201
25908
|
}
|
|
25909
|
+
if (treeConfig && !treeOpts.transform && this.stripe) {
|
|
25910
|
+
warnLog('vxe.error.noTree', ['stripe']);
|
|
25911
|
+
}
|
|
25202
25912
|
if (this.showFooter && !(this.footerMethod || this.footerData)) {
|
|
25203
25913
|
warnLog('vxe.error.reqProp', ['footer-data | footer-method']);
|
|
25204
25914
|
}
|
|
25205
|
-
if (
|
|
25206
|
-
warnLog('vxe.error.
|
|
25915
|
+
if (rowOpts.height) {
|
|
25916
|
+
warnLog('vxe.error.delProp', ['row-config.height', 'cell-config.height']);
|
|
25207
25917
|
}
|
|
25208
25918
|
if (this.tooltipOpts.enabled) {
|
|
25209
25919
|
warnLog('vxe.error.delProp', ['tooltip-config.enabled', 'tooltip-config.showAll']);
|
|
@@ -25350,7 +26060,7 @@ function renderBody(h, $xeTable) {
|
|
|
25350
26060
|
endIndex: 1,
|
|
25351
26061
|
visibleSize: 0
|
|
25352
26062
|
});
|
|
25353
|
-
this.loadTableData(data).then(() => {
|
|
26063
|
+
this.loadTableData(data, true).then(() => {
|
|
25354
26064
|
if (data && data.length) {
|
|
25355
26065
|
this.inited = true;
|
|
25356
26066
|
this.initStatus = true;
|
|
@@ -25473,7 +26183,6 @@ function renderBody(h, $xeTable) {
|
|
|
25473
26183
|
editRules
|
|
25474
26184
|
} = props;
|
|
25475
26185
|
const {
|
|
25476
|
-
isCalcColumn,
|
|
25477
26186
|
isGroup,
|
|
25478
26187
|
overflowX,
|
|
25479
26188
|
overflowY,
|
|
@@ -25483,15 +26192,15 @@ function renderBody(h, $xeTable) {
|
|
|
25483
26192
|
initStore,
|
|
25484
26193
|
columnStore,
|
|
25485
26194
|
filterStore,
|
|
25486
|
-
customStore
|
|
25487
|
-
tooltipStore
|
|
26195
|
+
customStore
|
|
25488
26196
|
} = reactData;
|
|
25489
26197
|
const {
|
|
25490
26198
|
leftList,
|
|
25491
26199
|
rightList
|
|
25492
26200
|
} = columnStore;
|
|
25493
26201
|
const loadingSlot = slots.loading;
|
|
25494
|
-
const
|
|
26202
|
+
const tableTipConfig = $xeTable.computeTableTipConfig;
|
|
26203
|
+
const validTipConfig = $xeTable.computeValidTipConfig;
|
|
25495
26204
|
const validOpts = $xeTable.computeValidOpts;
|
|
25496
26205
|
const checkboxOpts = $xeTable.computeCheckboxOpts;
|
|
25497
26206
|
const treeOpts = $xeTable.computeTreeOpts;
|
|
@@ -25503,7 +26212,7 @@ function renderBody(h, $xeTable) {
|
|
|
25503
26212
|
const areaOpts = $xeTable.computeAreaOpts;
|
|
25504
26213
|
const loadingOpts = $xeTable.computeLoadingOpts;
|
|
25505
26214
|
const isMenu = $xeTable.computeIsMenu;
|
|
25506
|
-
const currLoading = reactData.
|
|
26215
|
+
const currLoading = reactData.isColLoading || reactData.isRowLoading || loading;
|
|
25507
26216
|
const resizableOpts = $xeTable.computeResizableOpts;
|
|
25508
26217
|
const isArea = mouseConfig && mouseOpts.area;
|
|
25509
26218
|
const columnDragOpts = $xeTable.computeColumnDragOpts;
|
|
@@ -25524,7 +26233,6 @@ function renderBody(h, $xeTable) {
|
|
|
25524
26233
|
'row--highlight': rowOpts.isHover || highlightHoverRow,
|
|
25525
26234
|
'column--highlight': columnOpts.isHover || highlightHoverColumn,
|
|
25526
26235
|
'checkbox--range': checkboxOpts.range,
|
|
25527
|
-
'column--calc': isCalcColumn,
|
|
25528
26236
|
'col--drag-cell': columnOpts.drag && columnDragOpts.trigger === 'cell',
|
|
25529
26237
|
'is--header': showHeader,
|
|
25530
26238
|
'is--footer': showFooter,
|
|
@@ -25533,7 +26241,6 @@ function renderBody(h, $xeTable) {
|
|
|
25533
26241
|
'is--fixed-left': leftList.length,
|
|
25534
26242
|
'is--fixed-right': rightList.length,
|
|
25535
26243
|
'is--animat': !!props.animat,
|
|
25536
|
-
'is--padding': props.padding,
|
|
25537
26244
|
'is--round': props.round,
|
|
25538
26245
|
'is--stripe': !treeConfig && stripe,
|
|
25539
26246
|
'is--loading': currLoading,
|
|
@@ -25581,11 +26288,21 @@ function renderBody(h, $xeTable) {
|
|
|
25581
26288
|
* 列宽线
|
|
25582
26289
|
*/
|
|
25583
26290
|
h('div', {
|
|
25584
|
-
key: '
|
|
25585
|
-
ref: '
|
|
25586
|
-
class: 'vxe-table--resizable-bar'
|
|
26291
|
+
key: 'tcl',
|
|
26292
|
+
ref: 'refColResizeBar',
|
|
26293
|
+
class: 'vxe-table--resizable-col-bar'
|
|
26294
|
+
}, resizableOpts.showDragTip ? [h('div', {
|
|
26295
|
+
ref: 'refColResizeTip',
|
|
26296
|
+
class: 'vxe-table--resizable-number-tip'
|
|
26297
|
+
})] : []),
|
|
26298
|
+
/**
|
|
26299
|
+
* 行高线
|
|
26300
|
+
*/
|
|
26301
|
+
h('div', {
|
|
26302
|
+
key: 'trl',
|
|
26303
|
+
ref: 'refRowResizeBar',
|
|
26304
|
+
class: 'vxe-table--resizable-row-bar'
|
|
25587
26305
|
}, resizableOpts.showDragTip ? [h('div', {
|
|
25588
|
-
ref: 'refCellResizeTip',
|
|
25589
26306
|
class: 'vxe-table--resizable-number-tip'
|
|
25590
26307
|
})] : []),
|
|
25591
26308
|
/**
|
|
@@ -25686,8 +26403,13 @@ function renderBody(h, $xeTable) {
|
|
|
25686
26403
|
*/
|
|
25687
26404
|
VxeUITooltipComponent ? h(VxeUITooltipComponent, {
|
|
25688
26405
|
key: 'btp',
|
|
25689
|
-
ref: '
|
|
25690
|
-
props:
|
|
26406
|
+
ref: 'refTooltip',
|
|
26407
|
+
props: {
|
|
26408
|
+
theme: tableTipConfig.theme,
|
|
26409
|
+
enterable: tableTipConfig.enterable,
|
|
26410
|
+
enterDelay: tableTipConfig.enterDelay,
|
|
26411
|
+
leaveDelay: tableTipConfig.leaveDelay
|
|
26412
|
+
}
|
|
25691
26413
|
}) : table_renderEmptyElement($xeTable),
|
|
25692
26414
|
/**
|
|
25693
26415
|
* 校验提示
|
|
@@ -25698,9 +26420,12 @@ function renderBody(h, $xeTable) {
|
|
|
25698
26420
|
class: [{
|
|
25699
26421
|
'old-cell-valid': editRules && table_getConfig().cellVaildMode === 'obsolete'
|
|
25700
26422
|
}, 'vxe-table--valid-error'],
|
|
25701
|
-
props:
|
|
25702
|
-
|
|
25703
|
-
|
|
26423
|
+
props: {
|
|
26424
|
+
theme: validTipConfig.theme,
|
|
26425
|
+
enterable: validTipConfig.enterable,
|
|
26426
|
+
enterDelay: validTipConfig.enterDelay,
|
|
26427
|
+
leaveDelay: validTipConfig.leaveDelay
|
|
26428
|
+
}
|
|
25704
26429
|
}) : table_renderEmptyElement($xeTable)])]);
|
|
25705
26430
|
},
|
|
25706
26431
|
methods: methods
|
|
@@ -29355,7 +30080,8 @@ const Toolbar = VxeToolbar;
|
|
|
29355
30080
|
customRestore: '恢复默认',
|
|
29356
30081
|
maxFixedCol: '最大冻结列的数量不能超过 {0} 个',
|
|
29357
30082
|
dragTip: '移动:{0}',
|
|
29358
|
-
resizeColTip: '{0} 像素'
|
|
30083
|
+
resizeColTip: '宽:{0} 像素',
|
|
30084
|
+
resizeRowTip: '高:{0} 像素'
|
|
29359
30085
|
},
|
|
29360
30086
|
grid: {
|
|
29361
30087
|
selectOneRecord: '请至少选择一条记录!',
|