vxe-table 4.10.6-beta.9 → 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 +118 -84
- 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 +45 -7
- package/es/table/src/header.js +67 -165
- package/es/table/src/props.js +14 -4
- package/es/table/src/table.js +858 -398
- package/es/table/src/util.js +77 -62
- package/es/table/style.css +246 -191
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +20 -7
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +246 -191
- 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 +1489 -874
- 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 +121 -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 +45 -5
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/header.js +51 -178
- 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 +911 -384
- 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 +246 -191
- package/lib/table/style/style.min.css +1 -1
- package/lib/ui/index.js +20 -7
- 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 +246 -191
- 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 +136 -94
- 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 +48 -8
- package/packages/table/src/header.ts +67 -165
- package/packages/table/src/props.ts +14 -5
- package/packages/table/src/table.ts +862 -398
- package/packages/table/src/util.ts +81 -62
- package/packages/ui/index.ts +19 -6
- package/styles/components/table.scss +313 -274
- 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.1736854674495.ttf → iconfont.1738985856004.ttf} +0 -0
- /package/es/{iconfont.1736854674495.woff → iconfont.1738985856004.woff} +0 -0
- /package/es/{iconfont.1736854674495.woff2 → iconfont.1738985856004.woff2} +0 -0
- /package/lib/{iconfont.1736854674495.ttf → iconfont.1738985856004.ttf} +0 -0
- /package/lib/{iconfont.1736854674495.woff → iconfont.1738985856004.woff} +0 -0
- /package/lib/{iconfont.1736854674495.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,20 +3324,20 @@ core_.VxeUI.setConfig({
|
|
|
3311
3324
|
isReplace: true
|
|
3312
3325
|
},
|
|
3313
3326
|
virtualXConfig: {
|
|
3314
|
-
|
|
3327
|
+
enabled: true,
|
|
3315
3328
|
gt: 60,
|
|
3316
3329
|
preSize: 0,
|
|
3317
3330
|
oSize: 1
|
|
3318
3331
|
},
|
|
3319
3332
|
virtualYConfig: {
|
|
3320
|
-
|
|
3333
|
+
enabled: true,
|
|
3321
3334
|
gt: 100,
|
|
3322
3335
|
preSize: 1,
|
|
3323
3336
|
oSize: 2
|
|
3324
3337
|
},
|
|
3325
3338
|
scrollbarConfig: {
|
|
3326
|
-
width:
|
|
3327
|
-
height:
|
|
3339
|
+
// width: 0,
|
|
3340
|
+
// height: 0
|
|
3328
3341
|
}
|
|
3329
3342
|
},
|
|
3330
3343
|
// export: {
|
|
@@ -3570,7 +3583,7 @@ var esnext_iterator_some = __webpack_require__(7550);
|
|
|
3570
3583
|
const {
|
|
3571
3584
|
log: log_log
|
|
3572
3585
|
} = core_.VxeUI;
|
|
3573
|
-
const log_version = `table v${"4.10.6
|
|
3586
|
+
const log_version = `table v${"4.10.6"}`;
|
|
3574
3587
|
const warnLog = log_log.create('warn', log_version);
|
|
3575
3588
|
const errLog = log_log.create('error', log_version);
|
|
3576
3589
|
;// ./packages/table/src/columnInfo.ts
|
|
@@ -3659,6 +3672,8 @@ class ColumnInfo {
|
|
|
3659
3672
|
footerClassName: _vm.footerClassName,
|
|
3660
3673
|
formatter: formatter,
|
|
3661
3674
|
footerFormatter: _vm.footerFormatter,
|
|
3675
|
+
padding: _vm.padding,
|
|
3676
|
+
verticalAlign: _vm.verticalAlign,
|
|
3662
3677
|
sortable: _vm.sortable,
|
|
3663
3678
|
sortBy: _vm.sortBy,
|
|
3664
3679
|
sortType: _vm.sortType,
|
|
@@ -3670,6 +3685,7 @@ class ColumnInfo {
|
|
|
3670
3685
|
filterRender: _vm.filterRender,
|
|
3671
3686
|
treeNode: _vm.treeNode,
|
|
3672
3687
|
dragSort: _vm.dragSort,
|
|
3688
|
+
rowResize: _vm.rowResize,
|
|
3673
3689
|
cellType: _vm.cellType,
|
|
3674
3690
|
cellRender: _vm.cellRender,
|
|
3675
3691
|
editRender: _vm.editRender,
|
|
@@ -4048,7 +4064,7 @@ function getRowid($xeTable, row) {
|
|
|
4048
4064
|
}
|
|
4049
4065
|
const handleFieldOrColumn = ($xeTable, fieldOrColumn) => {
|
|
4050
4066
|
if (fieldOrColumn) {
|
|
4051
|
-
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;
|
|
4052
4068
|
}
|
|
4053
4069
|
return null;
|
|
4054
4070
|
};
|
|
@@ -4112,6 +4128,12 @@ function getRefElem(refEl) {
|
|
|
4112
4128
|
}
|
|
4113
4129
|
return null;
|
|
4114
4130
|
}
|
|
4131
|
+
function getCellHeight(height) {
|
|
4132
|
+
if (height === 'unset') {
|
|
4133
|
+
return 0;
|
|
4134
|
+
}
|
|
4135
|
+
return height || 0;
|
|
4136
|
+
}
|
|
4115
4137
|
/**
|
|
4116
4138
|
* 列宽拖动最大宽度
|
|
4117
4139
|
* @param params
|
|
@@ -4148,9 +4170,8 @@ function getColReMinWidth(params) {
|
|
|
4148
4170
|
column,
|
|
4149
4171
|
cell
|
|
4150
4172
|
} = params;
|
|
4151
|
-
const
|
|
4152
|
-
|
|
4153
|
-
} = $table;
|
|
4173
|
+
const tableProps = $table.props;
|
|
4174
|
+
const internalData = $table.internalData;
|
|
4154
4175
|
const {
|
|
4155
4176
|
computeResizableOpts
|
|
4156
4177
|
} = $table.getComputeMaps();
|
|
@@ -4165,6 +4186,9 @@ function getColReMinWidth(params) {
|
|
|
4165
4186
|
return Math.max(1, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(customMinWidth));
|
|
4166
4187
|
}
|
|
4167
4188
|
}
|
|
4189
|
+
const {
|
|
4190
|
+
elemStore
|
|
4191
|
+
} = internalData;
|
|
4168
4192
|
const {
|
|
4169
4193
|
showHeaderOverflow: allColumnHeaderOverflow
|
|
4170
4194
|
} = tableProps;
|
|
@@ -4194,14 +4218,10 @@ function getColReMinWidth(params) {
|
|
|
4194
4218
|
}
|
|
4195
4219
|
// 如果设置最小宽
|
|
4196
4220
|
if (colMinWidth) {
|
|
4197
|
-
const
|
|
4198
|
-
|
|
4199
|
-
} = $table.getRefMaps();
|
|
4200
|
-
const tableBody = refTableBody.value;
|
|
4201
|
-
const bodyElem = tableBody ? tableBody.$el : null;
|
|
4202
|
-
if (bodyElem) {
|
|
4221
|
+
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
4222
|
+
if (bodyScrollElem) {
|
|
4203
4223
|
if (isScale(colMinWidth)) {
|
|
4204
|
-
const bodyWidth =
|
|
4224
|
+
const bodyWidth = bodyScrollElem.clientWidth - 1;
|
|
4205
4225
|
const meanWidth = bodyWidth / 100;
|
|
4206
4226
|
return Math.max(mWidth, Math.floor(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toInteger(colMinWidth) * meanWidth));
|
|
4207
4227
|
} else if (isPx(colMinWidth)) {
|
|
@@ -4324,14 +4344,44 @@ const getOffsetSize = $xeTable => {
|
|
|
4324
4344
|
};
|
|
4325
4345
|
function calcTreeLine(params, prevRow) {
|
|
4326
4346
|
const {
|
|
4327
|
-
$table
|
|
4347
|
+
$table,
|
|
4348
|
+
row
|
|
4328
4349
|
} = params;
|
|
4350
|
+
const tableProps = $table.props;
|
|
4329
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;
|
|
4330
4373
|
let expandSize = 1;
|
|
4331
4374
|
if (prevRow) {
|
|
4332
4375
|
expandSize = countTreeExpand(prevRow, params);
|
|
4333
4376
|
}
|
|
4334
|
-
|
|
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));
|
|
4335
4385
|
}
|
|
4336
4386
|
function mergeBodyMethod(mergeList, _rowIndex, _columnIndex) {
|
|
4337
4387
|
for (let mIndex = 0; mIndex < mergeList.length; mIndex++) {
|
|
@@ -4393,45 +4443,39 @@ function clearTableAllStatus($xeTable) {
|
|
|
4393
4443
|
return clearTableDefaultStatus($xeTable);
|
|
4394
4444
|
}
|
|
4395
4445
|
function rowToVisible($xeTable, row) {
|
|
4396
|
-
const {
|
|
4397
|
-
reactData,
|
|
4398
|
-
internalData
|
|
4399
|
-
} = $xeTable;
|
|
4400
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();
|
|
4401
4456
|
const {
|
|
4402
4457
|
showOverflow
|
|
4403
4458
|
} = tableProps;
|
|
4404
4459
|
const {
|
|
4405
|
-
|
|
4406
|
-
} = $xeTable.getRefMaps();
|
|
4407
|
-
const {
|
|
4408
|
-
columnStore,
|
|
4409
|
-
scrollYLoad,
|
|
4410
|
-
rowHeight
|
|
4460
|
+
scrollYLoad
|
|
4411
4461
|
} = reactData;
|
|
4412
4462
|
const {
|
|
4463
|
+
elemStore,
|
|
4413
4464
|
afterFullData,
|
|
4414
|
-
fullAllDataRowIdData
|
|
4465
|
+
fullAllDataRowIdData,
|
|
4466
|
+
isResizeCellHeight
|
|
4415
4467
|
} = internalData;
|
|
4416
|
-
const
|
|
4417
|
-
const
|
|
4418
|
-
|
|
4419
|
-
|
|
4420
|
-
|
|
4421
|
-
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']);
|
|
4422
4474
|
const rowid = getRowid($xeTable, row);
|
|
4423
|
-
|
|
4424
|
-
|
|
4425
|
-
|
|
4426
|
-
|
|
4427
|
-
let offsetFixedRight = 0;
|
|
4428
|
-
rightList.forEach(item => {
|
|
4429
|
-
offsetFixedRight += item.renderWidth;
|
|
4430
|
-
});
|
|
4431
|
-
if (bodyElem) {
|
|
4432
|
-
const bodyHeight = bodyElem.clientHeight;
|
|
4433
|
-
const bodyScrollTop = bodyElem.scrollTop;
|
|
4434
|
-
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}"]`);
|
|
4435
4479
|
if (trElem) {
|
|
4436
4480
|
const trOffsetParent = trElem.offsetParent;
|
|
4437
4481
|
const trOffsetTop = trElem.offsetTop + (trOffsetParent ? trOffsetParent.offsetTop : 0);
|
|
@@ -4445,82 +4489,71 @@ function rowToVisible($xeTable, row) {
|
|
|
4445
4489
|
} else {
|
|
4446
4490
|
// 如果是虚拟渲染滚动
|
|
4447
4491
|
if (scrollYLoad) {
|
|
4448
|
-
|
|
4449
|
-
|
|
4492
|
+
const isCustomCellHeight = isResizeCellHeight || cellOpts.height || rowOpts.height;
|
|
4493
|
+
if (!isCustomCellHeight && showOverflow) {
|
|
4494
|
+
return $xeTable.scrollTo(null, ($xeTable.findRowIndexOf(afterFullData, row) - 1) * defaultRowHeight);
|
|
4450
4495
|
}
|
|
4451
4496
|
let scrollTop = 0;
|
|
4452
|
-
const rowRest = fullAllDataRowIdData[rowid];
|
|
4453
|
-
const rHeight = rowRest ? rowRest.height ||
|
|
4497
|
+
const rowRest = fullAllDataRowIdData[rowid] || {};
|
|
4498
|
+
const rHeight = rowRest ? rowRest.resizeHeight || cellOpts.height || rowOpts.height || defaultRowHeight : defaultRowHeight;
|
|
4454
4499
|
for (let i = 0; i < afterFullData.length; i++) {
|
|
4455
4500
|
const currRow = afterFullData[i];
|
|
4456
4501
|
const currRowid = getRowid($xeTable, currRow);
|
|
4457
4502
|
if (currRow === row || currRowid === rowid) {
|
|
4458
4503
|
break;
|
|
4459
4504
|
}
|
|
4460
|
-
const
|
|
4461
|
-
scrollTop +=
|
|
4505
|
+
const currRowRest = fullAllDataRowIdData[currRowid] || {};
|
|
4506
|
+
scrollTop += currRowRest.resizeHeight || currRowRest.height || cellOpts.height || rowOpts.height || defaultRowHeight;
|
|
4462
4507
|
}
|
|
4463
4508
|
if (scrollTop < bodyScrollTop) {
|
|
4464
|
-
return $xeTable.scrollTo(null, scrollTop -
|
|
4509
|
+
return $xeTable.scrollTo(null, scrollTop - leftFixedWidth - 1);
|
|
4465
4510
|
}
|
|
4466
|
-
return $xeTable.scrollTo(null, scrollTop + rHeight - (bodyHeight -
|
|
4511
|
+
return $xeTable.scrollTo(null, scrollTop + rHeight - (bodyHeight - rightFixedWidth - 1));
|
|
4467
4512
|
}
|
|
4468
4513
|
}
|
|
4469
4514
|
}
|
|
4470
4515
|
return Promise.resolve();
|
|
4471
4516
|
}
|
|
4472
4517
|
function colToVisible($xeTable, column, row) {
|
|
4518
|
+
const reactData = $xeTable.reactData;
|
|
4519
|
+
const internalData = $xeTable.internalData;
|
|
4473
4520
|
const {
|
|
4474
|
-
|
|
4475
|
-
|
|
4476
|
-
} = $xeTable;
|
|
4477
|
-
const {
|
|
4478
|
-
refTableBody
|
|
4479
|
-
} = $xeTable.getRefMaps();
|
|
4521
|
+
computeLeftFixedWidth,
|
|
4522
|
+
computeRightFixedWidth
|
|
4523
|
+
} = $xeTable.getComputeMaps();
|
|
4480
4524
|
const {
|
|
4481
|
-
columnStore,
|
|
4482
4525
|
scrollXLoad
|
|
4483
4526
|
} = reactData;
|
|
4484
4527
|
const {
|
|
4528
|
+
elemStore,
|
|
4485
4529
|
visibleColumn
|
|
4486
4530
|
} = internalData;
|
|
4487
|
-
const
|
|
4488
|
-
|
|
4489
|
-
|
|
4490
|
-
} = columnStore;
|
|
4491
|
-
const tableBody = refTableBody.value;
|
|
4492
|
-
const bodyElem = tableBody ? tableBody.$el : null;
|
|
4531
|
+
const leftFixedWidth = computeLeftFixedWidth.value;
|
|
4532
|
+
const rightFixedWidth = computeRightFixedWidth.value;
|
|
4533
|
+
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
4493
4534
|
if (column.fixed) {
|
|
4494
4535
|
return Promise.resolve();
|
|
4495
4536
|
}
|
|
4496
|
-
|
|
4497
|
-
|
|
4498
|
-
|
|
4499
|
-
});
|
|
4500
|
-
let offsetFixedRight = 0;
|
|
4501
|
-
rightList.forEach(item => {
|
|
4502
|
-
offsetFixedRight += item.renderWidth;
|
|
4503
|
-
});
|
|
4504
|
-
if (bodyElem) {
|
|
4505
|
-
const bodyWidth = bodyElem.clientWidth;
|
|
4506
|
-
const bodyScrollLeft = bodyElem.scrollLeft;
|
|
4537
|
+
if (bodyScrollElem) {
|
|
4538
|
+
const bodyWidth = bodyScrollElem.clientWidth;
|
|
4539
|
+
const bodyScrollLeft = bodyScrollElem.scrollLeft;
|
|
4507
4540
|
let tdElem = null;
|
|
4508
4541
|
if (row) {
|
|
4509
4542
|
const rowid = getRowid($xeTable, row);
|
|
4510
|
-
tdElem =
|
|
4543
|
+
tdElem = bodyScrollElem.querySelector(`[rowid="${rowid}"] .${column.id}`);
|
|
4511
4544
|
}
|
|
4512
4545
|
if (!tdElem) {
|
|
4513
|
-
tdElem =
|
|
4546
|
+
tdElem = bodyScrollElem.querySelector(`.${column.id}`);
|
|
4514
4547
|
}
|
|
4515
4548
|
if (tdElem) {
|
|
4516
4549
|
const tdOffsetParent = tdElem.offsetParent;
|
|
4517
4550
|
const tdOffsetLeft = tdElem.offsetLeft + (tdOffsetParent ? tdOffsetParent.offsetLeft : 0);
|
|
4518
4551
|
const cellWidth = tdElem.clientWidth;
|
|
4519
4552
|
// 检测是否在可视区中
|
|
4520
|
-
if (tdOffsetLeft < bodyScrollLeft +
|
|
4521
|
-
return $xeTable.scrollTo(tdOffsetLeft -
|
|
4522
|
-
} else if (tdOffsetLeft + cellWidth - bodyScrollLeft > bodyWidth -
|
|
4523
|
-
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));
|
|
4524
4557
|
}
|
|
4525
4558
|
} else {
|
|
4526
4559
|
// 检测是否在虚拟渲染可视区中
|
|
@@ -4535,9 +4568,9 @@ function colToVisible($xeTable, column, row) {
|
|
|
4535
4568
|
scrollLeft += currCol.renderWidth;
|
|
4536
4569
|
}
|
|
4537
4570
|
if (scrollLeft < bodyScrollLeft) {
|
|
4538
|
-
return $xeTable.scrollTo(scrollLeft -
|
|
4571
|
+
return $xeTable.scrollTo(scrollLeft - leftFixedWidth - 1);
|
|
4539
4572
|
}
|
|
4540
|
-
return $xeTable.scrollTo(scrollLeft + cellWidth - (bodyWidth -
|
|
4573
|
+
return $xeTable.scrollTo(scrollLeft + cellWidth - (bodyWidth - rightFixedWidth - 1));
|
|
4541
4574
|
}
|
|
4542
4575
|
}
|
|
4543
4576
|
}
|
|
@@ -4804,7 +4837,7 @@ function renderTitleContent(params, content) {
|
|
|
4804
4837
|
const ons = {};
|
|
4805
4838
|
if (showTitle || showTooltip || showAllTip) {
|
|
4806
4839
|
ons.onMouseenter = evnt => {
|
|
4807
|
-
if (tableReactData.
|
|
4840
|
+
if (tableReactData.isDragResize) {
|
|
4808
4841
|
return;
|
|
4809
4842
|
}
|
|
4810
4843
|
if (showTitle) {
|
|
@@ -4816,7 +4849,7 @@ function renderTitleContent(params, content) {
|
|
|
4816
4849
|
}
|
|
4817
4850
|
if (showTooltip || showAllTip) {
|
|
4818
4851
|
ons.onMouseleave = evnt => {
|
|
4819
|
-
if (tableReactData.
|
|
4852
|
+
if (tableReactData.isDragResize) {
|
|
4820
4853
|
return;
|
|
4821
4854
|
}
|
|
4822
4855
|
if (showTooltip || showAllTip) {
|
|
@@ -4833,18 +4866,6 @@ function renderTitleContent(params, content) {
|
|
|
4833
4866
|
...ons
|
|
4834
4867
|
}, getSlotVNs(content))];
|
|
4835
4868
|
}
|
|
4836
|
-
function formatFooterLabel(footerFormatter, params) {
|
|
4837
|
-
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(footerFormatter)) {
|
|
4838
|
-
return `${footerFormatter(params)}`;
|
|
4839
|
-
}
|
|
4840
|
-
const isArr = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(footerFormatter);
|
|
4841
|
-
const gFormatOpts = isArr ? cell_formats.get(footerFormatter[0]) : cell_formats.get(footerFormatter);
|
|
4842
|
-
const footerFormatMethod = gFormatOpts ? gFormatOpts.tableFooterCellFormatMethod : null;
|
|
4843
|
-
if (footerFormatMethod) {
|
|
4844
|
-
return `${isArr ? footerFormatMethod(params, ...footerFormatter.slice(1)) : footerFormatMethod(params)}`;
|
|
4845
|
-
}
|
|
4846
|
-
return '';
|
|
4847
|
-
}
|
|
4848
4869
|
function getFooterContent(params) {
|
|
4849
4870
|
const {
|
|
4850
4871
|
$table,
|
|
@@ -4864,35 +4885,38 @@ function getFooterContent(params) {
|
|
|
4864
4885
|
if (footerSlot) {
|
|
4865
4886
|
return $table.callSlot(footerSlot, params);
|
|
4866
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
|
+
}
|
|
4867
4910
|
if (renderOpts) {
|
|
4868
4911
|
const compConf = cell_renderer.get(renderOpts.name);
|
|
4869
4912
|
if (compConf) {
|
|
4870
4913
|
const rtFooter = compConf.renderTableFooter || compConf.renderFooter;
|
|
4871
4914
|
if (rtFooter) {
|
|
4872
|
-
return getSlotVNs(rtFooter(renderOpts,
|
|
4915
|
+
return getSlotVNs(rtFooter(renderOpts, footParams));
|
|
4873
4916
|
}
|
|
4874
4917
|
}
|
|
4875
4918
|
}
|
|
4876
|
-
|
|
4877
|
-
// 兼容老模式
|
|
4878
|
-
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(items)) {
|
|
4879
|
-
itemValue = items[_columnIndex];
|
|
4880
|
-
return [footerFormatter ? formatFooterLabel(footerFormatter, {
|
|
4881
|
-
itemValue,
|
|
4882
|
-
column,
|
|
4883
|
-
row,
|
|
4884
|
-
items,
|
|
4885
|
-
_columnIndex
|
|
4886
|
-
}) : formatText(itemValue, 1)];
|
|
4887
|
-
}
|
|
4888
|
-
itemValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, column.field);
|
|
4889
|
-
return [footerFormatter ? formatFooterLabel(footerFormatter, {
|
|
4890
|
-
itemValue,
|
|
4891
|
-
column,
|
|
4892
|
-
row,
|
|
4893
|
-
items,
|
|
4894
|
-
_columnIndex
|
|
4895
|
-
}) : formatText(itemValue, 1)];
|
|
4919
|
+
return [formatText(itemValue, 1)];
|
|
4896
4920
|
}
|
|
4897
4921
|
function getDefaultCellLabel(params) {
|
|
4898
4922
|
const {
|
|
@@ -5075,9 +5099,7 @@ const Cell = {
|
|
|
5075
5099
|
return Cell.renderTreeIcon(params, Cell.renderDefaultCell(params));
|
|
5076
5100
|
},
|
|
5077
5101
|
renderDefaultFooter(params) {
|
|
5078
|
-
return
|
|
5079
|
-
class: 'vxe-cell--item'
|
|
5080
|
-
}, getFooterContent(params))];
|
|
5102
|
+
return getFooterContent(params);
|
|
5081
5103
|
},
|
|
5082
5104
|
/**
|
|
5083
5105
|
* 树节点
|
|
@@ -5666,6 +5688,7 @@ const Cell = {
|
|
|
5666
5688
|
const sortOpts = computeSortOpts.value;
|
|
5667
5689
|
const {
|
|
5668
5690
|
showIcon,
|
|
5691
|
+
allowBtn,
|
|
5669
5692
|
iconLayout,
|
|
5670
5693
|
iconAsc,
|
|
5671
5694
|
iconDesc,
|
|
@@ -5682,19 +5705,19 @@ const Cell = {
|
|
|
5682
5705
|
'sort--active': order === 'asc'
|
|
5683
5706
|
}],
|
|
5684
5707
|
title: cell_getI18n('vxe.table.sortAsc'),
|
|
5685
|
-
onClick
|
|
5708
|
+
onClick: allowBtn ? evnt => {
|
|
5686
5709
|
evnt.stopPropagation();
|
|
5687
5710
|
$table.triggerSortEvent(evnt, column, 'asc');
|
|
5688
|
-
}
|
|
5711
|
+
} : undefined
|
|
5689
5712
|
}), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('i', {
|
|
5690
5713
|
class: ['vxe-sort--desc-btn', iconDesc || cell_getIcon().TABLE_SORT_DESC, {
|
|
5691
5714
|
'sort--active': order === 'desc'
|
|
5692
5715
|
}],
|
|
5693
5716
|
title: cell_getI18n('vxe.table.sortDesc'),
|
|
5694
|
-
onClick
|
|
5717
|
+
onClick: allowBtn ? evnt => {
|
|
5695
5718
|
evnt.stopPropagation();
|
|
5696
5719
|
$table.triggerSortEvent(evnt, column, 'desc');
|
|
5697
|
-
}
|
|
5720
|
+
} : undefined
|
|
5698
5721
|
})])];
|
|
5699
5722
|
}
|
|
5700
5723
|
return [];
|
|
@@ -5920,6 +5943,16 @@ const columnProps = {
|
|
|
5920
5943
|
formatter: [Function, Array, String],
|
|
5921
5944
|
// 格式化表尾显示内容
|
|
5922
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
|
+
},
|
|
5923
5956
|
// 是否允许排序
|
|
5924
5957
|
sortable: Boolean,
|
|
5925
5958
|
// 自定义排序的属性
|
|
@@ -5946,8 +5979,10 @@ const columnProps = {
|
|
|
5946
5979
|
filterRender: Object,
|
|
5947
5980
|
// 设置为树节点
|
|
5948
5981
|
treeNode: Boolean,
|
|
5949
|
-
//
|
|
5982
|
+
// 设置为拖拽排序
|
|
5950
5983
|
dragSort: Boolean,
|
|
5984
|
+
// 设置为行高拖拽
|
|
5985
|
+
rowResize: Boolean,
|
|
5951
5986
|
// 是否可视
|
|
5952
5987
|
visible: {
|
|
5953
5988
|
type: Boolean,
|
|
@@ -6163,7 +6198,8 @@ const renderType = 'body';
|
|
|
6163
6198
|
computeRowDragOpts,
|
|
6164
6199
|
computeColumnDragOpts,
|
|
6165
6200
|
computeLeftFixedWidth,
|
|
6166
|
-
computeRightFixedWidth
|
|
6201
|
+
computeRightFixedWidth,
|
|
6202
|
+
computeResizableOpts
|
|
6167
6203
|
} = $xeTable.getComputeMaps();
|
|
6168
6204
|
const refElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
6169
6205
|
const refBodyScroll = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
@@ -6180,11 +6216,11 @@ const renderType = 'body';
|
|
|
6180
6216
|
} = tableProps;
|
|
6181
6217
|
const {
|
|
6182
6218
|
lastScrollTime,
|
|
6183
|
-
|
|
6219
|
+
isDragResize
|
|
6184
6220
|
} = tableReactData;
|
|
6185
|
-
return !!(
|
|
6221
|
+
return !!(isDragResize || lastScrollTime && Date.now() < lastScrollTime + delayHover);
|
|
6186
6222
|
};
|
|
6187
|
-
const renderLine = params => {
|
|
6223
|
+
const renderLine = (params, cellHeight) => {
|
|
6188
6224
|
const {
|
|
6189
6225
|
row,
|
|
6190
6226
|
column
|
|
@@ -6217,11 +6253,13 @@ const renderType = 'body';
|
|
|
6217
6253
|
const isFirstRow = $xeTable.eqRow(afterFullData[0], row);
|
|
6218
6254
|
if (treeConfig && treeNode && (treeOpts.showLine || treeOpts.line)) {
|
|
6219
6255
|
return [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
6256
|
+
key: 'tl',
|
|
6220
6257
|
class: 'vxe-tree--line-wrapper'
|
|
6221
6258
|
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
6222
6259
|
class: 'vxe-tree--line',
|
|
6223
6260
|
style: {
|
|
6224
6261
|
height: `${isFirstRow ? 1 : calcTreeLine(params, prevRow)}px`,
|
|
6262
|
+
bottom: `-${Math.floor(cellHeight / 2)}px`,
|
|
6225
6263
|
left: `${rLevel * treeOpts.indent + (rLevel ? 2 - getOffsetSize($xeTable) : 0) + 16}px`
|
|
6226
6264
|
}
|
|
6227
6265
|
})])];
|
|
@@ -6237,8 +6275,9 @@ const renderType = 'body';
|
|
|
6237
6275
|
} = tableInternalData;
|
|
6238
6276
|
const {
|
|
6239
6277
|
columnKey,
|
|
6278
|
+
resizable: allResizable,
|
|
6279
|
+
border,
|
|
6240
6280
|
height,
|
|
6241
|
-
showOverflow: allColumnOverflow,
|
|
6242
6281
|
cellClassName: allCellClassName,
|
|
6243
6282
|
cellStyle,
|
|
6244
6283
|
align: allAlign,
|
|
@@ -6246,7 +6285,8 @@ const renderType = 'body';
|
|
|
6246
6285
|
mouseConfig,
|
|
6247
6286
|
editConfig,
|
|
6248
6287
|
editRules,
|
|
6249
|
-
tooltipConfig
|
|
6288
|
+
tooltipConfig,
|
|
6289
|
+
padding: allPadding
|
|
6250
6290
|
} = tableProps;
|
|
6251
6291
|
const {
|
|
6252
6292
|
tableData,
|
|
@@ -6254,7 +6294,8 @@ const renderType = 'body';
|
|
|
6254
6294
|
currentColumn,
|
|
6255
6295
|
scrollXLoad,
|
|
6256
6296
|
scrollYLoad,
|
|
6257
|
-
|
|
6297
|
+
calcCellHeightFlag,
|
|
6298
|
+
resizeHeightFlag,
|
|
6258
6299
|
mergeList,
|
|
6259
6300
|
editStore,
|
|
6260
6301
|
isAllOverflow,
|
|
@@ -6270,9 +6311,16 @@ const renderType = 'body';
|
|
|
6270
6311
|
const checkboxOpts = computeCheckboxOpts.value;
|
|
6271
6312
|
const editOpts = computeEditOpts.value;
|
|
6272
6313
|
const tooltipOpts = computeTooltipOpts.value;
|
|
6314
|
+
const resizableOpts = computeResizableOpts.value;
|
|
6315
|
+
const {
|
|
6316
|
+
isAllColumnDrag,
|
|
6317
|
+
isAllRowDrag
|
|
6318
|
+
} = resizableOpts;
|
|
6273
6319
|
const rowOpts = computeRowOpts.value;
|
|
6274
6320
|
const rowDragOpts = computeRowDragOpts.value;
|
|
6275
6321
|
const defaultRowHeight = computeDefaultRowHeight.value;
|
|
6322
|
+
const customCellHeight = cellOpts.height || rowOpts.height;
|
|
6323
|
+
const currCellHeight = customCellHeight || defaultRowHeight;
|
|
6276
6324
|
const {
|
|
6277
6325
|
disabledMethod: dragDisabledMethod,
|
|
6278
6326
|
isCrossDrag,
|
|
@@ -6292,17 +6340,18 @@ const renderType = 'body';
|
|
|
6292
6340
|
showOverflow,
|
|
6293
6341
|
className,
|
|
6294
6342
|
treeNode,
|
|
6343
|
+
rowResize,
|
|
6344
|
+
padding,
|
|
6345
|
+
verticalAlign,
|
|
6295
6346
|
slots
|
|
6296
6347
|
} = column;
|
|
6297
6348
|
const {
|
|
6298
|
-
verticalAlign
|
|
6349
|
+
verticalAlign: allVerticalAlign
|
|
6299
6350
|
} = cellOpts;
|
|
6300
6351
|
const {
|
|
6301
6352
|
actived
|
|
6302
6353
|
} = editStore;
|
|
6303
|
-
const
|
|
6304
|
-
height: customRHeight
|
|
6305
|
-
} = rowOpts;
|
|
6354
|
+
const rowRest = fullAllDataRowIdData[rowid];
|
|
6306
6355
|
const colid = column.id;
|
|
6307
6356
|
const renderOpts = editRender || cellRender;
|
|
6308
6357
|
const compConf = renderOpts ? body_renderer.get(renderOpts.name) : null;
|
|
@@ -6312,23 +6361,27 @@ const renderType = 'body';
|
|
|
6312
6361
|
const columnIndex = $xeTable.getColumnIndex(column);
|
|
6313
6362
|
const _columnIndex = $xeTable.getVTColumnIndex(column);
|
|
6314
6363
|
const isEdit = isEnableConf(editRender);
|
|
6364
|
+
const resizeHeight = resizeHeightFlag ? rowRest.resizeHeight : 0;
|
|
6315
6365
|
let fixedHiddenColumn = fixedType ? column.fixed !== fixedType : column.fixed && overflowX;
|
|
6316
|
-
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;
|
|
6317
6368
|
const showEllipsis = cellOverflow === 'ellipsis';
|
|
6318
6369
|
const showTitle = cellOverflow === 'title';
|
|
6319
6370
|
const showTooltip = cellOverflow === true || cellOverflow === 'tooltip';
|
|
6320
|
-
|
|
6321
|
-
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;
|
|
6322
6375
|
let isDirty;
|
|
6323
6376
|
const tdOns = {};
|
|
6324
|
-
const rest = fullAllDataRowIdData[rowid];
|
|
6325
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;
|
|
6326
6379
|
const errorValidItem = validErrorMaps[`${rowid}:${colid}`];
|
|
6327
6380
|
const showValidTip = editRules && validOpts.showMessage && (validOpts.message === 'default' ? height || tableData.length > 1 : validOpts.message === 'inline');
|
|
6328
|
-
const
|
|
6381
|
+
const tdAttrs = {
|
|
6329
6382
|
colid
|
|
6330
6383
|
};
|
|
6331
|
-
const
|
|
6384
|
+
const cellParams = {
|
|
6332
6385
|
$table: $xeTable,
|
|
6333
6386
|
$grid: $xeTable.xegrid,
|
|
6334
6387
|
isEdit: false,
|
|
@@ -6356,7 +6409,7 @@ const renderType = 'body';
|
|
|
6356
6409
|
isRowDragCell = rowDragOpts.trigger === 'row' || column.dragSort && rowDragOpts.trigger === 'cell';
|
|
6357
6410
|
}
|
|
6358
6411
|
if (isRowDragCell) {
|
|
6359
|
-
isDisabledDrag = !!(dragDisabledMethod && dragDisabledMethod(
|
|
6412
|
+
isDisabledDrag = !!(dragDisabledMethod && dragDisabledMethod(cellParams));
|
|
6360
6413
|
}
|
|
6361
6414
|
// hover 进入事件
|
|
6362
6415
|
if (showTitle || showTooltip || showAllTip || tooltipConfig) {
|
|
@@ -6368,11 +6421,11 @@ const renderType = 'body';
|
|
|
6368
6421
|
updateCellTitle(evnt.currentTarget, column);
|
|
6369
6422
|
} else if (showTooltip || showAllTip) {
|
|
6370
6423
|
// 如果配置了显示 tooltip
|
|
6371
|
-
$xeTable.triggerBodyTooltipEvent(evnt,
|
|
6424
|
+
$xeTable.triggerBodyTooltipEvent(evnt, cellParams);
|
|
6372
6425
|
}
|
|
6373
6426
|
$xeTable.dispatchEvent('cell-mouseenter', Object.assign({
|
|
6374
6427
|
cell: evnt.currentTarget
|
|
6375
|
-
},
|
|
6428
|
+
}, cellParams), evnt);
|
|
6376
6429
|
};
|
|
6377
6430
|
}
|
|
6378
6431
|
// hover 退出事件
|
|
@@ -6386,13 +6439,13 @@ const renderType = 'body';
|
|
|
6386
6439
|
}
|
|
6387
6440
|
$xeTable.dispatchEvent('cell-mouseleave', Object.assign({
|
|
6388
6441
|
cell: evnt.currentTarget
|
|
6389
|
-
},
|
|
6442
|
+
}, cellParams), evnt);
|
|
6390
6443
|
};
|
|
6391
6444
|
}
|
|
6392
6445
|
// 按下事件处理
|
|
6393
6446
|
if (isRowDragCell || checkboxOpts.range || mouseConfig) {
|
|
6394
6447
|
tdOns.onMousedown = evnt => {
|
|
6395
|
-
$xeTable.triggerCellMousedownEvent(evnt,
|
|
6448
|
+
$xeTable.triggerCellMousedownEvent(evnt, cellParams);
|
|
6396
6449
|
};
|
|
6397
6450
|
}
|
|
6398
6451
|
// 拖拽列事件
|
|
@@ -6401,11 +6454,11 @@ const renderType = 'body';
|
|
|
6401
6454
|
}
|
|
6402
6455
|
// 点击事件处理
|
|
6403
6456
|
tdOns.onClick = evnt => {
|
|
6404
|
-
$xeTable.triggerCellClickEvent(evnt,
|
|
6457
|
+
$xeTable.triggerCellClickEvent(evnt, cellParams);
|
|
6405
6458
|
};
|
|
6406
6459
|
// 双击事件处理
|
|
6407
6460
|
tdOns.onDblclick = evnt => {
|
|
6408
|
-
$xeTable.triggerCellDblclickEvent(evnt,
|
|
6461
|
+
$xeTable.triggerCellDblclickEvent(evnt, cellParams);
|
|
6409
6462
|
};
|
|
6410
6463
|
// 合并行或列
|
|
6411
6464
|
if (mergeList.length) {
|
|
@@ -6419,10 +6472,10 @@ const renderType = 'body';
|
|
|
6419
6472
|
return null;
|
|
6420
6473
|
}
|
|
6421
6474
|
if (rowspan > 1) {
|
|
6422
|
-
|
|
6475
|
+
tdAttrs.rowspan = rowspan;
|
|
6423
6476
|
}
|
|
6424
6477
|
if (colspan > 1) {
|
|
6425
|
-
|
|
6478
|
+
tdAttrs.colspan = colspan;
|
|
6426
6479
|
}
|
|
6427
6480
|
}
|
|
6428
6481
|
} else if (spanMethod) {
|
|
@@ -6430,20 +6483,20 @@ const renderType = 'body';
|
|
|
6430
6483
|
const {
|
|
6431
6484
|
rowspan = 1,
|
|
6432
6485
|
colspan = 1
|
|
6433
|
-
} = spanMethod(
|
|
6486
|
+
} = spanMethod(cellParams) || {};
|
|
6434
6487
|
if (!rowspan || !colspan) {
|
|
6435
6488
|
return null;
|
|
6436
6489
|
}
|
|
6437
6490
|
if (rowspan > 1) {
|
|
6438
|
-
|
|
6491
|
+
tdAttrs.rowspan = rowspan;
|
|
6439
6492
|
}
|
|
6440
6493
|
if (colspan > 1) {
|
|
6441
|
-
|
|
6494
|
+
tdAttrs.colspan = colspan;
|
|
6442
6495
|
}
|
|
6443
6496
|
}
|
|
6444
6497
|
// 如果被合并不可隐藏
|
|
6445
6498
|
if (fixedHiddenColumn && mergeList) {
|
|
6446
|
-
if (
|
|
6499
|
+
if (tdAttrs.colspan > 1 || tdAttrs.rowspan > 1) {
|
|
6447
6500
|
fixedHiddenColumn = false;
|
|
6448
6501
|
}
|
|
6449
6502
|
}
|
|
@@ -6452,28 +6505,35 @@ const renderType = 'body';
|
|
|
6452
6505
|
isDirty = $xeTable.isUpdateByRow(row, column.field);
|
|
6453
6506
|
}
|
|
6454
6507
|
const isVNAutoHeight = scrollYLoad && !hasEllipsis;
|
|
6455
|
-
let cellHeight =
|
|
6456
|
-
const vnHeight =
|
|
6457
|
-
if (
|
|
6458
|
-
|
|
6459
|
-
cellHeight = customRHeight;
|
|
6460
|
-
} else if (!isAllOverflow) {
|
|
6461
|
-
cellHeight = vnHeight || defaultRowHeight || 18;
|
|
6462
|
-
}
|
|
6508
|
+
let cellHeight = currCellHeight;
|
|
6509
|
+
const vnHeight = calcCellHeightFlag ? rowRest.height : 0;
|
|
6510
|
+
if (resizeHeight) {
|
|
6511
|
+
cellHeight = resizeHeight;
|
|
6463
6512
|
} else {
|
|
6464
|
-
|
|
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;
|
|
6465
6526
|
}
|
|
6466
6527
|
const tcStyle = {};
|
|
6467
|
-
if (
|
|
6468
|
-
|
|
6469
|
-
|
|
6470
|
-
|
|
6471
|
-
tcStyle.height = `${cellHeight}px`;
|
|
6472
|
-
}
|
|
6528
|
+
if (scrollYLoad || hasEllipsis || isCsHeight || isRsHeight) {
|
|
6529
|
+
tcStyle.height = `${cellHeight}px`;
|
|
6530
|
+
} else {
|
|
6531
|
+
tcStyle.minHeight = `${cellHeight}px`;
|
|
6473
6532
|
}
|
|
6474
6533
|
const tdVNs = [];
|
|
6475
|
-
if (fixedHiddenColumn &&
|
|
6534
|
+
if (fixedHiddenColumn && isAllOverflow) {
|
|
6476
6535
|
tdVNs.push((0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
6536
|
+
key: 'tc',
|
|
6477
6537
|
class: ['vxe-cell', {
|
|
6478
6538
|
'c--title': showTitle,
|
|
6479
6539
|
'c--tooltip': showTooltip,
|
|
@@ -6483,7 +6543,8 @@ const renderType = 'body';
|
|
|
6483
6543
|
}));
|
|
6484
6544
|
} else {
|
|
6485
6545
|
// 渲染单元格
|
|
6486
|
-
tdVNs.push(...renderLine(
|
|
6546
|
+
tdVNs.push(...renderLine(cellParams, cellHeight), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
6547
|
+
key: 'tc',
|
|
6487
6548
|
class: ['vxe-cell', {
|
|
6488
6549
|
'c--title': showTitle,
|
|
6489
6550
|
'c--tooltip': showTooltip,
|
|
@@ -6491,18 +6552,21 @@ const renderType = 'body';
|
|
|
6491
6552
|
}],
|
|
6492
6553
|
style: tcStyle,
|
|
6493
6554
|
title: showTitle ? $xeTable.getCellLabel(row, column) : null
|
|
6494
|
-
},
|
|
6495
|
-
|
|
6496
|
-
|
|
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))]));
|
|
6497
6560
|
if (showValidTip && errorValidItem) {
|
|
6498
6561
|
const errRule = errorValidItem.rule;
|
|
6499
6562
|
const validSlot = slots ? slots.valid : null;
|
|
6500
6563
|
const validParams = {
|
|
6501
|
-
...
|
|
6564
|
+
...cellParams,
|
|
6502
6565
|
...errorValidItem,
|
|
6503
6566
|
rule: errorValidItem
|
|
6504
6567
|
};
|
|
6505
6568
|
tdVNs.push((0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
6569
|
+
key: 'tcv',
|
|
6506
6570
|
class: ['vxe-cell--valid-error-tip', getPropClass(validOpts.className, validParams)],
|
|
6507
6571
|
style: errRule && errRule.maxWidth ? {
|
|
6508
6572
|
width: `${errRule.maxWidth}px`
|
|
@@ -6514,47 +6578,55 @@ const renderType = 'body';
|
|
|
6514
6578
|
}, errorValidItem.content)]])]));
|
|
6515
6579
|
}
|
|
6516
6580
|
}
|
|
6581
|
+
let showAreaRowStatus = false;
|
|
6517
6582
|
if (mouseConfig && mouseOpts.area && selectCellToRow) {
|
|
6518
|
-
if (
|
|
6519
|
-
|
|
6520
|
-
class: 'vxe-cell--area-status'
|
|
6521
|
-
}));
|
|
6583
|
+
if (!_columnIndex && selectCellToRow === true || selectCellToRow === column.field) {
|
|
6584
|
+
showAreaRowStatus = true;
|
|
6522
6585
|
}
|
|
6523
6586
|
}
|
|
6524
|
-
|
|
6525
|
-
|
|
6526
|
-
|
|
6527
|
-
|
|
6528
|
-
|
|
6529
|
-
|
|
6530
|
-
|
|
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
|
+
}));
|
|
6531
6604
|
}
|
|
6532
6605
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('td', {
|
|
6533
|
-
class: ['vxe-body--column', colid, {
|
|
6534
|
-
[`col--${cellAlign}`]: cellAlign,
|
|
6535
|
-
[`col--vertical-${verticalAlign}`]: verticalAlign,
|
|
6536
|
-
[`col--${type}`]: type,
|
|
6606
|
+
class: ['vxe-body--column', colid, cellVerticalAlign ? `col--vertical-${cellVerticalAlign}` : '', cellAlign ? `col--${cellAlign}` : '', type ? `col--${type}` : '', {
|
|
6537
6607
|
'col--last': isLastColumn,
|
|
6538
6608
|
'col--tree-node': treeNode,
|
|
6539
6609
|
'col--edit': isEdit,
|
|
6540
6610
|
'col--ellipsis': hasEllipsis,
|
|
6611
|
+
'col--cs-height': isCsHeight,
|
|
6612
|
+
'col--rs-height': isRsHeight,
|
|
6613
|
+
'col--to-row': showAreaRowStatus,
|
|
6541
6614
|
'col--auto-height': isVNAutoHeight,
|
|
6542
6615
|
'fixed--width': !isAutoCellWidth,
|
|
6543
6616
|
'fixed--hidden': fixedHiddenColumn,
|
|
6617
|
+
'is--padding': isCellPadding,
|
|
6544
6618
|
'is--drag-cell': isRowDragCell && (isCrossDrag || isPeerDrag || !rowLevel),
|
|
6545
6619
|
'is--drag-disabled': isDisabledDrag,
|
|
6546
6620
|
'col--dirty': isDirty,
|
|
6547
6621
|
'col--active': editConfig && isEdit && actived.row === row && (actived.column === column || editOpts.mode === 'row'),
|
|
6548
6622
|
'col--valid-error': !!errorValidItem,
|
|
6549
6623
|
'col--current': currentColumn === column
|
|
6550
|
-
}, getPropClass(compCellClassName,
|
|
6624
|
+
}, getPropClass(compCellClassName, cellParams), getPropClass(className, cellParams), getPropClass(allCellClassName, cellParams)],
|
|
6551
6625
|
key: columnKey || scrollXLoad || scrollYLoad || columnOpts.useKey || rowOpts.useKey || columnOpts.drag ? colid : $columnIndex,
|
|
6552
|
-
...
|
|
6553
|
-
style: Object.assign({
|
|
6554
|
-
height: cellHeight ? `${cellHeight}px` : ''
|
|
6555
|
-
}, 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),
|
|
6556
6628
|
...tdOns
|
|
6557
|
-
},
|
|
6629
|
+
}, isOptimizeMode && fixedHiddenColumn ? [] : tdVNs);
|
|
6558
6630
|
};
|
|
6559
6631
|
const renderRows = (fixedType, isOptimizeMode, tableData, tableColumn) => {
|
|
6560
6632
|
const {
|
|
@@ -6563,15 +6635,16 @@ const renderType = 'body';
|
|
|
6563
6635
|
highlightHoverRow,
|
|
6564
6636
|
rowClassName,
|
|
6565
6637
|
rowStyle,
|
|
6566
|
-
showOverflow: allColumnOverflow,
|
|
6567
6638
|
editConfig,
|
|
6568
6639
|
treeConfig
|
|
6569
6640
|
} = tableProps;
|
|
6570
6641
|
const {
|
|
6571
6642
|
hasFixedColumn,
|
|
6572
6643
|
treeExpandedMaps,
|
|
6644
|
+
isColLoading,
|
|
6573
6645
|
scrollXLoad,
|
|
6574
6646
|
scrollYLoad,
|
|
6647
|
+
isAllOverflow,
|
|
6575
6648
|
rowExpandedMaps,
|
|
6576
6649
|
expandColumn,
|
|
6577
6650
|
selectRadioRow,
|
|
@@ -6675,7 +6748,7 @@ const renderType = 'body';
|
|
|
6675
6748
|
const tdVNs = tableColumn.map((column, $columnIndex) => {
|
|
6676
6749
|
return renderTdColumn(seq, rowid, fixedType, isOptimizeMode, rowLevel, row, rowIndex, $rowIndex, _rowIndex, column, $columnIndex, tableColumn, tableData);
|
|
6677
6750
|
});
|
|
6678
|
-
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, {
|
|
6679
6752
|
name: `vxe-header--col-list${isDragColMove ? '' : '-disabled'}`,
|
|
6680
6753
|
tag: 'tr',
|
|
6681
6754
|
class: trClass,
|
|
@@ -6709,7 +6782,7 @@ const renderType = 'body';
|
|
|
6709
6782
|
const {
|
|
6710
6783
|
showOverflow
|
|
6711
6784
|
} = expandColumn;
|
|
6712
|
-
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;
|
|
6713
6786
|
const expandParams = {
|
|
6714
6787
|
$table: $xeTable,
|
|
6715
6788
|
seq,
|
|
@@ -6797,7 +6870,6 @@ const renderType = 'body';
|
|
|
6797
6870
|
tableColumn
|
|
6798
6871
|
} = props;
|
|
6799
6872
|
const {
|
|
6800
|
-
showOverflow: allColumnOverflow,
|
|
6801
6873
|
spanMethod,
|
|
6802
6874
|
footerSpanMethod,
|
|
6803
6875
|
mouseConfig
|
|
@@ -6805,6 +6877,8 @@ const renderType = 'body';
|
|
|
6805
6877
|
const {
|
|
6806
6878
|
isGroup,
|
|
6807
6879
|
tableData,
|
|
6880
|
+
isRowLoading,
|
|
6881
|
+
isColLoading,
|
|
6808
6882
|
scrollXLoad,
|
|
6809
6883
|
scrollYLoad,
|
|
6810
6884
|
isAllOverflow,
|
|
@@ -6828,7 +6902,7 @@ const renderType = 'body';
|
|
|
6828
6902
|
let renderColumnList = tableColumn;
|
|
6829
6903
|
let isOptimizeMode = false;
|
|
6830
6904
|
// 如果是使用优化模式
|
|
6831
|
-
if (scrollXLoad || scrollYLoad ||
|
|
6905
|
+
if (scrollXLoad || scrollYLoad || isAllOverflow) {
|
|
6832
6906
|
if (expandColumn || spanMethod || footerSpanMethod) {
|
|
6833
6907
|
// 如果不支持优化模式
|
|
6834
6908
|
} else {
|
|
@@ -6947,9 +7021,9 @@ const renderType = 'body';
|
|
|
6947
7021
|
});
|
|
6948
7022
|
})),
|
|
6949
7023
|
/**
|
|
6950
|
-
|
|
6951
|
-
|
|
6952
|
-
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, {
|
|
6953
7027
|
ref: refBodyTBody,
|
|
6954
7028
|
name: `vxe-body--row-list${isDragRowMove ? '' : '-disabled'}`,
|
|
6955
7029
|
tag: 'tbody'
|
|
@@ -6982,6 +7056,8 @@ const renderType = 'body';
|
|
|
6982
7056
|
class: 'vxe-table--cell-multi-area'
|
|
6983
7057
|
}), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
|
|
6984
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'
|
|
6985
7061
|
})]) : body_renderEmptyElement($xeTable), !fixedType ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
6986
7062
|
class: 'vxe-table--empty-block',
|
|
6987
7063
|
ref: refBodyEmptyBlock
|
|
@@ -7000,10 +7076,7 @@ const renderType = 'body';
|
|
|
7000
7076
|
|
|
7001
7077
|
|
|
7002
7078
|
|
|
7003
|
-
|
|
7004
|
-
|
|
7005
7079
|
const {
|
|
7006
|
-
getI18n: header_getI18n,
|
|
7007
7080
|
renderer: header_renderer,
|
|
7008
7081
|
renderEmptyElement: header_renderEmptyElement
|
|
7009
7082
|
} = core_.VxeUI;
|
|
@@ -7028,18 +7101,13 @@ const header_renderType = 'header';
|
|
|
7028
7101
|
reactData: tableReactData,
|
|
7029
7102
|
internalData: tableInternalData
|
|
7030
7103
|
} = $xeTable;
|
|
7031
|
-
const {
|
|
7032
|
-
refElem: tableRefElem,
|
|
7033
|
-
refLeftContainer,
|
|
7034
|
-
refRightContainer,
|
|
7035
|
-
refCellResizeBar,
|
|
7036
|
-
refCellResizeTip
|
|
7037
|
-
} = $xeTable.getRefMaps();
|
|
7038
7104
|
const {
|
|
7039
7105
|
computeColumnOpts,
|
|
7040
7106
|
computeColumnDragOpts,
|
|
7041
|
-
|
|
7042
|
-
|
|
7107
|
+
computeCellOpts,
|
|
7108
|
+
computeMouseOpts,
|
|
7109
|
+
computeHeaderCellOpts,
|
|
7110
|
+
computeDefaultRowHeight
|
|
7043
7111
|
} = $xeTable.getComputeMaps();
|
|
7044
7112
|
const headerColumn = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)([]);
|
|
7045
7113
|
const refElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
@@ -7055,153 +7123,6 @@ const header_renderType = 'header';
|
|
|
7055
7123
|
} = tableReactData;
|
|
7056
7124
|
headerColumn.value = isGroup ? convertHeaderColumnToRows(props.tableGroupColumn) : [];
|
|
7057
7125
|
};
|
|
7058
|
-
const resizeMousedownEvent = (evnt, params) => {
|
|
7059
|
-
const {
|
|
7060
|
-
column
|
|
7061
|
-
} = params;
|
|
7062
|
-
const {
|
|
7063
|
-
fixedType
|
|
7064
|
-
} = props;
|
|
7065
|
-
const {
|
|
7066
|
-
scrollbarHeight
|
|
7067
|
-
} = tableReactData;
|
|
7068
|
-
const {
|
|
7069
|
-
elemStore,
|
|
7070
|
-
visibleColumn
|
|
7071
|
-
} = tableInternalData;
|
|
7072
|
-
const resizableOpts = computeResizableOpts.value;
|
|
7073
|
-
const tableEl = tableRefElem.value;
|
|
7074
|
-
const leftContainerElem = refLeftContainer.value;
|
|
7075
|
-
const rightContainerElem = refRightContainer.value;
|
|
7076
|
-
const resizeBarElem = refCellResizeBar.value;
|
|
7077
|
-
const resizeTipElem = refCellResizeTip.value;
|
|
7078
|
-
const scrollbarXToTop = computeScrollbarXToTop.value;
|
|
7079
|
-
const {
|
|
7080
|
-
clientX: dragClientX
|
|
7081
|
-
} = evnt;
|
|
7082
|
-
const wrapperElem = refElem.value;
|
|
7083
|
-
const dragBtnElem = evnt.target;
|
|
7084
|
-
let resizeColumn = column;
|
|
7085
|
-
if (column.children && column.children.length) {
|
|
7086
|
-
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(column.children, childColumn => {
|
|
7087
|
-
resizeColumn = childColumn;
|
|
7088
|
-
});
|
|
7089
|
-
}
|
|
7090
|
-
const cell = dragBtnElem.parentNode;
|
|
7091
|
-
const cellParams = Object.assign(params, {
|
|
7092
|
-
cell
|
|
7093
|
-
});
|
|
7094
|
-
let dragLeft = 0;
|
|
7095
|
-
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
7096
|
-
if (!bodyScrollElem) {
|
|
7097
|
-
return;
|
|
7098
|
-
}
|
|
7099
|
-
const pos = getOffsetPos(dragBtnElem, wrapperElem);
|
|
7100
|
-
const dragBtnWidth = dragBtnElem.clientWidth;
|
|
7101
|
-
const dragBtnOffsetWidth = Math.floor(dragBtnWidth / 2);
|
|
7102
|
-
const minInterval = getColReMinWidth(cellParams) - dragBtnOffsetWidth; // 列之间的最小间距
|
|
7103
|
-
let dragMinLeft = pos.left - cell.clientWidth + dragBtnWidth + minInterval;
|
|
7104
|
-
let dragPosLeft = pos.left + dragBtnOffsetWidth;
|
|
7105
|
-
const domMousemove = document.onmousemove;
|
|
7106
|
-
const domMouseup = document.onmouseup;
|
|
7107
|
-
const isLeftFixed = fixedType === 'left';
|
|
7108
|
-
const isRightFixed = fixedType === 'right';
|
|
7109
|
-
// 计算左右侧固定列偏移量
|
|
7110
|
-
let fixedOffsetWidth = 0;
|
|
7111
|
-
if (isLeftFixed || isRightFixed) {
|
|
7112
|
-
const siblingProp = isLeftFixed ? 'nextElementSibling' : 'previousElementSibling';
|
|
7113
|
-
let tempCellElem = cell[siblingProp];
|
|
7114
|
-
while (tempCellElem) {
|
|
7115
|
-
if (hasClass(tempCellElem, 'fixed--hidden')) {
|
|
7116
|
-
break;
|
|
7117
|
-
} else if (!hasClass(tempCellElem, 'col--group')) {
|
|
7118
|
-
fixedOffsetWidth += tempCellElem.offsetWidth;
|
|
7119
|
-
}
|
|
7120
|
-
tempCellElem = tempCellElem[siblingProp];
|
|
7121
|
-
}
|
|
7122
|
-
if (isRightFixed && rightContainerElem) {
|
|
7123
|
-
dragPosLeft = rightContainerElem.offsetLeft + fixedOffsetWidth;
|
|
7124
|
-
}
|
|
7125
|
-
}
|
|
7126
|
-
// 处理拖动事件
|
|
7127
|
-
const updateEvent = evnt => {
|
|
7128
|
-
evnt.stopPropagation();
|
|
7129
|
-
evnt.preventDefault();
|
|
7130
|
-
const tableHeight = tableEl.clientHeight;
|
|
7131
|
-
const offsetX = evnt.clientX - dragClientX;
|
|
7132
|
-
let left = dragPosLeft + offsetX;
|
|
7133
|
-
const scrollLeft = fixedType ? 0 : bodyScrollElem.scrollLeft;
|
|
7134
|
-
if (isLeftFixed) {
|
|
7135
|
-
// 左固定列(不允许超过右侧固定列、不允许超过右边距)
|
|
7136
|
-
left = Math.min(left, (rightContainerElem ? rightContainerElem.offsetLeft : bodyScrollElem.clientWidth) - fixedOffsetWidth - minInterval);
|
|
7137
|
-
} else if (isRightFixed) {
|
|
7138
|
-
// 右侧固定列(不允许超过左侧固定列、不允许超过左边距)
|
|
7139
|
-
dragMinLeft = (leftContainerElem ? leftContainerElem.clientWidth : 0) + fixedOffsetWidth + minInterval;
|
|
7140
|
-
left = Math.min(left, dragPosLeft + cell.clientWidth - minInterval);
|
|
7141
|
-
} else {
|
|
7142
|
-
dragMinLeft = Math.max(bodyScrollElem.scrollLeft, dragMinLeft);
|
|
7143
|
-
// left = Math.min(left, bodyScrollElem.clientWidth + bodyScrollElem.scrollLeft - 40)
|
|
7144
|
-
}
|
|
7145
|
-
dragLeft = Math.max(left, dragMinLeft);
|
|
7146
|
-
const resizeBarLeft = Math.max(1, dragLeft - scrollLeft);
|
|
7147
|
-
resizeBarElem.style.left = `${resizeBarLeft}px`;
|
|
7148
|
-
resizeBarElem.style.top = `${scrollbarXToTop ? scrollbarHeight : 0}px`;
|
|
7149
|
-
resizeBarElem.style.height = `${scrollbarXToTop ? tableHeight - scrollbarHeight : tableHeight}px`;
|
|
7150
|
-
if (resizableOpts.showDragTip && resizeTipElem) {
|
|
7151
|
-
const tableWidth = tableEl.clientWidth;
|
|
7152
|
-
const wrapperRect = wrapperElem.getBoundingClientRect();
|
|
7153
|
-
const resizeBarWidth = resizeBarElem.clientWidth;
|
|
7154
|
-
const resizeTipWidth = resizeTipElem.clientWidth;
|
|
7155
|
-
const resizeTipHeight = resizeTipElem.clientHeight;
|
|
7156
|
-
let resizeTipLeft = -resizeTipWidth;
|
|
7157
|
-
if (resizeBarLeft < resizeTipWidth + resizeBarWidth) {
|
|
7158
|
-
resizeTipLeft = 0;
|
|
7159
|
-
} else if (resizeBarLeft > tableWidth) {
|
|
7160
|
-
resizeTipLeft += tableWidth - resizeBarLeft;
|
|
7161
|
-
}
|
|
7162
|
-
resizeTipElem.style.left = `${resizeTipLeft}px`;
|
|
7163
|
-
resizeTipElem.style.top = `${Math.min(tableHeight - resizeTipHeight, Math.max(0, evnt.clientY - wrapperRect.y - resizeTipHeight / 2))}px`;
|
|
7164
|
-
resizeTipElem.textContent = header_getI18n('vxe.table.resizeColTip', [resizeColumn.renderWidth + (isRightFixed ? dragPosLeft - dragLeft : dragLeft - dragPosLeft)]);
|
|
7165
|
-
}
|
|
7166
|
-
};
|
|
7167
|
-
tableReactData._isResize = true;
|
|
7168
|
-
addClass(tableEl, 'drag--resize');
|
|
7169
|
-
resizeBarElem.style.display = 'block';
|
|
7170
|
-
document.onmousemove = updateEvent;
|
|
7171
|
-
document.onmouseup = function (evnt) {
|
|
7172
|
-
document.onmousemove = domMousemove;
|
|
7173
|
-
document.onmouseup = domMouseup;
|
|
7174
|
-
const resizeWidth = resizeColumn.renderWidth + (isRightFixed ? dragPosLeft - dragLeft : dragLeft - dragPosLeft);
|
|
7175
|
-
resizeColumn.resizeWidth = resizeWidth;
|
|
7176
|
-
if (resizableOpts.dragMode === 'fixed') {
|
|
7177
|
-
visibleColumn.forEach(item => {
|
|
7178
|
-
if (item.id !== resizeColumn.id) {
|
|
7179
|
-
if (!item.resizeWidth) {
|
|
7180
|
-
item.resizeWidth = item.renderWidth;
|
|
7181
|
-
}
|
|
7182
|
-
}
|
|
7183
|
-
});
|
|
7184
|
-
}
|
|
7185
|
-
resizeBarElem.style.display = 'none';
|
|
7186
|
-
tableReactData._isResize = false;
|
|
7187
|
-
tableInternalData._lastResizeTime = Date.now();
|
|
7188
|
-
$xeTable.analyColumnWidth();
|
|
7189
|
-
$xeTable.recalculate(true).then(() => {
|
|
7190
|
-
$xeTable.saveCustomStore('update:visible');
|
|
7191
|
-
$xeTable.updateCellAreas();
|
|
7192
|
-
$xeTable.dispatchEvent('resizable-change', {
|
|
7193
|
-
...params,
|
|
7194
|
-
resizeWidth
|
|
7195
|
-
}, evnt);
|
|
7196
|
-
setTimeout(() => $xeTable.recalculate(true), 300);
|
|
7197
|
-
});
|
|
7198
|
-
removeClass(tableEl, 'drag--resize');
|
|
7199
|
-
};
|
|
7200
|
-
updateEvent(evnt);
|
|
7201
|
-
if ($xeTable.closeMenu) {
|
|
7202
|
-
$xeTable.closeMenu();
|
|
7203
|
-
}
|
|
7204
|
-
};
|
|
7205
7126
|
const renderRows = (isGroup, isOptimizeMode, cols, $rowIndex) => {
|
|
7206
7127
|
const {
|
|
7207
7128
|
fixedType
|
|
@@ -7228,6 +7149,10 @@ const header_renderType = 'header';
|
|
|
7228
7149
|
} = tableInternalData;
|
|
7229
7150
|
const columnOpts = computeColumnOpts.value;
|
|
7230
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;
|
|
7231
7156
|
const {
|
|
7232
7157
|
disabledMethod: dragDisabledMethod,
|
|
7233
7158
|
isCrossDrag,
|
|
@@ -7249,6 +7174,7 @@ const header_renderType = 'header';
|
|
|
7249
7174
|
const compConf = renderOpts ? header_renderer.get(renderOpts.name) : null;
|
|
7250
7175
|
const isColGroup = column.children && column.children.length;
|
|
7251
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;
|
|
7252
7178
|
const headOverflow = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(showHeaderOverflow) ? allColumnHeaderOverflow : showHeaderOverflow;
|
|
7253
7179
|
const headAlign = headerAlign || (compConf ? compConf.tableHeaderCellAlign : '') || allHeaderAlign || align || (compConf ? compConf.tableCellAlign : '') || allAlign;
|
|
7254
7180
|
let showEllipsis = headOverflow === 'ellipsis';
|
|
@@ -7263,7 +7189,7 @@ const header_renderType = 'header';
|
|
|
7263
7189
|
}
|
|
7264
7190
|
const columnIndex = $xeTable.getColumnIndex(column);
|
|
7265
7191
|
const _columnIndex = $xeTable.getVTColumnIndex(column);
|
|
7266
|
-
const
|
|
7192
|
+
const cellParams = {
|
|
7267
7193
|
$table: $xeTable,
|
|
7268
7194
|
$grid: $xeTable.xegrid,
|
|
7269
7195
|
$rowIndex,
|
|
@@ -7283,8 +7209,8 @@ const header_renderType = 'header';
|
|
|
7283
7209
|
rowspan: column.rowSpan > 1 ? column.rowSpan : null
|
|
7284
7210
|
};
|
|
7285
7211
|
const thOns = {
|
|
7286
|
-
onClick: evnt => $xeTable.triggerHeaderCellClickEvent(evnt,
|
|
7287
|
-
onDblclick: evnt => $xeTable.triggerHeaderCellDblclickEvent(evnt,
|
|
7212
|
+
onClick: evnt => $xeTable.triggerHeaderCellClickEvent(evnt, cellParams),
|
|
7213
|
+
onDblclick: evnt => $xeTable.triggerHeaderCellDblclickEvent(evnt, cellParams)
|
|
7288
7214
|
};
|
|
7289
7215
|
// 横向虚拟滚动不支持动态行高
|
|
7290
7216
|
if (scrollXLoad && !hasEllipsis) {
|
|
@@ -7293,11 +7219,11 @@ const header_renderType = 'header';
|
|
|
7293
7219
|
const isColDragCell = columnOpts.drag && columnDragOpts.trigger === 'cell';
|
|
7294
7220
|
let isDisabledDrag = false;
|
|
7295
7221
|
if (isColDragCell) {
|
|
7296
|
-
isDisabledDrag = !!(dragDisabledMethod && dragDisabledMethod(
|
|
7222
|
+
isDisabledDrag = !!(dragDisabledMethod && dragDisabledMethod(cellParams));
|
|
7297
7223
|
}
|
|
7298
7224
|
// 按下事件处理
|
|
7299
7225
|
if (mouseConfig || isColDragCell) {
|
|
7300
|
-
thOns.onMousedown = evnt => $xeTable.triggerHeaderCellMousedownEvent(evnt,
|
|
7226
|
+
thOns.onMousedown = evnt => $xeTable.triggerHeaderCellMousedownEvent(evnt, cellParams);
|
|
7301
7227
|
}
|
|
7302
7228
|
// 拖拽列事件
|
|
7303
7229
|
if (columnOpts.drag) {
|
|
@@ -7315,6 +7241,12 @@ const header_renderType = 'header';
|
|
|
7315
7241
|
if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
|
|
7316
7242
|
isVNPreEmptyStatus = true;
|
|
7317
7243
|
}
|
|
7244
|
+
const tcStyle = {};
|
|
7245
|
+
if (hasEllipsis) {
|
|
7246
|
+
tcStyle.height = `${currCellHeight}px`;
|
|
7247
|
+
} else {
|
|
7248
|
+
tcStyle.minHeight = `${currCellHeight}px`;
|
|
7249
|
+
}
|
|
7318
7250
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('th', {
|
|
7319
7251
|
class: ['vxe-header--column', colid, {
|
|
7320
7252
|
[`col--${headAlign}`]: headAlign,
|
|
@@ -7325,14 +7257,15 @@ const header_renderType = 'header';
|
|
|
7325
7257
|
'col--ellipsis': hasEllipsis,
|
|
7326
7258
|
'fixed--width': !isAutoCellWidth,
|
|
7327
7259
|
'fixed--hidden': fixedHiddenColumn,
|
|
7260
|
+
'is--padding': isPadding,
|
|
7328
7261
|
'is--sortable': column.sortable,
|
|
7329
7262
|
'col--filter': !!filters,
|
|
7330
7263
|
'is--filter-active': hasFilter,
|
|
7331
7264
|
'is--drag-active': !column.fixed && !isDisabledDrag && (isCrossDrag || isPeerDrag || !column.parentId),
|
|
7332
7265
|
'is--drag-disabled': isDisabledDrag,
|
|
7333
7266
|
'col--current': currentColumn === column
|
|
7334
|
-
}, headerClassName ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(headerClassName) ? headerClassName(
|
|
7335
|
-
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,
|
|
7336
7269
|
...thAttrs,
|
|
7337
7270
|
...thOns,
|
|
7338
7271
|
key: columnKey || scrollXLoad || scrollYLoad || columnOpts.useKey || columnOpts.drag || isColGroup ? colid : $columnIndex
|
|
@@ -7341,17 +7274,21 @@ const header_renderType = 'header';
|
|
|
7341
7274
|
'c--title': showTitle,
|
|
7342
7275
|
'c--tooltip': showTooltip,
|
|
7343
7276
|
'c--ellipsis': showEllipsis
|
|
7344
|
-
}]
|
|
7345
|
-
|
|
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))]),
|
|
7346
7283
|
/**
|
|
7347
7284
|
* 列宽拖动
|
|
7348
7285
|
*/
|
|
7349
7286
|
!fixedHiddenColumn && showResizable ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
7350
|
-
class: ['vxe-resizable', {
|
|
7287
|
+
class: ['vxe-cell--col-resizable', {
|
|
7351
7288
|
'is--line': !border || border === 'none'
|
|
7352
7289
|
}],
|
|
7353
|
-
onMousedown: evnt =>
|
|
7354
|
-
onDblclick: evnt => $xeTable.
|
|
7290
|
+
onMousedown: evnt => $xeTable.handleColResizeMousedownEvent(evnt, fixedType, cellParams),
|
|
7291
|
+
onDblclick: evnt => $xeTable.handleColResizeDblclickEvent(evnt, cellParams)
|
|
7355
7292
|
}) : header_renderEmptyElement($xeTable)]);
|
|
7356
7293
|
});
|
|
7357
7294
|
};
|
|
@@ -7364,6 +7301,7 @@ const header_renderType = 'header';
|
|
|
7364
7301
|
headerRowStyle
|
|
7365
7302
|
} = tableProps;
|
|
7366
7303
|
const {
|
|
7304
|
+
isColLoading,
|
|
7367
7305
|
isDragColMove
|
|
7368
7306
|
} = tableReactData;
|
|
7369
7307
|
const columnOpts = computeColumnOpts.value;
|
|
@@ -7375,7 +7313,7 @@ const header_renderType = 'header';
|
|
|
7375
7313
|
fixed: fixedType,
|
|
7376
7314
|
type: header_renderType
|
|
7377
7315
|
};
|
|
7378
|
-
if (columnOpts.drag && columnDragOpts.animation) {
|
|
7316
|
+
if (!isColLoading && columnOpts.drag && columnDragOpts.animation) {
|
|
7379
7317
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(external_commonjs_vue_commonjs2_vue_root_Vue_.TransitionGroup, {
|
|
7380
7318
|
key: $rowIndex,
|
|
7381
7319
|
name: `vxe-header--col-list${isDragColMove ? '' : '-disabled'}`,
|
|
@@ -7400,6 +7338,7 @@ const header_renderType = 'header';
|
|
|
7400
7338
|
tableColumn
|
|
7401
7339
|
} = props;
|
|
7402
7340
|
const {
|
|
7341
|
+
mouseConfig,
|
|
7403
7342
|
showHeaderOverflow: allColumnHeaderOverflow,
|
|
7404
7343
|
spanMethod,
|
|
7405
7344
|
footerSpanMethod
|
|
@@ -7414,6 +7353,7 @@ const header_renderType = 'header';
|
|
|
7414
7353
|
visibleColumn,
|
|
7415
7354
|
fullColumnIdData
|
|
7416
7355
|
} = tableInternalData;
|
|
7356
|
+
const mouseOpts = computeMouseOpts.value;
|
|
7417
7357
|
let renderHeaderList = headerColumn.value;
|
|
7418
7358
|
let renderColumnList = tableColumn;
|
|
7419
7359
|
let isOptimizeMode = false;
|
|
@@ -7500,14 +7440,21 @@ const header_renderType = 'header';
|
|
|
7500
7440
|
*/
|
|
7501
7441
|
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('thead', {
|
|
7502
7442
|
ref: refHeaderTHead
|
|
7503
|
-
}, renderHeads(isGroup, isOptimizeMode, renderHeaderList))])
|
|
7504
|
-
|
|
7505
|
-
|
|
7506
|
-
|
|
7507
|
-
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('
|
|
7508
|
-
|
|
7509
|
-
|
|
7510
|
-
|
|
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)])]);
|
|
7511
7458
|
};
|
|
7512
7459
|
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.tableColumn, uploadColumn);
|
|
7513
7460
|
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.onMounted)(() => {
|
|
@@ -7560,6 +7507,7 @@ const header_renderType = 'header';
|
|
|
7560
7507
|
|
|
7561
7508
|
|
|
7562
7509
|
|
|
7510
|
+
|
|
7563
7511
|
const {
|
|
7564
7512
|
renderer: footer_renderer,
|
|
7565
7513
|
renderEmptyElement: footer_renderEmptyElement
|
|
@@ -7620,7 +7568,11 @@ function mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex) {
|
|
|
7620
7568
|
const {
|
|
7621
7569
|
computeTooltipOpts,
|
|
7622
7570
|
computeColumnOpts,
|
|
7623
|
-
computeColumnDragOpts
|
|
7571
|
+
computeColumnDragOpts,
|
|
7572
|
+
computeCellOpts,
|
|
7573
|
+
computeFooterCellOpts,
|
|
7574
|
+
computeDefaultRowHeight,
|
|
7575
|
+
computeResizableOpts
|
|
7624
7576
|
} = $xeTable.getComputeMaps();
|
|
7625
7577
|
const refElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
7626
7578
|
const refFooterScroll = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
@@ -7633,6 +7585,8 @@ function mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex) {
|
|
|
7633
7585
|
fixedType
|
|
7634
7586
|
} = props;
|
|
7635
7587
|
const {
|
|
7588
|
+
resizable: allResizable,
|
|
7589
|
+
border,
|
|
7636
7590
|
footerCellClassName,
|
|
7637
7591
|
footerCellStyle,
|
|
7638
7592
|
footerAlign: allFooterAlign,
|
|
@@ -7652,7 +7606,15 @@ function mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex) {
|
|
|
7652
7606
|
scrollXStore
|
|
7653
7607
|
} = tableInternalData;
|
|
7654
7608
|
const tooltipOpts = computeTooltipOpts.value;
|
|
7609
|
+
const resizableOpts = computeResizableOpts.value;
|
|
7610
|
+
const {
|
|
7611
|
+
isAllColumnDrag
|
|
7612
|
+
} = resizableOpts;
|
|
7655
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;
|
|
7656
7618
|
return tableColumn.map((column, $columnIndex) => {
|
|
7657
7619
|
const {
|
|
7658
7620
|
type,
|
|
@@ -7663,19 +7625,22 @@ function mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex) {
|
|
|
7663
7625
|
editRender,
|
|
7664
7626
|
cellRender
|
|
7665
7627
|
} = column;
|
|
7628
|
+
const colid = column.id;
|
|
7666
7629
|
const renderOpts = editRender || cellRender;
|
|
7667
7630
|
const compConf = renderOpts ? footer_renderer.get(renderOpts.name) : null;
|
|
7668
7631
|
const showAllTip = tooltipOpts.showAll;
|
|
7669
7632
|
const isColGroup = column.children && column.children.length;
|
|
7670
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;
|
|
7671
7635
|
const footOverflow = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(showFooterOverflow) ? allColumnFooterOverflow : showFooterOverflow;
|
|
7672
7636
|
const footAlign = footerAlign || (compConf ? compConf.tableFooterCellAlign : '') || allFooterAlign || align || (compConf ? compConf.tableCellAlign : '') || allAlign;
|
|
7673
7637
|
let showEllipsis = footOverflow === 'ellipsis';
|
|
7674
7638
|
const showTitle = footOverflow === 'title';
|
|
7675
7639
|
const showTooltip = footOverflow === true || footOverflow === 'tooltip';
|
|
7676
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;
|
|
7677
7642
|
const attrs = {
|
|
7678
|
-
colid
|
|
7643
|
+
colid
|
|
7679
7644
|
};
|
|
7680
7645
|
const tfOns = {};
|
|
7681
7646
|
const columnIndex = $xeTable.getColumnIndex(column);
|
|
@@ -7768,6 +7733,12 @@ function mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex) {
|
|
|
7768
7733
|
if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
|
|
7769
7734
|
isVNPreEmptyStatus = true;
|
|
7770
7735
|
}
|
|
7736
|
+
const tcStyle = {};
|
|
7737
|
+
if (hasEllipsis) {
|
|
7738
|
+
tcStyle.height = `${currCellHeight}px`;
|
|
7739
|
+
} else {
|
|
7740
|
+
tcStyle.minHeight = `${currCellHeight}px`;
|
|
7741
|
+
}
|
|
7771
7742
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('td', {
|
|
7772
7743
|
class: ['vxe-footer--column', column.id, {
|
|
7773
7744
|
[`col--${footAlign}`]: footAlign,
|
|
@@ -7775,6 +7746,7 @@ function mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex) {
|
|
|
7775
7746
|
'col--last': isLastColumn,
|
|
7776
7747
|
'fixed--width': !isAutoCellWidth,
|
|
7777
7748
|
'fixed--hidden': fixedHiddenColumn,
|
|
7749
|
+
'is--padding': isPadding,
|
|
7778
7750
|
'col--ellipsis': hasEllipsis,
|
|
7779
7751
|
'col--current': currentColumn === column
|
|
7780
7752
|
}, getPropClass(footerClassName, cellParams), getPropClass(footerCellClassName, cellParams)],
|
|
@@ -7787,8 +7759,22 @@ function mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex) {
|
|
|
7787
7759
|
'c--title': showTitle,
|
|
7788
7760
|
'c--tooltip': showTooltip,
|
|
7789
7761
|
'c--ellipsis': showEllipsis
|
|
7790
|
-
}]
|
|
7791
|
-
|
|
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)]);
|
|
7792
7778
|
});
|
|
7793
7779
|
};
|
|
7794
7780
|
const renderHeads = renderColumnList => {
|
|
@@ -7801,6 +7787,7 @@ function mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex) {
|
|
|
7801
7787
|
footerRowStyle
|
|
7802
7788
|
} = tableProps;
|
|
7803
7789
|
const {
|
|
7790
|
+
isColLoading,
|
|
7804
7791
|
isDragColMove
|
|
7805
7792
|
} = tableReactData;
|
|
7806
7793
|
const columnOpts = computeColumnOpts.value;
|
|
@@ -7815,7 +7802,7 @@ function mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex) {
|
|
|
7815
7802
|
fixed: fixedType,
|
|
7816
7803
|
type: footer_renderType
|
|
7817
7804
|
};
|
|
7818
|
-
if (columnOpts.drag && columnDragOpts.animation) {
|
|
7805
|
+
if (!isColLoading && columnOpts.drag && columnDragOpts.animation) {
|
|
7819
7806
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(external_commonjs_vue_commonjs2_vue_root_Vue_.TransitionGroup, {
|
|
7820
7807
|
key: $rowIndex,
|
|
7821
7808
|
name: `vxe-header--col-list${isDragColMove ? '' : '-disabled'}`,
|
|
@@ -8002,10 +7989,10 @@ const {
|
|
|
8002
7989
|
type: [Boolean, String],
|
|
8003
7990
|
default: () => props_getConfig().table.border
|
|
8004
7991
|
},
|
|
8005
|
-
//
|
|
7992
|
+
// 已废弃,被 cell-config.padding 替换
|
|
8006
7993
|
padding: {
|
|
8007
7994
|
type: Boolean,
|
|
8008
|
-
default:
|
|
7995
|
+
default: null
|
|
8009
7996
|
},
|
|
8010
7997
|
// 是否圆角边框
|
|
8011
7998
|
round: {
|
|
@@ -8054,12 +8041,18 @@ const {
|
|
|
8054
8041
|
type: Boolean,
|
|
8055
8042
|
default: () => props_getConfig().table.highlightHoverRow
|
|
8056
8043
|
},
|
|
8057
|
-
|
|
8044
|
+
/**
|
|
8045
|
+
* (即将废弃)是否要高亮当前选中列
|
|
8046
|
+
* @deprecated
|
|
8047
|
+
*/
|
|
8058
8048
|
highlightCurrentColumn: {
|
|
8059
8049
|
type: Boolean,
|
|
8060
8050
|
default: () => props_getConfig().table.highlightCurrentColumn
|
|
8061
8051
|
},
|
|
8062
|
-
|
|
8052
|
+
/**
|
|
8053
|
+
* (即将废弃)鼠标移到列是否要高亮显示
|
|
8054
|
+
* @deprecated
|
|
8055
|
+
*/
|
|
8063
8056
|
highlightHoverColumn: {
|
|
8064
8057
|
type: Boolean,
|
|
8065
8058
|
default: () => props_getConfig().table.highlightHoverColumn
|
|
@@ -8151,6 +8144,10 @@ const {
|
|
|
8151
8144
|
columnConfig: Object,
|
|
8152
8145
|
// 单元格配置信息
|
|
8153
8146
|
cellConfig: Object,
|
|
8147
|
+
// 表头单元格配置信息
|
|
8148
|
+
headerCellConfig: Object,
|
|
8149
|
+
// 表尾单元格配置信息
|
|
8150
|
+
footerCellConfig: Object,
|
|
8154
8151
|
// 行配置信息
|
|
8155
8152
|
rowConfig: Object,
|
|
8156
8153
|
// 已废弃,被 rowDragConfig 替换
|
|
@@ -8231,7 +8228,7 @@ const {
|
|
|
8231
8228
|
params: Object
|
|
8232
8229
|
});
|
|
8233
8230
|
;// ./packages/table/src/emits.ts
|
|
8234
|
-
/* 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']);
|
|
8235
8232
|
;// ./packages/table/module/custom/panel.ts
|
|
8236
8233
|
|
|
8237
8234
|
|
|
@@ -10342,7 +10339,6 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
10342
10339
|
computeSize
|
|
10343
10340
|
} = useFns.useSize(props);
|
|
10344
10341
|
const reactData = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.reactive)({
|
|
10345
|
-
isCalcColumn: false,
|
|
10346
10342
|
// 低性能的静态列
|
|
10347
10343
|
staticColumns: [],
|
|
10348
10344
|
// 渲染的列分组
|
|
@@ -10555,15 +10551,17 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
10555
10551
|
isFooter: false
|
|
10556
10552
|
},
|
|
10557
10553
|
scrollVMLoading: false,
|
|
10558
|
-
|
|
10554
|
+
calcCellHeightFlag: 0,
|
|
10555
|
+
resizeHeightFlag: 0,
|
|
10559
10556
|
isCustomStatus: false,
|
|
10560
10557
|
isDragRowMove: false,
|
|
10561
10558
|
dragRow: null,
|
|
10562
10559
|
isDragColMove: false,
|
|
10563
10560
|
dragCol: null,
|
|
10564
10561
|
dragTipText: '',
|
|
10565
|
-
|
|
10566
|
-
|
|
10562
|
+
isDragResize: false,
|
|
10563
|
+
isRowLoading: false,
|
|
10564
|
+
isColLoading: false
|
|
10567
10565
|
});
|
|
10568
10566
|
const internalData = {
|
|
10569
10567
|
tZindex: 0,
|
|
@@ -10637,10 +10635,6 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
10637
10635
|
fullDataRowIdData: {},
|
|
10638
10636
|
fullColumnIdData: {},
|
|
10639
10637
|
fullColumnFieldData: {},
|
|
10640
|
-
// 列选取状态
|
|
10641
|
-
columnStatusMaps: {},
|
|
10642
|
-
// 行选取状态
|
|
10643
|
-
rowStatusMaps: {},
|
|
10644
10638
|
// prevDragRow: null,
|
|
10645
10639
|
inited: false,
|
|
10646
10640
|
tooltipTimeout: null,
|
|
@@ -10668,8 +10662,8 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
10668
10662
|
const refTableRightFooter = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
10669
10663
|
const refLeftContainer = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
10670
10664
|
const refRightContainer = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
10671
|
-
const
|
|
10672
|
-
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)();
|
|
10673
10667
|
const refEmptyPlaceholder = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
10674
10668
|
const refDragTipElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
10675
10669
|
const refDragRowLineElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
@@ -10768,7 +10762,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
10768
10762
|
const computeDefaultRowHeight = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
10769
10763
|
const vSize = computeSize.value;
|
|
10770
10764
|
const rowHeightMaps = computeRowHeightMaps.value;
|
|
10771
|
-
return rowHeightMaps[vSize || 'default'];
|
|
10765
|
+
return rowHeightMaps[vSize || 'default'] || 18;
|
|
10772
10766
|
});
|
|
10773
10767
|
const computeColumnOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
10774
10768
|
return Object.assign({}, table_getConfig().table.columnConfig, props.columnConfig);
|
|
@@ -10776,6 +10770,12 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
10776
10770
|
const computeCellOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
10777
10771
|
return Object.assign({}, table_getConfig().table.cellConfig, props.cellConfig);
|
|
10778
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
|
+
});
|
|
10779
10779
|
const computeRowOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
10780
10780
|
return Object.assign({}, table_getConfig().table.rowConfig, props.rowConfig);
|
|
10781
10781
|
});
|
|
@@ -10805,6 +10805,17 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
10805
10805
|
const computeTooltipOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
10806
10806
|
return Object.assign({}, table_getConfig().tooltip, table_getConfig().table.tooltipConfig, props.tooltipConfig);
|
|
10807
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
|
+
});
|
|
10808
10819
|
const computeEditOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
10809
10820
|
return Object.assign({}, table_getConfig().table.editConfig, props.editConfig);
|
|
10810
10821
|
});
|
|
@@ -11035,8 +11046,8 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
11035
11046
|
refTableRightFooter,
|
|
11036
11047
|
refLeftContainer,
|
|
11037
11048
|
refRightContainer,
|
|
11038
|
-
|
|
11039
|
-
|
|
11049
|
+
refColResizeBar,
|
|
11050
|
+
refRowResizeBar,
|
|
11040
11051
|
refScrollXVirtualElem,
|
|
11041
11052
|
refScrollYVirtualElem,
|
|
11042
11053
|
refScrollXHandleElem,
|
|
@@ -11058,6 +11069,8 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
11058
11069
|
computeScrollYThreshold,
|
|
11059
11070
|
computeDefaultRowHeight,
|
|
11060
11071
|
computeCellOpts,
|
|
11072
|
+
computeHeaderCellOpts,
|
|
11073
|
+
computeFooterCellOpts,
|
|
11061
11074
|
computeRowOpts,
|
|
11062
11075
|
computeRowDragOpts,
|
|
11063
11076
|
computeColumnDragOpts,
|
|
@@ -11209,14 +11222,14 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
11209
11222
|
};
|
|
11210
11223
|
const computeRowHeight = () => {
|
|
11211
11224
|
const {
|
|
11212
|
-
|
|
11213
|
-
} =
|
|
11225
|
+
isAllOverflow
|
|
11226
|
+
} = reactData;
|
|
11214
11227
|
const tableHeader = refTableHeader.value;
|
|
11215
11228
|
const tableBody = refTableBody.value;
|
|
11216
11229
|
const tableBodyElem = tableBody ? tableBody.$el : null;
|
|
11217
11230
|
const defaultRowHeight = computeDefaultRowHeight.value;
|
|
11218
11231
|
let rowHeight = 0;
|
|
11219
|
-
if (
|
|
11232
|
+
if (isAllOverflow) {
|
|
11220
11233
|
if (tableBodyElem) {
|
|
11221
11234
|
const tableHeaderElem = tableHeader ? tableHeader.$el : null;
|
|
11222
11235
|
let firstTrElem;
|
|
@@ -11239,16 +11252,17 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
11239
11252
|
};
|
|
11240
11253
|
const handleVirtualYVisible = currScrollTop => {
|
|
11241
11254
|
const {
|
|
11242
|
-
|
|
11243
|
-
} = props;
|
|
11244
|
-
const {
|
|
11245
|
-
rowHeight
|
|
11255
|
+
isAllOverflow
|
|
11246
11256
|
} = reactData;
|
|
11247
11257
|
const {
|
|
11248
11258
|
elemStore,
|
|
11259
|
+
isResizeCellHeight,
|
|
11249
11260
|
afterFullData,
|
|
11250
11261
|
fullAllDataRowIdData
|
|
11251
11262
|
} = internalData;
|
|
11263
|
+
const rowOpts = computeRowOpts.value;
|
|
11264
|
+
const cellOpts = computeCellOpts.value;
|
|
11265
|
+
const defaultRowHeight = computeDefaultRowHeight.value;
|
|
11252
11266
|
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
11253
11267
|
if (bodyScrollElem) {
|
|
11254
11268
|
const clientHeight = bodyScrollElem.clientHeight;
|
|
@@ -11257,15 +11271,16 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
11257
11271
|
let toVisibleIndex = -1;
|
|
11258
11272
|
let offsetTop = 0;
|
|
11259
11273
|
let visibleSize = 0;
|
|
11260
|
-
|
|
11261
|
-
|
|
11262
|
-
|
|
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;
|
|
11263
11278
|
} else {
|
|
11264
11279
|
for (let rIndex = 0, rLen = afterFullData.length; rIndex < rLen; rIndex++) {
|
|
11265
11280
|
const row = afterFullData[rIndex];
|
|
11266
11281
|
const rowid = getRowid($xeTable, row);
|
|
11267
|
-
const rowRest = fullAllDataRowIdData[rowid];
|
|
11268
|
-
offsetTop += rowRest
|
|
11282
|
+
const rowRest = fullAllDataRowIdData[rowid] || {};
|
|
11283
|
+
offsetTop += rowRest.resizeHeight || rowRest.height || cellOpts.height || rowOpts.height || defaultRowHeight;
|
|
11269
11284
|
if (toVisibleIndex === -1 && scrollTop < offsetTop) {
|
|
11270
11285
|
toVisibleIndex = rIndex;
|
|
11271
11286
|
}
|
|
@@ -11656,56 +11671,40 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
11656
11671
|
internalData.customMaxHeight = calcTableHeight('maxHeight');
|
|
11657
11672
|
};
|
|
11658
11673
|
const calcColumnAutoWidth = (column, wrapperEl) => {
|
|
11659
|
-
const
|
|
11660
|
-
|
|
11661
|
-
|
|
11662
|
-
if (firstCellEl) {
|
|
11663
|
-
const cellStyle = getComputedStyle(firstCellEl);
|
|
11664
|
-
|
|
11665
|
-
}
|
|
11666
|
-
let colWidth = column.renderAutoWidth -
|
|
11667
|
-
|
|
11668
|
-
const
|
|
11669
|
-
|
|
11670
|
-
|
|
11671
|
-
|
|
11672
|
-
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(cellEl.children, btnEl => {
|
|
11673
|
-
titleWidth += btnEl.offsetWidth + 1;
|
|
11674
|
-
});
|
|
11675
|
-
} else {
|
|
11676
|
-
const labelEl = cellEl.firstElementChild;
|
|
11677
|
-
if (labelEl) {
|
|
11678
|
-
titleWidth = labelEl.offsetWidth;
|
|
11679
|
-
}
|
|
11680
|
-
}
|
|
11681
|
-
if (titleWidth) {
|
|
11682
|
-
colWidth = Math.max(colWidth, Math.ceil(titleWidth) + 4);
|
|
11683
|
-
}
|
|
11684
|
-
});
|
|
11685
|
-
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;
|
|
11686
11687
|
};
|
|
11687
11688
|
const calcCellWidth = () => {
|
|
11688
11689
|
const autoWidthColumnList = computeAutoWidthColumnList.value;
|
|
11689
|
-
|
|
11690
|
-
|
|
11691
|
-
|
|
11692
|
-
|
|
11693
|
-
|
|
11694
|
-
|
|
11695
|
-
|
|
11696
|
-
|
|
11697
|
-
|
|
11698
|
-
|
|
11699
|
-
|
|
11700
|
-
|
|
11701
|
-
|
|
11702
|
-
|
|
11703
|
-
|
|
11704
|
-
|
|
11705
|
-
|
|
11706
|
-
|
|
11707
|
-
reactData.isCalcColumn = false;
|
|
11708
|
-
});
|
|
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
|
+
}
|
|
11709
11708
|
};
|
|
11710
11709
|
/**
|
|
11711
11710
|
* 列宽算法,计算单元格列宽,动态分配可用剩余空间
|
|
@@ -11761,39 +11760,39 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
11761
11760
|
});
|
|
11762
11761
|
// 最小自适应
|
|
11763
11762
|
autoMinList.forEach(column => {
|
|
11764
|
-
const
|
|
11765
|
-
tableWidth +=
|
|
11766
|
-
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;
|
|
11767
11766
|
});
|
|
11768
11767
|
// 最小百分比
|
|
11769
11768
|
scaleMinList.forEach(column => {
|
|
11770
|
-
const
|
|
11771
|
-
tableWidth +=
|
|
11772
|
-
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;
|
|
11773
11772
|
});
|
|
11774
11773
|
// 固定百分比
|
|
11775
11774
|
scaleList.forEach(column => {
|
|
11776
|
-
const
|
|
11777
|
-
tableWidth +=
|
|
11778
|
-
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;
|
|
11779
11778
|
});
|
|
11780
11779
|
// 固定宽
|
|
11781
11780
|
pxList.forEach(column => {
|
|
11782
|
-
const
|
|
11783
|
-
tableWidth +=
|
|
11784
|
-
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;
|
|
11785
11784
|
});
|
|
11786
11785
|
// 自适应宽
|
|
11787
11786
|
autoList.forEach(column => {
|
|
11788
|
-
const
|
|
11789
|
-
tableWidth +=
|
|
11790
|
-
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;
|
|
11791
11790
|
});
|
|
11792
11791
|
// 调整了列宽
|
|
11793
11792
|
resizeList.forEach(column => {
|
|
11794
|
-
const
|
|
11795
|
-
tableWidth +=
|
|
11796
|
-
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;
|
|
11797
11796
|
});
|
|
11798
11797
|
remainWidth -= tableWidth;
|
|
11799
11798
|
meanWidth = remainWidth > 0 ? Math.floor(remainWidth / (scaleMinList.length + pxMinList.length + autoMinList.length + remainList.length)) : 0;
|
|
@@ -11833,7 +11832,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
11833
11832
|
}
|
|
11834
11833
|
const tableHeight = bodyElem.offsetHeight;
|
|
11835
11834
|
const overflowY = yHandleEl.scrollHeight > yHandleEl.clientHeight;
|
|
11836
|
-
reactData.scrollbarWidth =
|
|
11835
|
+
reactData.scrollbarWidth = Math.max(scrollbarOpts.width || 0, yHandleEl.offsetWidth - yHandleEl.clientWidth);
|
|
11837
11836
|
reactData.overflowY = overflowY;
|
|
11838
11837
|
internalData.tableWidth = tableWidth;
|
|
11839
11838
|
internalData.tableHeight = tableHeight;
|
|
@@ -11842,7 +11841,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
11842
11841
|
const headerHeight = headerTableElem ? headerTableElem.clientHeight : 0;
|
|
11843
11842
|
const overflowX = tableWidth > bodyWidth;
|
|
11844
11843
|
const footerHeight = footerTableElem ? footerTableElem.clientHeight : 0;
|
|
11845
|
-
reactData.scrollbarHeight =
|
|
11844
|
+
reactData.scrollbarHeight = Math.max(scrollbarOpts.height || 0, xHandleEl.offsetHeight - xHandleEl.clientHeight);
|
|
11846
11845
|
internalData.headerHeight = headerHeight;
|
|
11847
11846
|
internalData.footerHeight = footerHeight;
|
|
11848
11847
|
reactData.overflowX = overflowX;
|
|
@@ -11852,64 +11851,43 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
11852
11851
|
$xeTable.checkScrolling();
|
|
11853
11852
|
}
|
|
11854
11853
|
};
|
|
11855
|
-
|
|
11856
|
-
|
|
11857
|
-
|
|
11858
|
-
|
|
11859
|
-
|
|
11860
|
-
|
|
11861
|
-
|
|
11862
|
-
|
|
11863
|
-
|
|
11864
|
-
|
|
11865
|
-
|
|
11866
|
-
|
|
11867
|
-
// }
|
|
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
|
+
};
|
|
11868
11866
|
const calcCellHeight = () => {
|
|
11869
|
-
const {
|
|
11870
|
-
showOverflow
|
|
11871
|
-
} = props;
|
|
11872
11867
|
const {
|
|
11873
11868
|
tableData,
|
|
11869
|
+
isAllOverflow,
|
|
11870
|
+
scrollYLoad,
|
|
11874
11871
|
scrollXLoad
|
|
11875
11872
|
} = reactData;
|
|
11876
11873
|
const {
|
|
11877
11874
|
fullAllDataRowIdData
|
|
11878
11875
|
} = internalData;
|
|
11876
|
+
const defaultRowHeight = computeDefaultRowHeight.value;
|
|
11879
11877
|
const el = refElem.value;
|
|
11880
|
-
if (!
|
|
11881
|
-
|
|
11882
|
-
let paddingBottom = 0;
|
|
11883
|
-
let calcPadding = false;
|
|
11878
|
+
if (!isAllOverflow && scrollYLoad && el) {
|
|
11879
|
+
el.setAttribute('data-calc-row', 'Y');
|
|
11884
11880
|
tableData.forEach(row => {
|
|
11885
11881
|
const rowid = getRowid($xeTable, row);
|
|
11886
11882
|
const rowRest = fullAllDataRowIdData[rowid];
|
|
11887
|
-
|
|
11888
|
-
|
|
11889
|
-
|
|
11890
|
-
for (let i = 0; i < cellList.length; i++) {
|
|
11891
|
-
const cellElem = cellList[i];
|
|
11892
|
-
const tdEl = cellElem.parentElement;
|
|
11893
|
-
if (!tdEl || !tdEl.clientWidth) {
|
|
11894
|
-
break;
|
|
11895
|
-
}
|
|
11896
|
-
if (!calcPadding) {
|
|
11897
|
-
paddingTop = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(getComputedStyle(tdEl).paddingTop);
|
|
11898
|
-
paddingBottom = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(getComputedStyle(tdEl).paddingBottom);
|
|
11899
|
-
calcPadding = true;
|
|
11900
|
-
}
|
|
11901
|
-
let cellHeight = paddingTop + paddingBottom;
|
|
11902
|
-
if (cellElem) {
|
|
11903
|
-
cellHeight += cellElem.clientHeight;
|
|
11904
|
-
}
|
|
11905
|
-
height = Math.max(height, cellHeight);
|
|
11906
|
-
}
|
|
11907
|
-
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);
|
|
11908
11886
|
}
|
|
11887
|
+
el.removeAttribute('data-calc-row');
|
|
11909
11888
|
});
|
|
11910
|
-
reactData.
|
|
11889
|
+
reactData.calcCellHeightFlag++;
|
|
11911
11890
|
}
|
|
11912
|
-
// updateCellOffset()
|
|
11913
11891
|
};
|
|
11914
11892
|
const getOrderField = column => {
|
|
11915
11893
|
const {
|
|
@@ -11963,6 +11941,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
11963
11941
|
parent: null,
|
|
11964
11942
|
level: 0,
|
|
11965
11943
|
height: 0,
|
|
11944
|
+
resizeHeight: 0,
|
|
11966
11945
|
oTop: 0
|
|
11967
11946
|
};
|
|
11968
11947
|
fullAllDataRowIdData[rowid] = rest;
|
|
@@ -12012,6 +11991,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
12012
11991
|
parent: null,
|
|
12013
11992
|
level: 0,
|
|
12014
11993
|
height: 0,
|
|
11994
|
+
resizeHeight: 0,
|
|
12015
11995
|
oTop: 0
|
|
12016
11996
|
};
|
|
12017
11997
|
fullAllDataRowIdData[rowid] = rest;
|
|
@@ -12281,7 +12261,6 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
12281
12261
|
const updateStyle = () => {
|
|
12282
12262
|
const {
|
|
12283
12263
|
border,
|
|
12284
|
-
showOverflow: allColumnOverflow,
|
|
12285
12264
|
showHeaderOverflow: allColumnHeaderOverflow,
|
|
12286
12265
|
showFooterOverflow: allColumnFooterOverflow,
|
|
12287
12266
|
mouseConfig,
|
|
@@ -12294,7 +12273,9 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
12294
12273
|
tableColumn,
|
|
12295
12274
|
scrollXLoad,
|
|
12296
12275
|
scrollYLoad,
|
|
12276
|
+
overflowX,
|
|
12297
12277
|
scrollbarWidth,
|
|
12278
|
+
overflowY,
|
|
12298
12279
|
scrollbarHeight,
|
|
12299
12280
|
columnStore,
|
|
12300
12281
|
editStore,
|
|
@@ -12318,6 +12299,8 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
12318
12299
|
return;
|
|
12319
12300
|
}
|
|
12320
12301
|
const containerList = ['main', 'left', 'right'];
|
|
12302
|
+
const osbWidth = overflowY ? scrollbarWidth : 0;
|
|
12303
|
+
const osbHeight = overflowX ? scrollbarHeight : 0;
|
|
12321
12304
|
const emptyPlaceholderElem = refEmptyPlaceholder.value;
|
|
12322
12305
|
const cellOffsetWidth = computeCellOffsetWidth.value;
|
|
12323
12306
|
const mouseOpts = computeMouseOpts.value;
|
|
@@ -12325,16 +12308,16 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
12325
12308
|
const bodyTableElem = getRefElem(elemStore['main-body-table']);
|
|
12326
12309
|
if (emptyPlaceholderElem) {
|
|
12327
12310
|
emptyPlaceholderElem.style.top = `${headerHeight}px`;
|
|
12328
|
-
emptyPlaceholderElem.style.height = bodyWrapperElem ? `${bodyWrapperElem.offsetHeight -
|
|
12311
|
+
emptyPlaceholderElem.style.height = bodyWrapperElem ? `${bodyWrapperElem.offsetHeight - osbHeight}px` : '';
|
|
12329
12312
|
}
|
|
12330
12313
|
let bodyHeight = 0;
|
|
12331
12314
|
let bodyMaxHeight = 0;
|
|
12332
|
-
const bodyMinHeight = customMinHeight - headerHeight - footerHeight -
|
|
12315
|
+
const bodyMinHeight = customMinHeight - headerHeight - footerHeight - osbHeight;
|
|
12333
12316
|
if (customMaxHeight) {
|
|
12334
|
-
bodyMaxHeight = Math.max(bodyMinHeight, customMaxHeight - headerHeight - footerHeight -
|
|
12317
|
+
bodyMaxHeight = Math.max(bodyMinHeight, customMaxHeight - headerHeight - footerHeight - osbHeight);
|
|
12335
12318
|
}
|
|
12336
12319
|
if (customHeight) {
|
|
12337
|
-
bodyHeight = customHeight - headerHeight - footerHeight -
|
|
12320
|
+
bodyHeight = customHeight - headerHeight - footerHeight - osbHeight;
|
|
12338
12321
|
}
|
|
12339
12322
|
if (!bodyHeight) {
|
|
12340
12323
|
if (bodyTableElem) {
|
|
@@ -12352,27 +12335,27 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
12352
12335
|
const scrollbarXToTop = computeScrollbarXToTop.value;
|
|
12353
12336
|
const scrollXVirtualEl = refScrollXVirtualElem.value;
|
|
12354
12337
|
if (scrollXVirtualEl) {
|
|
12355
|
-
scrollXVirtualEl.style.height = `${
|
|
12356
|
-
scrollXVirtualEl.style.visibility =
|
|
12338
|
+
scrollXVirtualEl.style.height = `${osbHeight}px`;
|
|
12339
|
+
scrollXVirtualEl.style.visibility = overflowX ? 'visible' : 'hidden';
|
|
12357
12340
|
}
|
|
12358
12341
|
const xWrapperEl = refScrollXWrapperElem.value;
|
|
12359
12342
|
if (xWrapperEl) {
|
|
12360
|
-
xWrapperEl.style.left = scrollbarXToTop ? `${
|
|
12361
|
-
xWrapperEl.style.width = `${el.clientWidth -
|
|
12343
|
+
xWrapperEl.style.left = scrollbarXToTop ? `${osbWidth}px` : '';
|
|
12344
|
+
xWrapperEl.style.width = `${el.clientWidth - osbWidth}px`;
|
|
12362
12345
|
}
|
|
12363
12346
|
if (xLeftCornerEl) {
|
|
12364
|
-
xLeftCornerEl.style.width = scrollbarXToTop ? `${
|
|
12365
|
-
xLeftCornerEl.style.display = scrollbarXToTop ?
|
|
12347
|
+
xLeftCornerEl.style.width = scrollbarXToTop ? `${osbWidth}px` : '';
|
|
12348
|
+
xLeftCornerEl.style.display = scrollbarXToTop ? osbWidth && osbHeight ? 'block' : '' : '';
|
|
12366
12349
|
}
|
|
12367
12350
|
if (xRightCornerEl) {
|
|
12368
|
-
xRightCornerEl.style.width = scrollbarXToTop ? '' : `${
|
|
12369
|
-
xRightCornerEl.style.display = scrollbarXToTop ? '' :
|
|
12351
|
+
xRightCornerEl.style.width = scrollbarXToTop ? '' : `${osbWidth}px`;
|
|
12352
|
+
xRightCornerEl.style.display = scrollbarXToTop ? '' : osbWidth && osbHeight ? 'block' : '';
|
|
12370
12353
|
}
|
|
12371
12354
|
const scrollYVirtualEl = refScrollYVirtualElem.value;
|
|
12372
12355
|
if (scrollYVirtualEl) {
|
|
12373
|
-
scrollYVirtualEl.style.width = `${
|
|
12356
|
+
scrollYVirtualEl.style.width = `${osbWidth}px`;
|
|
12374
12357
|
scrollYVirtualEl.style.height = `${bodyHeight + headerHeight + footerHeight}px`;
|
|
12375
|
-
scrollYVirtualEl.style.visibility =
|
|
12358
|
+
scrollYVirtualEl.style.visibility = overflowY ? 'visible' : 'hidden';
|
|
12376
12359
|
}
|
|
12377
12360
|
const yTopCornerEl = refScrollYTopCornerElem.value;
|
|
12378
12361
|
if (yTopCornerEl) {
|
|
@@ -12491,14 +12474,14 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
12491
12474
|
if (wrapperElem) {
|
|
12492
12475
|
wrapperElem.style.top = `${headerHeight}px`;
|
|
12493
12476
|
}
|
|
12494
|
-
fixedWrapperElem.style.height = `${customHeight > 0 ? customHeight : tableHeight + headerHeight + footerHeight +
|
|
12477
|
+
fixedWrapperElem.style.height = `${customHeight > 0 ? customHeight : tableHeight + headerHeight + footerHeight + osbHeight}px`;
|
|
12495
12478
|
fixedWrapperElem.style.width = `${fixedColumn.reduce((previous, column) => previous + column.renderWidth, 0)}px`;
|
|
12496
12479
|
}
|
|
12497
12480
|
let tWidth = tableWidth;
|
|
12498
12481
|
let renderColumnList = tableColumn;
|
|
12499
12482
|
let isOptimizeMode = false;
|
|
12500
12483
|
// 如果是使用优化模式
|
|
12501
|
-
if (scrollXLoad || scrollYLoad ||
|
|
12484
|
+
if (scrollXLoad || scrollYLoad || isAllOverflow) {
|
|
12502
12485
|
if (expandColumn || spanMethod || footerSpanMethod) {
|
|
12503
12486
|
// 如果不支持优化模式
|
|
12504
12487
|
} else {
|
|
@@ -12520,7 +12503,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
12520
12503
|
if (tableElem) {
|
|
12521
12504
|
tableElem.style.width = tWidth ? `${tWidth}px` : '';
|
|
12522
12505
|
// 兼容性处理
|
|
12523
|
-
tableElem.style.paddingRight =
|
|
12506
|
+
tableElem.style.paddingRight = osbWidth && fixedType && (browse['-moz'] || browse.safari) ? `${osbWidth}px` : '';
|
|
12524
12507
|
}
|
|
12525
12508
|
const emptyBlockElem = getRefElem(elemStore[`${name}-${layout}-emptyBlock`]);
|
|
12526
12509
|
if (emptyBlockElem) {
|
|
@@ -12555,7 +12538,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
12555
12538
|
// 如果是固定列
|
|
12556
12539
|
if (fixedWrapperElem) {
|
|
12557
12540
|
if (wrapperElem) {
|
|
12558
|
-
wrapperElem.style.top = `${customHeight > 0 ? customHeight - footerHeight -
|
|
12541
|
+
wrapperElem.style.top = `${customHeight > 0 ? customHeight - footerHeight - osbHeight : tableHeight + headerHeight}px`;
|
|
12559
12542
|
}
|
|
12560
12543
|
}
|
|
12561
12544
|
}
|
|
@@ -12582,7 +12565,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
12582
12565
|
} else if (layout === 'footer') {
|
|
12583
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;
|
|
12584
12567
|
} else {
|
|
12585
|
-
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;
|
|
12586
12569
|
}
|
|
12587
12570
|
const showEllipsis = cellOverflow === 'ellipsis';
|
|
12588
12571
|
const showTitle = cellOverflow === 'title';
|
|
@@ -13282,11 +13265,10 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
13282
13265
|
* 加载表格数据
|
|
13283
13266
|
* @param {Array} datas 数据
|
|
13284
13267
|
*/
|
|
13285
|
-
const loadTableData = datas => {
|
|
13268
|
+
const loadTableData = (datas, isReset) => {
|
|
13286
13269
|
const {
|
|
13287
13270
|
keepSource,
|
|
13288
|
-
treeConfig
|
|
13289
|
-
showOverflow
|
|
13271
|
+
treeConfig
|
|
13290
13272
|
} = props;
|
|
13291
13273
|
const {
|
|
13292
13274
|
editStore,
|
|
@@ -13299,7 +13281,6 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
13299
13281
|
lastScrollTop
|
|
13300
13282
|
} = internalData;
|
|
13301
13283
|
const treeOpts = computeTreeOpts.value;
|
|
13302
|
-
const rowOpts = computeRowOpts.value;
|
|
13303
13284
|
const {
|
|
13304
13285
|
transform
|
|
13305
13286
|
} = treeOpts;
|
|
@@ -13346,42 +13327,30 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
13346
13327
|
scrollYStore.endIndex = 1;
|
|
13347
13328
|
scrollXStore.startIndex = 0;
|
|
13348
13329
|
scrollXStore.endIndex = 1;
|
|
13330
|
+
reactData.isRowLoading = true;
|
|
13349
13331
|
reactData.scrollVMLoading = false;
|
|
13350
13332
|
editStore.insertMaps = {};
|
|
13351
13333
|
editStore.removeMaps = {};
|
|
13352
13334
|
const sYLoad = updateScrollYStatus(fullData);
|
|
13335
|
+
reactData.isDragColMove = false;
|
|
13353
13336
|
reactData.isDragRowMove = false;
|
|
13354
13337
|
// 全量数据
|
|
13355
13338
|
internalData.tableFullData = fullData;
|
|
13356
13339
|
internalData.tableFullTreeData = treeData;
|
|
13357
13340
|
// 缓存数据
|
|
13358
|
-
|
|
13341
|
+
$xeTable.cacheRowMap(true, isReset);
|
|
13359
13342
|
// 原始数据
|
|
13360
13343
|
internalData.tableSynchData = datas;
|
|
13344
|
+
if (isReset) {
|
|
13345
|
+
internalData.isResizeCellHeight = false;
|
|
13346
|
+
reactData.rowExpandedMaps = {};
|
|
13347
|
+
reactData.rowExpandLazyLoadedMaps = {};
|
|
13348
|
+
reactData.treeExpandedMaps = {};
|
|
13349
|
+
reactData.treeExpandLazyLoadedMaps = {};
|
|
13350
|
+
}
|
|
13361
13351
|
// 克隆原数据,用于显示编辑状态,与编辑值做对比
|
|
13362
13352
|
if (keepSource) {
|
|
13363
|
-
|
|
13364
|
-
}
|
|
13365
|
-
if (sYLoad) {
|
|
13366
|
-
if (showOverflow) {
|
|
13367
|
-
if (!rowOpts.height) {
|
|
13368
|
-
const errColumn = internalData.tableFullColumn.find(column => column.showOverflow === false);
|
|
13369
|
-
if (errColumn) {
|
|
13370
|
-
errLog('vxe.error.errProp', [`column[field="${errColumn.field}"].show-overflow=false`, 'show-overflow=true']);
|
|
13371
|
-
}
|
|
13372
|
-
}
|
|
13373
|
-
}
|
|
13374
|
-
if (true) {
|
|
13375
|
-
if (!(props.height || props.maxHeight)) {
|
|
13376
|
-
errLog('vxe.error.reqProp', ['table.height | table.max-height | table.scroll-y={enabled: false}']);
|
|
13377
|
-
}
|
|
13378
|
-
// if (!props.showOverflow) {
|
|
13379
|
-
// warnLog('vxe.error.reqProp', ['table.show-overflow'])
|
|
13380
|
-
// }
|
|
13381
|
-
if (props.spanMethod) {
|
|
13382
|
-
warnLog('vxe.error.scrollErrProp', ['table.span-method']);
|
|
13383
|
-
}
|
|
13384
|
-
}
|
|
13353
|
+
$xeTable.cacheSourceMap(fullData);
|
|
13385
13354
|
}
|
|
13386
13355
|
if ($xeTable.clearCellAreas && props.mouseConfig) {
|
|
13387
13356
|
$xeTable.clearCellAreas();
|
|
@@ -13401,6 +13370,27 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
13401
13370
|
if (sYLoad) {
|
|
13402
13371
|
scrollYStore.endIndex = scrollYStore.visibleSize;
|
|
13403
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
|
+
}
|
|
13404
13394
|
handleReserveStatus();
|
|
13405
13395
|
tablePrivateMethods.checkSelectionStatus();
|
|
13406
13396
|
return new Promise(resolve => {
|
|
@@ -13416,6 +13406,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
13416
13406
|
if (sYOpts.scrollToTopOnChange) {
|
|
13417
13407
|
targetScrollTop = 0;
|
|
13418
13408
|
}
|
|
13409
|
+
reactData.isRowLoading = false;
|
|
13419
13410
|
calcCellHeight();
|
|
13420
13411
|
// 是否变更虚拟滚动
|
|
13421
13412
|
if (oldScrollYLoad === sYLoad) {
|
|
@@ -13679,11 +13670,10 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
13679
13670
|
internalData.collectColumn = collectColumn;
|
|
13680
13671
|
const tableFullColumn = getColumnList(collectColumn);
|
|
13681
13672
|
internalData.tableFullColumn = tableFullColumn;
|
|
13682
|
-
reactData.
|
|
13673
|
+
reactData.isColLoading = true;
|
|
13683
13674
|
reactData.isDragColMove = false;
|
|
13684
13675
|
initColumnSort();
|
|
13685
13676
|
return Promise.resolve(restoreCustomStorage()).then(() => {
|
|
13686
|
-
reactData.isLoading = false;
|
|
13687
13677
|
cacheColumnMap();
|
|
13688
13678
|
parseColumns(true).then(() => {
|
|
13689
13679
|
if (reactData.scrollXLoad) {
|
|
@@ -13708,6 +13698,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
13708
13698
|
if ($xeTable.handleUpdateCustomColumn) {
|
|
13709
13699
|
$xeTable.handleUpdateCustomColumn();
|
|
13710
13700
|
}
|
|
13701
|
+
reactData.isColLoading = false;
|
|
13711
13702
|
return $xeTable.recalculate();
|
|
13712
13703
|
});
|
|
13713
13704
|
});
|
|
@@ -13851,10 +13842,8 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
13851
13842
|
*/
|
|
13852
13843
|
const loadScrollYData = scrollTop => {
|
|
13853
13844
|
const {
|
|
13854
|
-
|
|
13855
|
-
|
|
13856
|
-
const {
|
|
13857
|
-
mergeList
|
|
13845
|
+
mergeList,
|
|
13846
|
+
isAllOverflow
|
|
13858
13847
|
} = reactData;
|
|
13859
13848
|
const {
|
|
13860
13849
|
scrollYStore
|
|
@@ -13865,7 +13854,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
13865
13854
|
endIndex,
|
|
13866
13855
|
offsetSize
|
|
13867
13856
|
} = scrollYStore;
|
|
13868
|
-
const autoOffsetYSize =
|
|
13857
|
+
const autoOffsetYSize = isAllOverflow ? offsetSize : offsetSize + 1;
|
|
13869
13858
|
const {
|
|
13870
13859
|
toVisibleIndex,
|
|
13871
13860
|
visibleSize
|
|
@@ -13927,7 +13916,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
13927
13916
|
const {
|
|
13928
13917
|
visibleSize
|
|
13929
13918
|
} = scrollXStore;
|
|
13930
|
-
const fpsTime = Math.max(5, Math.min(
|
|
13919
|
+
const fpsTime = Math.max(5, Math.min(10, Math.floor(visibleSize / 3)));
|
|
13931
13920
|
if (lxTimeout) {
|
|
13932
13921
|
clearTimeout(lxTimeout);
|
|
13933
13922
|
}
|
|
@@ -13944,9 +13933,13 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
13944
13933
|
const lazyScrollYData = () => {
|
|
13945
13934
|
const {
|
|
13946
13935
|
lyTimeout,
|
|
13947
|
-
lyRunTime
|
|
13936
|
+
lyRunTime,
|
|
13937
|
+
scrollYStore
|
|
13948
13938
|
} = internalData;
|
|
13949
|
-
const
|
|
13939
|
+
const {
|
|
13940
|
+
visibleSize
|
|
13941
|
+
} = scrollYStore;
|
|
13942
|
+
const fpsTime = Math.floor(Math.max(4, Math.min(10, visibleSize / 3)));
|
|
13950
13943
|
if (lyTimeout) {
|
|
13951
13944
|
clearTimeout(lyTimeout);
|
|
13952
13945
|
}
|
|
@@ -13974,6 +13967,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
13974
13967
|
internalData.lcsTimeout = setTimeout(() => {
|
|
13975
13968
|
internalData.lcsRunTime = Date.now();
|
|
13976
13969
|
internalData.lcsTimeout = undefined;
|
|
13970
|
+
internalData.intoRunScroll = false;
|
|
13977
13971
|
internalData.inVirtualScroll = false;
|
|
13978
13972
|
internalData.inWheelScroll = false;
|
|
13979
13973
|
internalData.inHeaderScroll = false;
|
|
@@ -13993,6 +13987,43 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
13993
13987
|
$xeTable.updateCellAreas();
|
|
13994
13988
|
}, 200);
|
|
13995
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
|
+
};
|
|
13996
14027
|
const dispatchEvent = (type, params, evnt) => {
|
|
13997
14028
|
emit(type, createEvent(evnt, {
|
|
13998
14029
|
$table: $xeTable,
|
|
@@ -14009,12 +14040,31 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
14009
14040
|
}
|
|
14010
14041
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
14011
14042
|
};
|
|
14012
|
-
|
|
14043
|
+
const handleUpdateResize = () => {
|
|
14013
14044
|
const el = refElem.value;
|
|
14014
14045
|
if (el && el.clientWidth && el.clientHeight) {
|
|
14015
14046
|
tableMethods.recalculate();
|
|
14016
14047
|
}
|
|
14017
|
-
}
|
|
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
|
+
};
|
|
14018
14068
|
tableMethods = {
|
|
14019
14069
|
dispatchEvent,
|
|
14020
14070
|
/**
|
|
@@ -14072,7 +14122,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
14072
14122
|
const {
|
|
14073
14123
|
initStatus
|
|
14074
14124
|
} = internalData;
|
|
14075
|
-
return loadTableData(datas).then(() => {
|
|
14125
|
+
return loadTableData(datas, false).then(() => {
|
|
14076
14126
|
internalData.inited = true;
|
|
14077
14127
|
internalData.initStatus = true;
|
|
14078
14128
|
if (!initStatus) {
|
|
@@ -14089,7 +14139,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
14089
14139
|
return tableMethods.clearAll().then(() => {
|
|
14090
14140
|
internalData.inited = true;
|
|
14091
14141
|
internalData.initStatus = true;
|
|
14092
|
-
return loadTableData(datas);
|
|
14142
|
+
return loadTableData(datas, true);
|
|
14093
14143
|
}).then(() => {
|
|
14094
14144
|
handleLoadDefaults();
|
|
14095
14145
|
return tableMethods.recalculate();
|
|
@@ -14208,6 +14258,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
14208
14258
|
parent: parentRow,
|
|
14209
14259
|
level: parentLevel + nodes.length,
|
|
14210
14260
|
height: 0,
|
|
14261
|
+
resizeHeight: 0,
|
|
14211
14262
|
oTop: 0
|
|
14212
14263
|
};
|
|
14213
14264
|
fullDataRowIdData[rowid] = rest;
|
|
@@ -14448,29 +14499,32 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
14448
14499
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
14449
14500
|
},
|
|
14450
14501
|
getCellElement(row, fieldOrColumn) {
|
|
14502
|
+
const {
|
|
14503
|
+
elemStore
|
|
14504
|
+
} = internalData;
|
|
14451
14505
|
const column = handleFieldOrColumn($xeTable, fieldOrColumn);
|
|
14452
14506
|
if (!column) {
|
|
14453
14507
|
return null;
|
|
14454
14508
|
}
|
|
14455
14509
|
const rowid = getRowid($xeTable, row);
|
|
14456
|
-
const
|
|
14457
|
-
const
|
|
14458
|
-
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']);
|
|
14459
14513
|
let bodyElem;
|
|
14460
14514
|
if (column) {
|
|
14461
14515
|
if (column.fixed) {
|
|
14462
14516
|
if (column.fixed === 'left') {
|
|
14463
|
-
if (
|
|
14464
|
-
bodyElem =
|
|
14517
|
+
if (leftScrollElem) {
|
|
14518
|
+
bodyElem = leftScrollElem;
|
|
14465
14519
|
}
|
|
14466
14520
|
} else {
|
|
14467
|
-
if (
|
|
14468
|
-
bodyElem =
|
|
14521
|
+
if (rightScrollElem) {
|
|
14522
|
+
bodyElem = rightScrollElem;
|
|
14469
14523
|
}
|
|
14470
14524
|
}
|
|
14471
14525
|
}
|
|
14472
14526
|
if (!bodyElem) {
|
|
14473
|
-
bodyElem =
|
|
14527
|
+
bodyElem = bodyScrollElem;
|
|
14474
14528
|
}
|
|
14475
14529
|
if (bodyElem) {
|
|
14476
14530
|
return bodyElem.querySelector(`.vxe-body--row[rowid="${rowid}"] .${column.id}`);
|
|
@@ -14943,29 +14997,40 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
14943
14997
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
14944
14998
|
},
|
|
14945
14999
|
setColumnWidth(fieldOrColumn, width) {
|
|
15000
|
+
const {
|
|
15001
|
+
elemStore
|
|
15002
|
+
} = internalData;
|
|
14946
15003
|
let status = false;
|
|
14947
15004
|
const cols = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(fieldOrColumn) ? fieldOrColumn : [fieldOrColumn];
|
|
14948
|
-
|
|
14949
|
-
|
|
14950
|
-
|
|
14951
|
-
|
|
14952
|
-
|
|
14953
|
-
|
|
14954
|
-
|
|
14955
|
-
|
|
14956
|
-
|
|
14957
|
-
|
|
14958
|
-
|
|
14959
|
-
|
|
14960
|
-
|
|
14961
|
-
|
|
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
|
+
}
|
|
14962
15019
|
}
|
|
15020
|
+
});
|
|
15021
|
+
if (status) {
|
|
15022
|
+
return $xeTable.refreshColumn().then(() => {
|
|
15023
|
+
return {
|
|
15024
|
+
status
|
|
15025
|
+
};
|
|
15026
|
+
});
|
|
14963
15027
|
}
|
|
14964
|
-
});
|
|
14965
|
-
if (status) {
|
|
14966
|
-
return tableMethods.refreshColumn();
|
|
14967
15028
|
}
|
|
14968
|
-
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
|
+
});
|
|
14969
15034
|
},
|
|
14970
15035
|
getColumnWidth(fieldOrColumn) {
|
|
14971
15036
|
const column = handleFieldOrColumn($xeTable, fieldOrColumn);
|
|
@@ -14998,6 +15063,106 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
14998
15063
|
return tableMethods.recalculate();
|
|
14999
15064
|
});
|
|
15000
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
|
+
},
|
|
15001
15166
|
/**
|
|
15002
15167
|
* 刷新滚动操作,手动同步滚动相关位置(对于某些特殊的操作,比如滚动条错位、固定列不同步)
|
|
15003
15168
|
*/
|
|
@@ -16208,13 +16373,15 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
16208
16373
|
scrollXLoad,
|
|
16209
16374
|
scrollYLoad
|
|
16210
16375
|
} = reactData;
|
|
16211
|
-
const
|
|
16212
|
-
|
|
16376
|
+
const {
|
|
16377
|
+
elemStore
|
|
16378
|
+
} = internalData;
|
|
16379
|
+
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
16213
16380
|
return {
|
|
16214
16381
|
virtualX: scrollXLoad,
|
|
16215
16382
|
virtualY: scrollYLoad,
|
|
16216
|
-
scrollTop:
|
|
16217
|
-
scrollLeft:
|
|
16383
|
+
scrollTop: bodyScrollElem ? bodyScrollElem.scrollTop : 0,
|
|
16384
|
+
scrollLeft: bodyScrollElem ? bodyScrollElem.scrollLeft : 0
|
|
16218
16385
|
};
|
|
16219
16386
|
},
|
|
16220
16387
|
/**
|
|
@@ -16265,9 +16432,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
16265
16432
|
*/
|
|
16266
16433
|
scrollToRow(row, fieldOrColumn) {
|
|
16267
16434
|
const {
|
|
16268
|
-
|
|
16269
|
-
} = props;
|
|
16270
|
-
const {
|
|
16435
|
+
isAllOverflow,
|
|
16271
16436
|
scrollYLoad,
|
|
16272
16437
|
scrollXLoad
|
|
16273
16438
|
} = reactData;
|
|
@@ -16284,7 +16449,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
16284
16449
|
}
|
|
16285
16450
|
return Promise.all(rest).then(() => {
|
|
16286
16451
|
if (row) {
|
|
16287
|
-
if (!
|
|
16452
|
+
if (!isAllOverflow && (scrollYLoad || scrollXLoad)) {
|
|
16288
16453
|
calcCellHeight();
|
|
16289
16454
|
calcCellWidth();
|
|
16290
16455
|
}
|
|
@@ -17354,13 +17519,17 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
17354
17519
|
return;
|
|
17355
17520
|
}
|
|
17356
17521
|
const {
|
|
17522
|
+
overflowX,
|
|
17357
17523
|
scrollbarWidth,
|
|
17524
|
+
overflowY,
|
|
17358
17525
|
scrollbarHeight
|
|
17359
17526
|
} = reactData;
|
|
17360
17527
|
const {
|
|
17361
17528
|
prevDragToChild
|
|
17362
17529
|
} = internalData;
|
|
17363
17530
|
const wrapperRect = el.getBoundingClientRect();
|
|
17531
|
+
const osbWidth = overflowY ? scrollbarWidth : 0;
|
|
17532
|
+
const osbHeight = overflowX ? scrollbarHeight : 0;
|
|
17364
17533
|
const tableWidth = el.clientWidth;
|
|
17365
17534
|
const tableHeight = el.clientHeight;
|
|
17366
17535
|
if (trEl) {
|
|
@@ -17371,14 +17540,14 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
17371
17540
|
const trRect = trEl.getBoundingClientRect();
|
|
17372
17541
|
let trHeight = trEl.clientHeight;
|
|
17373
17542
|
const offsetTop = Math.max(1, trRect.y - wrapperRect.y);
|
|
17374
|
-
if (offsetTop + trHeight > tableHeight -
|
|
17375
|
-
trHeight = tableHeight - offsetTop -
|
|
17543
|
+
if (offsetTop + trHeight > tableHeight - osbHeight) {
|
|
17544
|
+
trHeight = tableHeight - offsetTop - osbHeight;
|
|
17376
17545
|
}
|
|
17377
17546
|
rdLineEl.style.display = 'block';
|
|
17378
|
-
rdLineEl.style.left = `${scrollbarYToLeft ?
|
|
17547
|
+
rdLineEl.style.left = `${scrollbarYToLeft ? osbWidth : 0}px`;
|
|
17379
17548
|
rdLineEl.style.top = `${offsetTop}px`;
|
|
17380
17549
|
rdLineEl.style.height = `${trHeight}px`;
|
|
17381
|
-
rdLineEl.style.width = `${tableWidth -
|
|
17550
|
+
rdLineEl.style.width = `${tableWidth - osbWidth}px`;
|
|
17382
17551
|
rdLineEl.setAttribute('drag-pos', dragPos);
|
|
17383
17552
|
rdLineEl.setAttribute('drag-to-child', prevDragToChild ? 'y' : 'n');
|
|
17384
17553
|
} else {
|
|
@@ -17403,7 +17572,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
17403
17572
|
thWidth -= startX - offsetLeft;
|
|
17404
17573
|
offsetLeft = startX;
|
|
17405
17574
|
}
|
|
17406
|
-
const endX = tableWidth - rightContainerWidth - (rightContainerWidth ? 0 :
|
|
17575
|
+
const endX = tableWidth - rightContainerWidth - (rightContainerWidth ? 0 : osbWidth);
|
|
17407
17576
|
if (offsetLeft + thWidth > endX) {
|
|
17408
17577
|
thWidth = endX - offsetLeft;
|
|
17409
17578
|
}
|
|
@@ -17414,7 +17583,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
17414
17583
|
if (prevDragToChild) {
|
|
17415
17584
|
cdLineEl.style.height = `${thRect.height}px`;
|
|
17416
17585
|
} else {
|
|
17417
|
-
cdLineEl.style.height = `${tableHeight - offsetTop - (scrollbarXToTop ? 0 :
|
|
17586
|
+
cdLineEl.style.height = `${tableHeight - offsetTop - (scrollbarXToTop ? 0 : osbHeight)}px`;
|
|
17418
17587
|
}
|
|
17419
17588
|
cdLineEl.setAttribute('drag-pos', dragPos);
|
|
17420
17589
|
cdLineEl.setAttribute('drag-to-child', prevDragToChild ? 'y' : 'n');
|
|
@@ -17450,11 +17619,11 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
17450
17619
|
* @param {Event} evnt 事件
|
|
17451
17620
|
* @param {Row} row 行对象
|
|
17452
17621
|
*/
|
|
17453
|
-
const handleTooltip = (evnt,
|
|
17622
|
+
const handleTooltip = (evnt, tdEl, overflowElem, tipElem, params) => {
|
|
17454
17623
|
if (!overflowElem) {
|
|
17455
17624
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
17456
17625
|
}
|
|
17457
|
-
params.cell =
|
|
17626
|
+
params.cell = tdEl;
|
|
17458
17627
|
const {
|
|
17459
17628
|
tooltipStore
|
|
17460
17629
|
} = reactData;
|
|
@@ -17626,9 +17795,8 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
17626
17795
|
},
|
|
17627
17796
|
/**
|
|
17628
17797
|
* 更新数据行的 Map
|
|
17629
|
-
* 牺牲数据组装的耗时,用来换取使用过程中的流畅
|
|
17630
17798
|
*/
|
|
17631
|
-
cacheRowMap(isSource) {
|
|
17799
|
+
cacheRowMap(isReset, isSource) {
|
|
17632
17800
|
const {
|
|
17633
17801
|
treeConfig
|
|
17634
17802
|
} = props;
|
|
@@ -17656,7 +17824,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
17656
17824
|
row[childrenField] = null;
|
|
17657
17825
|
}
|
|
17658
17826
|
let cacheItem = fullAllDataRowIdData[rowid];
|
|
17659
|
-
if (!cacheItem) {
|
|
17827
|
+
if (isReset || !cacheItem) {
|
|
17660
17828
|
cacheItem = {
|
|
17661
17829
|
row,
|
|
17662
17830
|
rowid,
|
|
@@ -17669,6 +17837,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
17669
17837
|
parent: parentRow,
|
|
17670
17838
|
level,
|
|
17671
17839
|
height: 0,
|
|
17840
|
+
resizeHeight: 0,
|
|
17672
17841
|
oTop: 0
|
|
17673
17842
|
};
|
|
17674
17843
|
}
|
|
@@ -17782,13 +17951,167 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
17782
17951
|
remainList
|
|
17783
17952
|
});
|
|
17784
17953
|
},
|
|
17785
|
-
|
|
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) {
|
|
17786
18107
|
const resizableOpts = computeResizableOpts.value;
|
|
17787
18108
|
const {
|
|
17788
18109
|
isDblclickAutoWidth
|
|
17789
18110
|
} = resizableOpts;
|
|
17790
18111
|
const el = refElem.value;
|
|
17791
18112
|
if (isDblclickAutoWidth && el) {
|
|
18113
|
+
evnt.stopPropagation();
|
|
18114
|
+
evnt.preventDefault();
|
|
17792
18115
|
const {
|
|
17793
18116
|
fullColumnIdData
|
|
17794
18117
|
} = internalData;
|
|
@@ -17809,23 +18132,195 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
17809
18132
|
cell
|
|
17810
18133
|
});
|
|
17811
18134
|
const colMinWidth = getColReMinWidth(cellParams);
|
|
18135
|
+
el.setAttribute('data-calc-col', 'Y');
|
|
17812
18136
|
let resizeWidth = calcColumnAutoWidth(resizeColumn, el);
|
|
18137
|
+
el.removeAttribute('data-calc-col');
|
|
17813
18138
|
if (colRest) {
|
|
17814
18139
|
resizeWidth = Math.max(resizeWidth, colRest.width);
|
|
17815
18140
|
}
|
|
17816
|
-
|
|
17817
|
-
|
|
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';
|
|
17818
18253
|
internalData._lastResizeTime = Date.now();
|
|
17819
|
-
|
|
17820
|
-
|
|
17821
|
-
|
|
17822
|
-
|
|
17823
|
-
|
|
18254
|
+
setTimeout(() => {
|
|
18255
|
+
reactData.isDragResize = false;
|
|
18256
|
+
}, 50);
|
|
18257
|
+
if (resizeHeight !== currCellHeight) {
|
|
18258
|
+
const resizeParams = {
|
|
17824
18259
|
...params,
|
|
17825
|
-
|
|
17826
|
-
|
|
17827
|
-
|
|
17828
|
-
|
|
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
|
+
}
|
|
17829
18324
|
}
|
|
17830
18325
|
},
|
|
17831
18326
|
saveCustomStore(type) {
|
|
@@ -18231,10 +18726,21 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
18231
18726
|
const {
|
|
18232
18727
|
column
|
|
18233
18728
|
} = params;
|
|
18234
|
-
const titleElem = evnt.currentTarget;
|
|
18235
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
|
+
}
|
|
18236
18742
|
if (tooltipStore.column !== column || !tooltipStore.visible) {
|
|
18237
|
-
handleTooltip(evnt,
|
|
18743
|
+
handleTooltip(evnt, thEl, cellEl, null, params);
|
|
18238
18744
|
}
|
|
18239
18745
|
},
|
|
18240
18746
|
/**
|
|
@@ -18258,7 +18764,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
18258
18764
|
row,
|
|
18259
18765
|
column
|
|
18260
18766
|
} = params;
|
|
18261
|
-
const
|
|
18767
|
+
const tdEl = evnt.currentTarget;
|
|
18262
18768
|
handleTargetEnterEvent(tooltipStore.column !== column || tooltipStore.row !== row);
|
|
18263
18769
|
// 单元格处于编辑状态时不触发提示框
|
|
18264
18770
|
if (column.editRender && isEnableConf(editConfig)) {
|
|
@@ -18272,17 +18778,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
18272
18778
|
}
|
|
18273
18779
|
}
|
|
18274
18780
|
if (tooltipStore.column !== column || tooltipStore.row !== row || !tooltipStore.visible) {
|
|
18275
|
-
|
|
18276
|
-
let tipElem;
|
|
18277
|
-
if (column.treeNode) {
|
|
18278
|
-
overflowElem = cell.querySelector('.vxe-tree-cell');
|
|
18279
|
-
if (column.type === 'html') {
|
|
18280
|
-
tipElem = cell.querySelector('.vxe-cell--html');
|
|
18281
|
-
}
|
|
18282
|
-
} else {
|
|
18283
|
-
tipElem = cell.querySelector(column.type === 'html' ? '.vxe-cell--html' : '.vxe-cell--label');
|
|
18284
|
-
}
|
|
18285
|
-
handleTooltip(evnt, cell, overflowElem || cell.children[0], tipElem, params);
|
|
18781
|
+
handleTooltip(evnt, tdEl, tdEl.querySelector('.vxe-cell--wrapper'), null, params);
|
|
18286
18782
|
}
|
|
18287
18783
|
},
|
|
18288
18784
|
/**
|
|
@@ -18298,7 +18794,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
18298
18794
|
const cell = evnt.currentTarget;
|
|
18299
18795
|
handleTargetEnterEvent(tooltipStore.column !== column || !!tooltipStore.row);
|
|
18300
18796
|
if (tooltipStore.column !== column || !tooltipStore.visible) {
|
|
18301
|
-
handleTooltip(evnt, cell, cell.querySelector('.vxe-cell--
|
|
18797
|
+
handleTooltip(evnt, cell, cell.querySelector('.vxe-cell--wrapper') || cell.children[0], null, params);
|
|
18302
18798
|
}
|
|
18303
18799
|
},
|
|
18304
18800
|
handleTargetLeaveEvent() {
|
|
@@ -18311,11 +18807,11 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
18311
18807
|
internalData.tooltipTimeout = setTimeout(() => {
|
|
18312
18808
|
$tooltip = refTooltip.value;
|
|
18313
18809
|
if ($tooltip && $tooltip.isActived && !$tooltip.isActived()) {
|
|
18314
|
-
|
|
18810
|
+
$xeTable.closeTooltip();
|
|
18315
18811
|
}
|
|
18316
18812
|
}, tooltipOpts.leaveDelay);
|
|
18317
18813
|
} else {
|
|
18318
|
-
|
|
18814
|
+
$xeTable.closeTooltip();
|
|
18319
18815
|
}
|
|
18320
18816
|
},
|
|
18321
18817
|
triggerHeaderCellClickEvent(evnt, params) {
|
|
@@ -18360,8 +18856,12 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
18360
18856
|
editConfig
|
|
18361
18857
|
} = props;
|
|
18362
18858
|
const {
|
|
18363
|
-
editStore
|
|
18859
|
+
editStore,
|
|
18860
|
+
isDragResize
|
|
18364
18861
|
} = reactData;
|
|
18862
|
+
if (isDragResize) {
|
|
18863
|
+
return;
|
|
18864
|
+
}
|
|
18365
18865
|
const expandOpts = computeExpandOpts.value;
|
|
18366
18866
|
const editOpts = computeEditOpts.value;
|
|
18367
18867
|
const treeOpts = computeTreeOpts.value;
|
|
@@ -18471,8 +18971,12 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
18471
18971
|
editConfig
|
|
18472
18972
|
} = props;
|
|
18473
18973
|
const {
|
|
18474
|
-
editStore
|
|
18974
|
+
editStore,
|
|
18975
|
+
isDragResize
|
|
18475
18976
|
} = reactData;
|
|
18977
|
+
if (isDragResize) {
|
|
18978
|
+
return;
|
|
18979
|
+
}
|
|
18476
18980
|
const editOpts = computeEditOpts.value;
|
|
18477
18981
|
const {
|
|
18478
18982
|
actived
|
|
@@ -18763,13 +19267,19 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
18763
19267
|
*/
|
|
18764
19268
|
triggerSortEvent(evnt, column, order) {
|
|
18765
19269
|
const sortOpts = computeSortOpts.value;
|
|
19270
|
+
const {
|
|
19271
|
+
multiple,
|
|
19272
|
+
allowClear
|
|
19273
|
+
} = sortOpts;
|
|
18766
19274
|
const {
|
|
18767
19275
|
field,
|
|
18768
19276
|
sortable
|
|
18769
19277
|
} = column;
|
|
18770
19278
|
if (sortable) {
|
|
18771
19279
|
if (!order || column.order === order) {
|
|
18772
|
-
|
|
19280
|
+
if (allowClear) {
|
|
19281
|
+
tableMethods.clearSort(multiple ? column : null);
|
|
19282
|
+
}
|
|
18773
19283
|
} else {
|
|
18774
19284
|
tableMethods.sort({
|
|
18775
19285
|
field,
|
|
@@ -18896,7 +19406,8 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
18896
19406
|
isPeerDrag,
|
|
18897
19407
|
isCrossDrag,
|
|
18898
19408
|
isSelfToChildDrag,
|
|
18899
|
-
dragEndMethod
|
|
19409
|
+
dragEndMethod,
|
|
19410
|
+
dragToChildMethod
|
|
18900
19411
|
} = rowDragOpts;
|
|
18901
19412
|
const treeOpts = computeTreeOpts.value;
|
|
18902
19413
|
const {
|
|
@@ -18915,13 +19426,15 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
18915
19426
|
if (prevDragRow && dragRow) {
|
|
18916
19427
|
// 判断是否有拖动
|
|
18917
19428
|
if (prevDragRow !== dragRow) {
|
|
18918
|
-
|
|
19429
|
+
const dragParams = {
|
|
18919
19430
|
oldRow: dragRow,
|
|
18920
19431
|
newRow: prevDragRow,
|
|
18921
19432
|
dragPos: prevDragPos,
|
|
18922
19433
|
dragToChild: !!prevDragToChild,
|
|
18923
19434
|
offsetIndex: dragOffsetIndex
|
|
18924
|
-
}
|
|
19435
|
+
};
|
|
19436
|
+
const isDragToChildFlag = isSelfToChildDrag && dragToChildMethod ? dragToChildMethod(dragParams) : prevDragToChild;
|
|
19437
|
+
return Promise.resolve(dEndMethod ? dEndMethod(dragParams) : true).then(status => {
|
|
18925
19438
|
if (!status) {
|
|
18926
19439
|
return;
|
|
18927
19440
|
}
|
|
@@ -18999,7 +19512,9 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
18999
19512
|
// 根到根
|
|
19000
19513
|
}
|
|
19001
19514
|
const fullList = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toTreeArray(internalData.afterTreeFullData, {
|
|
19002
|
-
|
|
19515
|
+
key: rowField,
|
|
19516
|
+
parentKey: parentField,
|
|
19517
|
+
children: mapChildrenField
|
|
19003
19518
|
});
|
|
19004
19519
|
// 移出
|
|
19005
19520
|
const otfIndex = $xeTable.findRowIndexOf(fullList, dragRow);
|
|
@@ -19014,12 +19529,12 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
19014
19529
|
childRow[parentField] = dragRow[parentField];
|
|
19015
19530
|
});
|
|
19016
19531
|
}
|
|
19017
|
-
dragRow[parentField] =
|
|
19532
|
+
dragRow[parentField] = isDragToChildFlag ? prevDragRow[rowField] : prevDragRow[parentField];
|
|
19018
19533
|
internalData.tableFullTreeData = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toArrayTree(fullList, {
|
|
19019
|
-
key:
|
|
19020
|
-
parentKey:
|
|
19534
|
+
key: rowField,
|
|
19535
|
+
parentKey: parentField,
|
|
19021
19536
|
children: childrenField,
|
|
19022
|
-
mapChildren:
|
|
19537
|
+
mapChildren: mapChildrenField
|
|
19023
19538
|
});
|
|
19024
19539
|
}
|
|
19025
19540
|
}
|
|
@@ -19039,7 +19554,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
19039
19554
|
}
|
|
19040
19555
|
reactData.isDragRowMove = true;
|
|
19041
19556
|
$xeTable.handleTableData(treeConfig && transform);
|
|
19042
|
-
$xeTable.cacheRowMap();
|
|
19557
|
+
$xeTable.cacheRowMap(false);
|
|
19043
19558
|
updateScrollYStatus();
|
|
19044
19559
|
if (!(treeConfig && transform)) {
|
|
19045
19560
|
$xeTable.updateAfterDataIndex();
|
|
@@ -19056,7 +19571,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
19056
19571
|
oldRow: dragRow,
|
|
19057
19572
|
newRow: prevDragRow,
|
|
19058
19573
|
dragPos: prevDragPos,
|
|
19059
|
-
dragToChild:
|
|
19574
|
+
dragToChild: isDragToChildFlag,
|
|
19060
19575
|
offsetIndex: dragOffsetIndex,
|
|
19061
19576
|
_index: {
|
|
19062
19577
|
newIndex: nafIndex,
|
|
@@ -19088,18 +19603,16 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
19088
19603
|
prevDragRow,
|
|
19089
19604
|
prevDragPos
|
|
19090
19605
|
} = internalData;
|
|
19091
|
-
if (treeConfig && prevDragToChild) {
|
|
19606
|
+
if (treeConfig && lazy && prevDragToChild) {
|
|
19092
19607
|
// 懒加载
|
|
19093
|
-
|
|
19094
|
-
|
|
19095
|
-
|
|
19096
|
-
if (
|
|
19097
|
-
if (rowRest && rowRest.treeLoaded) {
|
|
19098
|
-
$xeTable.handleRowDragSwapEvent(evnt, true, dragRow, prevDragRow, prevDragPos, prevDragToChild);
|
|
19099
|
-
}
|
|
19100
|
-
} else {
|
|
19608
|
+
const newRowid = getRowid($xeTable, prevDragRow);
|
|
19609
|
+
const rowRest = fullAllDataRowIdData[newRowid];
|
|
19610
|
+
if (prevDragRow[hasChildField]) {
|
|
19611
|
+
if (rowRest && rowRest.treeLoaded) {
|
|
19101
19612
|
$xeTable.handleRowDragSwapEvent(evnt, true, dragRow, prevDragRow, prevDragPos, prevDragToChild);
|
|
19102
19613
|
}
|
|
19614
|
+
} else {
|
|
19615
|
+
$xeTable.handleRowDragSwapEvent(evnt, true, dragRow, prevDragRow, prevDragPos, prevDragToChild);
|
|
19103
19616
|
}
|
|
19104
19617
|
} else {
|
|
19105
19618
|
$xeTable.handleRowDragSwapEvent(evnt, true, dragRow, prevDragRow, prevDragPos, prevDragToChild);
|
|
@@ -19229,7 +19742,8 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
19229
19742
|
isCrossDrag,
|
|
19230
19743
|
isSelfToChildDrag,
|
|
19231
19744
|
isToChildDrag,
|
|
19232
|
-
dragEndMethod
|
|
19745
|
+
dragEndMethod,
|
|
19746
|
+
dragToChildMethod
|
|
19233
19747
|
} = columnDragOpts;
|
|
19234
19748
|
const {
|
|
19235
19749
|
collectColumn
|
|
@@ -19240,13 +19754,15 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
19240
19754
|
if (prevDragCol !== dragCol) {
|
|
19241
19755
|
const oldColumn = dragCol;
|
|
19242
19756
|
const newColumn = prevDragCol;
|
|
19243
|
-
|
|
19757
|
+
const dragParams = {
|
|
19244
19758
|
oldColumn,
|
|
19245
19759
|
newColumn,
|
|
19246
19760
|
dragPos: prevDragPos,
|
|
19247
19761
|
dragToChild: !!prevDragToChild,
|
|
19248
19762
|
offsetIndex: dragOffsetIndex
|
|
19249
|
-
}
|
|
19763
|
+
};
|
|
19764
|
+
const isDragToChildFlag = isSelfToChildDrag && dragToChildMethod ? dragToChildMethod(dragParams) : prevDragToChild;
|
|
19765
|
+
return Promise.resolve(dragEndMethod ? dragEndMethod(dragParams) : true).then(status => {
|
|
19250
19766
|
if (!status) {
|
|
19251
19767
|
return;
|
|
19252
19768
|
}
|
|
@@ -19342,7 +19858,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
19342
19858
|
parent: nParent
|
|
19343
19859
|
} = newMatchRest;
|
|
19344
19860
|
// 转子级
|
|
19345
|
-
if (isCrossDrag && isToChildDrag &&
|
|
19861
|
+
if (isCrossDrag && isToChildDrag && isDragToChildFlag) {
|
|
19346
19862
|
oldColumn.parentId = newColumn.id;
|
|
19347
19863
|
newColumn.children = (newColumn.children || []).concat([oldColumn]);
|
|
19348
19864
|
} else {
|
|
@@ -19373,7 +19889,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
19373
19889
|
oldColumn,
|
|
19374
19890
|
newColumn,
|
|
19375
19891
|
dragPos: prevDragPos,
|
|
19376
|
-
dragToChild:
|
|
19892
|
+
dragToChild: isDragToChildFlag,
|
|
19377
19893
|
offsetIndex: dragOffsetIndex,
|
|
19378
19894
|
_index: {
|
|
19379
19895
|
newIndex: nafIndex,
|
|
@@ -19641,6 +20157,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
19641
20157
|
triggerBodyScrollEvent(evnt, fixedType) {
|
|
19642
20158
|
const {
|
|
19643
20159
|
elemStore,
|
|
20160
|
+
intoRunScroll,
|
|
19644
20161
|
lastScrollTop,
|
|
19645
20162
|
lastScrollLeft,
|
|
19646
20163
|
inWheelScroll,
|
|
@@ -19660,6 +20177,9 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
19660
20177
|
if (inWheelScroll || inVirtualScroll || inHeaderScroll || inFooterScroll) {
|
|
19661
20178
|
return;
|
|
19662
20179
|
}
|
|
20180
|
+
if (intoRunScroll) {
|
|
20181
|
+
return;
|
|
20182
|
+
}
|
|
19663
20183
|
if (!bodyScrollElem) {
|
|
19664
20184
|
return;
|
|
19665
20185
|
}
|
|
@@ -19716,6 +20236,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
19716
20236
|
triggerHeaderScrollEvent(evnt, fixedType) {
|
|
19717
20237
|
const {
|
|
19718
20238
|
elemStore,
|
|
20239
|
+
intoRunScroll,
|
|
19719
20240
|
inWheelScroll,
|
|
19720
20241
|
inVirtualScroll,
|
|
19721
20242
|
inBodyScroll,
|
|
@@ -19726,16 +20247,10 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
19726
20247
|
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
19727
20248
|
const headerScrollElem = getRefElem(elemStore['main-header-scroll']);
|
|
19728
20249
|
const footerScrollElem = getRefElem(elemStore['main-footer-scroll']);
|
|
19729
|
-
if (inWheelScroll) {
|
|
19730
|
-
return;
|
|
19731
|
-
}
|
|
19732
|
-
if (inVirtualScroll) {
|
|
19733
|
-
return;
|
|
19734
|
-
}
|
|
19735
|
-
if (inBodyScroll) {
|
|
20250
|
+
if (inWheelScroll || inVirtualScroll || inBodyScroll || inFooterScroll) {
|
|
19736
20251
|
return;
|
|
19737
20252
|
}
|
|
19738
|
-
if (
|
|
20253
|
+
if (intoRunScroll) {
|
|
19739
20254
|
return;
|
|
19740
20255
|
}
|
|
19741
20256
|
if (!headerScrollElem) {
|
|
@@ -19764,6 +20279,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
19764
20279
|
triggerFooterScrollEvent(evnt, fixedType) {
|
|
19765
20280
|
const {
|
|
19766
20281
|
elemStore,
|
|
20282
|
+
intoRunScroll,
|
|
19767
20283
|
inWheelScroll,
|
|
19768
20284
|
inVirtualScroll,
|
|
19769
20285
|
inHeaderScroll,
|
|
@@ -19774,16 +20290,10 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
19774
20290
|
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
19775
20291
|
const headerScrollElem = getRefElem(elemStore['main-header-scroll']);
|
|
19776
20292
|
const footerScrollElem = getRefElem(elemStore['main-footer-scroll']);
|
|
19777
|
-
if (inWheelScroll) {
|
|
19778
|
-
return;
|
|
19779
|
-
}
|
|
19780
|
-
if (inVirtualScroll) {
|
|
19781
|
-
return;
|
|
19782
|
-
}
|
|
19783
|
-
if (inHeaderScroll) {
|
|
20293
|
+
if (inWheelScroll || inVirtualScroll || inHeaderScroll || inBodyScroll) {
|
|
19784
20294
|
return;
|
|
19785
20295
|
}
|
|
19786
|
-
if (
|
|
20296
|
+
if (intoRunScroll) {
|
|
19787
20297
|
return;
|
|
19788
20298
|
}
|
|
19789
20299
|
if (!footerScrollElem) {
|
|
@@ -19811,9 +20321,13 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
19811
20321
|
},
|
|
19812
20322
|
triggerBodyWheelEvent(evnt) {
|
|
19813
20323
|
const {
|
|
20324
|
+
target,
|
|
19814
20325
|
deltaY,
|
|
19815
20326
|
deltaX
|
|
19816
20327
|
} = evnt;
|
|
20328
|
+
if (target && /^textarea$/i.test(target.tagName)) {
|
|
20329
|
+
return;
|
|
20330
|
+
}
|
|
19817
20331
|
const {
|
|
19818
20332
|
highlightHoverRow
|
|
19819
20333
|
} = src_props;
|
|
@@ -19837,26 +20351,13 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
19837
20351
|
if (!bodyScrollElem) {
|
|
19838
20352
|
return;
|
|
19839
20353
|
}
|
|
19840
|
-
|
|
19841
|
-
|
|
19842
|
-
|
|
19843
|
-
} else if (reactData.lastScrollTime + 30 > Date.now()) {
|
|
19844
|
-
multiple = 1.15;
|
|
19845
|
-
} else if (reactData.lastScrollTime + 40 > Date.now()) {
|
|
19846
|
-
multiple = 1.12;
|
|
19847
|
-
} else if (reactData.lastScrollTime + 55 > Date.now()) {
|
|
19848
|
-
multiple = 1.09;
|
|
19849
|
-
} else if (reactData.lastScrollTime + 75 > Date.now()) {
|
|
19850
|
-
multiple = 1.06;
|
|
19851
|
-
} else if (reactData.lastScrollTime + 100 > Date.now()) {
|
|
19852
|
-
multiple = 1.03;
|
|
19853
|
-
}
|
|
19854
|
-
const deltaTop = deltaY * multiple;
|
|
19855
|
-
const deltaLeft = deltaX * multiple;
|
|
20354
|
+
const wheelSpeed = getWheelSpeed(reactData.lastScrollTime);
|
|
20355
|
+
const deltaTop = deltaY * wheelSpeed;
|
|
20356
|
+
const deltaLeft = deltaX * wheelSpeed;
|
|
19856
20357
|
const isTopWheel = deltaTop < 0;
|
|
19857
|
-
const currScrollTop =
|
|
20358
|
+
const currScrollTop = bodyScrollElem.scrollTop;
|
|
19858
20359
|
// 如果滚动位置已经是顶部或底部,则不需要触发
|
|
19859
|
-
if (isTopWheel ? currScrollTop <= 0 : currScrollTop >=
|
|
20360
|
+
if (isTopWheel ? currScrollTop <= 0 : currScrollTop >= bodyScrollElem.scrollHeight - bodyScrollElem.clientHeight) {
|
|
19860
20361
|
return;
|
|
19861
20362
|
}
|
|
19862
20363
|
const scrollTop = bodyScrollElem.scrollTop + deltaTop;
|
|
@@ -19869,16 +20370,29 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
19869
20370
|
if (rowOpts.isHover || highlightHoverRow) {
|
|
19870
20371
|
$xeTable.clearHoverRow();
|
|
19871
20372
|
}
|
|
19872
|
-
|
|
19873
|
-
|
|
19874
|
-
|
|
19875
|
-
|
|
19876
|
-
|
|
19877
|
-
|
|
19878
|
-
|
|
19879
|
-
|
|
19880
|
-
|
|
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
|
+
});
|
|
19881
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
|
+
// })
|
|
19882
20396
|
}
|
|
19883
20397
|
},
|
|
19884
20398
|
triggerVirtualScrollXEvent(evnt) {
|
|
@@ -20048,45 +20562,43 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20048
20562
|
// 更新纵向 Y 可视渲染上下剩余空间大小
|
|
20049
20563
|
updateScrollYSpace() {
|
|
20050
20564
|
const {
|
|
20051
|
-
|
|
20052
|
-
|
|
20053
|
-
const {
|
|
20054
|
-
scrollYLoad,
|
|
20055
|
-
rowHeight
|
|
20565
|
+
isAllOverflow,
|
|
20566
|
+
scrollYLoad
|
|
20056
20567
|
} = reactData;
|
|
20057
20568
|
const {
|
|
20058
20569
|
scrollYStore,
|
|
20059
20570
|
elemStore,
|
|
20571
|
+
isResizeCellHeight,
|
|
20060
20572
|
afterFullData,
|
|
20061
20573
|
fullAllDataRowIdData
|
|
20062
20574
|
} = internalData;
|
|
20063
20575
|
const {
|
|
20064
20576
|
startIndex
|
|
20065
20577
|
} = scrollYStore;
|
|
20578
|
+
const rowOpts = computeRowOpts.value;
|
|
20579
|
+
const cellOpts = computeCellOpts.value;
|
|
20580
|
+
const defaultRowHeight = computeDefaultRowHeight.value;
|
|
20066
20581
|
const bodyTableElem = getRefElem(elemStore['main-body-table']);
|
|
20067
20582
|
const containerList = ['main', 'left', 'right'];
|
|
20068
20583
|
let topSpaceHeight = 0;
|
|
20069
20584
|
let ySpaceHeight = 0;
|
|
20070
20585
|
if (scrollYLoad) {
|
|
20071
|
-
|
|
20072
|
-
|
|
20073
|
-
|
|
20586
|
+
const isCustomCellHeight = isResizeCellHeight || cellOpts.height || rowOpts.height;
|
|
20587
|
+
if (!isCustomCellHeight && isAllOverflow) {
|
|
20588
|
+
ySpaceHeight = afterFullData.length * defaultRowHeight;
|
|
20589
|
+
topSpaceHeight = Math.max(0, startIndex * defaultRowHeight);
|
|
20074
20590
|
} else {
|
|
20075
20591
|
for (let i = 0; i < afterFullData.length; i++) {
|
|
20076
20592
|
const row = afterFullData[i];
|
|
20077
20593
|
const rowid = getRowid($xeTable, row);
|
|
20078
|
-
const rowRest = fullAllDataRowIdData[rowid];
|
|
20079
|
-
|
|
20080
|
-
ySpaceHeight += rowRest.height || rowHeight;
|
|
20081
|
-
}
|
|
20594
|
+
const rowRest = fullAllDataRowIdData[rowid] || {};
|
|
20595
|
+
ySpaceHeight += rowRest.resizeHeight || rowRest.height || cellOpts.height || rowOpts.height || defaultRowHeight;
|
|
20082
20596
|
}
|
|
20083
20597
|
for (let i = 0; i < startIndex; i++) {
|
|
20084
20598
|
const row = afterFullData[i];
|
|
20085
20599
|
const rowid = getRowid($xeTable, row);
|
|
20086
|
-
const rowRest = fullAllDataRowIdData[rowid];
|
|
20087
|
-
|
|
20088
|
-
topSpaceHeight += rowRest.height || rowHeight;
|
|
20089
|
-
}
|
|
20600
|
+
const rowRest = fullAllDataRowIdData[rowid] || {};
|
|
20601
|
+
topSpaceHeight += rowRest.resizeHeight || rowRest.height || cellOpts.height || rowOpts.height || defaultRowHeight;
|
|
20090
20602
|
}
|
|
20091
20603
|
}
|
|
20092
20604
|
} else {
|
|
@@ -20111,19 +20623,19 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20111
20623
|
if (scrollYSpaceEl) {
|
|
20112
20624
|
scrollYSpaceEl.style.height = ySpaceHeight ? `${ySpaceHeight}px` : '';
|
|
20113
20625
|
}
|
|
20114
|
-
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => {
|
|
20626
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(() => {
|
|
20115
20627
|
updateStyle();
|
|
20116
20628
|
});
|
|
20117
20629
|
},
|
|
20118
20630
|
updateScrollXData() {
|
|
20119
20631
|
const {
|
|
20120
|
-
|
|
20121
|
-
} =
|
|
20632
|
+
isAllOverflow
|
|
20633
|
+
} = reactData;
|
|
20122
20634
|
handleTableColumn();
|
|
20123
20635
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(() => {
|
|
20124
20636
|
handleTableColumn();
|
|
20125
20637
|
$xeTable.updateScrollXSpace();
|
|
20126
|
-
if (!
|
|
20638
|
+
if (!isAllOverflow) {
|
|
20127
20639
|
$xeTable.updateScrollYSpace();
|
|
20128
20640
|
}
|
|
20129
20641
|
});
|
|
@@ -20475,7 +20987,6 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20475
20987
|
editRules
|
|
20476
20988
|
} = props;
|
|
20477
20989
|
const {
|
|
20478
|
-
isCalcColumn,
|
|
20479
20990
|
isGroup,
|
|
20480
20991
|
overflowX,
|
|
20481
20992
|
overflowY,
|
|
@@ -20485,15 +20996,15 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20485
20996
|
initStore,
|
|
20486
20997
|
columnStore,
|
|
20487
20998
|
filterStore,
|
|
20488
|
-
customStore
|
|
20489
|
-
tooltipStore
|
|
20999
|
+
customStore
|
|
20490
21000
|
} = reactData;
|
|
20491
21001
|
const {
|
|
20492
21002
|
leftList,
|
|
20493
21003
|
rightList
|
|
20494
21004
|
} = columnStore;
|
|
20495
21005
|
const loadingSlot = slots.loading;
|
|
20496
|
-
const
|
|
21006
|
+
const tableTipConfig = computeTableTipConfig.value;
|
|
21007
|
+
const validTipConfig = computeValidTipConfig.value;
|
|
20497
21008
|
const validOpts = computeValidOpts.value;
|
|
20498
21009
|
const checkboxOpts = computeCheckboxOpts.value;
|
|
20499
21010
|
const treeOpts = computeTreeOpts.value;
|
|
@@ -20505,7 +21016,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20505
21016
|
const areaOpts = computeAreaOpts.value;
|
|
20506
21017
|
const loadingOpts = computeLoadingOpts.value;
|
|
20507
21018
|
const isMenu = computeIsMenu.value;
|
|
20508
|
-
const currLoading = reactData.
|
|
21019
|
+
const currLoading = reactData.isColLoading || reactData.isRowLoading || loading;
|
|
20509
21020
|
const resizableOpts = computeResizableOpts.value;
|
|
20510
21021
|
const isArea = mouseConfig && mouseOpts.area;
|
|
20511
21022
|
const columnDragOpts = computeColumnDragOpts.value;
|
|
@@ -20526,7 +21037,6 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20526
21037
|
'row--highlight': rowOpts.isHover || highlightHoverRow,
|
|
20527
21038
|
'column--highlight': columnOpts.isHover || highlightHoverColumn,
|
|
20528
21039
|
'checkbox--range': checkboxOpts.range,
|
|
20529
|
-
'column--calc': isCalcColumn,
|
|
20530
21040
|
'col--drag-cell': columnOpts.drag && columnDragOpts.trigger === 'cell',
|
|
20531
21041
|
'is--header': showHeader,
|
|
20532
21042
|
'is--footer': showFooter,
|
|
@@ -20535,7 +21045,6 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20535
21045
|
'is--fixed-left': leftList.length,
|
|
20536
21046
|
'is--fixed-right': rightList.length,
|
|
20537
21047
|
'is--animat': !!props.animat,
|
|
20538
|
-
'is--padding': props.padding,
|
|
20539
21048
|
'is--round': props.round,
|
|
20540
21049
|
'is--stripe': !treeConfig && stripe,
|
|
20541
21050
|
'is--loading': currLoading,
|
|
@@ -20578,11 +21087,20 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20578
21087
|
* 列宽线
|
|
20579
21088
|
*/
|
|
20580
21089
|
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
20581
|
-
key: '
|
|
20582
|
-
ref:
|
|
20583
|
-
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'
|
|
20584
21103
|
}, resizableOpts.showDragTip ? [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
20585
|
-
ref: refCellResizeTip,
|
|
20586
21104
|
class: 'vxe-table--resizable-number-tip'
|
|
20587
21105
|
})] : []),
|
|
20588
21106
|
/**
|
|
@@ -20668,10 +21186,14 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20668
21186
|
/**
|
|
20669
21187
|
* 工具提示
|
|
20670
21188
|
*/
|
|
20671
|
-
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(VxeUITooltipComponent,
|
|
21189
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(VxeUITooltipComponent, {
|
|
20672
21190
|
key: 'btp',
|
|
20673
|
-
ref: refTooltip
|
|
20674
|
-
|
|
21191
|
+
ref: refTooltip,
|
|
21192
|
+
theme: tableTipConfig.theme,
|
|
21193
|
+
enterable: tableTipConfig.enterable,
|
|
21194
|
+
enterDelay: tableTipConfig.enterDelay,
|
|
21195
|
+
leaveDelay: tableTipConfig.leaveDelay
|
|
21196
|
+
}),
|
|
20675
21197
|
/**
|
|
20676
21198
|
* 校验提示
|
|
20677
21199
|
*/
|
|
@@ -20681,9 +21203,10 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20681
21203
|
class: [{
|
|
20682
21204
|
'old-cell-valid': editRules && table_getConfig().cellVaildMode === 'obsolete'
|
|
20683
21205
|
}, 'vxe-table--valid-error'],
|
|
20684
|
-
|
|
20685
|
-
|
|
20686
|
-
|
|
21206
|
+
theme: validTipConfig.theme,
|
|
21207
|
+
enterable: validTipConfig.enterable,
|
|
21208
|
+
enterDelay: validTipConfig.enterDelay,
|
|
21209
|
+
leaveDelay: validTipConfig.leaveDelay
|
|
20687
21210
|
}) : table_renderEmptyElement($xeTable)]) : table_renderEmptyElement($xeTable)]);
|
|
20688
21211
|
};
|
|
20689
21212
|
const dataFlag = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)(0);
|
|
@@ -20701,7 +21224,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20701
21224
|
if (value && value.length >= 50000) {
|
|
20702
21225
|
warnLog('vxe.error.errLargeData', ['loadData(data), reloadData(data)']);
|
|
20703
21226
|
}
|
|
20704
|
-
loadTableData(value).then(() => {
|
|
21227
|
+
loadTableData(value, true).then(() => {
|
|
20705
21228
|
const {
|
|
20706
21229
|
scrollXLoad,
|
|
20707
21230
|
scrollYLoad,
|
|
@@ -20796,10 +21319,10 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20796
21319
|
});
|
|
20797
21320
|
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.syncResize, value => {
|
|
20798
21321
|
if (value) {
|
|
20799
|
-
|
|
21322
|
+
handleUpdateResize();
|
|
20800
21323
|
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => {
|
|
20801
|
-
|
|
20802
|
-
setTimeout(() =>
|
|
21324
|
+
handleUpdateResize();
|
|
21325
|
+
setTimeout(() => handleUpdateResize());
|
|
20803
21326
|
});
|
|
20804
21327
|
}
|
|
20805
21328
|
});
|
|
@@ -20914,6 +21437,9 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20914
21437
|
if (props.showFooter && !(props.footerMethod || props.footerData)) {
|
|
20915
21438
|
warnLog('vxe.error.reqProp', ['footer-data | footer-method']);
|
|
20916
21439
|
}
|
|
21440
|
+
if (rowOpts.height) {
|
|
21441
|
+
warnLog('vxe.error.delProp', ['row-config.height', 'cell-config.height']);
|
|
21442
|
+
}
|
|
20917
21443
|
// if (props.highlightCurrentRow) {
|
|
20918
21444
|
// warnLog('vxe.error.delProp', ['highlight-current-row', 'row-config.isCurrent'])
|
|
20919
21445
|
// }
|
|
@@ -21024,7 +21550,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
21024
21550
|
endIndex: 0,
|
|
21025
21551
|
visibleSize: 0
|
|
21026
21552
|
});
|
|
21027
|
-
loadTableData(data || []).then(() => {
|
|
21553
|
+
loadTableData(data || [], true).then(() => {
|
|
21028
21554
|
if (data && data.length) {
|
|
21029
21555
|
internalData.inited = true;
|
|
21030
21556
|
internalData.initStatus = true;
|
|
@@ -22133,6 +22659,7 @@ edit_hook_hooks.add('tableEditModule', {
|
|
|
22133
22659
|
parent: parentRow,
|
|
22134
22660
|
level: parentLevel + 1,
|
|
22135
22661
|
height: 0,
|
|
22662
|
+
resizeHeight: 0,
|
|
22136
22663
|
oTop: 0
|
|
22137
22664
|
};
|
|
22138
22665
|
fullDataRowIdData[rowid] = rest;
|
|
@@ -22157,6 +22684,7 @@ edit_hook_hooks.add('tableEditModule', {
|
|
|
22157
22684
|
parent: null,
|
|
22158
22685
|
level: 0,
|
|
22159
22686
|
height: 0,
|
|
22687
|
+
resizeHeight: 0,
|
|
22160
22688
|
oTop: 0
|
|
22161
22689
|
};
|
|
22162
22690
|
fullDataRowIdData[rowid] = rest;
|
|
@@ -22212,6 +22740,7 @@ edit_hook_hooks.add('tableEditModule', {
|
|
|
22212
22740
|
parent: null,
|
|
22213
22741
|
level: 0,
|
|
22214
22742
|
height: 0,
|
|
22743
|
+
resizeHeight: 0,
|
|
22215
22744
|
oTop: 0
|
|
22216
22745
|
};
|
|
22217
22746
|
fullDataRowIdData[rowid] = rest;
|
|
@@ -22249,6 +22778,7 @@ edit_hook_hooks.add('tableEditModule', {
|
|
|
22249
22778
|
parent: null,
|
|
22250
22779
|
level: 0,
|
|
22251
22780
|
height: 0,
|
|
22781
|
+
resizeHeight: 0,
|
|
22252
22782
|
oTop: 0
|
|
22253
22783
|
};
|
|
22254
22784
|
fullDataRowIdData[rowid] = rest;
|
|
@@ -22309,6 +22839,7 @@ edit_hook_hooks.add('tableEditModule', {
|
|
|
22309
22839
|
parent: parentRow,
|
|
22310
22840
|
level: parentLevel + 1,
|
|
22311
22841
|
height: 0,
|
|
22842
|
+
resizeHeight: 0,
|
|
22312
22843
|
oTop: 0
|
|
22313
22844
|
};
|
|
22314
22845
|
fullDataRowIdData[rowid] = rest;
|
|
@@ -22383,7 +22914,7 @@ edit_hook_hooks.add('tableEditModule', {
|
|
|
22383
22914
|
const rowid = getRowid($xeTable, newRow);
|
|
22384
22915
|
insertMaps[rowid] = newRow;
|
|
22385
22916
|
});
|
|
22386
|
-
$xeTable.cacheRowMap();
|
|
22917
|
+
$xeTable.cacheRowMap(false);
|
|
22387
22918
|
$xeTable.updateScrollYStatus();
|
|
22388
22919
|
$xeTable.handleTableData(treeConfig && transform);
|
|
22389
22920
|
if (!(treeConfig && transform)) {
|
|
@@ -22646,7 +23177,7 @@ edit_hook_hooks.add('tableEditModule', {
|
|
|
22646
23177
|
editStore.insertMaps = insertDataRowMaps;
|
|
22647
23178
|
reactData.pendingRowMaps = pendingDataRowMaps;
|
|
22648
23179
|
$xeTable.updateFooter();
|
|
22649
|
-
$xeTable.cacheRowMap();
|
|
23180
|
+
$xeTable.cacheRowMap(false);
|
|
22650
23181
|
$xeTable.handleTableData(treeConfig && transform);
|
|
22651
23182
|
if (!(treeConfig && transform)) {
|
|
22652
23183
|
$xeTable.updateAfterDataIndex();
|
|
@@ -23369,7 +23900,21 @@ function getTxtCellValue(val, vMaps) {
|
|
|
23369
23900
|
const rest = replaceTxtCell(val, vMaps);
|
|
23370
23901
|
return rest.replace(/^"+$/g, qVal => '"'.repeat(Math.ceil(qVal.length / 2)));
|
|
23371
23902
|
}
|
|
23372
|
-
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) {
|
|
23373
23918
|
const list = content.split(enterSymbol);
|
|
23374
23919
|
const rows = [];
|
|
23375
23920
|
let fields = [];
|
|
@@ -23390,7 +23935,7 @@ function parseCsvAndTxt(columns, content, cellSeparator) {
|
|
|
23390
23935
|
});
|
|
23391
23936
|
const cells = rVal.split(cellSeparator);
|
|
23392
23937
|
if (!fields.length) {
|
|
23393
|
-
fields = cells.map(val => getTxtCellValue(val.trim(), vMaps));
|
|
23938
|
+
fields = cells.map(val => toExportField(tableConf, getTxtCellValue(val.trim(), vMaps)));
|
|
23394
23939
|
} else {
|
|
23395
23940
|
cells.forEach((val, colIndex) => {
|
|
23396
23941
|
if (colIndex < fields.length) {
|
|
@@ -23407,13 +23952,13 @@ function parseCsvAndTxt(columns, content, cellSeparator) {
|
|
|
23407
23952
|
rows
|
|
23408
23953
|
};
|
|
23409
23954
|
}
|
|
23410
|
-
function parseCsv(
|
|
23411
|
-
return parseCsvAndTxt(
|
|
23955
|
+
function parseCsv(tableConf, content) {
|
|
23956
|
+
return parseCsvAndTxt(tableConf, content, ',');
|
|
23412
23957
|
}
|
|
23413
|
-
function parseTxt(
|
|
23414
|
-
return parseCsvAndTxt(
|
|
23958
|
+
function parseTxt(tableConf, content) {
|
|
23959
|
+
return parseCsvAndTxt(tableConf, content, '\t');
|
|
23415
23960
|
}
|
|
23416
|
-
function parseHTML(
|
|
23961
|
+
function parseHTML(tableConf, content) {
|
|
23417
23962
|
const domParser = new DOMParser();
|
|
23418
23963
|
const xmlDoc = domParser.parseFromString(content, 'text/html');
|
|
23419
23964
|
const bodyNodes = getElementsByTagName(xmlDoc, 'body');
|
|
@@ -23426,7 +23971,7 @@ function parseHTML(columns, content) {
|
|
|
23426
23971
|
if (theadNodes.length) {
|
|
23427
23972
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(getElementsByTagName(theadNodes[0], 'tr'), rowNode => {
|
|
23428
23973
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(getElementsByTagName(rowNode, 'th'), cellNode => {
|
|
23429
|
-
fields.push(cellNode.textContent);
|
|
23974
|
+
fields.push(toExportField(tableConf, cellNode.textContent || ''));
|
|
23430
23975
|
});
|
|
23431
23976
|
});
|
|
23432
23977
|
const tbodyNodes = getElementsByTagName(tableNodes[0], 'tbody');
|
|
@@ -23449,7 +23994,7 @@ function parseHTML(columns, content) {
|
|
|
23449
23994
|
rows
|
|
23450
23995
|
};
|
|
23451
23996
|
}
|
|
23452
|
-
function parseXML(
|
|
23997
|
+
function parseXML(tableConf, content) {
|
|
23453
23998
|
const domParser = new DOMParser();
|
|
23454
23999
|
const xmlDoc = domParser.parseFromString(content, 'application/xml');
|
|
23455
24000
|
const sheetNodes = getElementsByTagName(xmlDoc, 'Worksheet');
|
|
@@ -23461,7 +24006,7 @@ function parseXML(columns, content) {
|
|
|
23461
24006
|
const rowNodes = getElementsByTagName(tableNodes[0], 'Row');
|
|
23462
24007
|
if (rowNodes.length) {
|
|
23463
24008
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(getElementsByTagName(rowNodes[0], 'Cell'), cellNode => {
|
|
23464
|
-
fields.push(cellNode.textContent);
|
|
24009
|
+
fields.push(toExportField(tableConf, cellNode.textContent || ''));
|
|
23465
24010
|
});
|
|
23466
24011
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(rowNodes, (rowNode, index) => {
|
|
23467
24012
|
if (index) {
|
|
@@ -23494,21 +24039,6 @@ function clearColumnConvert(columns) {
|
|
|
23494
24039
|
children: 'children'
|
|
23495
24040
|
});
|
|
23496
24041
|
}
|
|
23497
|
-
/**
|
|
23498
|
-
* 检查导入的列是否完整
|
|
23499
|
-
* @param {Array} fields 字段名列表
|
|
23500
|
-
* @param {Array} rows 数据列表
|
|
23501
|
-
*/
|
|
23502
|
-
function checkImportData(columns, fields) {
|
|
23503
|
-
const tableFields = [];
|
|
23504
|
-
columns.forEach(column => {
|
|
23505
|
-
const field = column.field;
|
|
23506
|
-
if (field) {
|
|
23507
|
-
tableFields.push(field);
|
|
23508
|
-
}
|
|
23509
|
-
});
|
|
23510
|
-
return fields.some(field => tableFields.indexOf(field) > -1);
|
|
23511
|
-
}
|
|
23512
24042
|
const tableExportMethodKeys = ['exportData', 'importByFile', 'importData', 'saveFile', 'readFile', 'print', 'getPrintHtml', 'openImport', 'closeImport', 'openExport', 'closeExport', 'openPrint', 'closePrint'];
|
|
23513
24043
|
export_hook_hooks.add('tableExportModule', {
|
|
23514
24044
|
setupTable($xeTable) {
|
|
@@ -24137,25 +24667,41 @@ export_hook_hooks.add('tableExportModule', {
|
|
|
24137
24667
|
fields: [],
|
|
24138
24668
|
rows: []
|
|
24139
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
|
+
};
|
|
24140
24686
|
switch (opts.type) {
|
|
24141
24687
|
case 'csv':
|
|
24142
|
-
rest = parseCsv(
|
|
24688
|
+
rest = parseCsv(tableConf, content);
|
|
24143
24689
|
break;
|
|
24144
24690
|
case 'txt':
|
|
24145
|
-
rest = parseTxt(
|
|
24691
|
+
rest = parseTxt(tableConf, content);
|
|
24146
24692
|
break;
|
|
24147
24693
|
case 'html':
|
|
24148
|
-
rest = parseHTML(
|
|
24694
|
+
rest = parseHTML(tableConf, content);
|
|
24149
24695
|
break;
|
|
24150
24696
|
case 'xml':
|
|
24151
|
-
rest = parseXML(
|
|
24697
|
+
rest = parseXML(tableConf, content);
|
|
24152
24698
|
break;
|
|
24153
24699
|
}
|
|
24154
24700
|
const {
|
|
24155
24701
|
fields,
|
|
24156
24702
|
rows
|
|
24157
24703
|
} = rest;
|
|
24158
|
-
const status =
|
|
24704
|
+
const status = fields.some(field => tableFieldMaps[field] || tableTitleMaps[field]);
|
|
24159
24705
|
if (status) {
|
|
24160
24706
|
$xeTable.createData(rows).then(data => {
|
|
24161
24707
|
let loadRest;
|
|
@@ -24313,6 +24859,43 @@ export_hook_hooks.add('tableExportModule', {
|
|
|
24313
24859
|
return Promise.reject(e);
|
|
24314
24860
|
});
|
|
24315
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
|
+
};
|
|
24316
24899
|
const handleExportAndPrint = (options, isPrint) => {
|
|
24317
24900
|
const {
|
|
24318
24901
|
treeConfig,
|
|
@@ -24353,7 +24936,9 @@ export_hook_hooks.add('tableExportModule', {
|
|
|
24353
24936
|
const checkMethod = customOpts.checkMethod;
|
|
24354
24937
|
const exportColumns = collectColumn.slice(0);
|
|
24355
24938
|
const {
|
|
24356
|
-
columns
|
|
24939
|
+
columns,
|
|
24940
|
+
excludeFields,
|
|
24941
|
+
includeFields
|
|
24357
24942
|
} = defOpts;
|
|
24358
24943
|
// 处理类型
|
|
24359
24944
|
const typeList = types.map(value => {
|
|
@@ -24377,33 +24962,19 @@ export_hook_hooks.add('tableExportModule', {
|
|
|
24377
24962
|
// 默认选中
|
|
24378
24963
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(exportColumns, (column, index, items, path, parent) => {
|
|
24379
24964
|
const isColGroup = column.children && column.children.length;
|
|
24380
|
-
|
|
24381
|
-
|
|
24382
|
-
|
|
24383
|
-
|
|
24384
|
-
|
|
24385
|
-
|
|
24386
|
-
|
|
24387
|
-
const colid = item.id || item.colId;
|
|
24388
|
-
const type = item.type;
|
|
24389
|
-
const field = item.field;
|
|
24390
|
-
if (colid) {
|
|
24391
|
-
return column.id === colid;
|
|
24392
|
-
} else if (field && type) {
|
|
24393
|
-
return column.field === field && column.type === type;
|
|
24394
|
-
} else if (field) {
|
|
24395
|
-
return column.field === field;
|
|
24396
|
-
} else if (type) {
|
|
24397
|
-
return column.type === type;
|
|
24398
|
-
}
|
|
24399
|
-
}
|
|
24400
|
-
return false;
|
|
24401
|
-
}) : column.visible;
|
|
24402
|
-
column.halfChecked = false;
|
|
24403
|
-
column.disabled = parent && parent.disabled || (checkMethod ? !checkMethod({
|
|
24404
|
-
column
|
|
24405
|
-
}) : 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));
|
|
24406
24972
|
}
|
|
24973
|
+
column.checked = isChecked;
|
|
24974
|
+
column.halfChecked = false;
|
|
24975
|
+
column.disabled = parent && parent.disabled || (checkMethod ? !checkMethod({
|
|
24976
|
+
column
|
|
24977
|
+
}) : false);
|
|
24407
24978
|
});
|
|
24408
24979
|
// 更新条件
|
|
24409
24980
|
Object.assign(exportStore, {
|
|
@@ -25040,38 +25611,75 @@ keyboard_hook_hooks.add('tableKeyboardModule', {
|
|
|
25040
25611
|
computeEditOpts,
|
|
25041
25612
|
computeCheckboxOpts,
|
|
25042
25613
|
computeMouseOpts,
|
|
25043
|
-
computeTreeOpts
|
|
25614
|
+
computeTreeOpts,
|
|
25615
|
+
computeRowOpts,
|
|
25616
|
+
computeCellOpts,
|
|
25617
|
+
computeDefaultRowHeight
|
|
25044
25618
|
} = $xeTable.getComputeMaps();
|
|
25045
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;
|
|
25046
25633
|
let countHeight = 0;
|
|
25047
25634
|
let rangeRows = [];
|
|
25048
25635
|
let moveSize = 0;
|
|
25049
25636
|
const isDown = moveRange > 0;
|
|
25050
25637
|
const {
|
|
25051
|
-
scrollYLoad
|
|
25052
|
-
rowHeight
|
|
25638
|
+
scrollYLoad
|
|
25053
25639
|
} = reactData;
|
|
25054
25640
|
const {
|
|
25055
25641
|
afterFullData
|
|
25056
25642
|
} = internalData;
|
|
25643
|
+
if (isDown) {
|
|
25644
|
+
moveSize = offsetClientTop + moveRange;
|
|
25645
|
+
} else {
|
|
25646
|
+
moveSize = trRect.height - offsetClientTop + Math.abs(moveRange);
|
|
25647
|
+
}
|
|
25057
25648
|
if (scrollYLoad) {
|
|
25058
|
-
|
|
25059
|
-
|
|
25060
|
-
|
|
25061
|
-
|
|
25062
|
-
|
|
25063
|
-
|
|
25064
|
-
|
|
25065
|
-
|
|
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
|
+
}
|
|
25066
25657
|
} else {
|
|
25067
|
-
|
|
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
|
+
}
|
|
25068
25681
|
}
|
|
25069
25682
|
} else {
|
|
25070
|
-
if (isDown) {
|
|
25071
|
-
moveSize = evnt.clientY - trRect.y;
|
|
25072
|
-
} else {
|
|
25073
|
-
moveSize = trRect.y - evnt.clientY + trRect.height;
|
|
25074
|
-
}
|
|
25075
25683
|
const siblingProp = isDown ? 'next' : 'previous';
|
|
25076
25684
|
while (targetTrElem && countHeight < moveSize) {
|
|
25077
25685
|
const rowNodeRest = $xeTable.getRowNode(targetTrElem);
|
|
@@ -25085,24 +25693,30 @@ keyboard_hook_hooks.add('tableKeyboardModule', {
|
|
|
25085
25693
|
return rangeRows;
|
|
25086
25694
|
}
|
|
25087
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']);
|
|
25088
25702
|
const {
|
|
25089
25703
|
column,
|
|
25090
25704
|
cell
|
|
25091
25705
|
} = params;
|
|
25092
25706
|
if (column.type === 'checkbox') {
|
|
25093
|
-
|
|
25094
|
-
|
|
25095
|
-
|
|
25096
|
-
}
|
|
25097
|
-
|
|
25098
|
-
|
|
25099
|
-
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
|
+
}
|
|
25100
25713
|
if (!bodyWrapperElem) {
|
|
25101
25714
|
return;
|
|
25102
25715
|
}
|
|
25716
|
+
const el = refElem.value;
|
|
25717
|
+
const disX = evnt.clientX;
|
|
25718
|
+
const disY = evnt.clientY;
|
|
25103
25719
|
const checkboxRangeElem = bodyWrapperElem.querySelector('.vxe-table--checkbox-range');
|
|
25104
|
-
const domMousemove = document.onmousemove;
|
|
25105
|
-
const domMouseup = document.onmouseup;
|
|
25106
25720
|
const trElem = cell.parentElement;
|
|
25107
25721
|
const selectRecords = $xeTable.getCheckboxRecords();
|
|
25108
25722
|
let lastRangeRows = [];
|
|
@@ -25245,8 +25859,8 @@ keyboard_hook_hooks.add('tableKeyboardModule', {
|
|
|
25245
25859
|
stopMouseScroll();
|
|
25246
25860
|
removeClass(el, 'drag--range');
|
|
25247
25861
|
checkboxRangeElem.removeAttribute('style');
|
|
25248
|
-
document.onmousemove =
|
|
25249
|
-
document.onmouseup =
|
|
25862
|
+
document.onmousemove = null;
|
|
25863
|
+
document.onmouseup = null;
|
|
25250
25864
|
triggerEvent('end', evnt);
|
|
25251
25865
|
};
|
|
25252
25866
|
triggerEvent('start', evnt);
|
|
@@ -28229,7 +28843,7 @@ const {
|
|
|
28229
28843
|
renderEmptyElement: grid_renderEmptyElement
|
|
28230
28844
|
} = core_.VxeUI;
|
|
28231
28845
|
const tableComponentPropKeys = Object.keys(src_props);
|
|
28232
|
-
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'];
|
|
28233
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'];
|
|
28234
28848
|
/* harmony default export */ var grid = ((0,external_commonjs_vue_commonjs2_vue_root_Vue_.defineComponent)({
|
|
28235
28849
|
name: 'VxeGrid',
|
|
@@ -29869,7 +30483,8 @@ const Grid = VxeGrid;
|
|
|
29869
30483
|
customRestore: '恢复默认',
|
|
29870
30484
|
maxFixedCol: '最大冻结列的数量不能超过 {0} 个',
|
|
29871
30485
|
dragTip: '移动:{0}',
|
|
29872
|
-
resizeColTip: '{0} 像素'
|
|
30486
|
+
resizeColTip: '宽:{0} 像素',
|
|
30487
|
+
resizeRowTip: '高:{0} 像素'
|
|
29873
30488
|
},
|
|
29874
30489
|
grid: {
|
|
29875
30490
|
selectOneRecord: '请至少选择一条记录!',
|