vxe-table 4.10.6-beta.8 → 4.10.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/grid/src/grid.js +1 -1
- 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/hook.js +7 -7
- package/es/table/module/export/hook.js +97 -62
- package/es/table/module/keyboard/hook.js +63 -27
- package/es/table/src/body.js +128 -81
- package/es/table/src/cell.js +41 -55
- package/es/table/src/column.js +13 -1
- package/es/table/src/columnInfo.js +3 -0
- package/es/table/src/emits.js +2 -0
- package/es/table/src/footer.js +48 -10
- package/es/table/src/header.js +70 -168
- package/es/table/src/props.js +14 -4
- package/es/table/src/table.js +884 -426
- package/es/table/src/util.js +77 -62
- package/es/table/style.css +253 -189
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +26 -11
- 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/grid/src/grid.js +1 -1
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.css +1 -1
- package/lib/index.min.css +1 -1
- package/lib/index.umd.js +1533 -917
- 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-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/hook.js +7 -2
- package/lib/table/module/edit/hook.min.js +1 -1
- package/lib/table/module/export/hook.js +97 -57
- package/lib/table/module/export/hook.min.js +1 -1
- package/lib/table/module/keyboard/hook.js +71 -28
- package/lib/table/module/keyboard/hook.min.js +1 -1
- package/lib/table/src/body.js +129 -80
- 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 +13 -1
- 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/emits.js +1 -1
- package/lib/table/src/emits.min.js +1 -1
- package/lib/table/src/footer.js +48 -8
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/header.js +54 -181
- package/lib/table/src/header.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 +935 -417
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +100 -82
- 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 -11
- 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/grid/src/grid.ts +1 -1
- 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/hook.ts +7 -7
- package/packages/table/module/export/hook.ts +118 -65
- package/packages/table/module/keyboard/hook.ts +59 -25
- package/packages/table/src/body.ts +148 -91
- package/packages/table/src/cell.ts +41 -63
- package/packages/table/src/column.ts +13 -1
- package/packages/table/src/columnInfo.ts +3 -0
- package/packages/table/src/emits.ts +5 -1
- package/packages/table/src/footer.ts +51 -11
- package/packages/table/src/header.ts +70 -168
- package/packages/table/src/props.ts +14 -5
- package/packages/table/src/table.ts +890 -428
- package/packages/table/src/util.ts +81 -62
- package/packages/ui/index.ts +25 -10
- 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 -1
- /package/es/{iconfont.1736840923205.ttf → iconfont.1738985856004.ttf} +0 -0
- /package/es/{iconfont.1736840923205.woff → iconfont.1738985856004.woff} +0 -0
- /package/es/{iconfont.1736840923205.woff2 → iconfont.1738985856004.woff2} +0 -0
- /package/lib/{iconfont.1736840923205.ttf → iconfont.1738985856004.ttf} +0 -0
- /package/lib/{iconfont.1736840923205.woff → iconfont.1738985856004.woff} +0 -0
- /package/lib/{iconfont.1736840923205.woff2 → iconfont.1738985856004.woff2} +0 -0
package/lib/index.umd.js
CHANGED
|
@@ -3138,7 +3138,7 @@ function eqEmptyValue(cellValue) {
|
|
|
3138
3138
|
;// ./packages/ui/index.ts
|
|
3139
3139
|
|
|
3140
3140
|
|
|
3141
|
-
const version = "4.10.6
|
|
3141
|
+
const version = "4.10.6";
|
|
3142
3142
|
core_.VxeUI.version = version;
|
|
3143
3143
|
core_.VxeUI.tableVersion = version;
|
|
3144
3144
|
core_.VxeUI.setConfig({
|
|
@@ -3149,7 +3149,6 @@ core_.VxeUI.setConfig({
|
|
|
3149
3149
|
animat: true,
|
|
3150
3150
|
delayHover: 250,
|
|
3151
3151
|
autoResize: true,
|
|
3152
|
-
padding: true,
|
|
3153
3152
|
minHeight: 144,
|
|
3154
3153
|
// keepSource: false,
|
|
3155
3154
|
// showOverflow: null,
|
|
@@ -3173,7 +3172,10 @@ core_.VxeUI.setConfig({
|
|
|
3173
3172
|
},
|
|
3174
3173
|
resizableConfig: {
|
|
3175
3174
|
dragMode: 'auto',
|
|
3176
|
-
showDragTip: true
|
|
3175
|
+
showDragTip: true,
|
|
3176
|
+
isSyncAutoHeight: true,
|
|
3177
|
+
isSyncAutoWidth: true,
|
|
3178
|
+
minHeight: 18
|
|
3177
3179
|
},
|
|
3178
3180
|
radioConfig: {
|
|
3179
3181
|
// trigger: 'default'
|
|
@@ -3207,6 +3209,15 @@ core_.VxeUI.setConfig({
|
|
|
3207
3209
|
columnConfig: {
|
|
3208
3210
|
maxFixedSize: 4
|
|
3209
3211
|
},
|
|
3212
|
+
cellConfig: {
|
|
3213
|
+
padding: true
|
|
3214
|
+
},
|
|
3215
|
+
headerCellConfig: {
|
|
3216
|
+
height: 'unset'
|
|
3217
|
+
},
|
|
3218
|
+
footerCellConfig: {
|
|
3219
|
+
height: 'unset'
|
|
3220
|
+
},
|
|
3210
3221
|
// menuConfig: {
|
|
3211
3222
|
// visibleMethod () {}
|
|
3212
3223
|
// },
|
|
@@ -3240,6 +3251,8 @@ core_.VxeUI.setConfig({
|
|
|
3240
3251
|
// orders: ['asc', 'desc', null],
|
|
3241
3252
|
// sortMethod: null,
|
|
3242
3253
|
showIcon: true,
|
|
3254
|
+
allowClear: true,
|
|
3255
|
+
allowBtn: true,
|
|
3243
3256
|
iconLayout: 'vertical'
|
|
3244
3257
|
},
|
|
3245
3258
|
filterConfig: {
|
|
@@ -3311,18 +3324,20 @@ core_.VxeUI.setConfig({
|
|
|
3311
3324
|
isReplace: true
|
|
3312
3325
|
},
|
|
3313
3326
|
virtualXConfig: {
|
|
3314
|
-
|
|
3315
|
-
gt: 60
|
|
3316
|
-
|
|
3327
|
+
enabled: true,
|
|
3328
|
+
gt: 60,
|
|
3329
|
+
preSize: 0,
|
|
3330
|
+
oSize: 1
|
|
3317
3331
|
},
|
|
3318
3332
|
virtualYConfig: {
|
|
3319
|
-
|
|
3320
|
-
gt: 100
|
|
3321
|
-
|
|
3333
|
+
enabled: true,
|
|
3334
|
+
gt: 100,
|
|
3335
|
+
preSize: 1,
|
|
3336
|
+
oSize: 2
|
|
3322
3337
|
},
|
|
3323
3338
|
scrollbarConfig: {
|
|
3324
|
-
width:
|
|
3325
|
-
height:
|
|
3339
|
+
// width: 0,
|
|
3340
|
+
// height: 0
|
|
3326
3341
|
}
|
|
3327
3342
|
},
|
|
3328
3343
|
// export: {
|
|
@@ -3568,7 +3583,7 @@ var esnext_iterator_some = __webpack_require__(7550);
|
|
|
3568
3583
|
const {
|
|
3569
3584
|
log: log_log
|
|
3570
3585
|
} = core_.VxeUI;
|
|
3571
|
-
const log_version = `table v${"4.10.6
|
|
3586
|
+
const log_version = `table v${"4.10.6"}`;
|
|
3572
3587
|
const warnLog = log_log.create('warn', log_version);
|
|
3573
3588
|
const errLog = log_log.create('error', log_version);
|
|
3574
3589
|
;// ./packages/table/src/columnInfo.ts
|
|
@@ -3657,6 +3672,8 @@ class ColumnInfo {
|
|
|
3657
3672
|
footerClassName: _vm.footerClassName,
|
|
3658
3673
|
formatter: formatter,
|
|
3659
3674
|
footerFormatter: _vm.footerFormatter,
|
|
3675
|
+
padding: _vm.padding,
|
|
3676
|
+
verticalAlign: _vm.verticalAlign,
|
|
3660
3677
|
sortable: _vm.sortable,
|
|
3661
3678
|
sortBy: _vm.sortBy,
|
|
3662
3679
|
sortType: _vm.sortType,
|
|
@@ -3668,6 +3685,7 @@ class ColumnInfo {
|
|
|
3668
3685
|
filterRender: _vm.filterRender,
|
|
3669
3686
|
treeNode: _vm.treeNode,
|
|
3670
3687
|
dragSort: _vm.dragSort,
|
|
3688
|
+
rowResize: _vm.rowResize,
|
|
3671
3689
|
cellType: _vm.cellType,
|
|
3672
3690
|
cellRender: _vm.cellRender,
|
|
3673
3691
|
editRender: _vm.editRender,
|
|
@@ -4046,7 +4064,7 @@ function getRowid($xeTable, row) {
|
|
|
4046
4064
|
}
|
|
4047
4065
|
const handleFieldOrColumn = ($xeTable, fieldOrColumn) => {
|
|
4048
4066
|
if (fieldOrColumn) {
|
|
4049
|
-
return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(fieldOrColumn) ? $xeTable.getColumnByField(fieldOrColumn) : fieldOrColumn;
|
|
4067
|
+
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) ? $xeTable.getColumnByField(`${fieldOrColumn}`) : fieldOrColumn;
|
|
4050
4068
|
}
|
|
4051
4069
|
return null;
|
|
4052
4070
|
};
|
|
@@ -4110,6 +4128,12 @@ function getRefElem(refEl) {
|
|
|
4110
4128
|
}
|
|
4111
4129
|
return null;
|
|
4112
4130
|
}
|
|
4131
|
+
function getCellHeight(height) {
|
|
4132
|
+
if (height === 'unset') {
|
|
4133
|
+
return 0;
|
|
4134
|
+
}
|
|
4135
|
+
return height || 0;
|
|
4136
|
+
}
|
|
4113
4137
|
/**
|
|
4114
4138
|
* 列宽拖动最大宽度
|
|
4115
4139
|
* @param params
|
|
@@ -4146,9 +4170,8 @@ function getColReMinWidth(params) {
|
|
|
4146
4170
|
column,
|
|
4147
4171
|
cell
|
|
4148
4172
|
} = params;
|
|
4149
|
-
const
|
|
4150
|
-
|
|
4151
|
-
} = $table;
|
|
4173
|
+
const tableProps = $table.props;
|
|
4174
|
+
const internalData = $table.internalData;
|
|
4152
4175
|
const {
|
|
4153
4176
|
computeResizableOpts
|
|
4154
4177
|
} = $table.getComputeMaps();
|
|
@@ -4163,6 +4186,9 @@ function getColReMinWidth(params) {
|
|
|
4163
4186
|
return Math.max(1, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(customMinWidth));
|
|
4164
4187
|
}
|
|
4165
4188
|
}
|
|
4189
|
+
const {
|
|
4190
|
+
elemStore
|
|
4191
|
+
} = internalData;
|
|
4166
4192
|
const {
|
|
4167
4193
|
showHeaderOverflow: allColumnHeaderOverflow
|
|
4168
4194
|
} = tableProps;
|
|
@@ -4192,14 +4218,10 @@ function getColReMinWidth(params) {
|
|
|
4192
4218
|
}
|
|
4193
4219
|
// 如果设置最小宽
|
|
4194
4220
|
if (colMinWidth) {
|
|
4195
|
-
const
|
|
4196
|
-
|
|
4197
|
-
} = $table.getRefMaps();
|
|
4198
|
-
const tableBody = refTableBody.value;
|
|
4199
|
-
const bodyElem = tableBody ? tableBody.$el : null;
|
|
4200
|
-
if (bodyElem) {
|
|
4221
|
+
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
4222
|
+
if (bodyScrollElem) {
|
|
4201
4223
|
if (isScale(colMinWidth)) {
|
|
4202
|
-
const bodyWidth =
|
|
4224
|
+
const bodyWidth = bodyScrollElem.clientWidth - 1;
|
|
4203
4225
|
const meanWidth = bodyWidth / 100;
|
|
4204
4226
|
return Math.max(mWidth, Math.floor(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toInteger(colMinWidth) * meanWidth));
|
|
4205
4227
|
} else if (isPx(colMinWidth)) {
|
|
@@ -4322,14 +4344,44 @@ const getOffsetSize = $xeTable => {
|
|
|
4322
4344
|
};
|
|
4323
4345
|
function calcTreeLine(params, prevRow) {
|
|
4324
4346
|
const {
|
|
4325
|
-
$table
|
|
4347
|
+
$table,
|
|
4348
|
+
row
|
|
4326
4349
|
} = params;
|
|
4350
|
+
const tableProps = $table.props;
|
|
4327
4351
|
const tableReactData = $table.reactData;
|
|
4352
|
+
const tableInternalData = $table.internalData;
|
|
4353
|
+
const {
|
|
4354
|
+
showOverflow
|
|
4355
|
+
} = tableProps;
|
|
4356
|
+
const {
|
|
4357
|
+
scrollYLoad
|
|
4358
|
+
} = tableReactData;
|
|
4359
|
+
const {
|
|
4360
|
+
fullAllDataRowIdData
|
|
4361
|
+
} = tableInternalData;
|
|
4362
|
+
const {
|
|
4363
|
+
computeRowOpts,
|
|
4364
|
+
computeCellOpts,
|
|
4365
|
+
computeDefaultRowHeight
|
|
4366
|
+
} = $table.getComputeMaps();
|
|
4367
|
+
const rowOpts = computeRowOpts.value;
|
|
4368
|
+
const cellOpts = computeCellOpts.value;
|
|
4369
|
+
const defaultRowHeight = computeDefaultRowHeight.value;
|
|
4370
|
+
const rowid = getRowid($table, row);
|
|
4371
|
+
const rowRest = fullAllDataRowIdData[rowid];
|
|
4372
|
+
const currCellHeight = rowRest.resizeHeight || cellOpts.height || rowOpts.height || defaultRowHeight;
|
|
4328
4373
|
let expandSize = 1;
|
|
4329
4374
|
if (prevRow) {
|
|
4330
4375
|
expandSize = countTreeExpand(prevRow, params);
|
|
4331
4376
|
}
|
|
4332
|
-
|
|
4377
|
+
let cellHeight = currCellHeight;
|
|
4378
|
+
const vnHeight = rowRest.height;
|
|
4379
|
+
if (scrollYLoad) {
|
|
4380
|
+
if (!showOverflow) {
|
|
4381
|
+
cellHeight = vnHeight || currCellHeight;
|
|
4382
|
+
}
|
|
4383
|
+
}
|
|
4384
|
+
return cellHeight * expandSize - (prevRow ? 1 : 12 - getOffsetSize($table));
|
|
4333
4385
|
}
|
|
4334
4386
|
function mergeBodyMethod(mergeList, _rowIndex, _columnIndex) {
|
|
4335
4387
|
for (let mIndex = 0; mIndex < mergeList.length; mIndex++) {
|
|
@@ -4391,45 +4443,39 @@ function clearTableAllStatus($xeTable) {
|
|
|
4391
4443
|
return clearTableDefaultStatus($xeTable);
|
|
4392
4444
|
}
|
|
4393
4445
|
function rowToVisible($xeTable, row) {
|
|
4394
|
-
const {
|
|
4395
|
-
reactData,
|
|
4396
|
-
internalData
|
|
4397
|
-
} = $xeTable;
|
|
4398
4446
|
const tableProps = $xeTable.props;
|
|
4447
|
+
const reactData = $xeTable.reactData;
|
|
4448
|
+
const internalData = $xeTable.internalData;
|
|
4449
|
+
const {
|
|
4450
|
+
computeLeftFixedWidth,
|
|
4451
|
+
computeRightFixedWidth,
|
|
4452
|
+
computeRowOpts,
|
|
4453
|
+
computeCellOpts,
|
|
4454
|
+
computeDefaultRowHeight
|
|
4455
|
+
} = $xeTable.getComputeMaps();
|
|
4399
4456
|
const {
|
|
4400
4457
|
showOverflow
|
|
4401
4458
|
} = tableProps;
|
|
4402
4459
|
const {
|
|
4403
|
-
|
|
4404
|
-
} = $xeTable.getRefMaps();
|
|
4405
|
-
const {
|
|
4406
|
-
columnStore,
|
|
4407
|
-
scrollYLoad,
|
|
4408
|
-
rowHeight
|
|
4460
|
+
scrollYLoad
|
|
4409
4461
|
} = reactData;
|
|
4410
4462
|
const {
|
|
4463
|
+
elemStore,
|
|
4411
4464
|
afterFullData,
|
|
4412
|
-
fullAllDataRowIdData
|
|
4465
|
+
fullAllDataRowIdData,
|
|
4466
|
+
isResizeCellHeight
|
|
4413
4467
|
} = internalData;
|
|
4414
|
-
const
|
|
4415
|
-
const
|
|
4416
|
-
|
|
4417
|
-
|
|
4418
|
-
|
|
4419
|
-
const
|
|
4468
|
+
const rowOpts = computeRowOpts.value;
|
|
4469
|
+
const cellOpts = computeCellOpts.value;
|
|
4470
|
+
const defaultRowHeight = computeDefaultRowHeight.value;
|
|
4471
|
+
const leftFixedWidth = computeLeftFixedWidth.value;
|
|
4472
|
+
const rightFixedWidth = computeRightFixedWidth.value;
|
|
4473
|
+
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
4420
4474
|
const rowid = getRowid($xeTable, row);
|
|
4421
|
-
|
|
4422
|
-
|
|
4423
|
-
|
|
4424
|
-
|
|
4425
|
-
let offsetFixedRight = 0;
|
|
4426
|
-
rightList.forEach(item => {
|
|
4427
|
-
offsetFixedRight += item.renderWidth;
|
|
4428
|
-
});
|
|
4429
|
-
if (bodyElem) {
|
|
4430
|
-
const bodyHeight = bodyElem.clientHeight;
|
|
4431
|
-
const bodyScrollTop = bodyElem.scrollTop;
|
|
4432
|
-
const trElem = bodyElem.querySelector(`[rowid="${rowid}"]`);
|
|
4475
|
+
if (bodyScrollElem) {
|
|
4476
|
+
const bodyHeight = bodyScrollElem.clientHeight;
|
|
4477
|
+
const bodyScrollTop = bodyScrollElem.scrollTop;
|
|
4478
|
+
const trElem = bodyScrollElem.querySelector(`[rowid="${rowid}"]`);
|
|
4433
4479
|
if (trElem) {
|
|
4434
4480
|
const trOffsetParent = trElem.offsetParent;
|
|
4435
4481
|
const trOffsetTop = trElem.offsetTop + (trOffsetParent ? trOffsetParent.offsetTop : 0);
|
|
@@ -4443,82 +4489,71 @@ function rowToVisible($xeTable, row) {
|
|
|
4443
4489
|
} else {
|
|
4444
4490
|
// 如果是虚拟渲染滚动
|
|
4445
4491
|
if (scrollYLoad) {
|
|
4446
|
-
|
|
4447
|
-
|
|
4492
|
+
const isCustomCellHeight = isResizeCellHeight || cellOpts.height || rowOpts.height;
|
|
4493
|
+
if (!isCustomCellHeight && showOverflow) {
|
|
4494
|
+
return $xeTable.scrollTo(null, ($xeTable.findRowIndexOf(afterFullData, row) - 1) * defaultRowHeight);
|
|
4448
4495
|
}
|
|
4449
4496
|
let scrollTop = 0;
|
|
4450
|
-
const rowRest = fullAllDataRowIdData[rowid];
|
|
4451
|
-
const rHeight = rowRest ? rowRest.height ||
|
|
4497
|
+
const rowRest = fullAllDataRowIdData[rowid] || {};
|
|
4498
|
+
const rHeight = rowRest ? rowRest.resizeHeight || cellOpts.height || rowOpts.height || defaultRowHeight : defaultRowHeight;
|
|
4452
4499
|
for (let i = 0; i < afterFullData.length; i++) {
|
|
4453
4500
|
const currRow = afterFullData[i];
|
|
4454
4501
|
const currRowid = getRowid($xeTable, currRow);
|
|
4455
4502
|
if (currRow === row || currRowid === rowid) {
|
|
4456
4503
|
break;
|
|
4457
4504
|
}
|
|
4458
|
-
const
|
|
4459
|
-
scrollTop +=
|
|
4505
|
+
const currRowRest = fullAllDataRowIdData[currRowid] || {};
|
|
4506
|
+
scrollTop += currRowRest.resizeHeight || currRowRest.height || cellOpts.height || rowOpts.height || defaultRowHeight;
|
|
4460
4507
|
}
|
|
4461
4508
|
if (scrollTop < bodyScrollTop) {
|
|
4462
|
-
return $xeTable.scrollTo(null, scrollTop -
|
|
4509
|
+
return $xeTable.scrollTo(null, scrollTop - leftFixedWidth - 1);
|
|
4463
4510
|
}
|
|
4464
|
-
return $xeTable.scrollTo(null, scrollTop + rHeight - (bodyHeight -
|
|
4511
|
+
return $xeTable.scrollTo(null, scrollTop + rHeight - (bodyHeight - rightFixedWidth - 1));
|
|
4465
4512
|
}
|
|
4466
4513
|
}
|
|
4467
4514
|
}
|
|
4468
4515
|
return Promise.resolve();
|
|
4469
4516
|
}
|
|
4470
4517
|
function colToVisible($xeTable, column, row) {
|
|
4518
|
+
const reactData = $xeTable.reactData;
|
|
4519
|
+
const internalData = $xeTable.internalData;
|
|
4471
4520
|
const {
|
|
4472
|
-
|
|
4473
|
-
|
|
4474
|
-
} = $xeTable;
|
|
4475
|
-
const {
|
|
4476
|
-
refTableBody
|
|
4477
|
-
} = $xeTable.getRefMaps();
|
|
4521
|
+
computeLeftFixedWidth,
|
|
4522
|
+
computeRightFixedWidth
|
|
4523
|
+
} = $xeTable.getComputeMaps();
|
|
4478
4524
|
const {
|
|
4479
|
-
columnStore,
|
|
4480
4525
|
scrollXLoad
|
|
4481
4526
|
} = reactData;
|
|
4482
4527
|
const {
|
|
4528
|
+
elemStore,
|
|
4483
4529
|
visibleColumn
|
|
4484
4530
|
} = internalData;
|
|
4485
|
-
const
|
|
4486
|
-
|
|
4487
|
-
|
|
4488
|
-
} = columnStore;
|
|
4489
|
-
const tableBody = refTableBody.value;
|
|
4490
|
-
const bodyElem = tableBody ? tableBody.$el : null;
|
|
4531
|
+
const leftFixedWidth = computeLeftFixedWidth.value;
|
|
4532
|
+
const rightFixedWidth = computeRightFixedWidth.value;
|
|
4533
|
+
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
4491
4534
|
if (column.fixed) {
|
|
4492
4535
|
return Promise.resolve();
|
|
4493
4536
|
}
|
|
4494
|
-
|
|
4495
|
-
|
|
4496
|
-
|
|
4497
|
-
});
|
|
4498
|
-
let offsetFixedRight = 0;
|
|
4499
|
-
rightList.forEach(item => {
|
|
4500
|
-
offsetFixedRight += item.renderWidth;
|
|
4501
|
-
});
|
|
4502
|
-
if (bodyElem) {
|
|
4503
|
-
const bodyWidth = bodyElem.clientWidth;
|
|
4504
|
-
const bodyScrollLeft = bodyElem.scrollLeft;
|
|
4537
|
+
if (bodyScrollElem) {
|
|
4538
|
+
const bodyWidth = bodyScrollElem.clientWidth;
|
|
4539
|
+
const bodyScrollLeft = bodyScrollElem.scrollLeft;
|
|
4505
4540
|
let tdElem = null;
|
|
4506
4541
|
if (row) {
|
|
4507
4542
|
const rowid = getRowid($xeTable, row);
|
|
4508
|
-
tdElem =
|
|
4543
|
+
tdElem = bodyScrollElem.querySelector(`[rowid="${rowid}"] .${column.id}`);
|
|
4509
4544
|
}
|
|
4510
4545
|
if (!tdElem) {
|
|
4511
|
-
tdElem =
|
|
4546
|
+
tdElem = bodyScrollElem.querySelector(`.${column.id}`);
|
|
4512
4547
|
}
|
|
4513
4548
|
if (tdElem) {
|
|
4514
4549
|
const tdOffsetParent = tdElem.offsetParent;
|
|
4515
4550
|
const tdOffsetLeft = tdElem.offsetLeft + (tdOffsetParent ? tdOffsetParent.offsetLeft : 0);
|
|
4516
4551
|
const cellWidth = tdElem.clientWidth;
|
|
4517
4552
|
// 检测是否在可视区中
|
|
4518
|
-
if (tdOffsetLeft < bodyScrollLeft +
|
|
4519
|
-
return $xeTable.scrollTo(tdOffsetLeft -
|
|
4520
|
-
} else if (tdOffsetLeft + cellWidth - bodyScrollLeft > bodyWidth -
|
|
4521
|
-
return $xeTable.scrollTo(tdOffsetLeft + cellWidth - (bodyWidth -
|
|
4553
|
+
if (tdOffsetLeft < bodyScrollLeft + leftFixedWidth) {
|
|
4554
|
+
return $xeTable.scrollTo(tdOffsetLeft - leftFixedWidth - 1);
|
|
4555
|
+
} else if (tdOffsetLeft + cellWidth - bodyScrollLeft > bodyWidth - rightFixedWidth) {
|
|
4556
|
+
return $xeTable.scrollTo(tdOffsetLeft + cellWidth - (bodyWidth - rightFixedWidth - 1));
|
|
4522
4557
|
}
|
|
4523
4558
|
} else {
|
|
4524
4559
|
// 检测是否在虚拟渲染可视区中
|
|
@@ -4533,9 +4568,9 @@ function colToVisible($xeTable, column, row) {
|
|
|
4533
4568
|
scrollLeft += currCol.renderWidth;
|
|
4534
4569
|
}
|
|
4535
4570
|
if (scrollLeft < bodyScrollLeft) {
|
|
4536
|
-
return $xeTable.scrollTo(scrollLeft -
|
|
4571
|
+
return $xeTable.scrollTo(scrollLeft - leftFixedWidth - 1);
|
|
4537
4572
|
}
|
|
4538
|
-
return $xeTable.scrollTo(scrollLeft + cellWidth - (bodyWidth -
|
|
4573
|
+
return $xeTable.scrollTo(scrollLeft + cellWidth - (bodyWidth - rightFixedWidth - 1));
|
|
4539
4574
|
}
|
|
4540
4575
|
}
|
|
4541
4576
|
}
|
|
@@ -4802,7 +4837,7 @@ function renderTitleContent(params, content) {
|
|
|
4802
4837
|
const ons = {};
|
|
4803
4838
|
if (showTitle || showTooltip || showAllTip) {
|
|
4804
4839
|
ons.onMouseenter = evnt => {
|
|
4805
|
-
if (tableReactData.
|
|
4840
|
+
if (tableReactData.isDragResize) {
|
|
4806
4841
|
return;
|
|
4807
4842
|
}
|
|
4808
4843
|
if (showTitle) {
|
|
@@ -4814,7 +4849,7 @@ function renderTitleContent(params, content) {
|
|
|
4814
4849
|
}
|
|
4815
4850
|
if (showTooltip || showAllTip) {
|
|
4816
4851
|
ons.onMouseleave = evnt => {
|
|
4817
|
-
if (tableReactData.
|
|
4852
|
+
if (tableReactData.isDragResize) {
|
|
4818
4853
|
return;
|
|
4819
4854
|
}
|
|
4820
4855
|
if (showTooltip || showAllTip) {
|
|
@@ -4831,18 +4866,6 @@ function renderTitleContent(params, content) {
|
|
|
4831
4866
|
...ons
|
|
4832
4867
|
}, getSlotVNs(content))];
|
|
4833
4868
|
}
|
|
4834
|
-
function formatFooterLabel(footerFormatter, params) {
|
|
4835
|
-
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(footerFormatter)) {
|
|
4836
|
-
return `${footerFormatter(params)}`;
|
|
4837
|
-
}
|
|
4838
|
-
const isArr = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(footerFormatter);
|
|
4839
|
-
const gFormatOpts = isArr ? cell_formats.get(footerFormatter[0]) : cell_formats.get(footerFormatter);
|
|
4840
|
-
const footerFormatMethod = gFormatOpts ? gFormatOpts.tableFooterCellFormatMethod : null;
|
|
4841
|
-
if (footerFormatMethod) {
|
|
4842
|
-
return `${isArr ? footerFormatMethod(params, ...footerFormatter.slice(1)) : footerFormatMethod(params)}`;
|
|
4843
|
-
}
|
|
4844
|
-
return '';
|
|
4845
|
-
}
|
|
4846
4869
|
function getFooterContent(params) {
|
|
4847
4870
|
const {
|
|
4848
4871
|
$table,
|
|
@@ -4862,35 +4885,38 @@ function getFooterContent(params) {
|
|
|
4862
4885
|
if (footerSlot) {
|
|
4863
4886
|
return $table.callSlot(footerSlot, params);
|
|
4864
4887
|
}
|
|
4888
|
+
let itemValue = '';
|
|
4889
|
+
// 兼容老模式
|
|
4890
|
+
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(items)) {
|
|
4891
|
+
itemValue = items[_columnIndex];
|
|
4892
|
+
} else {
|
|
4893
|
+
itemValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, column.field);
|
|
4894
|
+
}
|
|
4895
|
+
const footParams = Object.assign(params, {
|
|
4896
|
+
itemValue
|
|
4897
|
+
});
|
|
4898
|
+
if (footerFormatter) {
|
|
4899
|
+
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(footerFormatter)) {
|
|
4900
|
+
return `${footerFormatter(footParams)}`;
|
|
4901
|
+
}
|
|
4902
|
+
const isArr = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(footerFormatter);
|
|
4903
|
+
const gFormatOpts = isArr ? cell_formats.get(footerFormatter[0]) : cell_formats.get(footerFormatter);
|
|
4904
|
+
const footerFormatMethod = gFormatOpts ? gFormatOpts.tableFooterCellFormatMethod : null;
|
|
4905
|
+
if (footerFormatMethod) {
|
|
4906
|
+
return `${isArr ? footerFormatMethod(footParams, ...footerFormatter.slice(1)) : footerFormatMethod(footParams)}`;
|
|
4907
|
+
}
|
|
4908
|
+
return '';
|
|
4909
|
+
}
|
|
4865
4910
|
if (renderOpts) {
|
|
4866
4911
|
const compConf = cell_renderer.get(renderOpts.name);
|
|
4867
4912
|
if (compConf) {
|
|
4868
4913
|
const rtFooter = compConf.renderTableFooter || compConf.renderFooter;
|
|
4869
4914
|
if (rtFooter) {
|
|
4870
|
-
return getSlotVNs(rtFooter(renderOpts,
|
|
4915
|
+
return getSlotVNs(rtFooter(renderOpts, footParams));
|
|
4871
4916
|
}
|
|
4872
4917
|
}
|
|
4873
4918
|
}
|
|
4874
|
-
|
|
4875
|
-
// 兼容老模式
|
|
4876
|
-
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(items)) {
|
|
4877
|
-
itemValue = items[_columnIndex];
|
|
4878
|
-
return [footerFormatter ? formatFooterLabel(footerFormatter, {
|
|
4879
|
-
itemValue,
|
|
4880
|
-
column,
|
|
4881
|
-
row,
|
|
4882
|
-
items,
|
|
4883
|
-
_columnIndex
|
|
4884
|
-
}) : formatText(itemValue, 1)];
|
|
4885
|
-
}
|
|
4886
|
-
itemValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, column.field);
|
|
4887
|
-
return [footerFormatter ? formatFooterLabel(footerFormatter, {
|
|
4888
|
-
itemValue,
|
|
4889
|
-
column,
|
|
4890
|
-
row,
|
|
4891
|
-
items,
|
|
4892
|
-
_columnIndex
|
|
4893
|
-
}) : formatText(itemValue, 1)];
|
|
4919
|
+
return [formatText(itemValue, 1)];
|
|
4894
4920
|
}
|
|
4895
4921
|
function getDefaultCellLabel(params) {
|
|
4896
4922
|
const {
|
|
@@ -5073,9 +5099,7 @@ const Cell = {
|
|
|
5073
5099
|
return Cell.renderTreeIcon(params, Cell.renderDefaultCell(params));
|
|
5074
5100
|
},
|
|
5075
5101
|
renderDefaultFooter(params) {
|
|
5076
|
-
return
|
|
5077
|
-
class: 'vxe-cell--item'
|
|
5078
|
-
}, getFooterContent(params))];
|
|
5102
|
+
return getFooterContent(params);
|
|
5079
5103
|
},
|
|
5080
5104
|
/**
|
|
5081
5105
|
* 树节点
|
|
@@ -5664,6 +5688,7 @@ const Cell = {
|
|
|
5664
5688
|
const sortOpts = computeSortOpts.value;
|
|
5665
5689
|
const {
|
|
5666
5690
|
showIcon,
|
|
5691
|
+
allowBtn,
|
|
5667
5692
|
iconLayout,
|
|
5668
5693
|
iconAsc,
|
|
5669
5694
|
iconDesc,
|
|
@@ -5680,19 +5705,19 @@ const Cell = {
|
|
|
5680
5705
|
'sort--active': order === 'asc'
|
|
5681
5706
|
}],
|
|
5682
5707
|
title: cell_getI18n('vxe.table.sortAsc'),
|
|
5683
|
-
onClick
|
|
5708
|
+
onClick: allowBtn ? evnt => {
|
|
5684
5709
|
evnt.stopPropagation();
|
|
5685
5710
|
$table.triggerSortEvent(evnt, column, 'asc');
|
|
5686
|
-
}
|
|
5711
|
+
} : undefined
|
|
5687
5712
|
}), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('i', {
|
|
5688
5713
|
class: ['vxe-sort--desc-btn', iconDesc || cell_getIcon().TABLE_SORT_DESC, {
|
|
5689
5714
|
'sort--active': order === 'desc'
|
|
5690
5715
|
}],
|
|
5691
5716
|
title: cell_getI18n('vxe.table.sortDesc'),
|
|
5692
|
-
onClick
|
|
5717
|
+
onClick: allowBtn ? evnt => {
|
|
5693
5718
|
evnt.stopPropagation();
|
|
5694
5719
|
$table.triggerSortEvent(evnt, column, 'desc');
|
|
5695
|
-
}
|
|
5720
|
+
} : undefined
|
|
5696
5721
|
})])];
|
|
5697
5722
|
}
|
|
5698
5723
|
return [];
|
|
@@ -5918,6 +5943,16 @@ const columnProps = {
|
|
|
5918
5943
|
formatter: [Function, Array, String],
|
|
5919
5944
|
// 格式化表尾显示内容
|
|
5920
5945
|
footerFormatter: [Function, Array, String],
|
|
5946
|
+
// 是否显示间距
|
|
5947
|
+
padding: {
|
|
5948
|
+
type: Boolean,
|
|
5949
|
+
default: null
|
|
5950
|
+
},
|
|
5951
|
+
// 垂直对齐方式
|
|
5952
|
+
verticalAlign: {
|
|
5953
|
+
type: String,
|
|
5954
|
+
default: null
|
|
5955
|
+
},
|
|
5921
5956
|
// 是否允许排序
|
|
5922
5957
|
sortable: Boolean,
|
|
5923
5958
|
// 自定义排序的属性
|
|
@@ -5944,8 +5979,10 @@ const columnProps = {
|
|
|
5944
5979
|
filterRender: Object,
|
|
5945
5980
|
// 设置为树节点
|
|
5946
5981
|
treeNode: Boolean,
|
|
5947
|
-
//
|
|
5982
|
+
// 设置为拖拽排序
|
|
5948
5983
|
dragSort: Boolean,
|
|
5984
|
+
// 设置为行高拖拽
|
|
5985
|
+
rowResize: Boolean,
|
|
5949
5986
|
// 是否可视
|
|
5950
5987
|
visible: {
|
|
5951
5988
|
type: Boolean,
|
|
@@ -6161,7 +6198,8 @@ const renderType = 'body';
|
|
|
6161
6198
|
computeRowDragOpts,
|
|
6162
6199
|
computeColumnDragOpts,
|
|
6163
6200
|
computeLeftFixedWidth,
|
|
6164
|
-
computeRightFixedWidth
|
|
6201
|
+
computeRightFixedWidth,
|
|
6202
|
+
computeResizableOpts
|
|
6165
6203
|
} = $xeTable.getComputeMaps();
|
|
6166
6204
|
const refElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
6167
6205
|
const refBodyScroll = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
@@ -6178,11 +6216,11 @@ const renderType = 'body';
|
|
|
6178
6216
|
} = tableProps;
|
|
6179
6217
|
const {
|
|
6180
6218
|
lastScrollTime,
|
|
6181
|
-
|
|
6219
|
+
isDragResize
|
|
6182
6220
|
} = tableReactData;
|
|
6183
|
-
return !!(
|
|
6221
|
+
return !!(isDragResize || lastScrollTime && Date.now() < lastScrollTime + delayHover);
|
|
6184
6222
|
};
|
|
6185
|
-
const renderLine = params => {
|
|
6223
|
+
const renderLine = (params, cellHeight) => {
|
|
6186
6224
|
const {
|
|
6187
6225
|
row,
|
|
6188
6226
|
column
|
|
@@ -6215,11 +6253,13 @@ const renderType = 'body';
|
|
|
6215
6253
|
const isFirstRow = $xeTable.eqRow(afterFullData[0], row);
|
|
6216
6254
|
if (treeConfig && treeNode && (treeOpts.showLine || treeOpts.line)) {
|
|
6217
6255
|
return [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
6256
|
+
key: 'tl',
|
|
6218
6257
|
class: 'vxe-tree--line-wrapper'
|
|
6219
6258
|
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
6220
6259
|
class: 'vxe-tree--line',
|
|
6221
6260
|
style: {
|
|
6222
6261
|
height: `${isFirstRow ? 1 : calcTreeLine(params, prevRow)}px`,
|
|
6262
|
+
bottom: `-${Math.floor(cellHeight / 2)}px`,
|
|
6223
6263
|
left: `${rLevel * treeOpts.indent + (rLevel ? 2 - getOffsetSize($xeTable) : 0) + 16}px`
|
|
6224
6264
|
}
|
|
6225
6265
|
})])];
|
|
@@ -6235,8 +6275,9 @@ const renderType = 'body';
|
|
|
6235
6275
|
} = tableInternalData;
|
|
6236
6276
|
const {
|
|
6237
6277
|
columnKey,
|
|
6278
|
+
resizable: allResizable,
|
|
6279
|
+
border,
|
|
6238
6280
|
height,
|
|
6239
|
-
showOverflow: allColumnOverflow,
|
|
6240
6281
|
cellClassName: allCellClassName,
|
|
6241
6282
|
cellStyle,
|
|
6242
6283
|
align: allAlign,
|
|
@@ -6244,7 +6285,8 @@ const renderType = 'body';
|
|
|
6244
6285
|
mouseConfig,
|
|
6245
6286
|
editConfig,
|
|
6246
6287
|
editRules,
|
|
6247
|
-
tooltipConfig
|
|
6288
|
+
tooltipConfig,
|
|
6289
|
+
padding: allPadding
|
|
6248
6290
|
} = tableProps;
|
|
6249
6291
|
const {
|
|
6250
6292
|
tableData,
|
|
@@ -6252,7 +6294,8 @@ const renderType = 'body';
|
|
|
6252
6294
|
currentColumn,
|
|
6253
6295
|
scrollXLoad,
|
|
6254
6296
|
scrollYLoad,
|
|
6255
|
-
|
|
6297
|
+
calcCellHeightFlag,
|
|
6298
|
+
resizeHeightFlag,
|
|
6256
6299
|
mergeList,
|
|
6257
6300
|
editStore,
|
|
6258
6301
|
isAllOverflow,
|
|
@@ -6268,9 +6311,16 @@ const renderType = 'body';
|
|
|
6268
6311
|
const checkboxOpts = computeCheckboxOpts.value;
|
|
6269
6312
|
const editOpts = computeEditOpts.value;
|
|
6270
6313
|
const tooltipOpts = computeTooltipOpts.value;
|
|
6314
|
+
const resizableOpts = computeResizableOpts.value;
|
|
6315
|
+
const {
|
|
6316
|
+
isAllColumnDrag,
|
|
6317
|
+
isAllRowDrag
|
|
6318
|
+
} = resizableOpts;
|
|
6271
6319
|
const rowOpts = computeRowOpts.value;
|
|
6272
6320
|
const rowDragOpts = computeRowDragOpts.value;
|
|
6273
6321
|
const defaultRowHeight = computeDefaultRowHeight.value;
|
|
6322
|
+
const customCellHeight = cellOpts.height || rowOpts.height;
|
|
6323
|
+
const currCellHeight = customCellHeight || defaultRowHeight;
|
|
6274
6324
|
const {
|
|
6275
6325
|
disabledMethod: dragDisabledMethod,
|
|
6276
6326
|
isCrossDrag,
|
|
@@ -6290,17 +6340,18 @@ const renderType = 'body';
|
|
|
6290
6340
|
showOverflow,
|
|
6291
6341
|
className,
|
|
6292
6342
|
treeNode,
|
|
6343
|
+
rowResize,
|
|
6344
|
+
padding,
|
|
6345
|
+
verticalAlign,
|
|
6293
6346
|
slots
|
|
6294
6347
|
} = column;
|
|
6295
6348
|
const {
|
|
6296
|
-
verticalAlign
|
|
6349
|
+
verticalAlign: allVerticalAlign
|
|
6297
6350
|
} = cellOpts;
|
|
6298
6351
|
const {
|
|
6299
6352
|
actived
|
|
6300
6353
|
} = editStore;
|
|
6301
|
-
const
|
|
6302
|
-
height: customRHeight
|
|
6303
|
-
} = rowOpts;
|
|
6354
|
+
const rowRest = fullAllDataRowIdData[rowid];
|
|
6304
6355
|
const colid = column.id;
|
|
6305
6356
|
const renderOpts = editRender || cellRender;
|
|
6306
6357
|
const compConf = renderOpts ? body_renderer.get(renderOpts.name) : null;
|
|
@@ -6310,23 +6361,27 @@ const renderType = 'body';
|
|
|
6310
6361
|
const columnIndex = $xeTable.getColumnIndex(column);
|
|
6311
6362
|
const _columnIndex = $xeTable.getVTColumnIndex(column);
|
|
6312
6363
|
const isEdit = isEnableConf(editRender);
|
|
6364
|
+
const resizeHeight = resizeHeightFlag ? rowRest.resizeHeight : 0;
|
|
6313
6365
|
let fixedHiddenColumn = fixedType ? column.fixed !== fixedType : column.fixed && overflowX;
|
|
6314
|
-
const
|
|
6366
|
+
const isCellPadding = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(padding) ? allPadding === null ? cellOpts.padding : allPadding : padding;
|
|
6367
|
+
const cellOverflow = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(showOverflow) ? isAllOverflow : showOverflow;
|
|
6315
6368
|
const showEllipsis = cellOverflow === 'ellipsis';
|
|
6316
6369
|
const showTitle = cellOverflow === 'title';
|
|
6317
6370
|
const showTooltip = cellOverflow === true || cellOverflow === 'tooltip';
|
|
6318
|
-
|
|
6319
|
-
const
|
|
6371
|
+
const hasEllipsis = isAllOverflow || showTitle || showTooltip || showEllipsis;
|
|
6372
|
+
const showResizable = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(column.resizable) ? column.resizable : columnOpts.resizable || allResizable;
|
|
6373
|
+
const isCsHeight = !!customCellHeight;
|
|
6374
|
+
const isRsHeight = resizeHeight > 0;
|
|
6320
6375
|
let isDirty;
|
|
6321
6376
|
const tdOns = {};
|
|
6322
|
-
const rest = fullAllDataRowIdData[rowid];
|
|
6323
6377
|
const cellAlign = align || (compConf ? compConf.tableCellAlign : '') || allAlign;
|
|
6378
|
+
const cellVerticalAlign = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(verticalAlign) ? allVerticalAlign : verticalAlign;
|
|
6324
6379
|
const errorValidItem = validErrorMaps[`${rowid}:${colid}`];
|
|
6325
6380
|
const showValidTip = editRules && validOpts.showMessage && (validOpts.message === 'default' ? height || tableData.length > 1 : validOpts.message === 'inline');
|
|
6326
|
-
const
|
|
6381
|
+
const tdAttrs = {
|
|
6327
6382
|
colid
|
|
6328
6383
|
};
|
|
6329
|
-
const
|
|
6384
|
+
const cellParams = {
|
|
6330
6385
|
$table: $xeTable,
|
|
6331
6386
|
$grid: $xeTable.xegrid,
|
|
6332
6387
|
isEdit: false,
|
|
@@ -6354,7 +6409,7 @@ const renderType = 'body';
|
|
|
6354
6409
|
isRowDragCell = rowDragOpts.trigger === 'row' || column.dragSort && rowDragOpts.trigger === 'cell';
|
|
6355
6410
|
}
|
|
6356
6411
|
if (isRowDragCell) {
|
|
6357
|
-
isDisabledDrag = !!(dragDisabledMethod && dragDisabledMethod(
|
|
6412
|
+
isDisabledDrag = !!(dragDisabledMethod && dragDisabledMethod(cellParams));
|
|
6358
6413
|
}
|
|
6359
6414
|
// hover 进入事件
|
|
6360
6415
|
if (showTitle || showTooltip || showAllTip || tooltipConfig) {
|
|
@@ -6366,11 +6421,11 @@ const renderType = 'body';
|
|
|
6366
6421
|
updateCellTitle(evnt.currentTarget, column);
|
|
6367
6422
|
} else if (showTooltip || showAllTip) {
|
|
6368
6423
|
// 如果配置了显示 tooltip
|
|
6369
|
-
$xeTable.triggerBodyTooltipEvent(evnt,
|
|
6424
|
+
$xeTable.triggerBodyTooltipEvent(evnt, cellParams);
|
|
6370
6425
|
}
|
|
6371
6426
|
$xeTable.dispatchEvent('cell-mouseenter', Object.assign({
|
|
6372
6427
|
cell: evnt.currentTarget
|
|
6373
|
-
},
|
|
6428
|
+
}, cellParams), evnt);
|
|
6374
6429
|
};
|
|
6375
6430
|
}
|
|
6376
6431
|
// hover 退出事件
|
|
@@ -6384,13 +6439,13 @@ const renderType = 'body';
|
|
|
6384
6439
|
}
|
|
6385
6440
|
$xeTable.dispatchEvent('cell-mouseleave', Object.assign({
|
|
6386
6441
|
cell: evnt.currentTarget
|
|
6387
|
-
},
|
|
6442
|
+
}, cellParams), evnt);
|
|
6388
6443
|
};
|
|
6389
6444
|
}
|
|
6390
6445
|
// 按下事件处理
|
|
6391
6446
|
if (isRowDragCell || checkboxOpts.range || mouseConfig) {
|
|
6392
6447
|
tdOns.onMousedown = evnt => {
|
|
6393
|
-
$xeTable.triggerCellMousedownEvent(evnt,
|
|
6448
|
+
$xeTable.triggerCellMousedownEvent(evnt, cellParams);
|
|
6394
6449
|
};
|
|
6395
6450
|
}
|
|
6396
6451
|
// 拖拽列事件
|
|
@@ -6399,11 +6454,11 @@ const renderType = 'body';
|
|
|
6399
6454
|
}
|
|
6400
6455
|
// 点击事件处理
|
|
6401
6456
|
tdOns.onClick = evnt => {
|
|
6402
|
-
$xeTable.triggerCellClickEvent(evnt,
|
|
6457
|
+
$xeTable.triggerCellClickEvent(evnt, cellParams);
|
|
6403
6458
|
};
|
|
6404
6459
|
// 双击事件处理
|
|
6405
6460
|
tdOns.onDblclick = evnt => {
|
|
6406
|
-
$xeTable.triggerCellDblclickEvent(evnt,
|
|
6461
|
+
$xeTable.triggerCellDblclickEvent(evnt, cellParams);
|
|
6407
6462
|
};
|
|
6408
6463
|
// 合并行或列
|
|
6409
6464
|
if (mergeList.length) {
|
|
@@ -6417,10 +6472,10 @@ const renderType = 'body';
|
|
|
6417
6472
|
return null;
|
|
6418
6473
|
}
|
|
6419
6474
|
if (rowspan > 1) {
|
|
6420
|
-
|
|
6475
|
+
tdAttrs.rowspan = rowspan;
|
|
6421
6476
|
}
|
|
6422
6477
|
if (colspan > 1) {
|
|
6423
|
-
|
|
6478
|
+
tdAttrs.colspan = colspan;
|
|
6424
6479
|
}
|
|
6425
6480
|
}
|
|
6426
6481
|
} else if (spanMethod) {
|
|
@@ -6428,20 +6483,20 @@ const renderType = 'body';
|
|
|
6428
6483
|
const {
|
|
6429
6484
|
rowspan = 1,
|
|
6430
6485
|
colspan = 1
|
|
6431
|
-
} = spanMethod(
|
|
6486
|
+
} = spanMethod(cellParams) || {};
|
|
6432
6487
|
if (!rowspan || !colspan) {
|
|
6433
6488
|
return null;
|
|
6434
6489
|
}
|
|
6435
6490
|
if (rowspan > 1) {
|
|
6436
|
-
|
|
6491
|
+
tdAttrs.rowspan = rowspan;
|
|
6437
6492
|
}
|
|
6438
6493
|
if (colspan > 1) {
|
|
6439
|
-
|
|
6494
|
+
tdAttrs.colspan = colspan;
|
|
6440
6495
|
}
|
|
6441
6496
|
}
|
|
6442
6497
|
// 如果被合并不可隐藏
|
|
6443
6498
|
if (fixedHiddenColumn && mergeList) {
|
|
6444
|
-
if (
|
|
6499
|
+
if (tdAttrs.colspan > 1 || tdAttrs.rowspan > 1) {
|
|
6445
6500
|
fixedHiddenColumn = false;
|
|
6446
6501
|
}
|
|
6447
6502
|
}
|
|
@@ -6449,40 +6504,69 @@ const renderType = 'body';
|
|
|
6449
6504
|
if (!fixedHiddenColumn && editConfig && (editRender || cellRender) && (editOpts.showStatus || editOpts.showUpdateStatus)) {
|
|
6450
6505
|
isDirty = $xeTable.isUpdateByRow(row, column.field);
|
|
6451
6506
|
}
|
|
6507
|
+
const isVNAutoHeight = scrollYLoad && !hasEllipsis;
|
|
6508
|
+
let cellHeight = currCellHeight;
|
|
6509
|
+
const vnHeight = calcCellHeightFlag ? rowRest.height : 0;
|
|
6510
|
+
if (resizeHeight) {
|
|
6511
|
+
cellHeight = resizeHeight;
|
|
6512
|
+
} else {
|
|
6513
|
+
if (scrollYLoad) {
|
|
6514
|
+
if (!hasEllipsis) {
|
|
6515
|
+
cellHeight = vnHeight || currCellHeight;
|
|
6516
|
+
}
|
|
6517
|
+
}
|
|
6518
|
+
}
|
|
6519
|
+
const isLastColumn = $columnIndex === columns.length - 1;
|
|
6520
|
+
const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto');
|
|
6521
|
+
let isVNPreEmptyStatus = false;
|
|
6522
|
+
if (scrollYLoad && (_rowIndex < scrollYStore.visibleStartIndex - scrollYStore.preloadSize || _rowIndex > scrollYStore.visibleEndIndex + scrollYStore.preloadSize)) {
|
|
6523
|
+
isVNPreEmptyStatus = true;
|
|
6524
|
+
} else if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
|
|
6525
|
+
isVNPreEmptyStatus = true;
|
|
6526
|
+
}
|
|
6527
|
+
const tcStyle = {};
|
|
6528
|
+
if (scrollYLoad || hasEllipsis || isCsHeight || isRsHeight) {
|
|
6529
|
+
tcStyle.height = `${cellHeight}px`;
|
|
6530
|
+
} else {
|
|
6531
|
+
tcStyle.minHeight = `${cellHeight}px`;
|
|
6532
|
+
}
|
|
6452
6533
|
const tdVNs = [];
|
|
6453
|
-
if (fixedHiddenColumn &&
|
|
6534
|
+
if (fixedHiddenColumn && isAllOverflow) {
|
|
6454
6535
|
tdVNs.push((0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
6536
|
+
key: 'tc',
|
|
6455
6537
|
class: ['vxe-cell', {
|
|
6456
6538
|
'c--title': showTitle,
|
|
6457
6539
|
'c--tooltip': showTooltip,
|
|
6458
6540
|
'c--ellipsis': showEllipsis
|
|
6459
6541
|
}],
|
|
6460
|
-
style:
|
|
6461
|
-
maxHeight: hasEllipsis && (customRHeight || defaultRowHeight) ? `${customRHeight || defaultRowHeight}px` : ''
|
|
6462
|
-
}
|
|
6542
|
+
style: tcStyle
|
|
6463
6543
|
}));
|
|
6464
6544
|
} else {
|
|
6465
6545
|
// 渲染单元格
|
|
6466
|
-
tdVNs.push(...renderLine(
|
|
6546
|
+
tdVNs.push(...renderLine(cellParams, cellHeight), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
6547
|
+
key: 'tc',
|
|
6467
6548
|
class: ['vxe-cell', {
|
|
6468
6549
|
'c--title': showTitle,
|
|
6469
6550
|
'c--tooltip': showTooltip,
|
|
6470
6551
|
'c--ellipsis': showEllipsis
|
|
6471
6552
|
}],
|
|
6472
|
-
style:
|
|
6473
|
-
maxHeight: hasEllipsis && (customRHeight || defaultRowHeight) ? `${customRHeight || defaultRowHeight}px` : ''
|
|
6474
|
-
},
|
|
6553
|
+
style: tcStyle,
|
|
6475
6554
|
title: showTitle ? $xeTable.getCellLabel(row, column) : null
|
|
6476
|
-
},
|
|
6555
|
+
}, isVNPreEmptyStatus ? [] : [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
6556
|
+
colid,
|
|
6557
|
+
rowid,
|
|
6558
|
+
class: 'vxe-cell--wrapper'
|
|
6559
|
+
}, column.renderCell(cellParams))]));
|
|
6477
6560
|
if (showValidTip && errorValidItem) {
|
|
6478
6561
|
const errRule = errorValidItem.rule;
|
|
6479
6562
|
const validSlot = slots ? slots.valid : null;
|
|
6480
6563
|
const validParams = {
|
|
6481
|
-
...
|
|
6564
|
+
...cellParams,
|
|
6482
6565
|
...errorValidItem,
|
|
6483
6566
|
rule: errorValidItem
|
|
6484
6567
|
};
|
|
6485
6568
|
tdVNs.push((0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
6569
|
+
key: 'tcv',
|
|
6486
6570
|
class: ['vxe-cell--valid-error-tip', getPropClass(validOpts.className, validParams)],
|
|
6487
6571
|
style: errRule && errRule.maxWidth ? {
|
|
6488
6572
|
width: `${errRule.maxWidth}px`
|
|
@@ -6494,57 +6578,55 @@ const renderType = 'body';
|
|
|
6494
6578
|
}, errorValidItem.content)]])]));
|
|
6495
6579
|
}
|
|
6496
6580
|
}
|
|
6497
|
-
let
|
|
6498
|
-
const vnHeight = isCalcCellHeight ? rest.height : 0;
|
|
6499
|
-
if (hasEllipsis) {
|
|
6500
|
-
if (customRHeight) {
|
|
6501
|
-
cellHeight = `${customRHeight}px`;
|
|
6502
|
-
} else if (!isAllOverflow) {
|
|
6503
|
-
cellHeight = `${vnHeight || defaultRowHeight || 18}px`;
|
|
6504
|
-
}
|
|
6505
|
-
} else {
|
|
6506
|
-
cellHeight = `${vnHeight || defaultRowHeight || 18}px`;
|
|
6507
|
-
}
|
|
6581
|
+
let showAreaRowStatus = false;
|
|
6508
6582
|
if (mouseConfig && mouseOpts.area && selectCellToRow) {
|
|
6509
|
-
if (
|
|
6510
|
-
|
|
6511
|
-
class: 'vxe-cell--area-status'
|
|
6512
|
-
}));
|
|
6583
|
+
if (!_columnIndex && selectCellToRow === true || selectCellToRow === column.field) {
|
|
6584
|
+
showAreaRowStatus = true;
|
|
6513
6585
|
}
|
|
6514
6586
|
}
|
|
6515
|
-
|
|
6516
|
-
|
|
6517
|
-
|
|
6518
|
-
|
|
6519
|
-
|
|
6520
|
-
|
|
6521
|
-
|
|
6587
|
+
if (!fixedHiddenColumn && showResizable && isAllColumnDrag) {
|
|
6588
|
+
tdVNs.push((0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
6589
|
+
key: 'tcc',
|
|
6590
|
+
class: ['vxe-cell--col-resizable', {
|
|
6591
|
+
'is--line': !border || border === 'none'
|
|
6592
|
+
}],
|
|
6593
|
+
onMousedown: evnt => $xeTable.handleColResizeMousedownEvent(evnt, fixedType, cellParams),
|
|
6594
|
+
onDblclick: evnt => $xeTable.handleColResizeDblclickEvent(evnt, cellParams)
|
|
6595
|
+
}));
|
|
6596
|
+
}
|
|
6597
|
+
if ((rowResize || isAllRowDrag) && rowOpts.resizable) {
|
|
6598
|
+
tdVNs.push((0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
6599
|
+
key: 'tcr',
|
|
6600
|
+
class: 'vxe-cell--row-resizable',
|
|
6601
|
+
onMousedown: evnt => $xeTable.handleRowResizeMousedownEvent(evnt, cellParams),
|
|
6602
|
+
onDblclick: evnt => $xeTable.handleRowResizeDblclickEvent(evnt, cellParams)
|
|
6603
|
+
}));
|
|
6522
6604
|
}
|
|
6523
6605
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('td', {
|
|
6524
|
-
class: ['vxe-body--column', colid, {
|
|
6525
|
-
[`col--${cellAlign}`]: cellAlign,
|
|
6526
|
-
[`col--vertical-${verticalAlign}`]: verticalAlign,
|
|
6527
|
-
[`col--${type}`]: type,
|
|
6606
|
+
class: ['vxe-body--column', colid, cellVerticalAlign ? `col--vertical-${cellVerticalAlign}` : '', cellAlign ? `col--${cellAlign}` : '', type ? `col--${type}` : '', {
|
|
6528
6607
|
'col--last': isLastColumn,
|
|
6529
6608
|
'col--tree-node': treeNode,
|
|
6530
6609
|
'col--edit': isEdit,
|
|
6531
6610
|
'col--ellipsis': hasEllipsis,
|
|
6611
|
+
'col--cs-height': isCsHeight,
|
|
6612
|
+
'col--rs-height': isRsHeight,
|
|
6613
|
+
'col--to-row': showAreaRowStatus,
|
|
6614
|
+
'col--auto-height': isVNAutoHeight,
|
|
6532
6615
|
'fixed--width': !isAutoCellWidth,
|
|
6533
6616
|
'fixed--hidden': fixedHiddenColumn,
|
|
6617
|
+
'is--padding': isCellPadding,
|
|
6534
6618
|
'is--drag-cell': isRowDragCell && (isCrossDrag || isPeerDrag || !rowLevel),
|
|
6535
6619
|
'is--drag-disabled': isDisabledDrag,
|
|
6536
6620
|
'col--dirty': isDirty,
|
|
6537
6621
|
'col--active': editConfig && isEdit && actived.row === row && (actived.column === column || editOpts.mode === 'row'),
|
|
6538
6622
|
'col--valid-error': !!errorValidItem,
|
|
6539
6623
|
'col--current': currentColumn === column
|
|
6540
|
-
}, getPropClass(compCellClassName,
|
|
6624
|
+
}, getPropClass(compCellClassName, cellParams), getPropClass(className, cellParams), getPropClass(allCellClassName, cellParams)],
|
|
6541
6625
|
key: columnKey || scrollXLoad || scrollYLoad || columnOpts.useKey || rowOpts.useKey || columnOpts.drag ? colid : $columnIndex,
|
|
6542
|
-
...
|
|
6543
|
-
style: Object.assign({
|
|
6544
|
-
height: cellHeight
|
|
6545
|
-
}, 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),
|
|
6626
|
+
...tdAttrs,
|
|
6627
|
+
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),
|
|
6546
6628
|
...tdOns
|
|
6547
|
-
},
|
|
6629
|
+
}, isOptimizeMode && fixedHiddenColumn ? [] : tdVNs);
|
|
6548
6630
|
};
|
|
6549
6631
|
const renderRows = (fixedType, isOptimizeMode, tableData, tableColumn) => {
|
|
6550
6632
|
const {
|
|
@@ -6553,15 +6635,16 @@ const renderType = 'body';
|
|
|
6553
6635
|
highlightHoverRow,
|
|
6554
6636
|
rowClassName,
|
|
6555
6637
|
rowStyle,
|
|
6556
|
-
showOverflow: allColumnOverflow,
|
|
6557
6638
|
editConfig,
|
|
6558
6639
|
treeConfig
|
|
6559
6640
|
} = tableProps;
|
|
6560
6641
|
const {
|
|
6561
6642
|
hasFixedColumn,
|
|
6562
6643
|
treeExpandedMaps,
|
|
6644
|
+
isColLoading,
|
|
6563
6645
|
scrollXLoad,
|
|
6564
6646
|
scrollYLoad,
|
|
6647
|
+
isAllOverflow,
|
|
6565
6648
|
rowExpandedMaps,
|
|
6566
6649
|
expandColumn,
|
|
6567
6650
|
selectRadioRow,
|
|
@@ -6665,7 +6748,7 @@ const renderType = 'body';
|
|
|
6665
6748
|
const tdVNs = tableColumn.map((column, $columnIndex) => {
|
|
6666
6749
|
return renderTdColumn(seq, rowid, fixedType, isOptimizeMode, rowLevel, row, rowIndex, $rowIndex, _rowIndex, column, $columnIndex, tableColumn, tableData);
|
|
6667
6750
|
});
|
|
6668
|
-
rows.push(columnOpts.drag && columnDragOpts.animation ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(external_commonjs_vue_commonjs2_vue_root_Vue_.TransitionGroup, {
|
|
6751
|
+
rows.push(!isColLoading && columnOpts.drag && columnDragOpts.animation ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(external_commonjs_vue_commonjs2_vue_root_Vue_.TransitionGroup, {
|
|
6669
6752
|
name: `vxe-header--col-list${isDragColMove ? '' : '-disabled'}`,
|
|
6670
6753
|
tag: 'tr',
|
|
6671
6754
|
class: trClass,
|
|
@@ -6699,7 +6782,7 @@ const renderType = 'body';
|
|
|
6699
6782
|
const {
|
|
6700
6783
|
showOverflow
|
|
6701
6784
|
} = expandColumn;
|
|
6702
|
-
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) ?
|
|
6785
|
+
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;
|
|
6703
6786
|
const expandParams = {
|
|
6704
6787
|
$table: $xeTable,
|
|
6705
6788
|
seq,
|
|
@@ -6787,7 +6870,6 @@ const renderType = 'body';
|
|
|
6787
6870
|
tableColumn
|
|
6788
6871
|
} = props;
|
|
6789
6872
|
const {
|
|
6790
|
-
showOverflow: allColumnOverflow,
|
|
6791
6873
|
spanMethod,
|
|
6792
6874
|
footerSpanMethod,
|
|
6793
6875
|
mouseConfig
|
|
@@ -6795,6 +6877,8 @@ const renderType = 'body';
|
|
|
6795
6877
|
const {
|
|
6796
6878
|
isGroup,
|
|
6797
6879
|
tableData,
|
|
6880
|
+
isRowLoading,
|
|
6881
|
+
isColLoading,
|
|
6798
6882
|
scrollXLoad,
|
|
6799
6883
|
scrollYLoad,
|
|
6800
6884
|
isAllOverflow,
|
|
@@ -6818,7 +6902,7 @@ const renderType = 'body';
|
|
|
6818
6902
|
let renderColumnList = tableColumn;
|
|
6819
6903
|
let isOptimizeMode = false;
|
|
6820
6904
|
// 如果是使用优化模式
|
|
6821
|
-
if (scrollXLoad || scrollYLoad ||
|
|
6905
|
+
if (scrollXLoad || scrollYLoad || isAllOverflow) {
|
|
6822
6906
|
if (expandColumn || spanMethod || footerSpanMethod) {
|
|
6823
6907
|
// 如果不支持优化模式
|
|
6824
6908
|
} else {
|
|
@@ -6937,9 +7021,9 @@ const renderType = 'body';
|
|
|
6937
7021
|
});
|
|
6938
7022
|
})),
|
|
6939
7023
|
/**
|
|
6940
|
-
|
|
6941
|
-
|
|
6942
|
-
rowOpts.drag && rowDragOpts.animation ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(external_commonjs_vue_commonjs2_vue_root_Vue_.TransitionGroup, {
|
|
7024
|
+
* 内容
|
|
7025
|
+
*/
|
|
7026
|
+
!(isRowLoading || isColLoading) && rowOpts.drag && rowDragOpts.animation ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(external_commonjs_vue_commonjs2_vue_root_Vue_.TransitionGroup, {
|
|
6943
7027
|
ref: refBodyTBody,
|
|
6944
7028
|
name: `vxe-body--row-list${isDragRowMove ? '' : '-disabled'}`,
|
|
6945
7029
|
tag: 'tbody'
|
|
@@ -6972,6 +7056,8 @@ const renderType = 'body';
|
|
|
6972
7056
|
class: 'vxe-table--cell-multi-area'
|
|
6973
7057
|
}), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
|
|
6974
7058
|
class: 'vxe-table--cell-active-area'
|
|
7059
|
+
}), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
|
|
7060
|
+
class: 'vxe-table--cell-row-status-area'
|
|
6975
7061
|
})]) : body_renderEmptyElement($xeTable), !fixedType ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
6976
7062
|
class: 'vxe-table--empty-block',
|
|
6977
7063
|
ref: refBodyEmptyBlock
|
|
@@ -6990,10 +7076,7 @@ const renderType = 'body';
|
|
|
6990
7076
|
|
|
6991
7077
|
|
|
6992
7078
|
|
|
6993
|
-
|
|
6994
|
-
|
|
6995
7079
|
const {
|
|
6996
|
-
getI18n: header_getI18n,
|
|
6997
7080
|
renderer: header_renderer,
|
|
6998
7081
|
renderEmptyElement: header_renderEmptyElement
|
|
6999
7082
|
} = core_.VxeUI;
|
|
@@ -7018,18 +7101,13 @@ const header_renderType = 'header';
|
|
|
7018
7101
|
reactData: tableReactData,
|
|
7019
7102
|
internalData: tableInternalData
|
|
7020
7103
|
} = $xeTable;
|
|
7021
|
-
const {
|
|
7022
|
-
refElem: tableRefElem,
|
|
7023
|
-
refLeftContainer,
|
|
7024
|
-
refRightContainer,
|
|
7025
|
-
refCellResizeBar,
|
|
7026
|
-
refCellResizeTip
|
|
7027
|
-
} = $xeTable.getRefMaps();
|
|
7028
7104
|
const {
|
|
7029
7105
|
computeColumnOpts,
|
|
7030
7106
|
computeColumnDragOpts,
|
|
7031
|
-
|
|
7032
|
-
|
|
7107
|
+
computeCellOpts,
|
|
7108
|
+
computeMouseOpts,
|
|
7109
|
+
computeHeaderCellOpts,
|
|
7110
|
+
computeDefaultRowHeight
|
|
7033
7111
|
} = $xeTable.getComputeMaps();
|
|
7034
7112
|
const headerColumn = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)([]);
|
|
7035
7113
|
const refElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
@@ -7045,153 +7123,6 @@ const header_renderType = 'header';
|
|
|
7045
7123
|
} = tableReactData;
|
|
7046
7124
|
headerColumn.value = isGroup ? convertHeaderColumnToRows(props.tableGroupColumn) : [];
|
|
7047
7125
|
};
|
|
7048
|
-
const resizeMousedownEvent = (evnt, params) => {
|
|
7049
|
-
const {
|
|
7050
|
-
column
|
|
7051
|
-
} = params;
|
|
7052
|
-
const {
|
|
7053
|
-
fixedType
|
|
7054
|
-
} = props;
|
|
7055
|
-
const {
|
|
7056
|
-
scrollbarHeight
|
|
7057
|
-
} = tableReactData;
|
|
7058
|
-
const {
|
|
7059
|
-
elemStore,
|
|
7060
|
-
visibleColumn
|
|
7061
|
-
} = tableInternalData;
|
|
7062
|
-
const resizableOpts = computeResizableOpts.value;
|
|
7063
|
-
const tableEl = tableRefElem.value;
|
|
7064
|
-
const leftContainerElem = refLeftContainer.value;
|
|
7065
|
-
const rightContainerElem = refRightContainer.value;
|
|
7066
|
-
const resizeBarElem = refCellResizeBar.value;
|
|
7067
|
-
const resizeTipElem = refCellResizeTip.value;
|
|
7068
|
-
const scrollbarXToTop = computeScrollbarXToTop.value;
|
|
7069
|
-
const {
|
|
7070
|
-
clientX: dragClientX
|
|
7071
|
-
} = evnt;
|
|
7072
|
-
const wrapperElem = refElem.value;
|
|
7073
|
-
const dragBtnElem = evnt.target;
|
|
7074
|
-
let resizeColumn = column;
|
|
7075
|
-
if (column.children && column.children.length) {
|
|
7076
|
-
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(column.children, childColumn => {
|
|
7077
|
-
resizeColumn = childColumn;
|
|
7078
|
-
});
|
|
7079
|
-
}
|
|
7080
|
-
const cell = dragBtnElem.parentNode;
|
|
7081
|
-
const cellParams = Object.assign(params, {
|
|
7082
|
-
cell
|
|
7083
|
-
});
|
|
7084
|
-
let dragLeft = 0;
|
|
7085
|
-
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
7086
|
-
if (!bodyScrollElem) {
|
|
7087
|
-
return;
|
|
7088
|
-
}
|
|
7089
|
-
const pos = getOffsetPos(dragBtnElem, wrapperElem);
|
|
7090
|
-
const dragBtnWidth = dragBtnElem.clientWidth;
|
|
7091
|
-
const dragBtnOffsetWidth = Math.floor(dragBtnWidth / 2);
|
|
7092
|
-
const minInterval = getColReMinWidth(cellParams) - dragBtnOffsetWidth; // 列之间的最小间距
|
|
7093
|
-
let dragMinLeft = pos.left - cell.clientWidth + dragBtnWidth + minInterval;
|
|
7094
|
-
let dragPosLeft = pos.left + dragBtnOffsetWidth;
|
|
7095
|
-
const domMousemove = document.onmousemove;
|
|
7096
|
-
const domMouseup = document.onmouseup;
|
|
7097
|
-
const isLeftFixed = fixedType === 'left';
|
|
7098
|
-
const isRightFixed = fixedType === 'right';
|
|
7099
|
-
// 计算左右侧固定列偏移量
|
|
7100
|
-
let fixedOffsetWidth = 0;
|
|
7101
|
-
if (isLeftFixed || isRightFixed) {
|
|
7102
|
-
const siblingProp = isLeftFixed ? 'nextElementSibling' : 'previousElementSibling';
|
|
7103
|
-
let tempCellElem = cell[siblingProp];
|
|
7104
|
-
while (tempCellElem) {
|
|
7105
|
-
if (hasClass(tempCellElem, 'fixed--hidden')) {
|
|
7106
|
-
break;
|
|
7107
|
-
} else if (!hasClass(tempCellElem, 'col--group')) {
|
|
7108
|
-
fixedOffsetWidth += tempCellElem.offsetWidth;
|
|
7109
|
-
}
|
|
7110
|
-
tempCellElem = tempCellElem[siblingProp];
|
|
7111
|
-
}
|
|
7112
|
-
if (isRightFixed && rightContainerElem) {
|
|
7113
|
-
dragPosLeft = rightContainerElem.offsetLeft + fixedOffsetWidth;
|
|
7114
|
-
}
|
|
7115
|
-
}
|
|
7116
|
-
// 处理拖动事件
|
|
7117
|
-
const updateEvent = evnt => {
|
|
7118
|
-
evnt.stopPropagation();
|
|
7119
|
-
evnt.preventDefault();
|
|
7120
|
-
const tableHeight = tableEl.clientHeight;
|
|
7121
|
-
const offsetX = evnt.clientX - dragClientX;
|
|
7122
|
-
let left = dragPosLeft + offsetX;
|
|
7123
|
-
const scrollLeft = fixedType ? 0 : bodyScrollElem.scrollLeft;
|
|
7124
|
-
if (isLeftFixed) {
|
|
7125
|
-
// 左固定列(不允许超过右侧固定列、不允许超过右边距)
|
|
7126
|
-
left = Math.min(left, (rightContainerElem ? rightContainerElem.offsetLeft : bodyScrollElem.clientWidth) - fixedOffsetWidth - minInterval);
|
|
7127
|
-
} else if (isRightFixed) {
|
|
7128
|
-
// 右侧固定列(不允许超过左侧固定列、不允许超过左边距)
|
|
7129
|
-
dragMinLeft = (leftContainerElem ? leftContainerElem.clientWidth : 0) + fixedOffsetWidth + minInterval;
|
|
7130
|
-
left = Math.min(left, dragPosLeft + cell.clientWidth - minInterval);
|
|
7131
|
-
} else {
|
|
7132
|
-
dragMinLeft = Math.max(bodyScrollElem.scrollLeft, dragMinLeft);
|
|
7133
|
-
// left = Math.min(left, bodyScrollElem.clientWidth + bodyScrollElem.scrollLeft - 40)
|
|
7134
|
-
}
|
|
7135
|
-
dragLeft = Math.max(left, dragMinLeft);
|
|
7136
|
-
const resizeBarLeft = Math.max(1, dragLeft - scrollLeft);
|
|
7137
|
-
resizeBarElem.style.left = `${resizeBarLeft}px`;
|
|
7138
|
-
resizeBarElem.style.top = `${scrollbarXToTop ? scrollbarHeight : 0}px`;
|
|
7139
|
-
resizeBarElem.style.height = `${scrollbarXToTop ? tableHeight - scrollbarHeight : tableHeight}px`;
|
|
7140
|
-
if (resizableOpts.showDragTip && resizeTipElem) {
|
|
7141
|
-
const tableWidth = tableEl.clientWidth;
|
|
7142
|
-
const wrapperRect = wrapperElem.getBoundingClientRect();
|
|
7143
|
-
const resizeBarWidth = resizeBarElem.clientWidth;
|
|
7144
|
-
const resizeTipWidth = resizeTipElem.clientWidth;
|
|
7145
|
-
const resizeTipHeight = resizeTipElem.clientHeight;
|
|
7146
|
-
let resizeTipLeft = -resizeTipWidth;
|
|
7147
|
-
if (resizeBarLeft < resizeTipWidth + resizeBarWidth) {
|
|
7148
|
-
resizeTipLeft = 0;
|
|
7149
|
-
} else if (resizeBarLeft > tableWidth) {
|
|
7150
|
-
resizeTipLeft += tableWidth - resizeBarLeft;
|
|
7151
|
-
}
|
|
7152
|
-
resizeTipElem.style.left = `${resizeTipLeft}px`;
|
|
7153
|
-
resizeTipElem.style.top = `${Math.min(tableHeight - resizeTipHeight, Math.max(0, evnt.clientY - wrapperRect.y - resizeTipHeight / 2))}px`;
|
|
7154
|
-
resizeTipElem.textContent = header_getI18n('vxe.table.resizeColTip', [resizeColumn.renderWidth + (isRightFixed ? dragPosLeft - dragLeft : dragLeft - dragPosLeft)]);
|
|
7155
|
-
}
|
|
7156
|
-
};
|
|
7157
|
-
tableReactData._isResize = true;
|
|
7158
|
-
addClass(tableEl, 'drag--resize');
|
|
7159
|
-
resizeBarElem.style.display = 'block';
|
|
7160
|
-
document.onmousemove = updateEvent;
|
|
7161
|
-
document.onmouseup = function (evnt) {
|
|
7162
|
-
document.onmousemove = domMousemove;
|
|
7163
|
-
document.onmouseup = domMouseup;
|
|
7164
|
-
const resizeWidth = resizeColumn.renderWidth + (isRightFixed ? dragPosLeft - dragLeft : dragLeft - dragPosLeft);
|
|
7165
|
-
resizeColumn.resizeWidth = resizeWidth;
|
|
7166
|
-
if (resizableOpts.dragMode === 'fixed') {
|
|
7167
|
-
visibleColumn.forEach(item => {
|
|
7168
|
-
if (item.id !== resizeColumn.id) {
|
|
7169
|
-
if (!item.resizeWidth) {
|
|
7170
|
-
item.resizeWidth = item.renderWidth;
|
|
7171
|
-
}
|
|
7172
|
-
}
|
|
7173
|
-
});
|
|
7174
|
-
}
|
|
7175
|
-
resizeBarElem.style.display = 'none';
|
|
7176
|
-
tableReactData._isResize = false;
|
|
7177
|
-
tableInternalData._lastResizeTime = Date.now();
|
|
7178
|
-
$xeTable.analyColumnWidth();
|
|
7179
|
-
$xeTable.recalculate(true).then(() => {
|
|
7180
|
-
$xeTable.saveCustomStore('update:visible');
|
|
7181
|
-
$xeTable.updateCellAreas();
|
|
7182
|
-
$xeTable.dispatchEvent('resizable-change', {
|
|
7183
|
-
...params,
|
|
7184
|
-
resizeWidth
|
|
7185
|
-
}, evnt);
|
|
7186
|
-
setTimeout(() => $xeTable.recalculate(true), 300);
|
|
7187
|
-
});
|
|
7188
|
-
removeClass(tableEl, 'drag--resize');
|
|
7189
|
-
};
|
|
7190
|
-
updateEvent(evnt);
|
|
7191
|
-
if ($xeTable.closeMenu) {
|
|
7192
|
-
$xeTable.closeMenu();
|
|
7193
|
-
}
|
|
7194
|
-
};
|
|
7195
7126
|
const renderRows = (isGroup, isOptimizeMode, cols, $rowIndex) => {
|
|
7196
7127
|
const {
|
|
7197
7128
|
fixedType
|
|
@@ -7218,6 +7149,10 @@ const header_renderType = 'header';
|
|
|
7218
7149
|
} = tableInternalData;
|
|
7219
7150
|
const columnOpts = computeColumnOpts.value;
|
|
7220
7151
|
const columnDragOpts = computeColumnDragOpts.value;
|
|
7152
|
+
const cellOpts = computeCellOpts.value;
|
|
7153
|
+
const defaultRowHeight = computeDefaultRowHeight.value;
|
|
7154
|
+
const headerCellOpts = computeHeaderCellOpts.value;
|
|
7155
|
+
const currCellHeight = getCellHeight(headerCellOpts.height || cellOpts.height) || defaultRowHeight;
|
|
7221
7156
|
const {
|
|
7222
7157
|
disabledMethod: dragDisabledMethod,
|
|
7223
7158
|
isCrossDrag,
|
|
@@ -7239,6 +7174,7 @@ const header_renderType = 'header';
|
|
|
7239
7174
|
const compConf = renderOpts ? header_renderer.get(renderOpts.name) : null;
|
|
7240
7175
|
const isColGroup = column.children && column.children.length;
|
|
7241
7176
|
const fixedHiddenColumn = fixedType ? column.fixed !== fixedType && !isColGroup : !!column.fixed && overflowX;
|
|
7177
|
+
const isPadding = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(headerCellOpts.padding) ? headerCellOpts.padding : cellOpts.padding;
|
|
7242
7178
|
const headOverflow = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(showHeaderOverflow) ? allColumnHeaderOverflow : showHeaderOverflow;
|
|
7243
7179
|
const headAlign = headerAlign || (compConf ? compConf.tableHeaderCellAlign : '') || allHeaderAlign || align || (compConf ? compConf.tableCellAlign : '') || allAlign;
|
|
7244
7180
|
let showEllipsis = headOverflow === 'ellipsis';
|
|
@@ -7253,7 +7189,7 @@ const header_renderType = 'header';
|
|
|
7253
7189
|
}
|
|
7254
7190
|
const columnIndex = $xeTable.getColumnIndex(column);
|
|
7255
7191
|
const _columnIndex = $xeTable.getVTColumnIndex(column);
|
|
7256
|
-
const
|
|
7192
|
+
const cellParams = {
|
|
7257
7193
|
$table: $xeTable,
|
|
7258
7194
|
$grid: $xeTable.xegrid,
|
|
7259
7195
|
$rowIndex,
|
|
@@ -7273,8 +7209,8 @@ const header_renderType = 'header';
|
|
|
7273
7209
|
rowspan: column.rowSpan > 1 ? column.rowSpan : null
|
|
7274
7210
|
};
|
|
7275
7211
|
const thOns = {
|
|
7276
|
-
onClick: evnt => $xeTable.triggerHeaderCellClickEvent(evnt,
|
|
7277
|
-
onDblclick: evnt => $xeTable.triggerHeaderCellDblclickEvent(evnt,
|
|
7212
|
+
onClick: evnt => $xeTable.triggerHeaderCellClickEvent(evnt, cellParams),
|
|
7213
|
+
onDblclick: evnt => $xeTable.triggerHeaderCellDblclickEvent(evnt, cellParams)
|
|
7278
7214
|
};
|
|
7279
7215
|
// 横向虚拟滚动不支持动态行高
|
|
7280
7216
|
if (scrollXLoad && !hasEllipsis) {
|
|
@@ -7283,11 +7219,11 @@ const header_renderType = 'header';
|
|
|
7283
7219
|
const isColDragCell = columnOpts.drag && columnDragOpts.trigger === 'cell';
|
|
7284
7220
|
let isDisabledDrag = false;
|
|
7285
7221
|
if (isColDragCell) {
|
|
7286
|
-
isDisabledDrag = !!(dragDisabledMethod && dragDisabledMethod(
|
|
7222
|
+
isDisabledDrag = !!(dragDisabledMethod && dragDisabledMethod(cellParams));
|
|
7287
7223
|
}
|
|
7288
7224
|
// 按下事件处理
|
|
7289
7225
|
if (mouseConfig || isColDragCell) {
|
|
7290
|
-
thOns.onMousedown = evnt => $xeTable.triggerHeaderCellMousedownEvent(evnt,
|
|
7226
|
+
thOns.onMousedown = evnt => $xeTable.triggerHeaderCellMousedownEvent(evnt, cellParams);
|
|
7291
7227
|
}
|
|
7292
7228
|
// 拖拽列事件
|
|
7293
7229
|
if (columnOpts.drag) {
|
|
@@ -7301,9 +7237,15 @@ const header_renderType = 'header';
|
|
|
7301
7237
|
const isLastColumn = $columnIndex === cols.length - 1;
|
|
7302
7238
|
const showResizable = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(column.resizable) ? column.resizable : columnOpts.resizable || allResizable;
|
|
7303
7239
|
const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto');
|
|
7304
|
-
let
|
|
7305
|
-
if (scrollXLoad && !
|
|
7306
|
-
|
|
7240
|
+
let isVNPreEmptyStatus = false;
|
|
7241
|
+
if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
|
|
7242
|
+
isVNPreEmptyStatus = true;
|
|
7243
|
+
}
|
|
7244
|
+
const tcStyle = {};
|
|
7245
|
+
if (hasEllipsis) {
|
|
7246
|
+
tcStyle.height = `${currCellHeight}px`;
|
|
7247
|
+
} else {
|
|
7248
|
+
tcStyle.minHeight = `${currCellHeight}px`;
|
|
7307
7249
|
}
|
|
7308
7250
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('th', {
|
|
7309
7251
|
class: ['vxe-header--column', colid, {
|
|
@@ -7315,14 +7257,15 @@ const header_renderType = 'header';
|
|
|
7315
7257
|
'col--ellipsis': hasEllipsis,
|
|
7316
7258
|
'fixed--width': !isAutoCellWidth,
|
|
7317
7259
|
'fixed--hidden': fixedHiddenColumn,
|
|
7260
|
+
'is--padding': isPadding,
|
|
7318
7261
|
'is--sortable': column.sortable,
|
|
7319
7262
|
'col--filter': !!filters,
|
|
7320
7263
|
'is--filter-active': hasFilter,
|
|
7321
7264
|
'is--drag-active': !column.fixed && !isDisabledDrag && (isCrossDrag || isPeerDrag || !column.parentId),
|
|
7322
7265
|
'is--drag-disabled': isDisabledDrag,
|
|
7323
7266
|
'col--current': currentColumn === column
|
|
7324
|
-
}, headerClassName ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(headerClassName) ? headerClassName(
|
|
7325
|
-
style: headerCellStyle ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(headerCellStyle) ? headerCellStyle(
|
|
7267
|
+
}, headerClassName ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(headerClassName) ? headerClassName(cellParams) : headerClassName : '', headerCellClassName ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(headerCellClassName) ? headerCellClassName(cellParams) : headerCellClassName : ''],
|
|
7268
|
+
style: headerCellStyle ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(headerCellStyle) ? headerCellStyle(cellParams) : headerCellStyle : null,
|
|
7326
7269
|
...thAttrs,
|
|
7327
7270
|
...thOns,
|
|
7328
7271
|
key: columnKey || scrollXLoad || scrollYLoad || columnOpts.useKey || columnOpts.drag || isColGroup ? colid : $columnIndex
|
|
@@ -7331,17 +7274,21 @@ const header_renderType = 'header';
|
|
|
7331
7274
|
'c--title': showTitle,
|
|
7332
7275
|
'c--tooltip': showTooltip,
|
|
7333
7276
|
'c--ellipsis': showEllipsis
|
|
7334
|
-
}]
|
|
7335
|
-
|
|
7277
|
+
}],
|
|
7278
|
+
style: tcStyle
|
|
7279
|
+
}, isVNPreEmptyStatus || isOptimizeMode && fixedHiddenColumn ? [] : [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
7280
|
+
colid,
|
|
7281
|
+
class: 'vxe-cell--wrapper'
|
|
7282
|
+
}, column.renderHeader(cellParams))]),
|
|
7336
7283
|
/**
|
|
7337
7284
|
* 列宽拖动
|
|
7338
7285
|
*/
|
|
7339
7286
|
!fixedHiddenColumn && showResizable ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
7340
|
-
class: ['vxe-resizable', {
|
|
7287
|
+
class: ['vxe-cell--col-resizable', {
|
|
7341
7288
|
'is--line': !border || border === 'none'
|
|
7342
7289
|
}],
|
|
7343
|
-
onMousedown: evnt =>
|
|
7344
|
-
onDblclick: evnt => $xeTable.
|
|
7290
|
+
onMousedown: evnt => $xeTable.handleColResizeMousedownEvent(evnt, fixedType, cellParams),
|
|
7291
|
+
onDblclick: evnt => $xeTable.handleColResizeDblclickEvent(evnt, cellParams)
|
|
7345
7292
|
}) : header_renderEmptyElement($xeTable)]);
|
|
7346
7293
|
});
|
|
7347
7294
|
};
|
|
@@ -7354,6 +7301,7 @@ const header_renderType = 'header';
|
|
|
7354
7301
|
headerRowStyle
|
|
7355
7302
|
} = tableProps;
|
|
7356
7303
|
const {
|
|
7304
|
+
isColLoading,
|
|
7357
7305
|
isDragColMove
|
|
7358
7306
|
} = tableReactData;
|
|
7359
7307
|
const columnOpts = computeColumnOpts.value;
|
|
@@ -7365,7 +7313,7 @@ const header_renderType = 'header';
|
|
|
7365
7313
|
fixed: fixedType,
|
|
7366
7314
|
type: header_renderType
|
|
7367
7315
|
};
|
|
7368
|
-
if (columnOpts.drag && columnDragOpts.animation) {
|
|
7316
|
+
if (!isColLoading && columnOpts.drag && columnDragOpts.animation) {
|
|
7369
7317
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(external_commonjs_vue_commonjs2_vue_root_Vue_.TransitionGroup, {
|
|
7370
7318
|
key: $rowIndex,
|
|
7371
7319
|
name: `vxe-header--col-list${isDragColMove ? '' : '-disabled'}`,
|
|
@@ -7390,6 +7338,7 @@ const header_renderType = 'header';
|
|
|
7390
7338
|
tableColumn
|
|
7391
7339
|
} = props;
|
|
7392
7340
|
const {
|
|
7341
|
+
mouseConfig,
|
|
7393
7342
|
showHeaderOverflow: allColumnHeaderOverflow,
|
|
7394
7343
|
spanMethod,
|
|
7395
7344
|
footerSpanMethod
|
|
@@ -7404,6 +7353,7 @@ const header_renderType = 'header';
|
|
|
7404
7353
|
visibleColumn,
|
|
7405
7354
|
fullColumnIdData
|
|
7406
7355
|
} = tableInternalData;
|
|
7356
|
+
const mouseOpts = computeMouseOpts.value;
|
|
7407
7357
|
let renderHeaderList = headerColumn.value;
|
|
7408
7358
|
let renderColumnList = tableColumn;
|
|
7409
7359
|
let isOptimizeMode = false;
|
|
@@ -7490,14 +7440,21 @@ const header_renderType = 'header';
|
|
|
7490
7440
|
*/
|
|
7491
7441
|
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('thead', {
|
|
7492
7442
|
ref: refHeaderTHead
|
|
7493
|
-
}, renderHeads(isGroup, isOptimizeMode, renderHeaderList))])
|
|
7494
|
-
|
|
7495
|
-
|
|
7496
|
-
|
|
7497
|
-
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('
|
|
7498
|
-
|
|
7499
|
-
|
|
7500
|
-
|
|
7443
|
+
}, renderHeads(isGroup, isOptimizeMode, renderHeaderList))]), mouseConfig && mouseOpts.area ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
7444
|
+
class: 'vxe-table--cell-area'
|
|
7445
|
+
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
|
|
7446
|
+
class: 'vxe-table--cell-main-area'
|
|
7447
|
+
}), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
|
|
7448
|
+
class: 'vxe-table--cell-copy-area'
|
|
7449
|
+
}), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
|
|
7450
|
+
class: 'vxe-table--cell-extend-area'
|
|
7451
|
+
}), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
|
|
7452
|
+
class: 'vxe-table--cell-multi-area'
|
|
7453
|
+
}), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
|
|
7454
|
+
class: 'vxe-table--cell-active-area'
|
|
7455
|
+
}), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
|
|
7456
|
+
class: 'vxe-table--cell-col-status-area'
|
|
7457
|
+
})]) : header_renderEmptyElement($xeTable)])]);
|
|
7501
7458
|
};
|
|
7502
7459
|
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.tableColumn, uploadColumn);
|
|
7503
7460
|
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.onMounted)(() => {
|
|
@@ -7550,6 +7507,7 @@ const header_renderType = 'header';
|
|
|
7550
7507
|
|
|
7551
7508
|
|
|
7552
7509
|
|
|
7510
|
+
|
|
7553
7511
|
const {
|
|
7554
7512
|
renderer: footer_renderer,
|
|
7555
7513
|
renderEmptyElement: footer_renderEmptyElement
|
|
@@ -7610,7 +7568,11 @@ function mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex) {
|
|
|
7610
7568
|
const {
|
|
7611
7569
|
computeTooltipOpts,
|
|
7612
7570
|
computeColumnOpts,
|
|
7613
|
-
computeColumnDragOpts
|
|
7571
|
+
computeColumnDragOpts,
|
|
7572
|
+
computeCellOpts,
|
|
7573
|
+
computeFooterCellOpts,
|
|
7574
|
+
computeDefaultRowHeight,
|
|
7575
|
+
computeResizableOpts
|
|
7614
7576
|
} = $xeTable.getComputeMaps();
|
|
7615
7577
|
const refElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
7616
7578
|
const refFooterScroll = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
@@ -7623,6 +7585,8 @@ function mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex) {
|
|
|
7623
7585
|
fixedType
|
|
7624
7586
|
} = props;
|
|
7625
7587
|
const {
|
|
7588
|
+
resizable: allResizable,
|
|
7589
|
+
border,
|
|
7626
7590
|
footerCellClassName,
|
|
7627
7591
|
footerCellStyle,
|
|
7628
7592
|
footerAlign: allFooterAlign,
|
|
@@ -7642,7 +7606,15 @@ function mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex) {
|
|
|
7642
7606
|
scrollXStore
|
|
7643
7607
|
} = tableInternalData;
|
|
7644
7608
|
const tooltipOpts = computeTooltipOpts.value;
|
|
7609
|
+
const resizableOpts = computeResizableOpts.value;
|
|
7610
|
+
const {
|
|
7611
|
+
isAllColumnDrag
|
|
7612
|
+
} = resizableOpts;
|
|
7645
7613
|
const columnOpts = computeColumnOpts.value;
|
|
7614
|
+
const defaultRowHeight = computeDefaultRowHeight.value;
|
|
7615
|
+
const cellOpts = computeCellOpts.value;
|
|
7616
|
+
const footerCellOpts = computeFooterCellOpts.value;
|
|
7617
|
+
const currCellHeight = getCellHeight(footerCellOpts.height || cellOpts.height) || defaultRowHeight;
|
|
7646
7618
|
return tableColumn.map((column, $columnIndex) => {
|
|
7647
7619
|
const {
|
|
7648
7620
|
type,
|
|
@@ -7653,19 +7625,22 @@ function mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex) {
|
|
|
7653
7625
|
editRender,
|
|
7654
7626
|
cellRender
|
|
7655
7627
|
} = column;
|
|
7628
|
+
const colid = column.id;
|
|
7656
7629
|
const renderOpts = editRender || cellRender;
|
|
7657
7630
|
const compConf = renderOpts ? footer_renderer.get(renderOpts.name) : null;
|
|
7658
7631
|
const showAllTip = tooltipOpts.showAll;
|
|
7659
7632
|
const isColGroup = column.children && column.children.length;
|
|
7660
7633
|
const fixedHiddenColumn = fixedType ? column.fixed !== fixedType && !isColGroup : column.fixed && overflowX;
|
|
7634
|
+
const isPadding = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(footerCellOpts.padding) ? footerCellOpts.padding : cellOpts.padding;
|
|
7661
7635
|
const footOverflow = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(showFooterOverflow) ? allColumnFooterOverflow : showFooterOverflow;
|
|
7662
7636
|
const footAlign = footerAlign || (compConf ? compConf.tableFooterCellAlign : '') || allFooterAlign || align || (compConf ? compConf.tableCellAlign : '') || allAlign;
|
|
7663
7637
|
let showEllipsis = footOverflow === 'ellipsis';
|
|
7664
7638
|
const showTitle = footOverflow === 'title';
|
|
7665
7639
|
const showTooltip = footOverflow === true || footOverflow === 'tooltip';
|
|
7666
7640
|
let hasEllipsis = showTitle || showTooltip || showEllipsis;
|
|
7641
|
+
const showResizable = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(column.resizable) ? column.resizable : columnOpts.resizable || allResizable;
|
|
7667
7642
|
const attrs = {
|
|
7668
|
-
colid
|
|
7643
|
+
colid
|
|
7669
7644
|
};
|
|
7670
7645
|
const tfOns = {};
|
|
7671
7646
|
const columnIndex = $xeTable.getColumnIndex(column);
|
|
@@ -7754,9 +7729,15 @@ function mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex) {
|
|
|
7754
7729
|
}
|
|
7755
7730
|
const isLastColumn = $columnIndex === tableColumn.length - 1;
|
|
7756
7731
|
const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto');
|
|
7757
|
-
let
|
|
7758
|
-
if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex || _columnIndex > scrollXStore.visibleEndIndex)) {
|
|
7759
|
-
|
|
7732
|
+
let isVNPreEmptyStatus = false;
|
|
7733
|
+
if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
|
|
7734
|
+
isVNPreEmptyStatus = true;
|
|
7735
|
+
}
|
|
7736
|
+
const tcStyle = {};
|
|
7737
|
+
if (hasEllipsis) {
|
|
7738
|
+
tcStyle.height = `${currCellHeight}px`;
|
|
7739
|
+
} else {
|
|
7740
|
+
tcStyle.minHeight = `${currCellHeight}px`;
|
|
7760
7741
|
}
|
|
7761
7742
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('td', {
|
|
7762
7743
|
class: ['vxe-footer--column', column.id, {
|
|
@@ -7765,6 +7746,7 @@ function mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex) {
|
|
|
7765
7746
|
'col--last': isLastColumn,
|
|
7766
7747
|
'fixed--width': !isAutoCellWidth,
|
|
7767
7748
|
'fixed--hidden': fixedHiddenColumn,
|
|
7749
|
+
'is--padding': isPadding,
|
|
7768
7750
|
'col--ellipsis': hasEllipsis,
|
|
7769
7751
|
'col--current': currentColumn === column
|
|
7770
7752
|
}, getPropClass(footerClassName, cellParams), getPropClass(footerCellClassName, cellParams)],
|
|
@@ -7777,8 +7759,22 @@ function mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex) {
|
|
|
7777
7759
|
'c--title': showTitle,
|
|
7778
7760
|
'c--tooltip': showTooltip,
|
|
7779
7761
|
'c--ellipsis': showEllipsis
|
|
7780
|
-
}]
|
|
7781
|
-
|
|
7762
|
+
}],
|
|
7763
|
+
style: tcStyle
|
|
7764
|
+
}, isVNPreEmptyStatus ? [] : [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
7765
|
+
colid,
|
|
7766
|
+
class: 'vxe-cell--wrapper'
|
|
7767
|
+
}, column.renderFooter(cellParams))]),
|
|
7768
|
+
/**
|
|
7769
|
+
* 列宽拖动
|
|
7770
|
+
*/
|
|
7771
|
+
!fixedHiddenColumn && showResizable && isAllColumnDrag ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
7772
|
+
class: ['vxe-cell--col-resizable', {
|
|
7773
|
+
'is--line': !border || border === 'none'
|
|
7774
|
+
}],
|
|
7775
|
+
onMousedown: evnt => $xeTable.handleColResizeMousedownEvent(evnt, fixedType, cellParams),
|
|
7776
|
+
onDblclick: evnt => $xeTable.handleColResizeDblclickEvent(evnt, cellParams)
|
|
7777
|
+
}) : footer_renderEmptyElement($xeTable)]);
|
|
7782
7778
|
});
|
|
7783
7779
|
};
|
|
7784
7780
|
const renderHeads = renderColumnList => {
|
|
@@ -7791,6 +7787,7 @@ function mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex) {
|
|
|
7791
7787
|
footerRowStyle
|
|
7792
7788
|
} = tableProps;
|
|
7793
7789
|
const {
|
|
7790
|
+
isColLoading,
|
|
7794
7791
|
isDragColMove
|
|
7795
7792
|
} = tableReactData;
|
|
7796
7793
|
const columnOpts = computeColumnOpts.value;
|
|
@@ -7805,7 +7802,7 @@ function mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex) {
|
|
|
7805
7802
|
fixed: fixedType,
|
|
7806
7803
|
type: footer_renderType
|
|
7807
7804
|
};
|
|
7808
|
-
if (columnOpts.drag && columnDragOpts.animation) {
|
|
7805
|
+
if (!isColLoading && columnOpts.drag && columnDragOpts.animation) {
|
|
7809
7806
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(external_commonjs_vue_commonjs2_vue_root_Vue_.TransitionGroup, {
|
|
7810
7807
|
key: $rowIndex,
|
|
7811
7808
|
name: `vxe-header--col-list${isDragColMove ? '' : '-disabled'}`,
|
|
@@ -7992,10 +7989,10 @@ const {
|
|
|
7992
7989
|
type: [Boolean, String],
|
|
7993
7990
|
default: () => props_getConfig().table.border
|
|
7994
7991
|
},
|
|
7995
|
-
//
|
|
7992
|
+
// 已废弃,被 cell-config.padding 替换
|
|
7996
7993
|
padding: {
|
|
7997
7994
|
type: Boolean,
|
|
7998
|
-
default:
|
|
7995
|
+
default: null
|
|
7999
7996
|
},
|
|
8000
7997
|
// 是否圆角边框
|
|
8001
7998
|
round: {
|
|
@@ -8044,12 +8041,18 @@ const {
|
|
|
8044
8041
|
type: Boolean,
|
|
8045
8042
|
default: () => props_getConfig().table.highlightHoverRow
|
|
8046
8043
|
},
|
|
8047
|
-
|
|
8044
|
+
/**
|
|
8045
|
+
* (即将废弃)是否要高亮当前选中列
|
|
8046
|
+
* @deprecated
|
|
8047
|
+
*/
|
|
8048
8048
|
highlightCurrentColumn: {
|
|
8049
8049
|
type: Boolean,
|
|
8050
8050
|
default: () => props_getConfig().table.highlightCurrentColumn
|
|
8051
8051
|
},
|
|
8052
|
-
|
|
8052
|
+
/**
|
|
8053
|
+
* (即将废弃)鼠标移到列是否要高亮显示
|
|
8054
|
+
* @deprecated
|
|
8055
|
+
*/
|
|
8053
8056
|
highlightHoverColumn: {
|
|
8054
8057
|
type: Boolean,
|
|
8055
8058
|
default: () => props_getConfig().table.highlightHoverColumn
|
|
@@ -8141,6 +8144,10 @@ const {
|
|
|
8141
8144
|
columnConfig: Object,
|
|
8142
8145
|
// 单元格配置信息
|
|
8143
8146
|
cellConfig: Object,
|
|
8147
|
+
// 表头单元格配置信息
|
|
8148
|
+
headerCellConfig: Object,
|
|
8149
|
+
// 表尾单元格配置信息
|
|
8150
|
+
footerCellConfig: Object,
|
|
8144
8151
|
// 行配置信息
|
|
8145
8152
|
rowConfig: Object,
|
|
8146
8153
|
// 已废弃,被 rowDragConfig 替换
|
|
@@ -8221,7 +8228,7 @@ const {
|
|
|
8221
8228
|
params: Object
|
|
8222
8229
|
});
|
|
8223
8230
|
;// ./packages/table/src/emits.ts
|
|
8224
|
-
/* harmony default export */ var emits = (['update:data', 'keydown-start', 'keydown', 'keydown-end', 'paste', 'copy', 'cut', 'current-change', 'radio-change', 'checkbox-change', 'checkbox-all', 'checkbox-range-start', 'checkbox-range-change', 'checkbox-range-end', 'checkbox-range-select', 'cell-click', 'cell-dblclick', 'cell-menu', 'cell-mouseenter', 'cell-mouseleave', 'cell-selected', 'cell-delete-value', 'cell-backspace-value', 'header-cell-click', 'header-cell-dblclick', 'header-cell-menu', 'footer-cell-click', 'footer-cell-dblclick', 'footer-cell-menu', 'clear-merge', 'sort-change', 'clear-sort', 'filter-change', 'filter-visible', 'clear-filter', 'resizable-change', 'toggle-row-expand', 'toggle-tree-expand', 'menu-click', 'edit-closed', 'row-dragstart', 'row-dragover', 'row-dragend', 'column-dragstart', 'column-dragover', 'column-dragend', 'enter-append-row', 'edit-actived', 'edit-activated', 'edit-disabled', 'valid-error', 'scroll', 'scroll-boundary', 'custom', 'change-fnr', 'open-fnr', 'show-fnr', 'hide-fnr', 'fnr-change', 'fnr-find', 'fnr-find-all', 'fnr-replace', 'fnr-replace-all', 'cell-area-copy', 'cell-area-cut', 'cell-area-paste', 'cell-area-merge', 'clear-cell-area-selection', 'clear-cell-area-merge', 'header-cell-area-selection', 'cell-area-selection-invalid', 'cell-area-selection-start', 'cell-area-selection-drag', 'cell-area-selection-end', 'cell-area-extension-start', 'cell-area-extension-drag', 'cell-area-extension-end', 'cell-area-selection-all-start', 'cell-area-selection-all-end', 'cell-area-arrows-start', 'cell-area-arrows-end', 'active-cell-change-start', 'active-cell-change-end']);
|
|
8231
|
+
/* harmony default export */ var emits = (['update:data', 'keydown-start', 'keydown', 'keydown-end', 'paste', 'copy', 'cut', 'current-change', 'radio-change', 'checkbox-change', 'checkbox-all', 'checkbox-range-start', 'checkbox-range-change', 'checkbox-range-end', 'checkbox-range-select', 'cell-click', 'cell-dblclick', 'cell-menu', 'cell-mouseenter', 'cell-mouseleave', 'cell-selected', 'cell-delete-value', 'cell-backspace-value', 'header-cell-click', 'header-cell-dblclick', 'header-cell-menu', 'footer-cell-click', 'footer-cell-dblclick', 'footer-cell-menu', 'clear-merge', 'sort-change', 'clear-sort', 'filter-change', 'filter-visible', 'clear-filter', 'resizable-change', 'column-resizable-change', 'row-resizable-change', 'toggle-row-expand', 'toggle-tree-expand', 'menu-click', 'edit-closed', 'row-dragstart', 'row-dragover', 'row-dragend', 'column-dragstart', 'column-dragover', 'column-dragend', 'enter-append-row', 'edit-actived', 'edit-activated', 'edit-disabled', 'valid-error', 'scroll', 'scroll-boundary', 'custom', 'change-fnr', 'open-fnr', 'show-fnr', 'hide-fnr', 'fnr-change', 'fnr-find', 'fnr-find-all', 'fnr-replace', 'fnr-replace-all', 'cell-area-copy', 'cell-area-cut', 'cell-area-paste', 'cell-area-merge', 'clear-cell-area-selection', 'clear-cell-area-merge', 'header-cell-area-selection', 'cell-area-selection-invalid', 'cell-area-selection-start', 'cell-area-selection-drag', 'cell-area-selection-end', 'cell-area-extension-start', 'cell-area-extension-drag', 'cell-area-extension-end', 'cell-area-selection-all-start', 'cell-area-selection-all-end', 'cell-area-arrows-start', 'cell-area-arrows-end', 'active-cell-change-start', 'active-cell-change-end']);
|
|
8225
8232
|
;// ./packages/table/module/custom/panel.ts
|
|
8226
8233
|
|
|
8227
8234
|
|
|
@@ -10332,7 +10339,6 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
10332
10339
|
computeSize
|
|
10333
10340
|
} = useFns.useSize(props);
|
|
10334
10341
|
const reactData = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.reactive)({
|
|
10335
|
-
isCalcColumn: false,
|
|
10336
10342
|
// 低性能的静态列
|
|
10337
10343
|
staticColumns: [],
|
|
10338
10344
|
// 渲染的列分组
|
|
@@ -10545,15 +10551,17 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
10545
10551
|
isFooter: false
|
|
10546
10552
|
},
|
|
10547
10553
|
scrollVMLoading: false,
|
|
10548
|
-
|
|
10554
|
+
calcCellHeightFlag: 0,
|
|
10555
|
+
resizeHeightFlag: 0,
|
|
10549
10556
|
isCustomStatus: false,
|
|
10550
10557
|
isDragRowMove: false,
|
|
10551
10558
|
dragRow: null,
|
|
10552
10559
|
isDragColMove: false,
|
|
10553
10560
|
dragCol: null,
|
|
10554
10561
|
dragTipText: '',
|
|
10555
|
-
|
|
10556
|
-
|
|
10562
|
+
isDragResize: false,
|
|
10563
|
+
isRowLoading: false,
|
|
10564
|
+
isColLoading: false
|
|
10557
10565
|
});
|
|
10558
10566
|
const internalData = {
|
|
10559
10567
|
tZindex: 0,
|
|
@@ -10627,10 +10635,6 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
10627
10635
|
fullDataRowIdData: {},
|
|
10628
10636
|
fullColumnIdData: {},
|
|
10629
10637
|
fullColumnFieldData: {},
|
|
10630
|
-
// 列选取状态
|
|
10631
|
-
columnStatusMaps: {},
|
|
10632
|
-
// 行选取状态
|
|
10633
|
-
rowStatusMaps: {},
|
|
10634
10638
|
// prevDragRow: null,
|
|
10635
10639
|
inited: false,
|
|
10636
10640
|
tooltipTimeout: null,
|
|
@@ -10658,8 +10662,8 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
10658
10662
|
const refTableRightFooter = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
10659
10663
|
const refLeftContainer = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
10660
10664
|
const refRightContainer = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
10661
|
-
const
|
|
10662
|
-
const
|
|
10665
|
+
const refColResizeBar = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
10666
|
+
const refRowResizeBar = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
10663
10667
|
const refEmptyPlaceholder = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
10664
10668
|
const refDragTipElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
10665
10669
|
const refDragRowLineElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
@@ -10758,7 +10762,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
10758
10762
|
const computeDefaultRowHeight = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
10759
10763
|
const vSize = computeSize.value;
|
|
10760
10764
|
const rowHeightMaps = computeRowHeightMaps.value;
|
|
10761
|
-
return rowHeightMaps[vSize || 'default'];
|
|
10765
|
+
return rowHeightMaps[vSize || 'default'] || 18;
|
|
10762
10766
|
});
|
|
10763
10767
|
const computeColumnOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
10764
10768
|
return Object.assign({}, table_getConfig().table.columnConfig, props.columnConfig);
|
|
@@ -10766,6 +10770,12 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
10766
10770
|
const computeCellOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
10767
10771
|
return Object.assign({}, table_getConfig().table.cellConfig, props.cellConfig);
|
|
10768
10772
|
});
|
|
10773
|
+
const computeHeaderCellOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
10774
|
+
return Object.assign({}, table_getConfig().table.headerCellConfig, props.headerCellConfig);
|
|
10775
|
+
});
|
|
10776
|
+
const computeFooterCellOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
10777
|
+
return Object.assign({}, table_getConfig().table.footerCellConfig, props.footerCellConfig);
|
|
10778
|
+
});
|
|
10769
10779
|
const computeRowOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
10770
10780
|
return Object.assign({}, table_getConfig().table.rowConfig, props.rowConfig);
|
|
10771
10781
|
});
|
|
@@ -10795,6 +10805,17 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
10795
10805
|
const computeTooltipOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
10796
10806
|
return Object.assign({}, table_getConfig().tooltip, table_getConfig().table.tooltipConfig, props.tooltipConfig);
|
|
10797
10807
|
});
|
|
10808
|
+
const computeTableTipConfig = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
10809
|
+
const {
|
|
10810
|
+
tooltipStore
|
|
10811
|
+
} = reactData;
|
|
10812
|
+
const tooltipOpts = computeTooltipOpts.value;
|
|
10813
|
+
return Object.assign({}, tooltipOpts, tooltipStore.currOpts);
|
|
10814
|
+
});
|
|
10815
|
+
const computeValidTipConfig = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
10816
|
+
const tooltipOpts = computeTooltipOpts.value;
|
|
10817
|
+
return Object.assign({}, tooltipOpts);
|
|
10818
|
+
});
|
|
10798
10819
|
const computeEditOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
10799
10820
|
return Object.assign({}, table_getConfig().table.editConfig, props.editConfig);
|
|
10800
10821
|
});
|
|
@@ -11025,8 +11046,8 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
11025
11046
|
refTableRightFooter,
|
|
11026
11047
|
refLeftContainer,
|
|
11027
11048
|
refRightContainer,
|
|
11028
|
-
|
|
11029
|
-
|
|
11049
|
+
refColResizeBar,
|
|
11050
|
+
refRowResizeBar,
|
|
11030
11051
|
refScrollXVirtualElem,
|
|
11031
11052
|
refScrollYVirtualElem,
|
|
11032
11053
|
refScrollXHandleElem,
|
|
@@ -11048,6 +11069,8 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
11048
11069
|
computeScrollYThreshold,
|
|
11049
11070
|
computeDefaultRowHeight,
|
|
11050
11071
|
computeCellOpts,
|
|
11072
|
+
computeHeaderCellOpts,
|
|
11073
|
+
computeFooterCellOpts,
|
|
11051
11074
|
computeRowOpts,
|
|
11052
11075
|
computeRowDragOpts,
|
|
11053
11076
|
computeColumnDragOpts,
|
|
@@ -11198,59 +11221,66 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
11198
11221
|
};
|
|
11199
11222
|
};
|
|
11200
11223
|
const computeRowHeight = () => {
|
|
11224
|
+
const {
|
|
11225
|
+
isAllOverflow
|
|
11226
|
+
} = reactData;
|
|
11201
11227
|
const tableHeader = refTableHeader.value;
|
|
11202
11228
|
const tableBody = refTableBody.value;
|
|
11203
11229
|
const tableBodyElem = tableBody ? tableBody.$el : null;
|
|
11204
11230
|
const defaultRowHeight = computeDefaultRowHeight.value;
|
|
11205
11231
|
let rowHeight = 0;
|
|
11206
|
-
if (
|
|
11207
|
-
|
|
11208
|
-
|
|
11209
|
-
|
|
11210
|
-
|
|
11211
|
-
firstTrElem
|
|
11232
|
+
if (isAllOverflow) {
|
|
11233
|
+
if (tableBodyElem) {
|
|
11234
|
+
const tableHeaderElem = tableHeader ? tableHeader.$el : null;
|
|
11235
|
+
let firstTrElem;
|
|
11236
|
+
firstTrElem = tableBodyElem.querySelector('tr');
|
|
11237
|
+
if (!firstTrElem && tableHeaderElem) {
|
|
11238
|
+
firstTrElem = tableHeaderElem.querySelector('tr');
|
|
11239
|
+
}
|
|
11240
|
+
if (firstTrElem) {
|
|
11241
|
+
rowHeight = firstTrElem.clientHeight;
|
|
11242
|
+
}
|
|
11212
11243
|
}
|
|
11213
|
-
if (
|
|
11214
|
-
rowHeight =
|
|
11244
|
+
if (!rowHeight) {
|
|
11245
|
+
rowHeight = defaultRowHeight;
|
|
11215
11246
|
}
|
|
11216
|
-
}
|
|
11217
|
-
if (!rowHeight) {
|
|
11247
|
+
} else {
|
|
11218
11248
|
rowHeight = defaultRowHeight;
|
|
11219
11249
|
}
|
|
11220
11250
|
// 最低支持 18px 行高
|
|
11221
11251
|
return Math.max(18, rowHeight);
|
|
11222
11252
|
};
|
|
11223
|
-
const handleVirtualYVisible =
|
|
11224
|
-
const {
|
|
11225
|
-
showOverflow
|
|
11226
|
-
} = props;
|
|
11253
|
+
const handleVirtualYVisible = currScrollTop => {
|
|
11227
11254
|
const {
|
|
11228
|
-
|
|
11255
|
+
isAllOverflow
|
|
11229
11256
|
} = reactData;
|
|
11230
11257
|
const {
|
|
11231
11258
|
elemStore,
|
|
11259
|
+
isResizeCellHeight,
|
|
11232
11260
|
afterFullData,
|
|
11233
11261
|
fullAllDataRowIdData
|
|
11234
11262
|
} = internalData;
|
|
11263
|
+
const rowOpts = computeRowOpts.value;
|
|
11264
|
+
const cellOpts = computeCellOpts.value;
|
|
11265
|
+
const defaultRowHeight = computeDefaultRowHeight.value;
|
|
11235
11266
|
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
11236
11267
|
if (bodyScrollElem) {
|
|
11237
|
-
const
|
|
11238
|
-
|
|
11239
|
-
clientHeight
|
|
11240
|
-
} = bodyScrollElem;
|
|
11268
|
+
const clientHeight = bodyScrollElem.clientHeight;
|
|
11269
|
+
const scrollTop = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isNumber(currScrollTop) ? currScrollTop : bodyScrollElem.scrollTop;
|
|
11241
11270
|
const endHeight = scrollTop + clientHeight;
|
|
11242
11271
|
let toVisibleIndex = -1;
|
|
11243
11272
|
let offsetTop = 0;
|
|
11244
11273
|
let visibleSize = 0;
|
|
11245
|
-
|
|
11246
|
-
|
|
11247
|
-
|
|
11274
|
+
const isCustomCellHeight = isResizeCellHeight || cellOpts.height || rowOpts.height;
|
|
11275
|
+
if (!isCustomCellHeight && isAllOverflow) {
|
|
11276
|
+
toVisibleIndex = Math.floor(scrollTop / defaultRowHeight);
|
|
11277
|
+
visibleSize = Math.ceil(clientHeight / defaultRowHeight) + 1;
|
|
11248
11278
|
} else {
|
|
11249
11279
|
for (let rIndex = 0, rLen = afterFullData.length; rIndex < rLen; rIndex++) {
|
|
11250
11280
|
const row = afterFullData[rIndex];
|
|
11251
11281
|
const rowid = getRowid($xeTable, row);
|
|
11252
|
-
const rowRest = fullAllDataRowIdData[rowid];
|
|
11253
|
-
offsetTop += rowRest
|
|
11282
|
+
const rowRest = fullAllDataRowIdData[rowid] || {};
|
|
11283
|
+
offsetTop += rowRest.resizeHeight || rowRest.height || cellOpts.height || rowOpts.height || defaultRowHeight;
|
|
11254
11284
|
if (toVisibleIndex === -1 && scrollTop < offsetTop) {
|
|
11255
11285
|
toVisibleIndex = rIndex;
|
|
11256
11286
|
}
|
|
@@ -11641,56 +11671,40 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
11641
11671
|
internalData.customMaxHeight = calcTableHeight('maxHeight');
|
|
11642
11672
|
};
|
|
11643
11673
|
const calcColumnAutoWidth = (column, wrapperEl) => {
|
|
11644
|
-
const
|
|
11645
|
-
|
|
11646
|
-
|
|
11647
|
-
if (firstCellEl) {
|
|
11648
|
-
const cellStyle = getComputedStyle(firstCellEl);
|
|
11649
|
-
|
|
11650
|
-
}
|
|
11651
|
-
let colWidth = column.renderAutoWidth -
|
|
11652
|
-
|
|
11653
|
-
const
|
|
11654
|
-
|
|
11655
|
-
|
|
11656
|
-
|
|
11657
|
-
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(cellEl.children, btnEl => {
|
|
11658
|
-
titleWidth += btnEl.offsetWidth + 1;
|
|
11659
|
-
});
|
|
11660
|
-
} else {
|
|
11661
|
-
const labelEl = cellEl.firstElementChild;
|
|
11662
|
-
if (labelEl) {
|
|
11663
|
-
titleWidth = labelEl.offsetWidth;
|
|
11664
|
-
}
|
|
11665
|
-
}
|
|
11666
|
-
if (titleWidth) {
|
|
11667
|
-
colWidth = Math.max(colWidth, Math.ceil(titleWidth) + 4);
|
|
11668
|
-
}
|
|
11669
|
-
});
|
|
11670
|
-
return colWidth + paddingSize;
|
|
11674
|
+
const cellElemList = wrapperEl.querySelectorAll(`.vxe-cell--wrapper[colid="${column.id}"]`);
|
|
11675
|
+
let leftRightPadding = 0;
|
|
11676
|
+
const firstCellEl = cellElemList[0];
|
|
11677
|
+
if (firstCellEl && firstCellEl.parentElement) {
|
|
11678
|
+
const cellStyle = getComputedStyle(firstCellEl.parentElement);
|
|
11679
|
+
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));
|
|
11680
|
+
}
|
|
11681
|
+
let colWidth = column.renderAutoWidth - leftRightPadding;
|
|
11682
|
+
for (let i = 0; i < cellElemList.length; i++) {
|
|
11683
|
+
const celEl = cellElemList[i];
|
|
11684
|
+
colWidth = Math.max(colWidth, celEl ? Math.ceil(celEl.scrollWidth) + 4 : 0);
|
|
11685
|
+
}
|
|
11686
|
+
return colWidth + leftRightPadding;
|
|
11671
11687
|
};
|
|
11672
11688
|
const calcCellWidth = () => {
|
|
11673
11689
|
const autoWidthColumnList = computeAutoWidthColumnList.value;
|
|
11674
|
-
|
|
11675
|
-
|
|
11676
|
-
|
|
11677
|
-
|
|
11678
|
-
|
|
11679
|
-
|
|
11680
|
-
|
|
11681
|
-
|
|
11682
|
-
|
|
11683
|
-
|
|
11684
|
-
|
|
11685
|
-
|
|
11686
|
-
|
|
11687
|
-
|
|
11688
|
-
|
|
11689
|
-
|
|
11690
|
-
|
|
11691
|
-
|
|
11692
|
-
reactData.isCalcColumn = false;
|
|
11693
|
-
});
|
|
11690
|
+
const {
|
|
11691
|
+
fullColumnIdData
|
|
11692
|
+
} = internalData;
|
|
11693
|
+
const el = refElem.value;
|
|
11694
|
+
if (el) {
|
|
11695
|
+
el.setAttribute('data-calc-col', 'Y');
|
|
11696
|
+
autoWidthColumnList.forEach(column => {
|
|
11697
|
+
const colid = column.id;
|
|
11698
|
+
const colRest = fullColumnIdData[colid];
|
|
11699
|
+
const colWidth = calcColumnAutoWidth(column, el);
|
|
11700
|
+
if (colRest) {
|
|
11701
|
+
colRest.width = Math.max(colWidth, colRest.width);
|
|
11702
|
+
}
|
|
11703
|
+
column.renderAutoWidth = colWidth;
|
|
11704
|
+
});
|
|
11705
|
+
$xeTable.analyColumnWidth();
|
|
11706
|
+
el.removeAttribute('data-calc-col');
|
|
11707
|
+
}
|
|
11694
11708
|
};
|
|
11695
11709
|
/**
|
|
11696
11710
|
* 列宽算法,计算单元格列宽,动态分配可用剩余空间
|
|
@@ -11746,39 +11760,39 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
11746
11760
|
});
|
|
11747
11761
|
// 最小自适应
|
|
11748
11762
|
autoMinList.forEach(column => {
|
|
11749
|
-
const
|
|
11750
|
-
tableWidth +=
|
|
11751
|
-
column.renderWidth =
|
|
11763
|
+
const caWidth = Math.max(60, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toInteger(column.renderAutoWidth));
|
|
11764
|
+
tableWidth += caWidth;
|
|
11765
|
+
column.renderWidth = caWidth;
|
|
11752
11766
|
});
|
|
11753
11767
|
// 最小百分比
|
|
11754
11768
|
scaleMinList.forEach(column => {
|
|
11755
|
-
const
|
|
11756
|
-
tableWidth +=
|
|
11757
|
-
column.renderWidth =
|
|
11769
|
+
const smWidth = Math.floor(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toInteger(column.minWidth) * meanWidth);
|
|
11770
|
+
tableWidth += smWidth;
|
|
11771
|
+
column.renderWidth = smWidth;
|
|
11758
11772
|
});
|
|
11759
11773
|
// 固定百分比
|
|
11760
11774
|
scaleList.forEach(column => {
|
|
11761
|
-
const
|
|
11762
|
-
tableWidth +=
|
|
11763
|
-
column.renderWidth =
|
|
11775
|
+
const sfWidth = Math.floor(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toInteger(column.width) * meanWidth);
|
|
11776
|
+
tableWidth += sfWidth;
|
|
11777
|
+
column.renderWidth = sfWidth;
|
|
11764
11778
|
});
|
|
11765
11779
|
// 固定宽
|
|
11766
11780
|
pxList.forEach(column => {
|
|
11767
|
-
const
|
|
11768
|
-
tableWidth +=
|
|
11769
|
-
column.renderWidth =
|
|
11781
|
+
const pWidth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toInteger(column.width);
|
|
11782
|
+
tableWidth += pWidth;
|
|
11783
|
+
column.renderWidth = pWidth;
|
|
11770
11784
|
});
|
|
11771
11785
|
// 自适应宽
|
|
11772
11786
|
autoList.forEach(column => {
|
|
11773
|
-
const
|
|
11774
|
-
tableWidth +=
|
|
11775
|
-
column.renderWidth =
|
|
11787
|
+
const aWidth = Math.max(60, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toInteger(column.renderAutoWidth));
|
|
11788
|
+
tableWidth += aWidth;
|
|
11789
|
+
column.renderWidth = aWidth;
|
|
11776
11790
|
});
|
|
11777
11791
|
// 调整了列宽
|
|
11778
11792
|
resizeList.forEach(column => {
|
|
11779
|
-
const
|
|
11780
|
-
tableWidth +=
|
|
11781
|
-
column.renderWidth =
|
|
11793
|
+
const reWidth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toInteger(column.resizeWidth);
|
|
11794
|
+
tableWidth += reWidth;
|
|
11795
|
+
column.renderWidth = reWidth;
|
|
11782
11796
|
});
|
|
11783
11797
|
remainWidth -= tableWidth;
|
|
11784
11798
|
meanWidth = remainWidth > 0 ? Math.floor(remainWidth / (scaleMinList.length + pxMinList.length + autoMinList.length + remainList.length)) : 0;
|
|
@@ -11818,7 +11832,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
11818
11832
|
}
|
|
11819
11833
|
const tableHeight = bodyElem.offsetHeight;
|
|
11820
11834
|
const overflowY = yHandleEl.scrollHeight > yHandleEl.clientHeight;
|
|
11821
|
-
reactData.scrollbarWidth =
|
|
11835
|
+
reactData.scrollbarWidth = Math.max(scrollbarOpts.width || 0, yHandleEl.offsetWidth - yHandleEl.clientWidth);
|
|
11822
11836
|
reactData.overflowY = overflowY;
|
|
11823
11837
|
internalData.tableWidth = tableWidth;
|
|
11824
11838
|
internalData.tableHeight = tableHeight;
|
|
@@ -11827,7 +11841,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
11827
11841
|
const headerHeight = headerTableElem ? headerTableElem.clientHeight : 0;
|
|
11828
11842
|
const overflowX = tableWidth > bodyWidth;
|
|
11829
11843
|
const footerHeight = footerTableElem ? footerTableElem.clientHeight : 0;
|
|
11830
|
-
reactData.scrollbarHeight =
|
|
11844
|
+
reactData.scrollbarHeight = Math.max(scrollbarOpts.height || 0, xHandleEl.offsetHeight - xHandleEl.clientHeight);
|
|
11831
11845
|
internalData.headerHeight = headerHeight;
|
|
11832
11846
|
internalData.footerHeight = footerHeight;
|
|
11833
11847
|
reactData.overflowX = overflowX;
|
|
@@ -11837,64 +11851,43 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
11837
11851
|
$xeTable.checkScrolling();
|
|
11838
11852
|
}
|
|
11839
11853
|
};
|
|
11840
|
-
|
|
11841
|
-
|
|
11842
|
-
|
|
11843
|
-
|
|
11844
|
-
|
|
11845
|
-
|
|
11846
|
-
|
|
11847
|
-
|
|
11848
|
-
|
|
11849
|
-
|
|
11850
|
-
|
|
11851
|
-
|
|
11852
|
-
// }
|
|
11854
|
+
const calcCellAutoHeight = (rowRest, wrapperEl) => {
|
|
11855
|
+
const cellElemList = wrapperEl.querySelectorAll(`.vxe-cell--wrapper[rowid="${rowRest.rowid}"]`);
|
|
11856
|
+
let colHeight = rowRest.height;
|
|
11857
|
+
for (let i = 0; i < cellElemList.length; i++) {
|
|
11858
|
+
const cellElem = cellElemList[i];
|
|
11859
|
+
const tdEl = cellElem.parentElement;
|
|
11860
|
+
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));
|
|
11861
|
+
const cellHeight = cellElem ? cellElem.clientHeight : 0;
|
|
11862
|
+
colHeight = Math.max(colHeight - topBottomPadding, Math.ceil(cellHeight));
|
|
11863
|
+
}
|
|
11864
|
+
return colHeight;
|
|
11865
|
+
};
|
|
11853
11866
|
const calcCellHeight = () => {
|
|
11854
|
-
const {
|
|
11855
|
-
showOverflow
|
|
11856
|
-
} = props;
|
|
11857
11867
|
const {
|
|
11858
11868
|
tableData,
|
|
11869
|
+
isAllOverflow,
|
|
11870
|
+
scrollYLoad,
|
|
11859
11871
|
scrollXLoad
|
|
11860
11872
|
} = reactData;
|
|
11861
11873
|
const {
|
|
11862
11874
|
fullAllDataRowIdData
|
|
11863
11875
|
} = internalData;
|
|
11876
|
+
const defaultRowHeight = computeDefaultRowHeight.value;
|
|
11864
11877
|
const el = refElem.value;
|
|
11865
|
-
if (!
|
|
11866
|
-
|
|
11867
|
-
let paddingBottom = 0;
|
|
11868
|
-
let calcPadding = false;
|
|
11878
|
+
if (!isAllOverflow && scrollYLoad && el) {
|
|
11879
|
+
el.setAttribute('data-calc-row', 'Y');
|
|
11869
11880
|
tableData.forEach(row => {
|
|
11870
11881
|
const rowid = getRowid($xeTable, row);
|
|
11871
11882
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
11872
|
-
|
|
11873
|
-
|
|
11874
|
-
|
|
11875
|
-
for (let i = 0; i < cellList.length; i++) {
|
|
11876
|
-
const cellElem = cellList[i];
|
|
11877
|
-
const tdEl = cellElem.parentElement;
|
|
11878
|
-
if (!tdEl || !tdEl.clientWidth) {
|
|
11879
|
-
break;
|
|
11880
|
-
}
|
|
11881
|
-
if (!calcPadding) {
|
|
11882
|
-
paddingTop = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(getComputedStyle(tdEl).paddingTop);
|
|
11883
|
-
paddingBottom = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(getComputedStyle(tdEl).paddingBottom);
|
|
11884
|
-
calcPadding = true;
|
|
11885
|
-
}
|
|
11886
|
-
let cellHeight = paddingTop + paddingBottom;
|
|
11887
|
-
if (cellElem) {
|
|
11888
|
-
cellHeight += cellElem.clientHeight;
|
|
11889
|
-
}
|
|
11890
|
-
height = Math.max(height, cellHeight);
|
|
11891
|
-
}
|
|
11892
|
-
rowRest.height = scrollXLoad ? Math.max(rowRest.height, height) : height;
|
|
11883
|
+
if (rowRest) {
|
|
11884
|
+
const reHeight = calcCellAutoHeight(rowRest, el);
|
|
11885
|
+
rowRest.height = Math.max(defaultRowHeight, scrollXLoad ? Math.max(rowRest.height, reHeight) : reHeight);
|
|
11893
11886
|
}
|
|
11887
|
+
el.removeAttribute('data-calc-row');
|
|
11894
11888
|
});
|
|
11895
|
-
reactData.
|
|
11889
|
+
reactData.calcCellHeightFlag++;
|
|
11896
11890
|
}
|
|
11897
|
-
// updateCellOffset()
|
|
11898
11891
|
};
|
|
11899
11892
|
const getOrderField = column => {
|
|
11900
11893
|
const {
|
|
@@ -11948,6 +11941,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
11948
11941
|
parent: null,
|
|
11949
11942
|
level: 0,
|
|
11950
11943
|
height: 0,
|
|
11944
|
+
resizeHeight: 0,
|
|
11951
11945
|
oTop: 0
|
|
11952
11946
|
};
|
|
11953
11947
|
fullAllDataRowIdData[rowid] = rest;
|
|
@@ -11997,6 +11991,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
11997
11991
|
parent: null,
|
|
11998
11992
|
level: 0,
|
|
11999
11993
|
height: 0,
|
|
11994
|
+
resizeHeight: 0,
|
|
12000
11995
|
oTop: 0
|
|
12001
11996
|
};
|
|
12002
11997
|
fullAllDataRowIdData[rowid] = rest;
|
|
@@ -12266,7 +12261,6 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
12266
12261
|
const updateStyle = () => {
|
|
12267
12262
|
const {
|
|
12268
12263
|
border,
|
|
12269
|
-
showOverflow: allColumnOverflow,
|
|
12270
12264
|
showHeaderOverflow: allColumnHeaderOverflow,
|
|
12271
12265
|
showFooterOverflow: allColumnFooterOverflow,
|
|
12272
12266
|
mouseConfig,
|
|
@@ -12279,7 +12273,9 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
12279
12273
|
tableColumn,
|
|
12280
12274
|
scrollXLoad,
|
|
12281
12275
|
scrollYLoad,
|
|
12276
|
+
overflowX,
|
|
12282
12277
|
scrollbarWidth,
|
|
12278
|
+
overflowY,
|
|
12283
12279
|
scrollbarHeight,
|
|
12284
12280
|
columnStore,
|
|
12285
12281
|
editStore,
|
|
@@ -12303,6 +12299,8 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
12303
12299
|
return;
|
|
12304
12300
|
}
|
|
12305
12301
|
const containerList = ['main', 'left', 'right'];
|
|
12302
|
+
const osbWidth = overflowY ? scrollbarWidth : 0;
|
|
12303
|
+
const osbHeight = overflowX ? scrollbarHeight : 0;
|
|
12306
12304
|
const emptyPlaceholderElem = refEmptyPlaceholder.value;
|
|
12307
12305
|
const cellOffsetWidth = computeCellOffsetWidth.value;
|
|
12308
12306
|
const mouseOpts = computeMouseOpts.value;
|
|
@@ -12310,16 +12308,16 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
12310
12308
|
const bodyTableElem = getRefElem(elemStore['main-body-table']);
|
|
12311
12309
|
if (emptyPlaceholderElem) {
|
|
12312
12310
|
emptyPlaceholderElem.style.top = `${headerHeight}px`;
|
|
12313
|
-
emptyPlaceholderElem.style.height = bodyWrapperElem ? `${bodyWrapperElem.offsetHeight -
|
|
12311
|
+
emptyPlaceholderElem.style.height = bodyWrapperElem ? `${bodyWrapperElem.offsetHeight - osbHeight}px` : '';
|
|
12314
12312
|
}
|
|
12315
12313
|
let bodyHeight = 0;
|
|
12316
12314
|
let bodyMaxHeight = 0;
|
|
12317
|
-
const bodyMinHeight = customMinHeight - headerHeight - footerHeight -
|
|
12315
|
+
const bodyMinHeight = customMinHeight - headerHeight - footerHeight - osbHeight;
|
|
12318
12316
|
if (customMaxHeight) {
|
|
12319
|
-
bodyMaxHeight = Math.max(bodyMinHeight, customMaxHeight - headerHeight - footerHeight -
|
|
12317
|
+
bodyMaxHeight = Math.max(bodyMinHeight, customMaxHeight - headerHeight - footerHeight - osbHeight);
|
|
12320
12318
|
}
|
|
12321
12319
|
if (customHeight) {
|
|
12322
|
-
bodyHeight = customHeight - headerHeight - footerHeight -
|
|
12320
|
+
bodyHeight = customHeight - headerHeight - footerHeight - osbHeight;
|
|
12323
12321
|
}
|
|
12324
12322
|
if (!bodyHeight) {
|
|
12325
12323
|
if (bodyTableElem) {
|
|
@@ -12337,27 +12335,27 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
12337
12335
|
const scrollbarXToTop = computeScrollbarXToTop.value;
|
|
12338
12336
|
const scrollXVirtualEl = refScrollXVirtualElem.value;
|
|
12339
12337
|
if (scrollXVirtualEl) {
|
|
12340
|
-
scrollXVirtualEl.style.height = `${
|
|
12341
|
-
scrollXVirtualEl.style.visibility =
|
|
12338
|
+
scrollXVirtualEl.style.height = `${osbHeight}px`;
|
|
12339
|
+
scrollXVirtualEl.style.visibility = overflowX ? 'visible' : 'hidden';
|
|
12342
12340
|
}
|
|
12343
12341
|
const xWrapperEl = refScrollXWrapperElem.value;
|
|
12344
12342
|
if (xWrapperEl) {
|
|
12345
|
-
xWrapperEl.style.left = scrollbarXToTop ? `${
|
|
12346
|
-
xWrapperEl.style.width = `${el.clientWidth -
|
|
12343
|
+
xWrapperEl.style.left = scrollbarXToTop ? `${osbWidth}px` : '';
|
|
12344
|
+
xWrapperEl.style.width = `${el.clientWidth - osbWidth}px`;
|
|
12347
12345
|
}
|
|
12348
12346
|
if (xLeftCornerEl) {
|
|
12349
|
-
xLeftCornerEl.style.width = scrollbarXToTop ? `${
|
|
12350
|
-
xLeftCornerEl.style.display = scrollbarXToTop ?
|
|
12347
|
+
xLeftCornerEl.style.width = scrollbarXToTop ? `${osbWidth}px` : '';
|
|
12348
|
+
xLeftCornerEl.style.display = scrollbarXToTop ? osbWidth && osbHeight ? 'block' : '' : '';
|
|
12351
12349
|
}
|
|
12352
12350
|
if (xRightCornerEl) {
|
|
12353
|
-
xRightCornerEl.style.width = scrollbarXToTop ? '' : `${
|
|
12354
|
-
xRightCornerEl.style.display = scrollbarXToTop ? '' :
|
|
12351
|
+
xRightCornerEl.style.width = scrollbarXToTop ? '' : `${osbWidth}px`;
|
|
12352
|
+
xRightCornerEl.style.display = scrollbarXToTop ? '' : osbWidth && osbHeight ? 'block' : '';
|
|
12355
12353
|
}
|
|
12356
12354
|
const scrollYVirtualEl = refScrollYVirtualElem.value;
|
|
12357
12355
|
if (scrollYVirtualEl) {
|
|
12358
|
-
scrollYVirtualEl.style.width = `${
|
|
12356
|
+
scrollYVirtualEl.style.width = `${osbWidth}px`;
|
|
12359
12357
|
scrollYVirtualEl.style.height = `${bodyHeight + headerHeight + footerHeight}px`;
|
|
12360
|
-
scrollYVirtualEl.style.visibility =
|
|
12358
|
+
scrollYVirtualEl.style.visibility = overflowY ? 'visible' : 'hidden';
|
|
12361
12359
|
}
|
|
12362
12360
|
const yTopCornerEl = refScrollYTopCornerElem.value;
|
|
12363
12361
|
if (yTopCornerEl) {
|
|
@@ -12476,14 +12474,14 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
12476
12474
|
if (wrapperElem) {
|
|
12477
12475
|
wrapperElem.style.top = `${headerHeight}px`;
|
|
12478
12476
|
}
|
|
12479
|
-
fixedWrapperElem.style.height = `${customHeight > 0 ? customHeight : tableHeight + headerHeight + footerHeight +
|
|
12477
|
+
fixedWrapperElem.style.height = `${customHeight > 0 ? customHeight : tableHeight + headerHeight + footerHeight + osbHeight}px`;
|
|
12480
12478
|
fixedWrapperElem.style.width = `${fixedColumn.reduce((previous, column) => previous + column.renderWidth, 0)}px`;
|
|
12481
12479
|
}
|
|
12482
12480
|
let tWidth = tableWidth;
|
|
12483
12481
|
let renderColumnList = tableColumn;
|
|
12484
12482
|
let isOptimizeMode = false;
|
|
12485
12483
|
// 如果是使用优化模式
|
|
12486
|
-
if (scrollXLoad || scrollYLoad ||
|
|
12484
|
+
if (scrollXLoad || scrollYLoad || isAllOverflow) {
|
|
12487
12485
|
if (expandColumn || spanMethod || footerSpanMethod) {
|
|
12488
12486
|
// 如果不支持优化模式
|
|
12489
12487
|
} else {
|
|
@@ -12505,7 +12503,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
12505
12503
|
if (tableElem) {
|
|
12506
12504
|
tableElem.style.width = tWidth ? `${tWidth}px` : '';
|
|
12507
12505
|
// 兼容性处理
|
|
12508
|
-
tableElem.style.paddingRight =
|
|
12506
|
+
tableElem.style.paddingRight = osbWidth && fixedType && (browse['-moz'] || browse.safari) ? `${osbWidth}px` : '';
|
|
12509
12507
|
}
|
|
12510
12508
|
const emptyBlockElem = getRefElem(elemStore[`${name}-${layout}-emptyBlock`]);
|
|
12511
12509
|
if (emptyBlockElem) {
|
|
@@ -12540,7 +12538,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
12540
12538
|
// 如果是固定列
|
|
12541
12539
|
if (fixedWrapperElem) {
|
|
12542
12540
|
if (wrapperElem) {
|
|
12543
|
-
wrapperElem.style.top = `${customHeight > 0 ? customHeight - footerHeight -
|
|
12541
|
+
wrapperElem.style.top = `${customHeight > 0 ? customHeight - footerHeight - osbHeight : tableHeight + headerHeight}px`;
|
|
12544
12542
|
}
|
|
12545
12543
|
}
|
|
12546
12544
|
}
|
|
@@ -12567,7 +12565,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
12567
12565
|
} else if (layout === 'footer') {
|
|
12568
12566
|
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;
|
|
12569
12567
|
} else {
|
|
12570
|
-
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) ?
|
|
12568
|
+
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;
|
|
12571
12569
|
}
|
|
12572
12570
|
const showEllipsis = cellOverflow === 'ellipsis';
|
|
12573
12571
|
const showTitle = cellOverflow === 'title';
|
|
@@ -13196,16 +13194,16 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
13196
13194
|
scrollXStore,
|
|
13197
13195
|
scrollYStore
|
|
13198
13196
|
} = internalData;
|
|
13199
|
-
const
|
|
13200
|
-
const
|
|
13197
|
+
const virtualYOpts = computeVirtualYOpts.value;
|
|
13198
|
+
const virtualXOpts = computeVirtualXOpts.value;
|
|
13201
13199
|
// 计算 X 逻辑
|
|
13202
13200
|
if (scrollXLoad) {
|
|
13203
13201
|
const {
|
|
13204
13202
|
toVisibleIndex: toXVisibleIndex,
|
|
13205
13203
|
visibleSize: visibleXSize
|
|
13206
13204
|
} = handleVirtualXVisible();
|
|
13207
|
-
const offsetXSize = Math.max(0,
|
|
13208
|
-
scrollXStore.preloadSize =
|
|
13205
|
+
const offsetXSize = Math.max(0, virtualXOpts.oSize ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(virtualXOpts.oSize) : 0);
|
|
13206
|
+
scrollXStore.preloadSize = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(virtualXOpts.preSize);
|
|
13209
13207
|
scrollXStore.offsetSize = offsetXSize;
|
|
13210
13208
|
scrollXStore.visibleSize = visibleXSize;
|
|
13211
13209
|
scrollXStore.endIndex = Math.max(scrollXStore.startIndex + scrollXStore.visibleSize + offsetXSize, scrollXStore.endIndex);
|
|
@@ -13217,7 +13215,6 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
13217
13215
|
} else {
|
|
13218
13216
|
$xeTable.updateScrollXSpace();
|
|
13219
13217
|
}
|
|
13220
|
-
calcCellHeight();
|
|
13221
13218
|
// 计算 Y 逻辑
|
|
13222
13219
|
const rowHeight = computeRowHeight();
|
|
13223
13220
|
scrollYStore.rowHeight = rowHeight;
|
|
@@ -13227,8 +13224,8 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
13227
13224
|
visibleSize: visibleYSize
|
|
13228
13225
|
} = handleVirtualYVisible();
|
|
13229
13226
|
if (scrollYLoad) {
|
|
13230
|
-
const offsetYSize = Math.max(0,
|
|
13231
|
-
scrollYStore.preloadSize =
|
|
13227
|
+
const offsetYSize = Math.max(0, virtualYOpts.oSize ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(virtualYOpts.oSize) : 0);
|
|
13228
|
+
scrollYStore.preloadSize = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(virtualYOpts.preSize);
|
|
13232
13229
|
scrollYStore.offsetSize = offsetYSize;
|
|
13233
13230
|
scrollYStore.visibleSize = visibleYSize;
|
|
13234
13231
|
scrollYStore.endIndex = Math.max(scrollYStore.startIndex + visibleYSize + offsetYSize, scrollYStore.endIndex);
|
|
@@ -13257,7 +13254,6 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
13257
13254
|
return computeScrollLoad().then(() => {
|
|
13258
13255
|
if (reFull === true) {
|
|
13259
13256
|
// 初始化时需要在列计算之后再执行优化运算,达到最优显示效果
|
|
13260
|
-
calcCellHeight();
|
|
13261
13257
|
calcCellWidth();
|
|
13262
13258
|
autoCellWidth();
|
|
13263
13259
|
updateStyle();
|
|
@@ -13269,11 +13265,10 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
13269
13265
|
* 加载表格数据
|
|
13270
13266
|
* @param {Array} datas 数据
|
|
13271
13267
|
*/
|
|
13272
|
-
const loadTableData = datas => {
|
|
13268
|
+
const loadTableData = (datas, isReset) => {
|
|
13273
13269
|
const {
|
|
13274
13270
|
keepSource,
|
|
13275
|
-
treeConfig
|
|
13276
|
-
showOverflow
|
|
13271
|
+
treeConfig
|
|
13277
13272
|
} = props;
|
|
13278
13273
|
const {
|
|
13279
13274
|
editStore,
|
|
@@ -13286,7 +13281,6 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
13286
13281
|
lastScrollTop
|
|
13287
13282
|
} = internalData;
|
|
13288
13283
|
const treeOpts = computeTreeOpts.value;
|
|
13289
|
-
const rowOpts = computeRowOpts.value;
|
|
13290
13284
|
const {
|
|
13291
13285
|
transform
|
|
13292
13286
|
} = treeOpts;
|
|
@@ -13333,42 +13327,30 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
13333
13327
|
scrollYStore.endIndex = 1;
|
|
13334
13328
|
scrollXStore.startIndex = 0;
|
|
13335
13329
|
scrollXStore.endIndex = 1;
|
|
13330
|
+
reactData.isRowLoading = true;
|
|
13336
13331
|
reactData.scrollVMLoading = false;
|
|
13337
13332
|
editStore.insertMaps = {};
|
|
13338
13333
|
editStore.removeMaps = {};
|
|
13339
13334
|
const sYLoad = updateScrollYStatus(fullData);
|
|
13335
|
+
reactData.isDragColMove = false;
|
|
13340
13336
|
reactData.isDragRowMove = false;
|
|
13341
13337
|
// 全量数据
|
|
13342
13338
|
internalData.tableFullData = fullData;
|
|
13343
13339
|
internalData.tableFullTreeData = treeData;
|
|
13344
13340
|
// 缓存数据
|
|
13345
|
-
|
|
13341
|
+
$xeTable.cacheRowMap(true, isReset);
|
|
13346
13342
|
// 原始数据
|
|
13347
13343
|
internalData.tableSynchData = datas;
|
|
13344
|
+
if (isReset) {
|
|
13345
|
+
internalData.isResizeCellHeight = false;
|
|
13346
|
+
reactData.rowExpandedMaps = {};
|
|
13347
|
+
reactData.rowExpandLazyLoadedMaps = {};
|
|
13348
|
+
reactData.treeExpandedMaps = {};
|
|
13349
|
+
reactData.treeExpandLazyLoadedMaps = {};
|
|
13350
|
+
}
|
|
13348
13351
|
// 克隆原数据,用于显示编辑状态,与编辑值做对比
|
|
13349
13352
|
if (keepSource) {
|
|
13350
|
-
|
|
13351
|
-
}
|
|
13352
|
-
if (sYLoad) {
|
|
13353
|
-
if (showOverflow) {
|
|
13354
|
-
if (!rowOpts.height) {
|
|
13355
|
-
const errColumn = internalData.tableFullColumn.find(column => column.showOverflow === false);
|
|
13356
|
-
if (errColumn) {
|
|
13357
|
-
errLog('vxe.error.errProp', [`column[field="${errColumn.field}"].show-overflow=false`, 'show-overflow=true']);
|
|
13358
|
-
}
|
|
13359
|
-
}
|
|
13360
|
-
}
|
|
13361
|
-
if (true) {
|
|
13362
|
-
if (!(props.height || props.maxHeight)) {
|
|
13363
|
-
errLog('vxe.error.reqProp', ['table.height | table.max-height | table.scroll-y={enabled: false}']);
|
|
13364
|
-
}
|
|
13365
|
-
// if (!props.showOverflow) {
|
|
13366
|
-
// warnLog('vxe.error.reqProp', ['table.show-overflow'])
|
|
13367
|
-
// }
|
|
13368
|
-
if (props.spanMethod) {
|
|
13369
|
-
warnLog('vxe.error.scrollErrProp', ['table.span-method']);
|
|
13370
|
-
}
|
|
13371
|
-
}
|
|
13353
|
+
$xeTable.cacheSourceMap(fullData);
|
|
13372
13354
|
}
|
|
13373
13355
|
if ($xeTable.clearCellAreas && props.mouseConfig) {
|
|
13374
13356
|
$xeTable.clearCellAreas();
|
|
@@ -13388,6 +13370,27 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
13388
13370
|
if (sYLoad) {
|
|
13389
13371
|
scrollYStore.endIndex = scrollYStore.visibleSize;
|
|
13390
13372
|
}
|
|
13373
|
+
if (sYLoad) {
|
|
13374
|
+
// if (showOverflow) {
|
|
13375
|
+
// if (!rowOpts.height) {
|
|
13376
|
+
// const errColumn = internalData.tableFullColumn.find(column => column.showOverflow === false)
|
|
13377
|
+
// if (errColumn) {
|
|
13378
|
+
// errLog('vxe.error.errProp', [`column[field="${errColumn.field}"].show-overflow=false`, 'show-overflow=true'])
|
|
13379
|
+
// }
|
|
13380
|
+
// }
|
|
13381
|
+
// }
|
|
13382
|
+
if (true) {
|
|
13383
|
+
if (!(props.height || props.maxHeight)) {
|
|
13384
|
+
errLog('vxe.error.reqProp', ['table.height | table.max-height | table.scroll-y={enabled: false}']);
|
|
13385
|
+
}
|
|
13386
|
+
// if (!props.showOverflow) {
|
|
13387
|
+
// warnLog('vxe.error.reqProp', ['table.show-overflow'])
|
|
13388
|
+
// }
|
|
13389
|
+
if (props.spanMethod) {
|
|
13390
|
+
warnLog('vxe.error.scrollErrProp', ['table.span-method']);
|
|
13391
|
+
}
|
|
13392
|
+
}
|
|
13393
|
+
}
|
|
13391
13394
|
handleReserveStatus();
|
|
13392
13395
|
tablePrivateMethods.checkSelectionStatus();
|
|
13393
13396
|
return new Promise(resolve => {
|
|
@@ -13403,6 +13406,8 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
13403
13406
|
if (sYOpts.scrollToTopOnChange) {
|
|
13404
13407
|
targetScrollTop = 0;
|
|
13405
13408
|
}
|
|
13409
|
+
reactData.isRowLoading = false;
|
|
13410
|
+
calcCellHeight();
|
|
13406
13411
|
// 是否变更虚拟滚动
|
|
13407
13412
|
if (oldScrollYLoad === sYLoad) {
|
|
13408
13413
|
restoreScrollLocation($xeTable, targetScrollLeft, targetScrollTop).then(() => {
|
|
@@ -13665,11 +13670,10 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
13665
13670
|
internalData.collectColumn = collectColumn;
|
|
13666
13671
|
const tableFullColumn = getColumnList(collectColumn);
|
|
13667
13672
|
internalData.tableFullColumn = tableFullColumn;
|
|
13668
|
-
reactData.
|
|
13673
|
+
reactData.isColLoading = true;
|
|
13669
13674
|
reactData.isDragColMove = false;
|
|
13670
13675
|
initColumnSort();
|
|
13671
13676
|
return Promise.resolve(restoreCustomStorage()).then(() => {
|
|
13672
|
-
reactData.isLoading = false;
|
|
13673
13677
|
cacheColumnMap();
|
|
13674
13678
|
parseColumns(true).then(() => {
|
|
13675
13679
|
if (reactData.scrollXLoad) {
|
|
@@ -13694,6 +13698,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
13694
13698
|
if ($xeTable.handleUpdateCustomColumn) {
|
|
13695
13699
|
$xeTable.handleUpdateCustomColumn();
|
|
13696
13700
|
}
|
|
13701
|
+
reactData.isColLoading = false;
|
|
13697
13702
|
return $xeTable.recalculate();
|
|
13698
13703
|
});
|
|
13699
13704
|
});
|
|
@@ -13835,12 +13840,10 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
13835
13840
|
/**
|
|
13836
13841
|
* 纵向 Y 可视渲染处理
|
|
13837
13842
|
*/
|
|
13838
|
-
const loadScrollYData =
|
|
13843
|
+
const loadScrollYData = scrollTop => {
|
|
13839
13844
|
const {
|
|
13840
|
-
|
|
13841
|
-
|
|
13842
|
-
const {
|
|
13843
|
-
mergeList
|
|
13845
|
+
mergeList,
|
|
13846
|
+
isAllOverflow
|
|
13844
13847
|
} = reactData;
|
|
13845
13848
|
const {
|
|
13846
13849
|
scrollYStore
|
|
@@ -13851,11 +13854,11 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
13851
13854
|
endIndex,
|
|
13852
13855
|
offsetSize
|
|
13853
13856
|
} = scrollYStore;
|
|
13854
|
-
const autoOffsetYSize =
|
|
13857
|
+
const autoOffsetYSize = isAllOverflow ? offsetSize : offsetSize + 1;
|
|
13855
13858
|
const {
|
|
13856
13859
|
toVisibleIndex,
|
|
13857
13860
|
visibleSize
|
|
13858
|
-
} = handleVirtualYVisible();
|
|
13861
|
+
} = handleVirtualYVisible(scrollTop);
|
|
13859
13862
|
const offsetItem = {
|
|
13860
13863
|
startIndex: Math.max(0, toVisibleIndex - 1 - offsetSize - preloadSize),
|
|
13861
13864
|
endIndex: toVisibleIndex + visibleSize + autoOffsetYSize + preloadSize
|
|
@@ -13913,7 +13916,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
13913
13916
|
const {
|
|
13914
13917
|
visibleSize
|
|
13915
13918
|
} = scrollXStore;
|
|
13916
|
-
const fpsTime = Math.max(5, Math.min(
|
|
13919
|
+
const fpsTime = Math.max(5, Math.min(10, Math.floor(visibleSize / 3)));
|
|
13917
13920
|
if (lxTimeout) {
|
|
13918
13921
|
clearTimeout(lxTimeout);
|
|
13919
13922
|
}
|
|
@@ -13928,9 +13931,6 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
13928
13931
|
}, fpsTime);
|
|
13929
13932
|
};
|
|
13930
13933
|
const lazyScrollYData = () => {
|
|
13931
|
-
const {
|
|
13932
|
-
showOverflow
|
|
13933
|
-
} = props;
|
|
13934
13934
|
const {
|
|
13935
13935
|
lyTimeout,
|
|
13936
13936
|
lyRunTime,
|
|
@@ -13939,7 +13939,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
13939
13939
|
const {
|
|
13940
13940
|
visibleSize
|
|
13941
13941
|
} = scrollYStore;
|
|
13942
|
-
const fpsTime =
|
|
13942
|
+
const fpsTime = Math.floor(Math.max(4, Math.min(10, visibleSize / 3)));
|
|
13943
13943
|
if (lyTimeout) {
|
|
13944
13944
|
clearTimeout(lyTimeout);
|
|
13945
13945
|
}
|
|
@@ -13967,27 +13967,63 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
13967
13967
|
internalData.lcsTimeout = setTimeout(() => {
|
|
13968
13968
|
internalData.lcsRunTime = Date.now();
|
|
13969
13969
|
internalData.lcsTimeout = undefined;
|
|
13970
|
+
internalData.intoRunScroll = false;
|
|
13970
13971
|
internalData.inVirtualScroll = false;
|
|
13971
13972
|
internalData.inWheelScroll = false;
|
|
13972
13973
|
internalData.inHeaderScroll = false;
|
|
13973
13974
|
internalData.inBodyScroll = false;
|
|
13974
13975
|
internalData.inFooterScroll = false;
|
|
13975
13976
|
internalData.scrollRenderType = '';
|
|
13977
|
+
calcCellHeight();
|
|
13976
13978
|
if (isRollX && scrollXLoad) {
|
|
13977
|
-
$xeTable.updateScrollXData()
|
|
13978
|
-
calcCellHeight();
|
|
13979
|
-
loadScrollXData();
|
|
13980
|
-
});
|
|
13979
|
+
$xeTable.updateScrollXData();
|
|
13981
13980
|
}
|
|
13982
13981
|
if (isRollY && scrollYLoad) {
|
|
13983
13982
|
$xeTable.updateScrollYData().then(() => {
|
|
13984
13983
|
calcCellHeight();
|
|
13985
|
-
|
|
13984
|
+
$xeTable.updateScrollYSpace();
|
|
13986
13985
|
});
|
|
13987
13986
|
}
|
|
13988
13987
|
$xeTable.updateCellAreas();
|
|
13989
13988
|
}, 200);
|
|
13990
13989
|
};
|
|
13990
|
+
const getWheelSpeed = lastScrollTime => {
|
|
13991
|
+
let multiple = 1;
|
|
13992
|
+
const currTime = Date.now();
|
|
13993
|
+
if (lastScrollTime + 25 > currTime) {
|
|
13994
|
+
multiple = 1.18;
|
|
13995
|
+
} else if (lastScrollTime + 30 > currTime) {
|
|
13996
|
+
multiple = 1.15;
|
|
13997
|
+
} else if (lastScrollTime + 40 > currTime) {
|
|
13998
|
+
multiple = 1.12;
|
|
13999
|
+
} else if (lastScrollTime + 55 > currTime) {
|
|
14000
|
+
multiple = 1.09;
|
|
14001
|
+
} else if (lastScrollTime + 75 > currTime) {
|
|
14002
|
+
multiple = 1.06;
|
|
14003
|
+
} else if (lastScrollTime + 100 > currTime) {
|
|
14004
|
+
multiple = 1.03;
|
|
14005
|
+
}
|
|
14006
|
+
return multiple;
|
|
14007
|
+
};
|
|
14008
|
+
const wheelScrollTo = (diffNum, cb) => {
|
|
14009
|
+
const duration = Math.abs(diffNum);
|
|
14010
|
+
const startTime = performance.now();
|
|
14011
|
+
let countTop = 0;
|
|
14012
|
+
const step = timestamp => {
|
|
14013
|
+
let progress = (timestamp - startTime) / duration;
|
|
14014
|
+
if (progress > 1) {
|
|
14015
|
+
progress = 1;
|
|
14016
|
+
}
|
|
14017
|
+
const easedProgress = Math.pow(progress, 2);
|
|
14018
|
+
const offsetTop = Math.floor(diffNum * easedProgress) - countTop;
|
|
14019
|
+
countTop += offsetTop;
|
|
14020
|
+
cb(offsetTop);
|
|
14021
|
+
if (progress < 1) {
|
|
14022
|
+
requestAnimationFrame(step);
|
|
14023
|
+
}
|
|
14024
|
+
};
|
|
14025
|
+
requestAnimationFrame(step);
|
|
14026
|
+
};
|
|
13991
14027
|
const dispatchEvent = (type, params, evnt) => {
|
|
13992
14028
|
emit(type, createEvent(evnt, {
|
|
13993
14029
|
$table: $xeTable,
|
|
@@ -14004,12 +14040,31 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
14004
14040
|
}
|
|
14005
14041
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
14006
14042
|
};
|
|
14007
|
-
|
|
14043
|
+
const handleUpdateResize = () => {
|
|
14008
14044
|
const el = refElem.value;
|
|
14009
14045
|
if (el && el.clientWidth && el.clientHeight) {
|
|
14010
14046
|
tableMethods.recalculate();
|
|
14011
14047
|
}
|
|
14012
|
-
}
|
|
14048
|
+
};
|
|
14049
|
+
const handleUpdateColResize = (evnt, params) => {
|
|
14050
|
+
$xeTable.analyColumnWidth();
|
|
14051
|
+
$xeTable.recalculate(true).then(() => {
|
|
14052
|
+
$xeTable.saveCustomStore('update:width');
|
|
14053
|
+
$xeTable.updateCellAreas();
|
|
14054
|
+
$xeTable.dispatchEvent('column-resizable-change', params, evnt);
|
|
14055
|
+
// 已废弃 resizable-change
|
|
14056
|
+
$xeTable.dispatchEvent('resizable-change', params, evnt);
|
|
14057
|
+
setTimeout(() => $xeTable.recalculate(true), 300);
|
|
14058
|
+
});
|
|
14059
|
+
};
|
|
14060
|
+
const handleUpdateRowResize = (evnt, params) => {
|
|
14061
|
+
reactData.resizeHeightFlag++;
|
|
14062
|
+
$xeTable.recalculate(true).then(() => {
|
|
14063
|
+
$xeTable.updateCellAreas();
|
|
14064
|
+
$xeTable.dispatchEvent('row-resizable-change', params, evnt);
|
|
14065
|
+
setTimeout(() => $xeTable.recalculate(true), 300);
|
|
14066
|
+
});
|
|
14067
|
+
};
|
|
14013
14068
|
tableMethods = {
|
|
14014
14069
|
dispatchEvent,
|
|
14015
14070
|
/**
|
|
@@ -14067,7 +14122,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
14067
14122
|
const {
|
|
14068
14123
|
initStatus
|
|
14069
14124
|
} = internalData;
|
|
14070
|
-
return loadTableData(datas).then(() => {
|
|
14125
|
+
return loadTableData(datas, false).then(() => {
|
|
14071
14126
|
internalData.inited = true;
|
|
14072
14127
|
internalData.initStatus = true;
|
|
14073
14128
|
if (!initStatus) {
|
|
@@ -14084,7 +14139,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
14084
14139
|
return tableMethods.clearAll().then(() => {
|
|
14085
14140
|
internalData.inited = true;
|
|
14086
14141
|
internalData.initStatus = true;
|
|
14087
|
-
return loadTableData(datas);
|
|
14142
|
+
return loadTableData(datas, true);
|
|
14088
14143
|
}).then(() => {
|
|
14089
14144
|
handleLoadDefaults();
|
|
14090
14145
|
return tableMethods.recalculate();
|
|
@@ -14203,6 +14258,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
14203
14258
|
parent: parentRow,
|
|
14204
14259
|
level: parentLevel + nodes.length,
|
|
14205
14260
|
height: 0,
|
|
14261
|
+
resizeHeight: 0,
|
|
14206
14262
|
oTop: 0
|
|
14207
14263
|
};
|
|
14208
14264
|
fullDataRowIdData[rowid] = rest;
|
|
@@ -14443,29 +14499,32 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
14443
14499
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
14444
14500
|
},
|
|
14445
14501
|
getCellElement(row, fieldOrColumn) {
|
|
14502
|
+
const {
|
|
14503
|
+
elemStore
|
|
14504
|
+
} = internalData;
|
|
14446
14505
|
const column = handleFieldOrColumn($xeTable, fieldOrColumn);
|
|
14447
14506
|
if (!column) {
|
|
14448
14507
|
return null;
|
|
14449
14508
|
}
|
|
14450
14509
|
const rowid = getRowid($xeTable, row);
|
|
14451
|
-
const
|
|
14452
|
-
const
|
|
14453
|
-
const
|
|
14510
|
+
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
14511
|
+
const leftScrollElem = getRefElem(elemStore['left-body-scroll']);
|
|
14512
|
+
const rightScrollElem = getRefElem(elemStore['right-body-scroll']);
|
|
14454
14513
|
let bodyElem;
|
|
14455
14514
|
if (column) {
|
|
14456
14515
|
if (column.fixed) {
|
|
14457
14516
|
if (column.fixed === 'left') {
|
|
14458
|
-
if (
|
|
14459
|
-
bodyElem =
|
|
14517
|
+
if (leftScrollElem) {
|
|
14518
|
+
bodyElem = leftScrollElem;
|
|
14460
14519
|
}
|
|
14461
14520
|
} else {
|
|
14462
|
-
if (
|
|
14463
|
-
bodyElem =
|
|
14521
|
+
if (rightScrollElem) {
|
|
14522
|
+
bodyElem = rightScrollElem;
|
|
14464
14523
|
}
|
|
14465
14524
|
}
|
|
14466
14525
|
}
|
|
14467
14526
|
if (!bodyElem) {
|
|
14468
|
-
bodyElem =
|
|
14527
|
+
bodyElem = bodyScrollElem;
|
|
14469
14528
|
}
|
|
14470
14529
|
if (bodyElem) {
|
|
14471
14530
|
return bodyElem.querySelector(`.vxe-body--row[rowid="${rowid}"] .${column.id}`);
|
|
@@ -14938,29 +14997,40 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
14938
14997
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
14939
14998
|
},
|
|
14940
14999
|
setColumnWidth(fieldOrColumn, width) {
|
|
15000
|
+
const {
|
|
15001
|
+
elemStore
|
|
15002
|
+
} = internalData;
|
|
14941
15003
|
let status = false;
|
|
14942
15004
|
const cols = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(fieldOrColumn) ? fieldOrColumn : [fieldOrColumn];
|
|
14943
|
-
|
|
14944
|
-
|
|
14945
|
-
|
|
14946
|
-
|
|
14947
|
-
|
|
14948
|
-
|
|
14949
|
-
|
|
14950
|
-
|
|
14951
|
-
|
|
14952
|
-
|
|
14953
|
-
|
|
14954
|
-
|
|
14955
|
-
|
|
14956
|
-
|
|
15005
|
+
let cWidth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toInteger(width);
|
|
15006
|
+
if (isScale(width)) {
|
|
15007
|
+
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
15008
|
+
const bodyWidth = bodyScrollElem ? bodyScrollElem.clientWidth - 1 : 0;
|
|
15009
|
+
cWidth = Math.floor(cWidth * bodyWidth);
|
|
15010
|
+
}
|
|
15011
|
+
if (cWidth) {
|
|
15012
|
+
cols.forEach(item => {
|
|
15013
|
+
const column = handleFieldOrColumn($xeTable, item);
|
|
15014
|
+
if (column) {
|
|
15015
|
+
column.resizeWidth = cWidth;
|
|
15016
|
+
if (!status) {
|
|
15017
|
+
status = true;
|
|
15018
|
+
}
|
|
14957
15019
|
}
|
|
15020
|
+
});
|
|
15021
|
+
if (status) {
|
|
15022
|
+
return $xeTable.refreshColumn().then(() => {
|
|
15023
|
+
return {
|
|
15024
|
+
status
|
|
15025
|
+
};
|
|
15026
|
+
});
|
|
14958
15027
|
}
|
|
14959
|
-
});
|
|
14960
|
-
if (status) {
|
|
14961
|
-
return tableMethods.refreshColumn();
|
|
14962
15028
|
}
|
|
14963
|
-
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)()
|
|
15029
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(() => {
|
|
15030
|
+
return {
|
|
15031
|
+
status
|
|
15032
|
+
};
|
|
15033
|
+
});
|
|
14964
15034
|
},
|
|
14965
15035
|
getColumnWidth(fieldOrColumn) {
|
|
14966
15036
|
const column = handleFieldOrColumn($xeTable, fieldOrColumn);
|
|
@@ -14993,6 +15063,106 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
14993
15063
|
return tableMethods.recalculate();
|
|
14994
15064
|
});
|
|
14995
15065
|
},
|
|
15066
|
+
setRowHeightConf(heightConf) {
|
|
15067
|
+
const {
|
|
15068
|
+
fullAllDataRowIdData
|
|
15069
|
+
} = internalData;
|
|
15070
|
+
let status = false;
|
|
15071
|
+
if (heightConf) {
|
|
15072
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(heightConf, (height, rowid) => {
|
|
15073
|
+
const rowRest = fullAllDataRowIdData[rowid];
|
|
15074
|
+
if (rowRest) {
|
|
15075
|
+
const rHeight = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toInteger(height);
|
|
15076
|
+
if (rHeight) {
|
|
15077
|
+
rowRest.resizeHeight = rHeight;
|
|
15078
|
+
if (!status) {
|
|
15079
|
+
status = true;
|
|
15080
|
+
}
|
|
15081
|
+
}
|
|
15082
|
+
}
|
|
15083
|
+
});
|
|
15084
|
+
if (status) {
|
|
15085
|
+
internalData.isResizeCellHeight = true;
|
|
15086
|
+
reactData.resizeHeightFlag++;
|
|
15087
|
+
}
|
|
15088
|
+
}
|
|
15089
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(() => {
|
|
15090
|
+
return {
|
|
15091
|
+
status
|
|
15092
|
+
};
|
|
15093
|
+
});
|
|
15094
|
+
},
|
|
15095
|
+
getRowHeightConf(isFull) {
|
|
15096
|
+
const {
|
|
15097
|
+
fullAllDataRowIdData,
|
|
15098
|
+
afterFullData
|
|
15099
|
+
} = internalData;
|
|
15100
|
+
const rowOpts = computeRowOpts.value;
|
|
15101
|
+
const cellOpts = computeCellOpts.value;
|
|
15102
|
+
const defaultRowHeight = computeDefaultRowHeight.value;
|
|
15103
|
+
const rest = {};
|
|
15104
|
+
afterFullData.forEach(row => {
|
|
15105
|
+
const rowid = getRowid($xeTable, row);
|
|
15106
|
+
const rowRest = fullAllDataRowIdData[rowid];
|
|
15107
|
+
if (rowRest) {
|
|
15108
|
+
const resizeHeight = rowRest.resizeHeight;
|
|
15109
|
+
if (resizeHeight || isFull) {
|
|
15110
|
+
const currCellHeight = resizeHeight || rowRest.height || cellOpts.height || rowOpts.height || defaultRowHeight;
|
|
15111
|
+
rest[rowid] = currCellHeight;
|
|
15112
|
+
}
|
|
15113
|
+
}
|
|
15114
|
+
});
|
|
15115
|
+
return rest;
|
|
15116
|
+
},
|
|
15117
|
+
setRowHeight(rowOrId, height) {
|
|
15118
|
+
const {
|
|
15119
|
+
fullAllDataRowIdData
|
|
15120
|
+
} = internalData;
|
|
15121
|
+
let status = false;
|
|
15122
|
+
const rows = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(rowOrId) ? rowOrId : [rowOrId];
|
|
15123
|
+
let rHeight = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toInteger(height);
|
|
15124
|
+
if (isScale(height)) {
|
|
15125
|
+
const tableBody = refTableBody.value;
|
|
15126
|
+
const bodyElem = tableBody ? tableBody.$el : null;
|
|
15127
|
+
const bodyHeight = bodyElem ? bodyElem.clientHeight - 1 : 0;
|
|
15128
|
+
rHeight = Math.floor(rHeight * bodyHeight);
|
|
15129
|
+
}
|
|
15130
|
+
if (rHeight) {
|
|
15131
|
+
rows.forEach(row => {
|
|
15132
|
+
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);
|
|
15133
|
+
const rowRest = fullAllDataRowIdData[rowid];
|
|
15134
|
+
if (rowRest) {
|
|
15135
|
+
rowRest.resizeHeight = rHeight;
|
|
15136
|
+
if (!status) {
|
|
15137
|
+
status = true;
|
|
15138
|
+
}
|
|
15139
|
+
}
|
|
15140
|
+
});
|
|
15141
|
+
if (status) {
|
|
15142
|
+
internalData.isResizeCellHeight = true;
|
|
15143
|
+
reactData.resizeHeightFlag++;
|
|
15144
|
+
}
|
|
15145
|
+
}
|
|
15146
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(() => {
|
|
15147
|
+
return {
|
|
15148
|
+
status
|
|
15149
|
+
};
|
|
15150
|
+
});
|
|
15151
|
+
},
|
|
15152
|
+
getRowHeight(rowOrId) {
|
|
15153
|
+
const {
|
|
15154
|
+
fullAllDataRowIdData
|
|
15155
|
+
} = internalData;
|
|
15156
|
+
const rowOpts = computeRowOpts.value;
|
|
15157
|
+
const cellOpts = computeCellOpts.value;
|
|
15158
|
+
const defaultRowHeight = computeDefaultRowHeight.value;
|
|
15159
|
+
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);
|
|
15160
|
+
const rowRest = fullAllDataRowIdData[rowid];
|
|
15161
|
+
if (rowRest) {
|
|
15162
|
+
return rowRest.resizeHeight || rowRest.height || cellOpts.height || rowOpts.height || defaultRowHeight;
|
|
15163
|
+
}
|
|
15164
|
+
return 0;
|
|
15165
|
+
},
|
|
14996
15166
|
/**
|
|
14997
15167
|
* 刷新滚动操作,手动同步滚动相关位置(对于某些特殊的操作,比如滚动条错位、固定列不同步)
|
|
14998
15168
|
*/
|
|
@@ -16203,13 +16373,15 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
16203
16373
|
scrollXLoad,
|
|
16204
16374
|
scrollYLoad
|
|
16205
16375
|
} = reactData;
|
|
16206
|
-
const
|
|
16207
|
-
|
|
16376
|
+
const {
|
|
16377
|
+
elemStore
|
|
16378
|
+
} = internalData;
|
|
16379
|
+
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
16208
16380
|
return {
|
|
16209
16381
|
virtualX: scrollXLoad,
|
|
16210
16382
|
virtualY: scrollYLoad,
|
|
16211
|
-
scrollTop:
|
|
16212
|
-
scrollLeft:
|
|
16383
|
+
scrollTop: bodyScrollElem ? bodyScrollElem.scrollTop : 0,
|
|
16384
|
+
scrollLeft: bodyScrollElem ? bodyScrollElem.scrollLeft : 0
|
|
16213
16385
|
};
|
|
16214
16386
|
},
|
|
16215
16387
|
/**
|
|
@@ -16260,9 +16432,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
16260
16432
|
*/
|
|
16261
16433
|
scrollToRow(row, fieldOrColumn) {
|
|
16262
16434
|
const {
|
|
16263
|
-
|
|
16264
|
-
} = props;
|
|
16265
|
-
const {
|
|
16435
|
+
isAllOverflow,
|
|
16266
16436
|
scrollYLoad,
|
|
16267
16437
|
scrollXLoad
|
|
16268
16438
|
} = reactData;
|
|
@@ -16279,7 +16449,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
16279
16449
|
}
|
|
16280
16450
|
return Promise.all(rest).then(() => {
|
|
16281
16451
|
if (row) {
|
|
16282
|
-
if (!
|
|
16452
|
+
if (!isAllOverflow && (scrollYLoad || scrollXLoad)) {
|
|
16283
16453
|
calcCellHeight();
|
|
16284
16454
|
calcCellWidth();
|
|
16285
16455
|
}
|
|
@@ -17349,13 +17519,17 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
17349
17519
|
return;
|
|
17350
17520
|
}
|
|
17351
17521
|
const {
|
|
17522
|
+
overflowX,
|
|
17352
17523
|
scrollbarWidth,
|
|
17524
|
+
overflowY,
|
|
17353
17525
|
scrollbarHeight
|
|
17354
17526
|
} = reactData;
|
|
17355
17527
|
const {
|
|
17356
17528
|
prevDragToChild
|
|
17357
17529
|
} = internalData;
|
|
17358
17530
|
const wrapperRect = el.getBoundingClientRect();
|
|
17531
|
+
const osbWidth = overflowY ? scrollbarWidth : 0;
|
|
17532
|
+
const osbHeight = overflowX ? scrollbarHeight : 0;
|
|
17359
17533
|
const tableWidth = el.clientWidth;
|
|
17360
17534
|
const tableHeight = el.clientHeight;
|
|
17361
17535
|
if (trEl) {
|
|
@@ -17366,14 +17540,14 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
17366
17540
|
const trRect = trEl.getBoundingClientRect();
|
|
17367
17541
|
let trHeight = trEl.clientHeight;
|
|
17368
17542
|
const offsetTop = Math.max(1, trRect.y - wrapperRect.y);
|
|
17369
|
-
if (offsetTop + trHeight > tableHeight -
|
|
17370
|
-
trHeight = tableHeight - offsetTop -
|
|
17543
|
+
if (offsetTop + trHeight > tableHeight - osbHeight) {
|
|
17544
|
+
trHeight = tableHeight - offsetTop - osbHeight;
|
|
17371
17545
|
}
|
|
17372
17546
|
rdLineEl.style.display = 'block';
|
|
17373
|
-
rdLineEl.style.left = `${scrollbarYToLeft ?
|
|
17547
|
+
rdLineEl.style.left = `${scrollbarYToLeft ? osbWidth : 0}px`;
|
|
17374
17548
|
rdLineEl.style.top = `${offsetTop}px`;
|
|
17375
17549
|
rdLineEl.style.height = `${trHeight}px`;
|
|
17376
|
-
rdLineEl.style.width = `${tableWidth -
|
|
17550
|
+
rdLineEl.style.width = `${tableWidth - osbWidth}px`;
|
|
17377
17551
|
rdLineEl.setAttribute('drag-pos', dragPos);
|
|
17378
17552
|
rdLineEl.setAttribute('drag-to-child', prevDragToChild ? 'y' : 'n');
|
|
17379
17553
|
} else {
|
|
@@ -17398,7 +17572,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
17398
17572
|
thWidth -= startX - offsetLeft;
|
|
17399
17573
|
offsetLeft = startX;
|
|
17400
17574
|
}
|
|
17401
|
-
const endX = tableWidth - rightContainerWidth - (rightContainerWidth ? 0 :
|
|
17575
|
+
const endX = tableWidth - rightContainerWidth - (rightContainerWidth ? 0 : osbWidth);
|
|
17402
17576
|
if (offsetLeft + thWidth > endX) {
|
|
17403
17577
|
thWidth = endX - offsetLeft;
|
|
17404
17578
|
}
|
|
@@ -17409,7 +17583,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
17409
17583
|
if (prevDragToChild) {
|
|
17410
17584
|
cdLineEl.style.height = `${thRect.height}px`;
|
|
17411
17585
|
} else {
|
|
17412
|
-
cdLineEl.style.height = `${tableHeight - offsetTop - (scrollbarXToTop ? 0 :
|
|
17586
|
+
cdLineEl.style.height = `${tableHeight - offsetTop - (scrollbarXToTop ? 0 : osbHeight)}px`;
|
|
17413
17587
|
}
|
|
17414
17588
|
cdLineEl.setAttribute('drag-pos', dragPos);
|
|
17415
17589
|
cdLineEl.setAttribute('drag-to-child', prevDragToChild ? 'y' : 'n');
|
|
@@ -17445,11 +17619,11 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
17445
17619
|
* @param {Event} evnt 事件
|
|
17446
17620
|
* @param {Row} row 行对象
|
|
17447
17621
|
*/
|
|
17448
|
-
const handleTooltip = (evnt,
|
|
17622
|
+
const handleTooltip = (evnt, tdEl, overflowElem, tipElem, params) => {
|
|
17449
17623
|
if (!overflowElem) {
|
|
17450
17624
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
17451
17625
|
}
|
|
17452
|
-
params.cell =
|
|
17626
|
+
params.cell = tdEl;
|
|
17453
17627
|
const {
|
|
17454
17628
|
tooltipStore
|
|
17455
17629
|
} = reactData;
|
|
@@ -17621,9 +17795,8 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
17621
17795
|
},
|
|
17622
17796
|
/**
|
|
17623
17797
|
* 更新数据行的 Map
|
|
17624
|
-
* 牺牲数据组装的耗时,用来换取使用过程中的流畅
|
|
17625
17798
|
*/
|
|
17626
|
-
cacheRowMap(isSource) {
|
|
17799
|
+
cacheRowMap(isReset, isSource) {
|
|
17627
17800
|
const {
|
|
17628
17801
|
treeConfig
|
|
17629
17802
|
} = props;
|
|
@@ -17651,7 +17824,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
17651
17824
|
row[childrenField] = null;
|
|
17652
17825
|
}
|
|
17653
17826
|
let cacheItem = fullAllDataRowIdData[rowid];
|
|
17654
|
-
if (!cacheItem) {
|
|
17827
|
+
if (isReset || !cacheItem) {
|
|
17655
17828
|
cacheItem = {
|
|
17656
17829
|
row,
|
|
17657
17830
|
rowid,
|
|
@@ -17664,6 +17837,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
17664
17837
|
parent: parentRow,
|
|
17665
17838
|
level,
|
|
17666
17839
|
height: 0,
|
|
17840
|
+
resizeHeight: 0,
|
|
17667
17841
|
oTop: 0
|
|
17668
17842
|
};
|
|
17669
17843
|
}
|
|
@@ -17777,13 +17951,167 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
17777
17951
|
remainList
|
|
17778
17952
|
});
|
|
17779
17953
|
},
|
|
17780
|
-
|
|
17954
|
+
handleColResizeMousedownEvent(evnt, fixedType, params) {
|
|
17955
|
+
evnt.stopPropagation();
|
|
17956
|
+
evnt.preventDefault();
|
|
17957
|
+
const {
|
|
17958
|
+
column
|
|
17959
|
+
} = params;
|
|
17960
|
+
const {
|
|
17961
|
+
overflowX,
|
|
17962
|
+
scrollbarHeight
|
|
17963
|
+
} = reactData;
|
|
17964
|
+
const {
|
|
17965
|
+
elemStore,
|
|
17966
|
+
visibleColumn
|
|
17967
|
+
} = internalData;
|
|
17968
|
+
const resizableOpts = computeResizableOpts.value;
|
|
17969
|
+
const osbHeight = overflowX ? scrollbarHeight : 0;
|
|
17970
|
+
const tableEl = refElem.value;
|
|
17971
|
+
const leftContainerElem = refLeftContainer.value;
|
|
17972
|
+
const rightContainerElem = refRightContainer.value;
|
|
17973
|
+
const resizeBarElem = refColResizeBar.value;
|
|
17974
|
+
if (!resizeBarElem) {
|
|
17975
|
+
return;
|
|
17976
|
+
}
|
|
17977
|
+
const resizeTipElem = resizeBarElem.firstElementChild;
|
|
17978
|
+
const scrollbarXToTop = computeScrollbarXToTop.value;
|
|
17979
|
+
const {
|
|
17980
|
+
clientX: dragClientX
|
|
17981
|
+
} = evnt;
|
|
17982
|
+
const wrapperElem = refElem.value;
|
|
17983
|
+
const dragBtnElem = evnt.target;
|
|
17984
|
+
let resizeColumn = column;
|
|
17985
|
+
if (column.children && column.children.length) {
|
|
17986
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(column.children, childColumn => {
|
|
17987
|
+
resizeColumn = childColumn;
|
|
17988
|
+
});
|
|
17989
|
+
}
|
|
17990
|
+
const cell = dragBtnElem.parentNode;
|
|
17991
|
+
const cellParams = Object.assign(params, {
|
|
17992
|
+
cell
|
|
17993
|
+
});
|
|
17994
|
+
let dragLeft = 0;
|
|
17995
|
+
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
17996
|
+
if (!bodyScrollElem) {
|
|
17997
|
+
return;
|
|
17998
|
+
}
|
|
17999
|
+
const pos = getOffsetPos(dragBtnElem, wrapperElem);
|
|
18000
|
+
const dragBtnWidth = dragBtnElem.clientWidth;
|
|
18001
|
+
const dragBtnOffsetWidth = Math.floor(dragBtnWidth / 2);
|
|
18002
|
+
const minInterval = getColReMinWidth(cellParams) - dragBtnOffsetWidth; // 列之间的最小间距
|
|
18003
|
+
let dragMinLeft = pos.left - cell.clientWidth + dragBtnWidth + minInterval;
|
|
18004
|
+
let dragPosLeft = pos.left + dragBtnOffsetWidth;
|
|
18005
|
+
const isLeftFixed = fixedType === 'left';
|
|
18006
|
+
const isRightFixed = fixedType === 'right';
|
|
18007
|
+
// 计算左右侧固定列偏移量
|
|
18008
|
+
let fixedOffsetWidth = 0;
|
|
18009
|
+
if (isLeftFixed || isRightFixed) {
|
|
18010
|
+
const siblingProp = isLeftFixed ? 'nextElementSibling' : 'previousElementSibling';
|
|
18011
|
+
let tempCellElem = cell[siblingProp];
|
|
18012
|
+
while (tempCellElem) {
|
|
18013
|
+
if (hasClass(tempCellElem, 'fixed--hidden')) {
|
|
18014
|
+
break;
|
|
18015
|
+
} else if (!hasClass(tempCellElem, 'col--group')) {
|
|
18016
|
+
fixedOffsetWidth += tempCellElem.offsetWidth;
|
|
18017
|
+
}
|
|
18018
|
+
tempCellElem = tempCellElem[siblingProp];
|
|
18019
|
+
}
|
|
18020
|
+
if (isRightFixed && rightContainerElem) {
|
|
18021
|
+
dragPosLeft = rightContainerElem.offsetLeft + fixedOffsetWidth;
|
|
18022
|
+
}
|
|
18023
|
+
}
|
|
18024
|
+
// 处理拖动事件
|
|
18025
|
+
const updateEvent = evnt => {
|
|
18026
|
+
evnt.stopPropagation();
|
|
18027
|
+
evnt.preventDefault();
|
|
18028
|
+
const tableHeight = tableEl.clientHeight;
|
|
18029
|
+
const offsetX = evnt.clientX - dragClientX;
|
|
18030
|
+
let left = dragPosLeft + offsetX;
|
|
18031
|
+
const scrollLeft = fixedType ? 0 : bodyScrollElem.scrollLeft;
|
|
18032
|
+
if (isLeftFixed) {
|
|
18033
|
+
// 左固定列(不允许超过右侧固定列、不允许超过右边距)
|
|
18034
|
+
left = Math.min(left, (rightContainerElem ? rightContainerElem.offsetLeft : bodyScrollElem.clientWidth) - fixedOffsetWidth - minInterval);
|
|
18035
|
+
} else if (isRightFixed) {
|
|
18036
|
+
// 右侧固定列(不允许超过左侧固定列、不允许超过左边距)
|
|
18037
|
+
dragMinLeft = (leftContainerElem ? leftContainerElem.clientWidth : 0) + fixedOffsetWidth + minInterval;
|
|
18038
|
+
left = Math.min(left, dragPosLeft + cell.clientWidth - minInterval);
|
|
18039
|
+
} else {
|
|
18040
|
+
dragMinLeft = Math.max(bodyScrollElem.scrollLeft, dragMinLeft);
|
|
18041
|
+
// left = Math.min(left, bodyScrollElem.clientWidth + bodyScrollElem.scrollLeft - 40)
|
|
18042
|
+
}
|
|
18043
|
+
dragLeft = Math.max(left, dragMinLeft);
|
|
18044
|
+
const resizeBarLeft = Math.max(1, dragLeft - scrollLeft);
|
|
18045
|
+
resizeBarElem.style.left = `${resizeBarLeft}px`;
|
|
18046
|
+
resizeBarElem.style.top = `${scrollbarXToTop ? osbHeight : 0}px`;
|
|
18047
|
+
resizeBarElem.style.height = `${scrollbarXToTop ? tableHeight - osbHeight : tableHeight}px`;
|
|
18048
|
+
if (resizableOpts.showDragTip && resizeTipElem) {
|
|
18049
|
+
resizeTipElem.textContent = table_getI18n('vxe.table.resizeColTip', [resizeColumn.renderWidth + (isRightFixed ? dragPosLeft - dragLeft : dragLeft - dragPosLeft)]);
|
|
18050
|
+
const tableWidth = tableEl.clientWidth;
|
|
18051
|
+
const wrapperRect = wrapperElem.getBoundingClientRect();
|
|
18052
|
+
const resizeBarWidth = resizeBarElem.clientWidth;
|
|
18053
|
+
const resizeTipWidth = resizeTipElem.clientWidth;
|
|
18054
|
+
const resizeTipHeight = resizeTipElem.clientHeight;
|
|
18055
|
+
let resizeTipLeft = -resizeTipWidth;
|
|
18056
|
+
if (resizeBarLeft < resizeTipWidth + resizeBarWidth) {
|
|
18057
|
+
resizeTipLeft = 0;
|
|
18058
|
+
} else if (resizeBarLeft > tableWidth) {
|
|
18059
|
+
resizeTipLeft += tableWidth - resizeBarLeft;
|
|
18060
|
+
}
|
|
18061
|
+
resizeTipElem.style.left = `${resizeTipLeft}px`;
|
|
18062
|
+
resizeTipElem.style.top = `${Math.min(tableHeight - resizeTipHeight, Math.max(0, evnt.clientY - wrapperRect.y - resizeTipHeight / 2))}px`;
|
|
18063
|
+
}
|
|
18064
|
+
reactData.isDragResize = true;
|
|
18065
|
+
};
|
|
18066
|
+
reactData.isDragResize = true;
|
|
18067
|
+
addClass(tableEl, 'col-drag--resize');
|
|
18068
|
+
resizeBarElem.style.display = 'block';
|
|
18069
|
+
document.onmousemove = updateEvent;
|
|
18070
|
+
document.onmouseup = function (evnt) {
|
|
18071
|
+
document.onmousemove = null;
|
|
18072
|
+
document.onmouseup = null;
|
|
18073
|
+
resizeBarElem.style.display = 'none';
|
|
18074
|
+
internalData._lastResizeTime = Date.now();
|
|
18075
|
+
setTimeout(() => {
|
|
18076
|
+
reactData.isDragResize = false;
|
|
18077
|
+
}, 50);
|
|
18078
|
+
const resizeWidth = resizeColumn.renderWidth + (isRightFixed ? dragPosLeft - dragLeft : dragLeft - dragPosLeft);
|
|
18079
|
+
const resizeParams = {
|
|
18080
|
+
...params,
|
|
18081
|
+
resizeWidth,
|
|
18082
|
+
resizeColumn
|
|
18083
|
+
};
|
|
18084
|
+
if (resizableOpts.dragMode === 'fixed') {
|
|
18085
|
+
visibleColumn.forEach(item => {
|
|
18086
|
+
if (item.id !== resizeColumn.id) {
|
|
18087
|
+
if (!item.resizeWidth) {
|
|
18088
|
+
item.resizeWidth = item.renderWidth;
|
|
18089
|
+
}
|
|
18090
|
+
}
|
|
18091
|
+
});
|
|
18092
|
+
}
|
|
18093
|
+
if ($xeTable.handleColResizeCellAreaEvent) {
|
|
18094
|
+
$xeTable.handleColResizeCellAreaEvent(evnt, resizeParams);
|
|
18095
|
+
} else {
|
|
18096
|
+
resizeColumn.resizeWidth = resizeWidth;
|
|
18097
|
+
handleUpdateColResize(evnt, resizeParams);
|
|
18098
|
+
}
|
|
18099
|
+
removeClass(tableEl, 'col-drag--resize');
|
|
18100
|
+
};
|
|
18101
|
+
updateEvent(evnt);
|
|
18102
|
+
if ($xeTable.closeMenu) {
|
|
18103
|
+
$xeTable.closeMenu();
|
|
18104
|
+
}
|
|
18105
|
+
},
|
|
18106
|
+
handleColResizeDblclickEvent(evnt, params) {
|
|
17781
18107
|
const resizableOpts = computeResizableOpts.value;
|
|
17782
18108
|
const {
|
|
17783
18109
|
isDblclickAutoWidth
|
|
17784
18110
|
} = resizableOpts;
|
|
17785
18111
|
const el = refElem.value;
|
|
17786
18112
|
if (isDblclickAutoWidth && el) {
|
|
18113
|
+
evnt.stopPropagation();
|
|
18114
|
+
evnt.preventDefault();
|
|
17787
18115
|
const {
|
|
17788
18116
|
fullColumnIdData
|
|
17789
18117
|
} = internalData;
|
|
@@ -17804,23 +18132,195 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
17804
18132
|
cell
|
|
17805
18133
|
});
|
|
17806
18134
|
const colMinWidth = getColReMinWidth(cellParams);
|
|
18135
|
+
el.setAttribute('data-calc-col', 'Y');
|
|
17807
18136
|
let resizeWidth = calcColumnAutoWidth(resizeColumn, el);
|
|
18137
|
+
el.removeAttribute('data-calc-col');
|
|
17808
18138
|
if (colRest) {
|
|
17809
18139
|
resizeWidth = Math.max(resizeWidth, colRest.width);
|
|
17810
18140
|
}
|
|
17811
|
-
|
|
17812
|
-
|
|
18141
|
+
resizeWidth = Math.max(colMinWidth, resizeWidth);
|
|
18142
|
+
const resizeParams = {
|
|
18143
|
+
...params,
|
|
18144
|
+
resizeWidth,
|
|
18145
|
+
resizeColumn
|
|
18146
|
+
};
|
|
18147
|
+
reactData.isDragResize = false;
|
|
18148
|
+
internalData._lastResizeTime = Date.now();
|
|
18149
|
+
if ($xeTable.handleColResizeDblclickCellAreaEvent) {
|
|
18150
|
+
$xeTable.handleColResizeDblclickCellAreaEvent(evnt, resizeParams);
|
|
18151
|
+
} else {
|
|
18152
|
+
resizeColumn.resizeWidth = resizeWidth;
|
|
18153
|
+
handleUpdateColResize(evnt, resizeParams);
|
|
18154
|
+
}
|
|
18155
|
+
}
|
|
18156
|
+
},
|
|
18157
|
+
handleRowResizeMousedownEvent(evnt, params) {
|
|
18158
|
+
evnt.stopPropagation();
|
|
18159
|
+
evnt.preventDefault();
|
|
18160
|
+
const {
|
|
18161
|
+
row
|
|
18162
|
+
} = params;
|
|
18163
|
+
const {
|
|
18164
|
+
overflowX,
|
|
18165
|
+
scrollbarWidth,
|
|
18166
|
+
overflowY,
|
|
18167
|
+
scrollbarHeight
|
|
18168
|
+
} = reactData;
|
|
18169
|
+
const {
|
|
18170
|
+
elemStore,
|
|
18171
|
+
fullAllDataRowIdData
|
|
18172
|
+
} = internalData;
|
|
18173
|
+
const osbWidth = overflowY ? scrollbarWidth : 0;
|
|
18174
|
+
const osbHeight = overflowX ? scrollbarHeight : 0;
|
|
18175
|
+
const scrollbarYToLeft = computeScrollbarYToLeft.value;
|
|
18176
|
+
const resizableOpts = computeResizableOpts.value;
|
|
18177
|
+
const rowOpts = computeRowOpts.value;
|
|
18178
|
+
const cellOpts = computeCellOpts.value;
|
|
18179
|
+
const tableEl = refElem.value;
|
|
18180
|
+
const resizeBarElem = refRowResizeBar.value;
|
|
18181
|
+
if (!resizeBarElem) {
|
|
18182
|
+
return;
|
|
18183
|
+
}
|
|
18184
|
+
const {
|
|
18185
|
+
clientY: dragClientY
|
|
18186
|
+
} = evnt;
|
|
18187
|
+
const resizeTipElem = resizeBarElem.firstElementChild;
|
|
18188
|
+
const dragBtnElem = evnt.currentTarget;
|
|
18189
|
+
const tdEl = dragBtnElem.parentNode;
|
|
18190
|
+
const trEl = tdEl.parentNode;
|
|
18191
|
+
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
18192
|
+
if (!bodyScrollElem) {
|
|
18193
|
+
return;
|
|
18194
|
+
}
|
|
18195
|
+
const rowid = getRowid($xeTable, row);
|
|
18196
|
+
const rowRest = fullAllDataRowIdData[rowid];
|
|
18197
|
+
if (!rowRest) {
|
|
18198
|
+
return;
|
|
18199
|
+
}
|
|
18200
|
+
const defaultRowHeight = computeDefaultRowHeight.value;
|
|
18201
|
+
const currCellHeight = rowRest.resizeHeight || rowRest.height || cellOpts.height || rowOpts.height || defaultRowHeight;
|
|
18202
|
+
const tableRect = tableEl.getBoundingClientRect();
|
|
18203
|
+
const trRect = trEl.getBoundingClientRect();
|
|
18204
|
+
const targetOffsetY = dragClientY - trRect.y - trEl.clientHeight;
|
|
18205
|
+
let resizeHeight = currCellHeight;
|
|
18206
|
+
const cellEl = tdEl.querySelector('.vxe-cell');
|
|
18207
|
+
let cellMinHeight = 0;
|
|
18208
|
+
if (cellEl) {
|
|
18209
|
+
const cellStyle = getComputedStyle(cellEl);
|
|
18210
|
+
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)));
|
|
18211
|
+
}
|
|
18212
|
+
const minTop = trRect.y - tableRect.y + cellMinHeight;
|
|
18213
|
+
// 处理拖动事件
|
|
18214
|
+
const updateEvent = evnt => {
|
|
18215
|
+
evnt.stopPropagation();
|
|
18216
|
+
evnt.preventDefault();
|
|
18217
|
+
const tableWidth = tableEl.clientWidth - osbWidth;
|
|
18218
|
+
const tableHeight = tableEl.clientHeight - osbHeight;
|
|
18219
|
+
let dragTop = evnt.clientY - tableRect.y - targetOffsetY;
|
|
18220
|
+
if (dragTop < minTop) {
|
|
18221
|
+
dragTop = minTop;
|
|
18222
|
+
} else {
|
|
18223
|
+
resizeHeight = Math.max(cellMinHeight, currCellHeight + evnt.clientY - dragClientY);
|
|
18224
|
+
}
|
|
18225
|
+
resizeBarElem.style.left = `${scrollbarYToLeft ? osbWidth : 0}px`;
|
|
18226
|
+
resizeBarElem.style.top = `${dragTop}px`;
|
|
18227
|
+
resizeBarElem.style.width = `${tableWidth}px`;
|
|
18228
|
+
if (resizableOpts.showDragTip && resizeTipElem) {
|
|
18229
|
+
resizeTipElem.textContent = table_getI18n('vxe.table.resizeRowTip', [resizeHeight]);
|
|
18230
|
+
const resizeTipWidth = resizeTipElem.clientWidth;
|
|
18231
|
+
const resizeTipHeight = resizeTipElem.clientHeight;
|
|
18232
|
+
let resizeBarLeft = Math.max(2, evnt.clientX - tableRect.x);
|
|
18233
|
+
let resizeBarTop = 0;
|
|
18234
|
+
if (resizeBarLeft + resizeTipWidth >= tableWidth - 2) {
|
|
18235
|
+
resizeBarLeft = tableWidth - resizeTipWidth - 2;
|
|
18236
|
+
}
|
|
18237
|
+
if (dragTop + resizeTipHeight >= tableHeight) {
|
|
18238
|
+
resizeBarTop = tableHeight - (dragTop + resizeTipHeight);
|
|
18239
|
+
}
|
|
18240
|
+
resizeTipElem.style.left = `${resizeBarLeft}px`;
|
|
18241
|
+
resizeTipElem.style.top = `${resizeBarTop}px`;
|
|
18242
|
+
}
|
|
18243
|
+
reactData.isDragResize = true;
|
|
18244
|
+
};
|
|
18245
|
+
reactData.isDragResize = true;
|
|
18246
|
+
addClass(tableEl, 'row-drag--resize');
|
|
18247
|
+
resizeBarElem.style.display = 'block';
|
|
18248
|
+
document.onmousemove = updateEvent;
|
|
18249
|
+
document.onmouseup = function (evnt) {
|
|
18250
|
+
document.onmousemove = null;
|
|
18251
|
+
document.onmouseup = null;
|
|
18252
|
+
resizeBarElem.style.display = 'none';
|
|
17813
18253
|
internalData._lastResizeTime = Date.now();
|
|
17814
|
-
|
|
17815
|
-
|
|
17816
|
-
|
|
17817
|
-
|
|
17818
|
-
|
|
18254
|
+
setTimeout(() => {
|
|
18255
|
+
reactData.isDragResize = false;
|
|
18256
|
+
}, 50);
|
|
18257
|
+
if (resizeHeight !== currCellHeight) {
|
|
18258
|
+
const resizeParams = {
|
|
17819
18259
|
...params,
|
|
17820
|
-
|
|
17821
|
-
|
|
17822
|
-
|
|
17823
|
-
|
|
18260
|
+
resizeHeight,
|
|
18261
|
+
resizeRow: row
|
|
18262
|
+
};
|
|
18263
|
+
internalData.isResizeCellHeight = true;
|
|
18264
|
+
if ($xeTable.handleRowResizeCellAreaEvent) {
|
|
18265
|
+
$xeTable.handleRowResizeCellAreaEvent(evnt, resizeParams);
|
|
18266
|
+
} else {
|
|
18267
|
+
rowRest.resizeHeight = resizeHeight;
|
|
18268
|
+
handleUpdateRowResize(evnt, resizeParams);
|
|
18269
|
+
}
|
|
18270
|
+
}
|
|
18271
|
+
removeClass(tableEl, 'row-drag--resize');
|
|
18272
|
+
};
|
|
18273
|
+
updateEvent(evnt);
|
|
18274
|
+
},
|
|
18275
|
+
handleRowResizeDblclickEvent(evnt, params) {
|
|
18276
|
+
const resizableOpts = computeResizableOpts.value;
|
|
18277
|
+
const {
|
|
18278
|
+
isDblclickAutoHeight
|
|
18279
|
+
} = resizableOpts;
|
|
18280
|
+
const el = refElem.value;
|
|
18281
|
+
if (isDblclickAutoHeight && el) {
|
|
18282
|
+
evnt.stopPropagation();
|
|
18283
|
+
evnt.preventDefault();
|
|
18284
|
+
const {
|
|
18285
|
+
editStore
|
|
18286
|
+
} = reactData;
|
|
18287
|
+
const {
|
|
18288
|
+
fullAllDataRowIdData
|
|
18289
|
+
} = internalData;
|
|
18290
|
+
const {
|
|
18291
|
+
actived
|
|
18292
|
+
} = editStore;
|
|
18293
|
+
const {
|
|
18294
|
+
row
|
|
18295
|
+
} = params;
|
|
18296
|
+
const rowid = getRowid($xeTable, row);
|
|
18297
|
+
const rowRest = fullAllDataRowIdData[rowid];
|
|
18298
|
+
if (!rowRest) {
|
|
18299
|
+
return;
|
|
18300
|
+
}
|
|
18301
|
+
const handleRsHeight = () => {
|
|
18302
|
+
el.setAttribute('data-calc-row', 'Y');
|
|
18303
|
+
const resizeHeight = calcCellAutoHeight(rowRest, el);
|
|
18304
|
+
el.removeAttribute('data-calc-row');
|
|
18305
|
+
const resizeParams = {
|
|
18306
|
+
...params,
|
|
18307
|
+
resizeHeight,
|
|
18308
|
+
resizeRow: row
|
|
18309
|
+
};
|
|
18310
|
+
reactData.isDragResize = false;
|
|
18311
|
+
internalData._lastResizeTime = Date.now();
|
|
18312
|
+
if ($xeTable.handleRowResizeDblclickCellAreaEvent) {
|
|
18313
|
+
$xeTable.handleRowResizeDblclickCellAreaEvent(evnt, resizeParams);
|
|
18314
|
+
} else {
|
|
18315
|
+
rowRest.resizeHeight = resizeHeight;
|
|
18316
|
+
handleUpdateRowResize(evnt, resizeParams);
|
|
18317
|
+
}
|
|
18318
|
+
};
|
|
18319
|
+
if (actived.row || actived.column) {
|
|
18320
|
+
$xeTable.clearEdit().then(handleRsHeight);
|
|
18321
|
+
} else {
|
|
18322
|
+
handleRsHeight();
|
|
18323
|
+
}
|
|
17824
18324
|
}
|
|
17825
18325
|
},
|
|
17826
18326
|
saveCustomStore(type) {
|
|
@@ -18226,10 +18726,21 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
18226
18726
|
const {
|
|
18227
18727
|
column
|
|
18228
18728
|
} = params;
|
|
18229
|
-
const titleElem = evnt.currentTarget;
|
|
18230
18729
|
handleTargetEnterEvent(true);
|
|
18730
|
+
const titleElem = evnt.currentTarget;
|
|
18731
|
+
if (!titleElem) {
|
|
18732
|
+
return;
|
|
18733
|
+
}
|
|
18734
|
+
const cellEl = titleElem.parentElement;
|
|
18735
|
+
if (!cellEl) {
|
|
18736
|
+
return;
|
|
18737
|
+
}
|
|
18738
|
+
const thEl = cellEl.parentElement;
|
|
18739
|
+
if (!thEl) {
|
|
18740
|
+
return;
|
|
18741
|
+
}
|
|
18231
18742
|
if (tooltipStore.column !== column || !tooltipStore.visible) {
|
|
18232
|
-
handleTooltip(evnt,
|
|
18743
|
+
handleTooltip(evnt, thEl, cellEl, null, params);
|
|
18233
18744
|
}
|
|
18234
18745
|
},
|
|
18235
18746
|
/**
|
|
@@ -18253,7 +18764,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
18253
18764
|
row,
|
|
18254
18765
|
column
|
|
18255
18766
|
} = params;
|
|
18256
|
-
const
|
|
18767
|
+
const tdEl = evnt.currentTarget;
|
|
18257
18768
|
handleTargetEnterEvent(tooltipStore.column !== column || tooltipStore.row !== row);
|
|
18258
18769
|
// 单元格处于编辑状态时不触发提示框
|
|
18259
18770
|
if (column.editRender && isEnableConf(editConfig)) {
|
|
@@ -18267,17 +18778,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
18267
18778
|
}
|
|
18268
18779
|
}
|
|
18269
18780
|
if (tooltipStore.column !== column || tooltipStore.row !== row || !tooltipStore.visible) {
|
|
18270
|
-
|
|
18271
|
-
let tipElem;
|
|
18272
|
-
if (column.treeNode) {
|
|
18273
|
-
overflowElem = cell.querySelector('.vxe-tree-cell');
|
|
18274
|
-
if (column.type === 'html') {
|
|
18275
|
-
tipElem = cell.querySelector('.vxe-cell--html');
|
|
18276
|
-
}
|
|
18277
|
-
} else {
|
|
18278
|
-
tipElem = cell.querySelector(column.type === 'html' ? '.vxe-cell--html' : '.vxe-cell--label');
|
|
18279
|
-
}
|
|
18280
|
-
handleTooltip(evnt, cell, overflowElem || cell.children[0], tipElem, params);
|
|
18781
|
+
handleTooltip(evnt, tdEl, tdEl.querySelector('.vxe-cell--wrapper'), null, params);
|
|
18281
18782
|
}
|
|
18282
18783
|
},
|
|
18283
18784
|
/**
|
|
@@ -18293,7 +18794,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
18293
18794
|
const cell = evnt.currentTarget;
|
|
18294
18795
|
handleTargetEnterEvent(tooltipStore.column !== column || !!tooltipStore.row);
|
|
18295
18796
|
if (tooltipStore.column !== column || !tooltipStore.visible) {
|
|
18296
|
-
handleTooltip(evnt, cell, cell.querySelector('.vxe-cell--
|
|
18797
|
+
handleTooltip(evnt, cell, cell.querySelector('.vxe-cell--wrapper') || cell.children[0], null, params);
|
|
18297
18798
|
}
|
|
18298
18799
|
},
|
|
18299
18800
|
handleTargetLeaveEvent() {
|
|
@@ -18306,11 +18807,11 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
18306
18807
|
internalData.tooltipTimeout = setTimeout(() => {
|
|
18307
18808
|
$tooltip = refTooltip.value;
|
|
18308
18809
|
if ($tooltip && $tooltip.isActived && !$tooltip.isActived()) {
|
|
18309
|
-
|
|
18810
|
+
$xeTable.closeTooltip();
|
|
18310
18811
|
}
|
|
18311
18812
|
}, tooltipOpts.leaveDelay);
|
|
18312
18813
|
} else {
|
|
18313
|
-
|
|
18814
|
+
$xeTable.closeTooltip();
|
|
18314
18815
|
}
|
|
18315
18816
|
},
|
|
18316
18817
|
triggerHeaderCellClickEvent(evnt, params) {
|
|
@@ -18355,8 +18856,12 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
18355
18856
|
editConfig
|
|
18356
18857
|
} = props;
|
|
18357
18858
|
const {
|
|
18358
|
-
editStore
|
|
18859
|
+
editStore,
|
|
18860
|
+
isDragResize
|
|
18359
18861
|
} = reactData;
|
|
18862
|
+
if (isDragResize) {
|
|
18863
|
+
return;
|
|
18864
|
+
}
|
|
18360
18865
|
const expandOpts = computeExpandOpts.value;
|
|
18361
18866
|
const editOpts = computeEditOpts.value;
|
|
18362
18867
|
const treeOpts = computeTreeOpts.value;
|
|
@@ -18466,8 +18971,12 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
18466
18971
|
editConfig
|
|
18467
18972
|
} = props;
|
|
18468
18973
|
const {
|
|
18469
|
-
editStore
|
|
18974
|
+
editStore,
|
|
18975
|
+
isDragResize
|
|
18470
18976
|
} = reactData;
|
|
18977
|
+
if (isDragResize) {
|
|
18978
|
+
return;
|
|
18979
|
+
}
|
|
18471
18980
|
const editOpts = computeEditOpts.value;
|
|
18472
18981
|
const {
|
|
18473
18982
|
actived
|
|
@@ -18758,13 +19267,19 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
18758
19267
|
*/
|
|
18759
19268
|
triggerSortEvent(evnt, column, order) {
|
|
18760
19269
|
const sortOpts = computeSortOpts.value;
|
|
19270
|
+
const {
|
|
19271
|
+
multiple,
|
|
19272
|
+
allowClear
|
|
19273
|
+
} = sortOpts;
|
|
18761
19274
|
const {
|
|
18762
19275
|
field,
|
|
18763
19276
|
sortable
|
|
18764
19277
|
} = column;
|
|
18765
19278
|
if (sortable) {
|
|
18766
19279
|
if (!order || column.order === order) {
|
|
18767
|
-
|
|
19280
|
+
if (allowClear) {
|
|
19281
|
+
tableMethods.clearSort(multiple ? column : null);
|
|
19282
|
+
}
|
|
18768
19283
|
} else {
|
|
18769
19284
|
tableMethods.sort({
|
|
18770
19285
|
field,
|
|
@@ -18891,7 +19406,8 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
18891
19406
|
isPeerDrag,
|
|
18892
19407
|
isCrossDrag,
|
|
18893
19408
|
isSelfToChildDrag,
|
|
18894
|
-
dragEndMethod
|
|
19409
|
+
dragEndMethod,
|
|
19410
|
+
dragToChildMethod
|
|
18895
19411
|
} = rowDragOpts;
|
|
18896
19412
|
const treeOpts = computeTreeOpts.value;
|
|
18897
19413
|
const {
|
|
@@ -18910,13 +19426,15 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
18910
19426
|
if (prevDragRow && dragRow) {
|
|
18911
19427
|
// 判断是否有拖动
|
|
18912
19428
|
if (prevDragRow !== dragRow) {
|
|
18913
|
-
|
|
19429
|
+
const dragParams = {
|
|
18914
19430
|
oldRow: dragRow,
|
|
18915
19431
|
newRow: prevDragRow,
|
|
18916
19432
|
dragPos: prevDragPos,
|
|
18917
19433
|
dragToChild: !!prevDragToChild,
|
|
18918
19434
|
offsetIndex: dragOffsetIndex
|
|
18919
|
-
}
|
|
19435
|
+
};
|
|
19436
|
+
const isDragToChildFlag = isSelfToChildDrag && dragToChildMethod ? dragToChildMethod(dragParams) : prevDragToChild;
|
|
19437
|
+
return Promise.resolve(dEndMethod ? dEndMethod(dragParams) : true).then(status => {
|
|
18920
19438
|
if (!status) {
|
|
18921
19439
|
return;
|
|
18922
19440
|
}
|
|
@@ -18994,7 +19512,9 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
18994
19512
|
// 根到根
|
|
18995
19513
|
}
|
|
18996
19514
|
const fullList = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toTreeArray(internalData.afterTreeFullData, {
|
|
18997
|
-
|
|
19515
|
+
key: rowField,
|
|
19516
|
+
parentKey: parentField,
|
|
19517
|
+
children: mapChildrenField
|
|
18998
19518
|
});
|
|
18999
19519
|
// 移出
|
|
19000
19520
|
const otfIndex = $xeTable.findRowIndexOf(fullList, dragRow);
|
|
@@ -19009,12 +19529,12 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
19009
19529
|
childRow[parentField] = dragRow[parentField];
|
|
19010
19530
|
});
|
|
19011
19531
|
}
|
|
19012
|
-
dragRow[parentField] =
|
|
19532
|
+
dragRow[parentField] = isDragToChildFlag ? prevDragRow[rowField] : prevDragRow[parentField];
|
|
19013
19533
|
internalData.tableFullTreeData = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toArrayTree(fullList, {
|
|
19014
|
-
key:
|
|
19015
|
-
parentKey:
|
|
19534
|
+
key: rowField,
|
|
19535
|
+
parentKey: parentField,
|
|
19016
19536
|
children: childrenField,
|
|
19017
|
-
mapChildren:
|
|
19537
|
+
mapChildren: mapChildrenField
|
|
19018
19538
|
});
|
|
19019
19539
|
}
|
|
19020
19540
|
}
|
|
@@ -19034,7 +19554,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
19034
19554
|
}
|
|
19035
19555
|
reactData.isDragRowMove = true;
|
|
19036
19556
|
$xeTable.handleTableData(treeConfig && transform);
|
|
19037
|
-
$xeTable.cacheRowMap();
|
|
19557
|
+
$xeTable.cacheRowMap(false);
|
|
19038
19558
|
updateScrollYStatus();
|
|
19039
19559
|
if (!(treeConfig && transform)) {
|
|
19040
19560
|
$xeTable.updateAfterDataIndex();
|
|
@@ -19051,7 +19571,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
19051
19571
|
oldRow: dragRow,
|
|
19052
19572
|
newRow: prevDragRow,
|
|
19053
19573
|
dragPos: prevDragPos,
|
|
19054
|
-
dragToChild:
|
|
19574
|
+
dragToChild: isDragToChildFlag,
|
|
19055
19575
|
offsetIndex: dragOffsetIndex,
|
|
19056
19576
|
_index: {
|
|
19057
19577
|
newIndex: nafIndex,
|
|
@@ -19083,18 +19603,16 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
19083
19603
|
prevDragRow,
|
|
19084
19604
|
prevDragPos
|
|
19085
19605
|
} = internalData;
|
|
19086
|
-
if (treeConfig && prevDragToChild) {
|
|
19606
|
+
if (treeConfig && lazy && prevDragToChild) {
|
|
19087
19607
|
// 懒加载
|
|
19088
|
-
|
|
19089
|
-
|
|
19090
|
-
|
|
19091
|
-
if (
|
|
19092
|
-
if (rowRest && rowRest.treeLoaded) {
|
|
19093
|
-
$xeTable.handleRowDragSwapEvent(evnt, true, dragRow, prevDragRow, prevDragPos, prevDragToChild);
|
|
19094
|
-
}
|
|
19095
|
-
} else {
|
|
19608
|
+
const newRowid = getRowid($xeTable, prevDragRow);
|
|
19609
|
+
const rowRest = fullAllDataRowIdData[newRowid];
|
|
19610
|
+
if (prevDragRow[hasChildField]) {
|
|
19611
|
+
if (rowRest && rowRest.treeLoaded) {
|
|
19096
19612
|
$xeTable.handleRowDragSwapEvent(evnt, true, dragRow, prevDragRow, prevDragPos, prevDragToChild);
|
|
19097
19613
|
}
|
|
19614
|
+
} else {
|
|
19615
|
+
$xeTable.handleRowDragSwapEvent(evnt, true, dragRow, prevDragRow, prevDragPos, prevDragToChild);
|
|
19098
19616
|
}
|
|
19099
19617
|
} else {
|
|
19100
19618
|
$xeTable.handleRowDragSwapEvent(evnt, true, dragRow, prevDragRow, prevDragPos, prevDragToChild);
|
|
@@ -19224,7 +19742,8 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
19224
19742
|
isCrossDrag,
|
|
19225
19743
|
isSelfToChildDrag,
|
|
19226
19744
|
isToChildDrag,
|
|
19227
|
-
dragEndMethod
|
|
19745
|
+
dragEndMethod,
|
|
19746
|
+
dragToChildMethod
|
|
19228
19747
|
} = columnDragOpts;
|
|
19229
19748
|
const {
|
|
19230
19749
|
collectColumn
|
|
@@ -19235,13 +19754,15 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
19235
19754
|
if (prevDragCol !== dragCol) {
|
|
19236
19755
|
const oldColumn = dragCol;
|
|
19237
19756
|
const newColumn = prevDragCol;
|
|
19238
|
-
|
|
19757
|
+
const dragParams = {
|
|
19239
19758
|
oldColumn,
|
|
19240
19759
|
newColumn,
|
|
19241
19760
|
dragPos: prevDragPos,
|
|
19242
19761
|
dragToChild: !!prevDragToChild,
|
|
19243
19762
|
offsetIndex: dragOffsetIndex
|
|
19244
|
-
}
|
|
19763
|
+
};
|
|
19764
|
+
const isDragToChildFlag = isSelfToChildDrag && dragToChildMethod ? dragToChildMethod(dragParams) : prevDragToChild;
|
|
19765
|
+
return Promise.resolve(dragEndMethod ? dragEndMethod(dragParams) : true).then(status => {
|
|
19245
19766
|
if (!status) {
|
|
19246
19767
|
return;
|
|
19247
19768
|
}
|
|
@@ -19337,7 +19858,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
19337
19858
|
parent: nParent
|
|
19338
19859
|
} = newMatchRest;
|
|
19339
19860
|
// 转子级
|
|
19340
|
-
if (isCrossDrag && isToChildDrag &&
|
|
19861
|
+
if (isCrossDrag && isToChildDrag && isDragToChildFlag) {
|
|
19341
19862
|
oldColumn.parentId = newColumn.id;
|
|
19342
19863
|
newColumn.children = (newColumn.children || []).concat([oldColumn]);
|
|
19343
19864
|
} else {
|
|
@@ -19368,7 +19889,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
19368
19889
|
oldColumn,
|
|
19369
19890
|
newColumn,
|
|
19370
19891
|
dragPos: prevDragPos,
|
|
19371
|
-
dragToChild:
|
|
19892
|
+
dragToChild: isDragToChildFlag,
|
|
19372
19893
|
offsetIndex: dragOffsetIndex,
|
|
19373
19894
|
_index: {
|
|
19374
19895
|
newIndex: nafIndex,
|
|
@@ -19636,6 +20157,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
19636
20157
|
triggerBodyScrollEvent(evnt, fixedType) {
|
|
19637
20158
|
const {
|
|
19638
20159
|
elemStore,
|
|
20160
|
+
intoRunScroll,
|
|
19639
20161
|
lastScrollTop,
|
|
19640
20162
|
lastScrollLeft,
|
|
19641
20163
|
inWheelScroll,
|
|
@@ -19655,6 +20177,9 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
19655
20177
|
if (inWheelScroll || inVirtualScroll || inHeaderScroll || inFooterScroll) {
|
|
19656
20178
|
return;
|
|
19657
20179
|
}
|
|
20180
|
+
if (intoRunScroll) {
|
|
20181
|
+
return;
|
|
20182
|
+
}
|
|
19658
20183
|
if (!bodyScrollElem) {
|
|
19659
20184
|
return;
|
|
19660
20185
|
}
|
|
@@ -19711,6 +20236,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
19711
20236
|
triggerHeaderScrollEvent(evnt, fixedType) {
|
|
19712
20237
|
const {
|
|
19713
20238
|
elemStore,
|
|
20239
|
+
intoRunScroll,
|
|
19714
20240
|
inWheelScroll,
|
|
19715
20241
|
inVirtualScroll,
|
|
19716
20242
|
inBodyScroll,
|
|
@@ -19721,16 +20247,10 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
19721
20247
|
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
19722
20248
|
const headerScrollElem = getRefElem(elemStore['main-header-scroll']);
|
|
19723
20249
|
const footerScrollElem = getRefElem(elemStore['main-footer-scroll']);
|
|
19724
|
-
if (inWheelScroll) {
|
|
19725
|
-
return;
|
|
19726
|
-
}
|
|
19727
|
-
if (inVirtualScroll) {
|
|
19728
|
-
return;
|
|
19729
|
-
}
|
|
19730
|
-
if (inBodyScroll) {
|
|
20250
|
+
if (inWheelScroll || inVirtualScroll || inBodyScroll || inFooterScroll) {
|
|
19731
20251
|
return;
|
|
19732
20252
|
}
|
|
19733
|
-
if (
|
|
20253
|
+
if (intoRunScroll) {
|
|
19734
20254
|
return;
|
|
19735
20255
|
}
|
|
19736
20256
|
if (!headerScrollElem) {
|
|
@@ -19759,6 +20279,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
19759
20279
|
triggerFooterScrollEvent(evnt, fixedType) {
|
|
19760
20280
|
const {
|
|
19761
20281
|
elemStore,
|
|
20282
|
+
intoRunScroll,
|
|
19762
20283
|
inWheelScroll,
|
|
19763
20284
|
inVirtualScroll,
|
|
19764
20285
|
inHeaderScroll,
|
|
@@ -19769,16 +20290,10 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
19769
20290
|
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
19770
20291
|
const headerScrollElem = getRefElem(elemStore['main-header-scroll']);
|
|
19771
20292
|
const footerScrollElem = getRefElem(elemStore['main-footer-scroll']);
|
|
19772
|
-
if (inWheelScroll) {
|
|
19773
|
-
return;
|
|
19774
|
-
}
|
|
19775
|
-
if (inVirtualScroll) {
|
|
20293
|
+
if (inWheelScroll || inVirtualScroll || inHeaderScroll || inBodyScroll) {
|
|
19776
20294
|
return;
|
|
19777
20295
|
}
|
|
19778
|
-
if (
|
|
19779
|
-
return;
|
|
19780
|
-
}
|
|
19781
|
-
if (inBodyScroll) {
|
|
20296
|
+
if (intoRunScroll) {
|
|
19782
20297
|
return;
|
|
19783
20298
|
}
|
|
19784
20299
|
if (!footerScrollElem) {
|
|
@@ -19806,9 +20321,13 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
19806
20321
|
},
|
|
19807
20322
|
triggerBodyWheelEvent(evnt) {
|
|
19808
20323
|
const {
|
|
20324
|
+
target,
|
|
19809
20325
|
deltaY,
|
|
19810
20326
|
deltaX
|
|
19811
20327
|
} = evnt;
|
|
20328
|
+
if (target && /^textarea$/i.test(target.tagName)) {
|
|
20329
|
+
return;
|
|
20330
|
+
}
|
|
19812
20331
|
const {
|
|
19813
20332
|
highlightHoverRow
|
|
19814
20333
|
} = src_props;
|
|
@@ -19832,26 +20351,13 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
19832
20351
|
if (!bodyScrollElem) {
|
|
19833
20352
|
return;
|
|
19834
20353
|
}
|
|
19835
|
-
|
|
19836
|
-
|
|
19837
|
-
|
|
19838
|
-
} else if (reactData.lastScrollTime + 30 > Date.now()) {
|
|
19839
|
-
multiple = 1.15;
|
|
19840
|
-
} else if (reactData.lastScrollTime + 40 > Date.now()) {
|
|
19841
|
-
multiple = 1.12;
|
|
19842
|
-
} else if (reactData.lastScrollTime + 55 > Date.now()) {
|
|
19843
|
-
multiple = 1.09;
|
|
19844
|
-
} else if (reactData.lastScrollTime + 75 > Date.now()) {
|
|
19845
|
-
multiple = 1.06;
|
|
19846
|
-
} else if (reactData.lastScrollTime + 100 > Date.now()) {
|
|
19847
|
-
multiple = 1.03;
|
|
19848
|
-
}
|
|
19849
|
-
const deltaTop = deltaY * multiple;
|
|
19850
|
-
const deltaLeft = deltaX * multiple;
|
|
20354
|
+
const wheelSpeed = getWheelSpeed(reactData.lastScrollTime);
|
|
20355
|
+
const deltaTop = deltaY * wheelSpeed;
|
|
20356
|
+
const deltaLeft = deltaX * wheelSpeed;
|
|
19851
20357
|
const isTopWheel = deltaTop < 0;
|
|
19852
|
-
const currScrollTop =
|
|
20358
|
+
const currScrollTop = bodyScrollElem.scrollTop;
|
|
19853
20359
|
// 如果滚动位置已经是顶部或底部,则不需要触发
|
|
19854
|
-
if (isTopWheel ? currScrollTop <= 0 : currScrollTop >=
|
|
20360
|
+
if (isTopWheel ? currScrollTop <= 0 : currScrollTop >= bodyScrollElem.scrollHeight - bodyScrollElem.clientHeight) {
|
|
19855
20361
|
return;
|
|
19856
20362
|
}
|
|
19857
20363
|
const scrollTop = bodyScrollElem.scrollTop + deltaTop;
|
|
@@ -19864,16 +20370,29 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
19864
20370
|
if (rowOpts.isHover || highlightHoverRow) {
|
|
19865
20371
|
$xeTable.clearHoverRow();
|
|
19866
20372
|
}
|
|
19867
|
-
|
|
19868
|
-
|
|
19869
|
-
|
|
19870
|
-
|
|
19871
|
-
|
|
19872
|
-
|
|
19873
|
-
|
|
19874
|
-
|
|
19875
|
-
|
|
20373
|
+
wheelScrollTo(scrollTop - bodyScrollElem.scrollTop, offsetTop => {
|
|
20374
|
+
const currTopNum = bodyScrollElem.scrollTop + offsetTop;
|
|
20375
|
+
internalData.inWheelScroll = true;
|
|
20376
|
+
setScrollTop(yHandleEl, currTopNum);
|
|
20377
|
+
setScrollTop(bodyScrollElem, currTopNum);
|
|
20378
|
+
setScrollTop(leftScrollElem, currTopNum);
|
|
20379
|
+
setScrollTop(rightScrollElem, currTopNum);
|
|
20380
|
+
$xeTable.triggerScrollYEvent(evnt);
|
|
20381
|
+
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, currTopNum, scrollLeft, {
|
|
20382
|
+
type: 'table',
|
|
20383
|
+
fixed: ''
|
|
20384
|
+
});
|
|
19876
20385
|
});
|
|
20386
|
+
// internalData.inWheelScroll = true
|
|
20387
|
+
// setScrollTop(yHandleEl, scrollTop)
|
|
20388
|
+
// setScrollTop(bodyScrollElem, scrollTop)
|
|
20389
|
+
// setScrollTop(leftScrollElem, scrollTop)
|
|
20390
|
+
// setScrollTop(rightScrollElem, scrollTop)
|
|
20391
|
+
// loadScrollYData(scrollTop)
|
|
20392
|
+
// $xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
|
|
20393
|
+
// type: 'footer',
|
|
20394
|
+
// fixed: ''
|
|
20395
|
+
// })
|
|
19877
20396
|
}
|
|
19878
20397
|
},
|
|
19879
20398
|
triggerVirtualScrollXEvent(evnt) {
|
|
@@ -20043,45 +20562,43 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20043
20562
|
// 更新纵向 Y 可视渲染上下剩余空间大小
|
|
20044
20563
|
updateScrollYSpace() {
|
|
20045
20564
|
const {
|
|
20046
|
-
|
|
20047
|
-
|
|
20048
|
-
const {
|
|
20049
|
-
scrollYLoad,
|
|
20050
|
-
rowHeight
|
|
20565
|
+
isAllOverflow,
|
|
20566
|
+
scrollYLoad
|
|
20051
20567
|
} = reactData;
|
|
20052
20568
|
const {
|
|
20053
20569
|
scrollYStore,
|
|
20054
20570
|
elemStore,
|
|
20571
|
+
isResizeCellHeight,
|
|
20055
20572
|
afterFullData,
|
|
20056
20573
|
fullAllDataRowIdData
|
|
20057
20574
|
} = internalData;
|
|
20058
20575
|
const {
|
|
20059
20576
|
startIndex
|
|
20060
20577
|
} = scrollYStore;
|
|
20578
|
+
const rowOpts = computeRowOpts.value;
|
|
20579
|
+
const cellOpts = computeCellOpts.value;
|
|
20580
|
+
const defaultRowHeight = computeDefaultRowHeight.value;
|
|
20061
20581
|
const bodyTableElem = getRefElem(elemStore['main-body-table']);
|
|
20062
20582
|
const containerList = ['main', 'left', 'right'];
|
|
20063
20583
|
let topSpaceHeight = 0;
|
|
20064
20584
|
let ySpaceHeight = 0;
|
|
20065
20585
|
if (scrollYLoad) {
|
|
20066
|
-
|
|
20067
|
-
|
|
20068
|
-
|
|
20586
|
+
const isCustomCellHeight = isResizeCellHeight || cellOpts.height || rowOpts.height;
|
|
20587
|
+
if (!isCustomCellHeight && isAllOverflow) {
|
|
20588
|
+
ySpaceHeight = afterFullData.length * defaultRowHeight;
|
|
20589
|
+
topSpaceHeight = Math.max(0, startIndex * defaultRowHeight);
|
|
20069
20590
|
} else {
|
|
20070
20591
|
for (let i = 0; i < afterFullData.length; i++) {
|
|
20071
20592
|
const row = afterFullData[i];
|
|
20072
20593
|
const rowid = getRowid($xeTable, row);
|
|
20073
|
-
const rowRest = fullAllDataRowIdData[rowid];
|
|
20074
|
-
|
|
20075
|
-
ySpaceHeight += rowRest.height || rowHeight;
|
|
20076
|
-
}
|
|
20594
|
+
const rowRest = fullAllDataRowIdData[rowid] || {};
|
|
20595
|
+
ySpaceHeight += rowRest.resizeHeight || rowRest.height || cellOpts.height || rowOpts.height || defaultRowHeight;
|
|
20077
20596
|
}
|
|
20078
20597
|
for (let i = 0; i < startIndex; i++) {
|
|
20079
20598
|
const row = afterFullData[i];
|
|
20080
20599
|
const rowid = getRowid($xeTable, row);
|
|
20081
|
-
const rowRest = fullAllDataRowIdData[rowid];
|
|
20082
|
-
|
|
20083
|
-
topSpaceHeight += rowRest.height || rowHeight;
|
|
20084
|
-
}
|
|
20600
|
+
const rowRest = fullAllDataRowIdData[rowid] || {};
|
|
20601
|
+
topSpaceHeight += rowRest.resizeHeight || rowRest.height || cellOpts.height || rowOpts.height || defaultRowHeight;
|
|
20085
20602
|
}
|
|
20086
20603
|
}
|
|
20087
20604
|
} else {
|
|
@@ -20106,30 +20623,26 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20106
20623
|
if (scrollYSpaceEl) {
|
|
20107
20624
|
scrollYSpaceEl.style.height = ySpaceHeight ? `${ySpaceHeight}px` : '';
|
|
20108
20625
|
}
|
|
20109
|
-
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => {
|
|
20626
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(() => {
|
|
20110
20627
|
updateStyle();
|
|
20111
20628
|
});
|
|
20112
20629
|
},
|
|
20113
20630
|
updateScrollXData() {
|
|
20114
20631
|
const {
|
|
20115
|
-
|
|
20116
|
-
} =
|
|
20632
|
+
isAllOverflow
|
|
20633
|
+
} = reactData;
|
|
20117
20634
|
handleTableColumn();
|
|
20118
|
-
// calcCellHeight()
|
|
20119
20635
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(() => {
|
|
20120
|
-
// calcCellHeight()
|
|
20121
20636
|
handleTableColumn();
|
|
20122
20637
|
$xeTable.updateScrollXSpace();
|
|
20123
|
-
if (!
|
|
20638
|
+
if (!isAllOverflow) {
|
|
20124
20639
|
$xeTable.updateScrollYSpace();
|
|
20125
20640
|
}
|
|
20126
20641
|
});
|
|
20127
20642
|
},
|
|
20128
20643
|
updateScrollYData() {
|
|
20129
20644
|
$xeTable.handleTableData();
|
|
20130
|
-
// calcCellHeight()
|
|
20131
20645
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(() => {
|
|
20132
|
-
// calcCellHeight()
|
|
20133
20646
|
$xeTable.handleTableData();
|
|
20134
20647
|
$xeTable.updateScrollYSpace();
|
|
20135
20648
|
});
|
|
@@ -20474,7 +20987,6 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20474
20987
|
editRules
|
|
20475
20988
|
} = props;
|
|
20476
20989
|
const {
|
|
20477
|
-
isCalcColumn,
|
|
20478
20990
|
isGroup,
|
|
20479
20991
|
overflowX,
|
|
20480
20992
|
overflowY,
|
|
@@ -20484,15 +20996,15 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20484
20996
|
initStore,
|
|
20485
20997
|
columnStore,
|
|
20486
20998
|
filterStore,
|
|
20487
|
-
customStore
|
|
20488
|
-
tooltipStore
|
|
20999
|
+
customStore
|
|
20489
21000
|
} = reactData;
|
|
20490
21001
|
const {
|
|
20491
21002
|
leftList,
|
|
20492
21003
|
rightList
|
|
20493
21004
|
} = columnStore;
|
|
20494
21005
|
const loadingSlot = slots.loading;
|
|
20495
|
-
const
|
|
21006
|
+
const tableTipConfig = computeTableTipConfig.value;
|
|
21007
|
+
const validTipConfig = computeValidTipConfig.value;
|
|
20496
21008
|
const validOpts = computeValidOpts.value;
|
|
20497
21009
|
const checkboxOpts = computeCheckboxOpts.value;
|
|
20498
21010
|
const treeOpts = computeTreeOpts.value;
|
|
@@ -20504,7 +21016,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20504
21016
|
const areaOpts = computeAreaOpts.value;
|
|
20505
21017
|
const loadingOpts = computeLoadingOpts.value;
|
|
20506
21018
|
const isMenu = computeIsMenu.value;
|
|
20507
|
-
const currLoading = reactData.
|
|
21019
|
+
const currLoading = reactData.isColLoading || reactData.isRowLoading || loading;
|
|
20508
21020
|
const resizableOpts = computeResizableOpts.value;
|
|
20509
21021
|
const isArea = mouseConfig && mouseOpts.area;
|
|
20510
21022
|
const columnDragOpts = computeColumnDragOpts.value;
|
|
@@ -20525,7 +21037,6 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20525
21037
|
'row--highlight': rowOpts.isHover || highlightHoverRow,
|
|
20526
21038
|
'column--highlight': columnOpts.isHover || highlightHoverColumn,
|
|
20527
21039
|
'checkbox--range': checkboxOpts.range,
|
|
20528
|
-
'column--calc': isCalcColumn,
|
|
20529
21040
|
'col--drag-cell': columnOpts.drag && columnDragOpts.trigger === 'cell',
|
|
20530
21041
|
'is--header': showHeader,
|
|
20531
21042
|
'is--footer': showFooter,
|
|
@@ -20534,7 +21045,6 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20534
21045
|
'is--fixed-left': leftList.length,
|
|
20535
21046
|
'is--fixed-right': rightList.length,
|
|
20536
21047
|
'is--animat': !!props.animat,
|
|
20537
|
-
'is--padding': props.padding,
|
|
20538
21048
|
'is--round': props.round,
|
|
20539
21049
|
'is--stripe': !treeConfig && stripe,
|
|
20540
21050
|
'is--loading': currLoading,
|
|
@@ -20577,11 +21087,20 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20577
21087
|
* 列宽线
|
|
20578
21088
|
*/
|
|
20579
21089
|
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
20580
|
-
key: '
|
|
20581
|
-
ref:
|
|
20582
|
-
class: 'vxe-table--resizable-bar'
|
|
21090
|
+
key: 'tcl',
|
|
21091
|
+
ref: refColResizeBar,
|
|
21092
|
+
class: 'vxe-table--resizable-col-bar'
|
|
21093
|
+
}, resizableOpts.showDragTip ? [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
21094
|
+
class: 'vxe-table--resizable-number-tip'
|
|
21095
|
+
})] : []),
|
|
21096
|
+
/**
|
|
21097
|
+
* 行高线
|
|
21098
|
+
*/
|
|
21099
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
21100
|
+
key: 'trl',
|
|
21101
|
+
ref: refRowResizeBar,
|
|
21102
|
+
class: 'vxe-table--resizable-row-bar'
|
|
20583
21103
|
}, resizableOpts.showDragTip ? [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
20584
|
-
ref: refCellResizeTip,
|
|
20585
21104
|
class: 'vxe-table--resizable-number-tip'
|
|
20586
21105
|
})] : []),
|
|
20587
21106
|
/**
|
|
@@ -20667,10 +21186,14 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20667
21186
|
/**
|
|
20668
21187
|
* 工具提示
|
|
20669
21188
|
*/
|
|
20670
|
-
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(VxeUITooltipComponent,
|
|
21189
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(VxeUITooltipComponent, {
|
|
20671
21190
|
key: 'btp',
|
|
20672
|
-
ref: refTooltip
|
|
20673
|
-
|
|
21191
|
+
ref: refTooltip,
|
|
21192
|
+
theme: tableTipConfig.theme,
|
|
21193
|
+
enterable: tableTipConfig.enterable,
|
|
21194
|
+
enterDelay: tableTipConfig.enterDelay,
|
|
21195
|
+
leaveDelay: tableTipConfig.leaveDelay
|
|
21196
|
+
}),
|
|
20674
21197
|
/**
|
|
20675
21198
|
* 校验提示
|
|
20676
21199
|
*/
|
|
@@ -20680,9 +21203,10 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20680
21203
|
class: [{
|
|
20681
21204
|
'old-cell-valid': editRules && table_getConfig().cellVaildMode === 'obsolete'
|
|
20682
21205
|
}, 'vxe-table--valid-error'],
|
|
20683
|
-
|
|
20684
|
-
|
|
20685
|
-
|
|
21206
|
+
theme: validTipConfig.theme,
|
|
21207
|
+
enterable: validTipConfig.enterable,
|
|
21208
|
+
enterDelay: validTipConfig.enterDelay,
|
|
21209
|
+
leaveDelay: validTipConfig.leaveDelay
|
|
20686
21210
|
}) : table_renderEmptyElement($xeTable)]) : table_renderEmptyElement($xeTable)]);
|
|
20687
21211
|
};
|
|
20688
21212
|
const dataFlag = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)(0);
|
|
@@ -20700,7 +21224,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20700
21224
|
if (value && value.length >= 50000) {
|
|
20701
21225
|
warnLog('vxe.error.errLargeData', ['loadData(data), reloadData(data)']);
|
|
20702
21226
|
}
|
|
20703
|
-
loadTableData(value).then(() => {
|
|
21227
|
+
loadTableData(value, true).then(() => {
|
|
20704
21228
|
const {
|
|
20705
21229
|
scrollXLoad,
|
|
20706
21230
|
scrollYLoad,
|
|
@@ -20795,10 +21319,10 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20795
21319
|
});
|
|
20796
21320
|
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.syncResize, value => {
|
|
20797
21321
|
if (value) {
|
|
20798
|
-
|
|
21322
|
+
handleUpdateResize();
|
|
20799
21323
|
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => {
|
|
20800
|
-
|
|
20801
|
-
setTimeout(() =>
|
|
21324
|
+
handleUpdateResize();
|
|
21325
|
+
setTimeout(() => handleUpdateResize());
|
|
20802
21326
|
});
|
|
20803
21327
|
}
|
|
20804
21328
|
});
|
|
@@ -20913,6 +21437,9 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20913
21437
|
if (props.showFooter && !(props.footerMethod || props.footerData)) {
|
|
20914
21438
|
warnLog('vxe.error.reqProp', ['footer-data | footer-method']);
|
|
20915
21439
|
}
|
|
21440
|
+
if (rowOpts.height) {
|
|
21441
|
+
warnLog('vxe.error.delProp', ['row-config.height', 'cell-config.height']);
|
|
21442
|
+
}
|
|
20916
21443
|
// if (props.highlightCurrentRow) {
|
|
20917
21444
|
// warnLog('vxe.error.delProp', ['highlight-current-row', 'row-config.isCurrent'])
|
|
20918
21445
|
// }
|
|
@@ -21023,7 +21550,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
21023
21550
|
endIndex: 0,
|
|
21024
21551
|
visibleSize: 0
|
|
21025
21552
|
});
|
|
21026
|
-
loadTableData(data || []).then(() => {
|
|
21553
|
+
loadTableData(data || [], true).then(() => {
|
|
21027
21554
|
if (data && data.length) {
|
|
21028
21555
|
internalData.inited = true;
|
|
21029
21556
|
internalData.initStatus = true;
|
|
@@ -22132,6 +22659,7 @@ edit_hook_hooks.add('tableEditModule', {
|
|
|
22132
22659
|
parent: parentRow,
|
|
22133
22660
|
level: parentLevel + 1,
|
|
22134
22661
|
height: 0,
|
|
22662
|
+
resizeHeight: 0,
|
|
22135
22663
|
oTop: 0
|
|
22136
22664
|
};
|
|
22137
22665
|
fullDataRowIdData[rowid] = rest;
|
|
@@ -22156,6 +22684,7 @@ edit_hook_hooks.add('tableEditModule', {
|
|
|
22156
22684
|
parent: null,
|
|
22157
22685
|
level: 0,
|
|
22158
22686
|
height: 0,
|
|
22687
|
+
resizeHeight: 0,
|
|
22159
22688
|
oTop: 0
|
|
22160
22689
|
};
|
|
22161
22690
|
fullDataRowIdData[rowid] = rest;
|
|
@@ -22211,6 +22740,7 @@ edit_hook_hooks.add('tableEditModule', {
|
|
|
22211
22740
|
parent: null,
|
|
22212
22741
|
level: 0,
|
|
22213
22742
|
height: 0,
|
|
22743
|
+
resizeHeight: 0,
|
|
22214
22744
|
oTop: 0
|
|
22215
22745
|
};
|
|
22216
22746
|
fullDataRowIdData[rowid] = rest;
|
|
@@ -22248,6 +22778,7 @@ edit_hook_hooks.add('tableEditModule', {
|
|
|
22248
22778
|
parent: null,
|
|
22249
22779
|
level: 0,
|
|
22250
22780
|
height: 0,
|
|
22781
|
+
resizeHeight: 0,
|
|
22251
22782
|
oTop: 0
|
|
22252
22783
|
};
|
|
22253
22784
|
fullDataRowIdData[rowid] = rest;
|
|
@@ -22308,6 +22839,7 @@ edit_hook_hooks.add('tableEditModule', {
|
|
|
22308
22839
|
parent: parentRow,
|
|
22309
22840
|
level: parentLevel + 1,
|
|
22310
22841
|
height: 0,
|
|
22842
|
+
resizeHeight: 0,
|
|
22311
22843
|
oTop: 0
|
|
22312
22844
|
};
|
|
22313
22845
|
fullDataRowIdData[rowid] = rest;
|
|
@@ -22382,7 +22914,7 @@ edit_hook_hooks.add('tableEditModule', {
|
|
|
22382
22914
|
const rowid = getRowid($xeTable, newRow);
|
|
22383
22915
|
insertMaps[rowid] = newRow;
|
|
22384
22916
|
});
|
|
22385
|
-
$xeTable.cacheRowMap();
|
|
22917
|
+
$xeTable.cacheRowMap(false);
|
|
22386
22918
|
$xeTable.updateScrollYStatus();
|
|
22387
22919
|
$xeTable.handleTableData(treeConfig && transform);
|
|
22388
22920
|
if (!(treeConfig && transform)) {
|
|
@@ -22645,7 +23177,7 @@ edit_hook_hooks.add('tableEditModule', {
|
|
|
22645
23177
|
editStore.insertMaps = insertDataRowMaps;
|
|
22646
23178
|
reactData.pendingRowMaps = pendingDataRowMaps;
|
|
22647
23179
|
$xeTable.updateFooter();
|
|
22648
|
-
$xeTable.cacheRowMap();
|
|
23180
|
+
$xeTable.cacheRowMap(false);
|
|
22649
23181
|
$xeTable.handleTableData(treeConfig && transform);
|
|
22650
23182
|
if (!(treeConfig && transform)) {
|
|
22651
23183
|
$xeTable.updateAfterDataIndex();
|
|
@@ -23368,7 +23900,21 @@ function getTxtCellValue(val, vMaps) {
|
|
|
23368
23900
|
const rest = replaceTxtCell(val, vMaps);
|
|
23369
23901
|
return rest.replace(/^"+$/g, qVal => '"'.repeat(Math.ceil(qVal.length / 2)));
|
|
23370
23902
|
}
|
|
23371
|
-
function
|
|
23903
|
+
function toExportField(tableConf, field) {
|
|
23904
|
+
const {
|
|
23905
|
+
fieldMaps,
|
|
23906
|
+
titleMaps
|
|
23907
|
+
} = tableConf;
|
|
23908
|
+
// title 转 field
|
|
23909
|
+
if (!fieldMaps[field]) {
|
|
23910
|
+
const teCol = titleMaps[field];
|
|
23911
|
+
if (teCol && teCol.field) {
|
|
23912
|
+
field = teCol.field;
|
|
23913
|
+
}
|
|
23914
|
+
}
|
|
23915
|
+
return field;
|
|
23916
|
+
}
|
|
23917
|
+
function parseCsvAndTxt(tableConf, content, cellSeparator) {
|
|
23372
23918
|
const list = content.split(enterSymbol);
|
|
23373
23919
|
const rows = [];
|
|
23374
23920
|
let fields = [];
|
|
@@ -23389,7 +23935,7 @@ function parseCsvAndTxt(columns, content, cellSeparator) {
|
|
|
23389
23935
|
});
|
|
23390
23936
|
const cells = rVal.split(cellSeparator);
|
|
23391
23937
|
if (!fields.length) {
|
|
23392
|
-
fields = cells.map(val => getTxtCellValue(val.trim(), vMaps));
|
|
23938
|
+
fields = cells.map(val => toExportField(tableConf, getTxtCellValue(val.trim(), vMaps)));
|
|
23393
23939
|
} else {
|
|
23394
23940
|
cells.forEach((val, colIndex) => {
|
|
23395
23941
|
if (colIndex < fields.length) {
|
|
@@ -23406,13 +23952,13 @@ function parseCsvAndTxt(columns, content, cellSeparator) {
|
|
|
23406
23952
|
rows
|
|
23407
23953
|
};
|
|
23408
23954
|
}
|
|
23409
|
-
function parseCsv(
|
|
23410
|
-
return parseCsvAndTxt(
|
|
23955
|
+
function parseCsv(tableConf, content) {
|
|
23956
|
+
return parseCsvAndTxt(tableConf, content, ',');
|
|
23411
23957
|
}
|
|
23412
|
-
function parseTxt(
|
|
23413
|
-
return parseCsvAndTxt(
|
|
23958
|
+
function parseTxt(tableConf, content) {
|
|
23959
|
+
return parseCsvAndTxt(tableConf, content, '\t');
|
|
23414
23960
|
}
|
|
23415
|
-
function parseHTML(
|
|
23961
|
+
function parseHTML(tableConf, content) {
|
|
23416
23962
|
const domParser = new DOMParser();
|
|
23417
23963
|
const xmlDoc = domParser.parseFromString(content, 'text/html');
|
|
23418
23964
|
const bodyNodes = getElementsByTagName(xmlDoc, 'body');
|
|
@@ -23425,7 +23971,7 @@ function parseHTML(columns, content) {
|
|
|
23425
23971
|
if (theadNodes.length) {
|
|
23426
23972
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(getElementsByTagName(theadNodes[0], 'tr'), rowNode => {
|
|
23427
23973
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(getElementsByTagName(rowNode, 'th'), cellNode => {
|
|
23428
|
-
fields.push(cellNode.textContent);
|
|
23974
|
+
fields.push(toExportField(tableConf, cellNode.textContent || ''));
|
|
23429
23975
|
});
|
|
23430
23976
|
});
|
|
23431
23977
|
const tbodyNodes = getElementsByTagName(tableNodes[0], 'tbody');
|
|
@@ -23448,7 +23994,7 @@ function parseHTML(columns, content) {
|
|
|
23448
23994
|
rows
|
|
23449
23995
|
};
|
|
23450
23996
|
}
|
|
23451
|
-
function parseXML(
|
|
23997
|
+
function parseXML(tableConf, content) {
|
|
23452
23998
|
const domParser = new DOMParser();
|
|
23453
23999
|
const xmlDoc = domParser.parseFromString(content, 'application/xml');
|
|
23454
24000
|
const sheetNodes = getElementsByTagName(xmlDoc, 'Worksheet');
|
|
@@ -23460,7 +24006,7 @@ function parseXML(columns, content) {
|
|
|
23460
24006
|
const rowNodes = getElementsByTagName(tableNodes[0], 'Row');
|
|
23461
24007
|
if (rowNodes.length) {
|
|
23462
24008
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(getElementsByTagName(rowNodes[0], 'Cell'), cellNode => {
|
|
23463
|
-
fields.push(cellNode.textContent);
|
|
24009
|
+
fields.push(toExportField(tableConf, cellNode.textContent || ''));
|
|
23464
24010
|
});
|
|
23465
24011
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(rowNodes, (rowNode, index) => {
|
|
23466
24012
|
if (index) {
|
|
@@ -23493,21 +24039,6 @@ function clearColumnConvert(columns) {
|
|
|
23493
24039
|
children: 'children'
|
|
23494
24040
|
});
|
|
23495
24041
|
}
|
|
23496
|
-
/**
|
|
23497
|
-
* 检查导入的列是否完整
|
|
23498
|
-
* @param {Array} fields 字段名列表
|
|
23499
|
-
* @param {Array} rows 数据列表
|
|
23500
|
-
*/
|
|
23501
|
-
function checkImportData(columns, fields) {
|
|
23502
|
-
const tableFields = [];
|
|
23503
|
-
columns.forEach(column => {
|
|
23504
|
-
const field = column.field;
|
|
23505
|
-
if (field) {
|
|
23506
|
-
tableFields.push(field);
|
|
23507
|
-
}
|
|
23508
|
-
});
|
|
23509
|
-
return fields.some(field => tableFields.indexOf(field) > -1);
|
|
23510
|
-
}
|
|
23511
24042
|
const tableExportMethodKeys = ['exportData', 'importByFile', 'importData', 'saveFile', 'readFile', 'print', 'getPrintHtml', 'openImport', 'closeImport', 'openExport', 'closeExport', 'openPrint', 'closePrint'];
|
|
23512
24043
|
export_hook_hooks.add('tableExportModule', {
|
|
23513
24044
|
setupTable($xeTable) {
|
|
@@ -24136,25 +24667,41 @@ export_hook_hooks.add('tableExportModule', {
|
|
|
24136
24667
|
fields: [],
|
|
24137
24668
|
rows: []
|
|
24138
24669
|
};
|
|
24670
|
+
const tableFieldMaps = {};
|
|
24671
|
+
const tableTitleMaps = {};
|
|
24672
|
+
tableFullColumn.forEach(column => {
|
|
24673
|
+
const field = column.field;
|
|
24674
|
+
const title = column.getTitle();
|
|
24675
|
+
if (field) {
|
|
24676
|
+
tableFieldMaps[field] = column;
|
|
24677
|
+
}
|
|
24678
|
+
if (title) {
|
|
24679
|
+
tableTitleMaps[column.getTitle()] = column;
|
|
24680
|
+
}
|
|
24681
|
+
});
|
|
24682
|
+
const tableConf = {
|
|
24683
|
+
fieldMaps: tableFieldMaps,
|
|
24684
|
+
titleMaps: tableTitleMaps
|
|
24685
|
+
};
|
|
24139
24686
|
switch (opts.type) {
|
|
24140
24687
|
case 'csv':
|
|
24141
|
-
rest = parseCsv(
|
|
24688
|
+
rest = parseCsv(tableConf, content);
|
|
24142
24689
|
break;
|
|
24143
24690
|
case 'txt':
|
|
24144
|
-
rest = parseTxt(
|
|
24691
|
+
rest = parseTxt(tableConf, content);
|
|
24145
24692
|
break;
|
|
24146
24693
|
case 'html':
|
|
24147
|
-
rest = parseHTML(
|
|
24694
|
+
rest = parseHTML(tableConf, content);
|
|
24148
24695
|
break;
|
|
24149
24696
|
case 'xml':
|
|
24150
|
-
rest = parseXML(
|
|
24697
|
+
rest = parseXML(tableConf, content);
|
|
24151
24698
|
break;
|
|
24152
24699
|
}
|
|
24153
24700
|
const {
|
|
24154
24701
|
fields,
|
|
24155
24702
|
rows
|
|
24156
24703
|
} = rest;
|
|
24157
|
-
const status =
|
|
24704
|
+
const status = fields.some(field => tableFieldMaps[field] || tableTitleMaps[field]);
|
|
24158
24705
|
if (status) {
|
|
24159
24706
|
$xeTable.createData(rows).then(data => {
|
|
24160
24707
|
let loadRest;
|
|
@@ -24312,6 +24859,43 @@ export_hook_hooks.add('tableExportModule', {
|
|
|
24312
24859
|
return Promise.reject(e);
|
|
24313
24860
|
});
|
|
24314
24861
|
};
|
|
24862
|
+
const handleFilterColumns = (exportOpts, column, columns) => {
|
|
24863
|
+
return columns.some(item => {
|
|
24864
|
+
if (isColumnInfo(item)) {
|
|
24865
|
+
return column.id === item.id;
|
|
24866
|
+
} else if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(item)) {
|
|
24867
|
+
return column.field === item;
|
|
24868
|
+
} else {
|
|
24869
|
+
const colid = item.id || item.colId;
|
|
24870
|
+
const type = item.type;
|
|
24871
|
+
const field = item.field;
|
|
24872
|
+
if (colid) {
|
|
24873
|
+
return column.id === colid;
|
|
24874
|
+
} else if (field && type) {
|
|
24875
|
+
return column.field === field && column.type === type;
|
|
24876
|
+
} else if (field) {
|
|
24877
|
+
return column.field === field;
|
|
24878
|
+
} else if (type) {
|
|
24879
|
+
return column.type === type;
|
|
24880
|
+
}
|
|
24881
|
+
}
|
|
24882
|
+
return false;
|
|
24883
|
+
});
|
|
24884
|
+
};
|
|
24885
|
+
const handleFilterFields = (exportOpts, column, includeFields, excludeFields) => {
|
|
24886
|
+
if (excludeFields) {
|
|
24887
|
+
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().includes(excludeFields, column.field)) {
|
|
24888
|
+
return false;
|
|
24889
|
+
}
|
|
24890
|
+
}
|
|
24891
|
+
if (includeFields) {
|
|
24892
|
+
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().includes(includeFields, column.field)) {
|
|
24893
|
+
return true;
|
|
24894
|
+
}
|
|
24895
|
+
return false;
|
|
24896
|
+
}
|
|
24897
|
+
return exportOpts.original ? column.field : defaultFilterExportColumn(column);
|
|
24898
|
+
};
|
|
24315
24899
|
const handleExportAndPrint = (options, isPrint) => {
|
|
24316
24900
|
const {
|
|
24317
24901
|
treeConfig,
|
|
@@ -24352,7 +24936,9 @@ export_hook_hooks.add('tableExportModule', {
|
|
|
24352
24936
|
const checkMethod = customOpts.checkMethod;
|
|
24353
24937
|
const exportColumns = collectColumn.slice(0);
|
|
24354
24938
|
const {
|
|
24355
|
-
columns
|
|
24939
|
+
columns,
|
|
24940
|
+
excludeFields,
|
|
24941
|
+
includeFields
|
|
24356
24942
|
} = defOpts;
|
|
24357
24943
|
// 处理类型
|
|
24358
24944
|
const typeList = types.map(value => {
|
|
@@ -24376,33 +24962,19 @@ export_hook_hooks.add('tableExportModule', {
|
|
|
24376
24962
|
// 默认选中
|
|
24377
24963
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(exportColumns, (column, index, items, path, parent) => {
|
|
24378
24964
|
const isColGroup = column.children && column.children.length;
|
|
24379
|
-
|
|
24380
|
-
|
|
24381
|
-
|
|
24382
|
-
|
|
24383
|
-
|
|
24384
|
-
|
|
24385
|
-
|
|
24386
|
-
const colid = item.id || item.colId;
|
|
24387
|
-
const type = item.type;
|
|
24388
|
-
const field = item.field;
|
|
24389
|
-
if (colid) {
|
|
24390
|
-
return column.id === colid;
|
|
24391
|
-
} else if (field && type) {
|
|
24392
|
-
return column.field === field && column.type === type;
|
|
24393
|
-
} else if (field) {
|
|
24394
|
-
return column.field === field;
|
|
24395
|
-
} else if (type) {
|
|
24396
|
-
return column.type === type;
|
|
24397
|
-
}
|
|
24398
|
-
}
|
|
24399
|
-
return false;
|
|
24400
|
-
}) : column.visible;
|
|
24401
|
-
column.halfChecked = false;
|
|
24402
|
-
column.disabled = parent && parent.disabled || (checkMethod ? !checkMethod({
|
|
24403
|
-
column
|
|
24404
|
-
}) : false);
|
|
24965
|
+
let isChecked = false;
|
|
24966
|
+
if (columns && columns.length) {
|
|
24967
|
+
isChecked = handleFilterColumns(defOpts, column, columns);
|
|
24968
|
+
} else if (excludeFields || includeFields) {
|
|
24969
|
+
isChecked = handleFilterFields(defOpts, column, includeFields, excludeFields);
|
|
24970
|
+
} else {
|
|
24971
|
+
isChecked = column.visible && (isColGroup || defaultFilterExportColumn(column));
|
|
24405
24972
|
}
|
|
24973
|
+
column.checked = isChecked;
|
|
24974
|
+
column.halfChecked = false;
|
|
24975
|
+
column.disabled = parent && parent.disabled || (checkMethod ? !checkMethod({
|
|
24976
|
+
column
|
|
24977
|
+
}) : false);
|
|
24406
24978
|
});
|
|
24407
24979
|
// 更新条件
|
|
24408
24980
|
Object.assign(exportStore, {
|
|
@@ -25039,38 +25611,75 @@ keyboard_hook_hooks.add('tableKeyboardModule', {
|
|
|
25039
25611
|
computeEditOpts,
|
|
25040
25612
|
computeCheckboxOpts,
|
|
25041
25613
|
computeMouseOpts,
|
|
25042
|
-
computeTreeOpts
|
|
25614
|
+
computeTreeOpts,
|
|
25615
|
+
computeRowOpts,
|
|
25616
|
+
computeCellOpts,
|
|
25617
|
+
computeDefaultRowHeight
|
|
25043
25618
|
} = $xeTable.getComputeMaps();
|
|
25044
25619
|
function getCheckboxRangeRows(evnt, params, targetTrElem, trRect, offsetClientTop, moveRange) {
|
|
25620
|
+
const {
|
|
25621
|
+
showOverflow
|
|
25622
|
+
} = props;
|
|
25623
|
+
const {
|
|
25624
|
+
fullAllDataRowIdData,
|
|
25625
|
+
isResizeCellHeight
|
|
25626
|
+
} = internalData;
|
|
25627
|
+
const rowOpts = computeRowOpts.value;
|
|
25628
|
+
const cellOpts = computeCellOpts.value;
|
|
25629
|
+
const defaultRowHeight = computeDefaultRowHeight.value;
|
|
25630
|
+
const {
|
|
25631
|
+
row
|
|
25632
|
+
} = params;
|
|
25045
25633
|
let countHeight = 0;
|
|
25046
25634
|
let rangeRows = [];
|
|
25047
25635
|
let moveSize = 0;
|
|
25048
25636
|
const isDown = moveRange > 0;
|
|
25049
25637
|
const {
|
|
25050
|
-
scrollYLoad
|
|
25051
|
-
rowHeight
|
|
25638
|
+
scrollYLoad
|
|
25052
25639
|
} = reactData;
|
|
25053
25640
|
const {
|
|
25054
25641
|
afterFullData
|
|
25055
25642
|
} = internalData;
|
|
25643
|
+
if (isDown) {
|
|
25644
|
+
moveSize = offsetClientTop + moveRange;
|
|
25645
|
+
} else {
|
|
25646
|
+
moveSize = trRect.height - offsetClientTop + Math.abs(moveRange);
|
|
25647
|
+
}
|
|
25056
25648
|
if (scrollYLoad) {
|
|
25057
|
-
|
|
25058
|
-
|
|
25059
|
-
|
|
25060
|
-
|
|
25061
|
-
|
|
25062
|
-
|
|
25063
|
-
|
|
25064
|
-
|
|
25649
|
+
const _rowIndex = $xeTable.getVTRowIndex(row);
|
|
25650
|
+
const isCustomCellHeight = isResizeCellHeight || cellOpts.height || rowOpts.height;
|
|
25651
|
+
if (!isCustomCellHeight && showOverflow) {
|
|
25652
|
+
if (isDown) {
|
|
25653
|
+
rangeRows = afterFullData.slice(_rowIndex, _rowIndex + Math.ceil(moveSize / defaultRowHeight));
|
|
25654
|
+
} else {
|
|
25655
|
+
rangeRows = afterFullData.slice(_rowIndex - Math.floor(moveSize / defaultRowHeight), _rowIndex + 1);
|
|
25656
|
+
}
|
|
25065
25657
|
} else {
|
|
25066
|
-
|
|
25658
|
+
if (isDown) {
|
|
25659
|
+
for (let i = _rowIndex; i < afterFullData.length; i++) {
|
|
25660
|
+
const item = afterFullData[i];
|
|
25661
|
+
const rowid = $xeTable.getRowid(item);
|
|
25662
|
+
const rowRest = fullAllDataRowIdData[rowid] || {};
|
|
25663
|
+
countHeight += rowRest.resizeHeight || cellOpts.height || rowOpts.height || defaultRowHeight;
|
|
25664
|
+
rangeRows.push(item);
|
|
25665
|
+
if (countHeight > moveSize) {
|
|
25666
|
+
return rangeRows;
|
|
25667
|
+
}
|
|
25668
|
+
}
|
|
25669
|
+
} else {
|
|
25670
|
+
for (let len = _rowIndex; len >= 0; len--) {
|
|
25671
|
+
const item = afterFullData[len];
|
|
25672
|
+
const rowid = $xeTable.getRowid(item);
|
|
25673
|
+
const rowRest = fullAllDataRowIdData[rowid] || {};
|
|
25674
|
+
countHeight += rowRest.resizeHeight || cellOpts.height || rowOpts.height || defaultRowHeight;
|
|
25675
|
+
rangeRows.push(item);
|
|
25676
|
+
if (countHeight > moveSize) {
|
|
25677
|
+
return rangeRows;
|
|
25678
|
+
}
|
|
25679
|
+
}
|
|
25680
|
+
}
|
|
25067
25681
|
}
|
|
25068
25682
|
} else {
|
|
25069
|
-
if (isDown) {
|
|
25070
|
-
moveSize = evnt.clientY - trRect.y;
|
|
25071
|
-
} else {
|
|
25072
|
-
moveSize = trRect.y - evnt.clientY + trRect.height;
|
|
25073
|
-
}
|
|
25074
25683
|
const siblingProp = isDown ? 'next' : 'previous';
|
|
25075
25684
|
while (targetTrElem && countHeight < moveSize) {
|
|
25076
25685
|
const rowNodeRest = $xeTable.getRowNode(targetTrElem);
|
|
@@ -25084,24 +25693,30 @@ keyboard_hook_hooks.add('tableKeyboardModule', {
|
|
|
25084
25693
|
return rangeRows;
|
|
25085
25694
|
}
|
|
25086
25695
|
const handleCheckboxRangeEvent = (evnt, params) => {
|
|
25696
|
+
const {
|
|
25697
|
+
elemStore
|
|
25698
|
+
} = internalData;
|
|
25699
|
+
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
25700
|
+
const leftScrollElem = getRefElem(elemStore['left-body-scroll']);
|
|
25701
|
+
const rightScrollElem = getRefElem(elemStore['right-body-scroll']);
|
|
25087
25702
|
const {
|
|
25088
25703
|
column,
|
|
25089
25704
|
cell
|
|
25090
25705
|
} = params;
|
|
25091
25706
|
if (column.type === 'checkbox') {
|
|
25092
|
-
|
|
25093
|
-
|
|
25094
|
-
|
|
25095
|
-
}
|
|
25096
|
-
|
|
25097
|
-
|
|
25098
|
-
const bodyWrapperElem = getRefElem(elemStore[`${column.fixed || 'main'}-body-wrapper`] || elemStore['main-body-wrapper']);
|
|
25707
|
+
let bodyWrapperElem = bodyScrollElem;
|
|
25708
|
+
if (leftScrollElem && column.fixed === 'left') {
|
|
25709
|
+
bodyWrapperElem = leftScrollElem;
|
|
25710
|
+
} else if (rightScrollElem && column.fixed === 'right') {
|
|
25711
|
+
bodyWrapperElem = rightScrollElem;
|
|
25712
|
+
}
|
|
25099
25713
|
if (!bodyWrapperElem) {
|
|
25100
25714
|
return;
|
|
25101
25715
|
}
|
|
25716
|
+
const el = refElem.value;
|
|
25717
|
+
const disX = evnt.clientX;
|
|
25718
|
+
const disY = evnt.clientY;
|
|
25102
25719
|
const checkboxRangeElem = bodyWrapperElem.querySelector('.vxe-table--checkbox-range');
|
|
25103
|
-
const domMousemove = document.onmousemove;
|
|
25104
|
-
const domMouseup = document.onmouseup;
|
|
25105
25720
|
const trElem = cell.parentElement;
|
|
25106
25721
|
const selectRecords = $xeTable.getCheckboxRecords();
|
|
25107
25722
|
let lastRangeRows = [];
|
|
@@ -25244,8 +25859,8 @@ keyboard_hook_hooks.add('tableKeyboardModule', {
|
|
|
25244
25859
|
stopMouseScroll();
|
|
25245
25860
|
removeClass(el, 'drag--range');
|
|
25246
25861
|
checkboxRangeElem.removeAttribute('style');
|
|
25247
|
-
document.onmousemove =
|
|
25248
|
-
document.onmouseup =
|
|
25862
|
+
document.onmousemove = null;
|
|
25863
|
+
document.onmouseup = null;
|
|
25249
25864
|
triggerEvent('end', evnt);
|
|
25250
25865
|
};
|
|
25251
25866
|
triggerEvent('start', evnt);
|
|
@@ -28228,7 +28843,7 @@ const {
|
|
|
28228
28843
|
renderEmptyElement: grid_renderEmptyElement
|
|
28229
28844
|
} = core_.VxeUI;
|
|
28230
28845
|
const tableComponentPropKeys = Object.keys(src_props);
|
|
28231
|
-
const tableComponentMethodKeys = ['clearAll', 'syncData', 'updateData', 'loadData', 'reloadData', 'reloadRow', 'loadColumn', 'reloadColumn', 'getRowNode', 'getColumnNode', 'getRowIndex', 'getVTRowIndex', 'getVMRowIndex', 'getColumnIndex', 'getVTColumnIndex', 'getVMColumnIndex', 'setRow', 'createData', 'createRow', 'revertData', 'clearData', 'isInsertByRow', 'isUpdateByRow', 'getColumns', 'getColumnById', 'getColumnByField', 'getTableColumn', 'getFullColumns', 'getData', 'getCheckboxRecords', 'getParentRow', 'getTreeParentRow', 'getRowSeq', 'getRowById', 'getRowid', 'getTableData', 'getFullData', 'setColumnFixed', 'clearColumnFixed', 'setColumnWidth', 'getColumnWidth', 'hideColumn', 'showColumn', 'resetColumn', 'refreshColumn', 'refreshScroll', 'recalculate', 'closeTooltip', 'isAllCheckboxChecked', 'isAllCheckboxIndeterminate', 'getCheckboxIndeterminateRecords', 'setCheckboxRow', 'setCheckboxRowKey', 'isCheckedByCheckboxRow', 'isCheckedByCheckboxRowKey', 'isIndeterminateByCheckboxRow', 'isIndeterminateByCheckboxRowKey', 'toggleCheckboxRow', 'setAllCheckboxRow', 'getRadioReserveRecord', 'clearRadioReserve', 'getCheckboxReserveRecords', 'clearCheckboxReserve', 'toggleAllCheckboxRow', 'clearCheckboxRow', 'setCurrentRow', 'isCheckedByRadioRow', 'isCheckedByRadioRowKey', 'setRadioRow', 'setRadioRowKey', 'clearCurrentRow', 'clearRadioRow', 'getCurrentRecord', 'getRadioRecord', 'getCurrentColumn', 'setCurrentColumn', 'clearCurrentColumn', 'setPendingRow', 'togglePendingRow', 'getPendingRecords', 'clearPendingRow', 'sort', 'setSort', 'clearSort', 'isSort', 'getSortColumns', 'closeFilter', 'isFilter', 'isActiveFilterByColumn', 'isRowExpandLoaded', 'clearRowExpandLoaded', 'reloadRowExpand', 'reloadRowExpand', 'toggleRowExpand', 'setAllRowExpand', 'setRowExpand', 'isExpandByRow', 'isRowExpandByRow', 'clearRowExpand', 'clearRowExpandReserve', 'getRowExpandRecords', 'getTreeExpandRecords', 'isTreeExpandLoaded', 'clearTreeExpandLoaded', 'reloadTreeExpand', 'reloadTreeChilds', 'toggleTreeExpand', 'setAllTreeExpand', 'setTreeExpand', 'isTreeExpandByRow', 'clearTreeExpand', 'clearTreeExpandReserve', 'getScroll', 'scrollTo', 'scrollToRow', 'scrollToColumn', 'clearScroll', 'updateFooter', 'updateStatus', 'setMergeCells', 'removeInsertRow', 'removeMergeCells', 'getMergeCells', 'clearMergeCells', 'setMergeFooterItems', 'removeMergeFooterItems', 'getMergeFooterItems', 'clearMergeFooterItems', 'getCustomStoreData', 'openTooltip', 'getCellLabel', 'getCellElement', 'focus', 'blur', 'connect'];
|
|
28846
|
+
const tableComponentMethodKeys = ['clearAll', 'syncData', 'updateData', 'loadData', 'reloadData', 'reloadRow', 'loadColumn', 'reloadColumn', 'getRowNode', 'getColumnNode', 'getRowIndex', 'getVTRowIndex', 'getVMRowIndex', 'getColumnIndex', 'getVTColumnIndex', 'getVMColumnIndex', 'setRow', 'createData', 'createRow', 'revertData', 'clearData', 'isInsertByRow', 'isUpdateByRow', 'getColumns', 'getColumnById', 'getColumnByField', 'getTableColumn', 'getFullColumns', 'getData', 'getCheckboxRecords', 'getParentRow', 'getTreeParentRow', 'getRowSeq', 'getRowById', 'getRowid', 'getTableData', 'getFullData', 'setColumnFixed', 'clearColumnFixed', 'setColumnWidth', 'getColumnWidth', 'setRowHeightConf', 'getRowHeightConf', 'setRowHeight', 'getRowHeight', 'hideColumn', 'showColumn', 'resetColumn', 'refreshColumn', 'refreshScroll', 'recalculate', 'closeTooltip', 'isAllCheckboxChecked', 'isAllCheckboxIndeterminate', 'getCheckboxIndeterminateRecords', 'setCheckboxRow', 'setCheckboxRowKey', 'isCheckedByCheckboxRow', 'isCheckedByCheckboxRowKey', 'isIndeterminateByCheckboxRow', 'isIndeterminateByCheckboxRowKey', 'toggleCheckboxRow', 'setAllCheckboxRow', 'getRadioReserveRecord', 'clearRadioReserve', 'getCheckboxReserveRecords', 'clearCheckboxReserve', 'toggleAllCheckboxRow', 'clearCheckboxRow', 'setCurrentRow', 'isCheckedByRadioRow', 'isCheckedByRadioRowKey', 'setRadioRow', 'setRadioRowKey', 'clearCurrentRow', 'clearRadioRow', 'getCurrentRecord', 'getRadioRecord', 'getCurrentColumn', 'setCurrentColumn', 'clearCurrentColumn', 'setPendingRow', 'togglePendingRow', 'getPendingRecords', 'clearPendingRow', 'sort', 'setSort', 'clearSort', 'isSort', 'getSortColumns', 'closeFilter', 'isFilter', 'isActiveFilterByColumn', 'isRowExpandLoaded', 'clearRowExpandLoaded', 'reloadRowExpand', 'reloadRowExpand', 'toggleRowExpand', 'setAllRowExpand', 'setRowExpand', 'isExpandByRow', 'isRowExpandByRow', 'clearRowExpand', 'clearRowExpandReserve', 'getRowExpandRecords', 'getTreeExpandRecords', 'isTreeExpandLoaded', 'clearTreeExpandLoaded', 'reloadTreeExpand', 'reloadTreeChilds', 'toggleTreeExpand', 'setAllTreeExpand', 'setTreeExpand', 'isTreeExpandByRow', 'clearTreeExpand', 'clearTreeExpandReserve', 'getScroll', 'scrollTo', 'scrollToRow', 'scrollToColumn', 'clearScroll', 'updateFooter', 'updateStatus', 'setMergeCells', 'removeInsertRow', 'removeMergeCells', 'getMergeCells', 'clearMergeCells', 'setMergeFooterItems', 'removeMergeFooterItems', 'getMergeFooterItems', 'clearMergeFooterItems', 'getCustomStoreData', 'openTooltip', 'getCellLabel', 'getCellElement', 'focus', 'blur', 'connect'];
|
|
28232
28847
|
const gridComponentEmits = [...emits, 'page-change', 'form-submit', 'form-submit-invalid', 'form-reset', 'form-collapse', 'form-toggle-collapse', 'proxy-query', 'proxy-delete', 'proxy-save', 'toolbar-button-click', 'toolbar-tool-click', 'zoom'];
|
|
28233
28848
|
/* harmony default export */ var grid = ((0,external_commonjs_vue_commonjs2_vue_root_Vue_.defineComponent)({
|
|
28234
28849
|
name: 'VxeGrid',
|
|
@@ -29868,7 +30483,8 @@ const Grid = VxeGrid;
|
|
|
29868
30483
|
customRestore: '恢复默认',
|
|
29869
30484
|
maxFixedCol: '最大冻结列的数量不能超过 {0} 个',
|
|
29870
30485
|
dragTip: '移动:{0}',
|
|
29871
|
-
resizeColTip: '{0} 像素'
|
|
30486
|
+
resizeColTip: '宽:{0} 像素',
|
|
30487
|
+
resizeRowTip: '高:{0} 像素'
|
|
29872
30488
|
},
|
|
29873
30489
|
grid: {
|
|
29874
30490
|
selectOneRecord: '请至少选择一条记录!',
|