vxe-table 4.10.6-beta.9 → 4.10.7
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 +107 -85
- 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 +1479 -875
- 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 +111 -81
- 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 +126 -95
- 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.1739008158505.ttf} +0 -0
- /package/es/{iconfont.1736854674495.woff → iconfont.1739008158505.woff} +0 -0
- /package/es/{iconfont.1736854674495.woff2 → iconfont.1739008158505.woff2} +0 -0
- /package/lib/{iconfont.1736854674495.ttf → iconfont.1739008158505.ttf} +0 -0
- /package/lib/{iconfont.1736854674495.woff → iconfont.1739008158505.woff} +0 -0
- /package/lib/{iconfont.1736854674495.woff2 → iconfont.1739008158505.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.
|
|
3141
|
+
const version = "4.10.7";
|
|
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.
|
|
3586
|
+
const log_version = `table v${"4.10.7"}`;
|
|
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 || rowRest.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
|
|
4497
|
+
const rowRest = fullAllDataRowIdData[rowid] || {};
|
|
4498
|
+
const rHeight = rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || 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 || cellOpts.height || rowOpts.height || currRowRest.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,15 @@ 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;
|
|
6276
6323
|
const {
|
|
6277
6324
|
disabledMethod: dragDisabledMethod,
|
|
6278
6325
|
isCrossDrag,
|
|
@@ -6292,17 +6339,18 @@ const renderType = 'body';
|
|
|
6292
6339
|
showOverflow,
|
|
6293
6340
|
className,
|
|
6294
6341
|
treeNode,
|
|
6342
|
+
rowResize,
|
|
6343
|
+
padding,
|
|
6344
|
+
verticalAlign,
|
|
6295
6345
|
slots
|
|
6296
6346
|
} = column;
|
|
6297
6347
|
const {
|
|
6298
|
-
verticalAlign
|
|
6348
|
+
verticalAlign: allVerticalAlign
|
|
6299
6349
|
} = cellOpts;
|
|
6300
6350
|
const {
|
|
6301
6351
|
actived
|
|
6302
6352
|
} = editStore;
|
|
6303
|
-
const
|
|
6304
|
-
height: customRHeight
|
|
6305
|
-
} = rowOpts;
|
|
6353
|
+
const rowRest = fullAllDataRowIdData[rowid];
|
|
6306
6354
|
const colid = column.id;
|
|
6307
6355
|
const renderOpts = editRender || cellRender;
|
|
6308
6356
|
const compConf = renderOpts ? body_renderer.get(renderOpts.name) : null;
|
|
@@ -6312,23 +6360,27 @@ const renderType = 'body';
|
|
|
6312
6360
|
const columnIndex = $xeTable.getColumnIndex(column);
|
|
6313
6361
|
const _columnIndex = $xeTable.getVTColumnIndex(column);
|
|
6314
6362
|
const isEdit = isEnableConf(editRender);
|
|
6363
|
+
const resizeHeight = resizeHeightFlag ? rowRest.resizeHeight : 0;
|
|
6315
6364
|
let fixedHiddenColumn = fixedType ? column.fixed !== fixedType : column.fixed && overflowX;
|
|
6316
|
-
const
|
|
6365
|
+
const isCellPadding = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(padding) ? allPadding === null ? cellOpts.padding : allPadding : padding;
|
|
6366
|
+
const cellOverflow = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(showOverflow) ? isAllOverflow : showOverflow;
|
|
6317
6367
|
const showEllipsis = cellOverflow === 'ellipsis';
|
|
6318
6368
|
const showTitle = cellOverflow === 'title';
|
|
6319
6369
|
const showTooltip = cellOverflow === true || cellOverflow === 'tooltip';
|
|
6320
|
-
|
|
6321
|
-
const
|
|
6370
|
+
const hasEllipsis = isAllOverflow || showTitle || showTooltip || showEllipsis;
|
|
6371
|
+
const showResizable = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(column.resizable) ? column.resizable : columnOpts.resizable || allResizable;
|
|
6372
|
+
const isCsHeight = !!customCellHeight;
|
|
6373
|
+
const isRsHeight = resizeHeight > 0;
|
|
6322
6374
|
let isDirty;
|
|
6323
6375
|
const tdOns = {};
|
|
6324
|
-
const rest = fullAllDataRowIdData[rowid];
|
|
6325
6376
|
const cellAlign = align || (compConf ? compConf.tableCellAlign : '') || allAlign;
|
|
6377
|
+
const cellVerticalAlign = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(verticalAlign) ? allVerticalAlign : verticalAlign;
|
|
6326
6378
|
const errorValidItem = validErrorMaps[`${rowid}:${colid}`];
|
|
6327
6379
|
const showValidTip = editRules && validOpts.showMessage && (validOpts.message === 'default' ? height || tableData.length > 1 : validOpts.message === 'inline');
|
|
6328
|
-
const
|
|
6380
|
+
const tdAttrs = {
|
|
6329
6381
|
colid
|
|
6330
6382
|
};
|
|
6331
|
-
const
|
|
6383
|
+
const cellParams = {
|
|
6332
6384
|
$table: $xeTable,
|
|
6333
6385
|
$grid: $xeTable.xegrid,
|
|
6334
6386
|
isEdit: false,
|
|
@@ -6356,7 +6408,7 @@ const renderType = 'body';
|
|
|
6356
6408
|
isRowDragCell = rowDragOpts.trigger === 'row' || column.dragSort && rowDragOpts.trigger === 'cell';
|
|
6357
6409
|
}
|
|
6358
6410
|
if (isRowDragCell) {
|
|
6359
|
-
isDisabledDrag = !!(dragDisabledMethod && dragDisabledMethod(
|
|
6411
|
+
isDisabledDrag = !!(dragDisabledMethod && dragDisabledMethod(cellParams));
|
|
6360
6412
|
}
|
|
6361
6413
|
// hover 进入事件
|
|
6362
6414
|
if (showTitle || showTooltip || showAllTip || tooltipConfig) {
|
|
@@ -6368,11 +6420,11 @@ const renderType = 'body';
|
|
|
6368
6420
|
updateCellTitle(evnt.currentTarget, column);
|
|
6369
6421
|
} else if (showTooltip || showAllTip) {
|
|
6370
6422
|
// 如果配置了显示 tooltip
|
|
6371
|
-
$xeTable.triggerBodyTooltipEvent(evnt,
|
|
6423
|
+
$xeTable.triggerBodyTooltipEvent(evnt, cellParams);
|
|
6372
6424
|
}
|
|
6373
6425
|
$xeTable.dispatchEvent('cell-mouseenter', Object.assign({
|
|
6374
6426
|
cell: evnt.currentTarget
|
|
6375
|
-
},
|
|
6427
|
+
}, cellParams), evnt);
|
|
6376
6428
|
};
|
|
6377
6429
|
}
|
|
6378
6430
|
// hover 退出事件
|
|
@@ -6386,13 +6438,13 @@ const renderType = 'body';
|
|
|
6386
6438
|
}
|
|
6387
6439
|
$xeTable.dispatchEvent('cell-mouseleave', Object.assign({
|
|
6388
6440
|
cell: evnt.currentTarget
|
|
6389
|
-
},
|
|
6441
|
+
}, cellParams), evnt);
|
|
6390
6442
|
};
|
|
6391
6443
|
}
|
|
6392
6444
|
// 按下事件处理
|
|
6393
6445
|
if (isRowDragCell || checkboxOpts.range || mouseConfig) {
|
|
6394
6446
|
tdOns.onMousedown = evnt => {
|
|
6395
|
-
$xeTable.triggerCellMousedownEvent(evnt,
|
|
6447
|
+
$xeTable.triggerCellMousedownEvent(evnt, cellParams);
|
|
6396
6448
|
};
|
|
6397
6449
|
}
|
|
6398
6450
|
// 拖拽列事件
|
|
@@ -6401,11 +6453,11 @@ const renderType = 'body';
|
|
|
6401
6453
|
}
|
|
6402
6454
|
// 点击事件处理
|
|
6403
6455
|
tdOns.onClick = evnt => {
|
|
6404
|
-
$xeTable.triggerCellClickEvent(evnt,
|
|
6456
|
+
$xeTable.triggerCellClickEvent(evnt, cellParams);
|
|
6405
6457
|
};
|
|
6406
6458
|
// 双击事件处理
|
|
6407
6459
|
tdOns.onDblclick = evnt => {
|
|
6408
|
-
$xeTable.triggerCellDblclickEvent(evnt,
|
|
6460
|
+
$xeTable.triggerCellDblclickEvent(evnt, cellParams);
|
|
6409
6461
|
};
|
|
6410
6462
|
// 合并行或列
|
|
6411
6463
|
if (mergeList.length) {
|
|
@@ -6419,10 +6471,10 @@ const renderType = 'body';
|
|
|
6419
6471
|
return null;
|
|
6420
6472
|
}
|
|
6421
6473
|
if (rowspan > 1) {
|
|
6422
|
-
|
|
6474
|
+
tdAttrs.rowspan = rowspan;
|
|
6423
6475
|
}
|
|
6424
6476
|
if (colspan > 1) {
|
|
6425
|
-
|
|
6477
|
+
tdAttrs.colspan = colspan;
|
|
6426
6478
|
}
|
|
6427
6479
|
}
|
|
6428
6480
|
} else if (spanMethod) {
|
|
@@ -6430,20 +6482,20 @@ const renderType = 'body';
|
|
|
6430
6482
|
const {
|
|
6431
6483
|
rowspan = 1,
|
|
6432
6484
|
colspan = 1
|
|
6433
|
-
} = spanMethod(
|
|
6485
|
+
} = spanMethod(cellParams) || {};
|
|
6434
6486
|
if (!rowspan || !colspan) {
|
|
6435
6487
|
return null;
|
|
6436
6488
|
}
|
|
6437
6489
|
if (rowspan > 1) {
|
|
6438
|
-
|
|
6490
|
+
tdAttrs.rowspan = rowspan;
|
|
6439
6491
|
}
|
|
6440
6492
|
if (colspan > 1) {
|
|
6441
|
-
|
|
6493
|
+
tdAttrs.colspan = colspan;
|
|
6442
6494
|
}
|
|
6443
6495
|
}
|
|
6444
6496
|
// 如果被合并不可隐藏
|
|
6445
6497
|
if (fixedHiddenColumn && mergeList) {
|
|
6446
|
-
if (
|
|
6498
|
+
if (tdAttrs.colspan > 1 || tdAttrs.rowspan > 1) {
|
|
6447
6499
|
fixedHiddenColumn = false;
|
|
6448
6500
|
}
|
|
6449
6501
|
}
|
|
@@ -6452,28 +6504,25 @@ const renderType = 'body';
|
|
|
6452
6504
|
isDirty = $xeTable.isUpdateByRow(row, column.field);
|
|
6453
6505
|
}
|
|
6454
6506
|
const isVNAutoHeight = scrollYLoad && !hasEllipsis;
|
|
6455
|
-
|
|
6456
|
-
const
|
|
6457
|
-
|
|
6458
|
-
|
|
6459
|
-
|
|
6460
|
-
|
|
6461
|
-
|
|
6462
|
-
|
|
6463
|
-
} else {
|
|
6464
|
-
cellHeight = vnHeight || defaultRowHeight || 18;
|
|
6507
|
+
const cellHeight = calcCellHeightFlag ? rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight : defaultRowHeight;
|
|
6508
|
+
const isLastColumn = $columnIndex === columns.length - 1;
|
|
6509
|
+
const isAutoCellWidth = !column.resizeWidth && (column.minWidth === 'auto' || column.width === 'auto');
|
|
6510
|
+
let isVNPreEmptyStatus = false;
|
|
6511
|
+
if (scrollYLoad && (_rowIndex < scrollYStore.visibleStartIndex - scrollYStore.preloadSize || _rowIndex > scrollYStore.visibleEndIndex + scrollYStore.preloadSize)) {
|
|
6512
|
+
isVNPreEmptyStatus = true;
|
|
6513
|
+
} else if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
|
|
6514
|
+
isVNPreEmptyStatus = true;
|
|
6465
6515
|
}
|
|
6466
6516
|
const tcStyle = {};
|
|
6467
|
-
if (
|
|
6468
|
-
|
|
6469
|
-
|
|
6470
|
-
|
|
6471
|
-
tcStyle.height = `${cellHeight}px`;
|
|
6472
|
-
}
|
|
6517
|
+
if (scrollYLoad || hasEllipsis || isCsHeight || isRsHeight) {
|
|
6518
|
+
tcStyle.height = `${cellHeight}px`;
|
|
6519
|
+
} else {
|
|
6520
|
+
tcStyle.minHeight = `${cellHeight}px`;
|
|
6473
6521
|
}
|
|
6474
6522
|
const tdVNs = [];
|
|
6475
|
-
if (fixedHiddenColumn &&
|
|
6523
|
+
if (fixedHiddenColumn && isAllOverflow) {
|
|
6476
6524
|
tdVNs.push((0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
6525
|
+
key: 'tc',
|
|
6477
6526
|
class: ['vxe-cell', {
|
|
6478
6527
|
'c--title': showTitle,
|
|
6479
6528
|
'c--tooltip': showTooltip,
|
|
@@ -6483,7 +6532,8 @@ const renderType = 'body';
|
|
|
6483
6532
|
}));
|
|
6484
6533
|
} else {
|
|
6485
6534
|
// 渲染单元格
|
|
6486
|
-
tdVNs.push(...renderLine(
|
|
6535
|
+
tdVNs.push(...renderLine(cellParams, cellHeight), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
6536
|
+
key: 'tc',
|
|
6487
6537
|
class: ['vxe-cell', {
|
|
6488
6538
|
'c--title': showTitle,
|
|
6489
6539
|
'c--tooltip': showTooltip,
|
|
@@ -6491,18 +6541,21 @@ const renderType = 'body';
|
|
|
6491
6541
|
}],
|
|
6492
6542
|
style: tcStyle,
|
|
6493
6543
|
title: showTitle ? $xeTable.getCellLabel(row, column) : null
|
|
6494
|
-
},
|
|
6495
|
-
|
|
6496
|
-
|
|
6544
|
+
}, isVNPreEmptyStatus ? [] : [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
6545
|
+
colid,
|
|
6546
|
+
rowid,
|
|
6547
|
+
class: 'vxe-cell--wrapper'
|
|
6548
|
+
}, column.renderCell(cellParams))]));
|
|
6497
6549
|
if (showValidTip && errorValidItem) {
|
|
6498
6550
|
const errRule = errorValidItem.rule;
|
|
6499
6551
|
const validSlot = slots ? slots.valid : null;
|
|
6500
6552
|
const validParams = {
|
|
6501
|
-
...
|
|
6553
|
+
...cellParams,
|
|
6502
6554
|
...errorValidItem,
|
|
6503
6555
|
rule: errorValidItem
|
|
6504
6556
|
};
|
|
6505
6557
|
tdVNs.push((0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
6558
|
+
key: 'tcv',
|
|
6506
6559
|
class: ['vxe-cell--valid-error-tip', getPropClass(validOpts.className, validParams)],
|
|
6507
6560
|
style: errRule && errRule.maxWidth ? {
|
|
6508
6561
|
width: `${errRule.maxWidth}px`
|
|
@@ -6514,47 +6567,55 @@ const renderType = 'body';
|
|
|
6514
6567
|
}, errorValidItem.content)]])]));
|
|
6515
6568
|
}
|
|
6516
6569
|
}
|
|
6570
|
+
let showAreaRowStatus = false;
|
|
6517
6571
|
if (mouseConfig && mouseOpts.area && selectCellToRow) {
|
|
6518
|
-
if (
|
|
6519
|
-
|
|
6520
|
-
class: 'vxe-cell--area-status'
|
|
6521
|
-
}));
|
|
6572
|
+
if (!_columnIndex && selectCellToRow === true || selectCellToRow === column.field) {
|
|
6573
|
+
showAreaRowStatus = true;
|
|
6522
6574
|
}
|
|
6523
6575
|
}
|
|
6524
|
-
|
|
6525
|
-
|
|
6526
|
-
|
|
6527
|
-
|
|
6528
|
-
|
|
6529
|
-
|
|
6530
|
-
|
|
6576
|
+
if (!fixedHiddenColumn && showResizable && isAllColumnDrag) {
|
|
6577
|
+
tdVNs.push((0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
6578
|
+
key: 'tcc',
|
|
6579
|
+
class: ['vxe-cell--col-resizable', {
|
|
6580
|
+
'is--line': !border || border === 'none'
|
|
6581
|
+
}],
|
|
6582
|
+
onMousedown: evnt => $xeTable.handleColResizeMousedownEvent(evnt, fixedType, cellParams),
|
|
6583
|
+
onDblclick: evnt => $xeTable.handleColResizeDblclickEvent(evnt, cellParams)
|
|
6584
|
+
}));
|
|
6585
|
+
}
|
|
6586
|
+
if ((rowResize || isAllRowDrag) && rowOpts.resizable) {
|
|
6587
|
+
tdVNs.push((0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
6588
|
+
key: 'tcr',
|
|
6589
|
+
class: 'vxe-cell--row-resizable',
|
|
6590
|
+
onMousedown: evnt => $xeTable.handleRowResizeMousedownEvent(evnt, cellParams),
|
|
6591
|
+
onDblclick: evnt => $xeTable.handleRowResizeDblclickEvent(evnt, cellParams)
|
|
6592
|
+
}));
|
|
6531
6593
|
}
|
|
6532
6594
|
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,
|
|
6595
|
+
class: ['vxe-body--column', colid, cellVerticalAlign ? `col--vertical-${cellVerticalAlign}` : '', cellAlign ? `col--${cellAlign}` : '', type ? `col--${type}` : '', {
|
|
6537
6596
|
'col--last': isLastColumn,
|
|
6538
6597
|
'col--tree-node': treeNode,
|
|
6539
6598
|
'col--edit': isEdit,
|
|
6540
6599
|
'col--ellipsis': hasEllipsis,
|
|
6600
|
+
'col--cs-height': isCsHeight,
|
|
6601
|
+
'col--rs-height': isRsHeight,
|
|
6602
|
+
'col--to-row': showAreaRowStatus,
|
|
6541
6603
|
'col--auto-height': isVNAutoHeight,
|
|
6542
6604
|
'fixed--width': !isAutoCellWidth,
|
|
6543
6605
|
'fixed--hidden': fixedHiddenColumn,
|
|
6606
|
+
'is--padding': isCellPadding,
|
|
6544
6607
|
'is--drag-cell': isRowDragCell && (isCrossDrag || isPeerDrag || !rowLevel),
|
|
6545
6608
|
'is--drag-disabled': isDisabledDrag,
|
|
6546
6609
|
'col--dirty': isDirty,
|
|
6547
6610
|
'col--active': editConfig && isEdit && actived.row === row && (actived.column === column || editOpts.mode === 'row'),
|
|
6548
6611
|
'col--valid-error': !!errorValidItem,
|
|
6549
6612
|
'col--current': currentColumn === column
|
|
6550
|
-
}, getPropClass(compCellClassName,
|
|
6613
|
+
}, getPropClass(compCellClassName, cellParams), getPropClass(className, cellParams), getPropClass(allCellClassName, cellParams)],
|
|
6551
6614
|
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),
|
|
6615
|
+
...tdAttrs,
|
|
6616
|
+
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
6617
|
...tdOns
|
|
6557
|
-
},
|
|
6618
|
+
}, isOptimizeMode && fixedHiddenColumn ? [] : tdVNs);
|
|
6558
6619
|
};
|
|
6559
6620
|
const renderRows = (fixedType, isOptimizeMode, tableData, tableColumn) => {
|
|
6560
6621
|
const {
|
|
@@ -6563,15 +6624,16 @@ const renderType = 'body';
|
|
|
6563
6624
|
highlightHoverRow,
|
|
6564
6625
|
rowClassName,
|
|
6565
6626
|
rowStyle,
|
|
6566
|
-
showOverflow: allColumnOverflow,
|
|
6567
6627
|
editConfig,
|
|
6568
6628
|
treeConfig
|
|
6569
6629
|
} = tableProps;
|
|
6570
6630
|
const {
|
|
6571
6631
|
hasFixedColumn,
|
|
6572
6632
|
treeExpandedMaps,
|
|
6633
|
+
isColLoading,
|
|
6573
6634
|
scrollXLoad,
|
|
6574
6635
|
scrollYLoad,
|
|
6636
|
+
isAllOverflow,
|
|
6575
6637
|
rowExpandedMaps,
|
|
6576
6638
|
expandColumn,
|
|
6577
6639
|
selectRadioRow,
|
|
@@ -6675,7 +6737,7 @@ const renderType = 'body';
|
|
|
6675
6737
|
const tdVNs = tableColumn.map((column, $columnIndex) => {
|
|
6676
6738
|
return renderTdColumn(seq, rowid, fixedType, isOptimizeMode, rowLevel, row, rowIndex, $rowIndex, _rowIndex, column, $columnIndex, tableColumn, tableData);
|
|
6677
6739
|
});
|
|
6678
|
-
rows.push(columnOpts.drag && columnDragOpts.animation ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(external_commonjs_vue_commonjs2_vue_root_Vue_.TransitionGroup, {
|
|
6740
|
+
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
6741
|
name: `vxe-header--col-list${isDragColMove ? '' : '-disabled'}`,
|
|
6680
6742
|
tag: 'tr',
|
|
6681
6743
|
class: trClass,
|
|
@@ -6709,7 +6771,7 @@ const renderType = 'body';
|
|
|
6709
6771
|
const {
|
|
6710
6772
|
showOverflow
|
|
6711
6773
|
} = 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) ?
|
|
6774
|
+
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
6775
|
const expandParams = {
|
|
6714
6776
|
$table: $xeTable,
|
|
6715
6777
|
seq,
|
|
@@ -6797,7 +6859,6 @@ const renderType = 'body';
|
|
|
6797
6859
|
tableColumn
|
|
6798
6860
|
} = props;
|
|
6799
6861
|
const {
|
|
6800
|
-
showOverflow: allColumnOverflow,
|
|
6801
6862
|
spanMethod,
|
|
6802
6863
|
footerSpanMethod,
|
|
6803
6864
|
mouseConfig
|
|
@@ -6805,6 +6866,8 @@ const renderType = 'body';
|
|
|
6805
6866
|
const {
|
|
6806
6867
|
isGroup,
|
|
6807
6868
|
tableData,
|
|
6869
|
+
isRowLoading,
|
|
6870
|
+
isColLoading,
|
|
6808
6871
|
scrollXLoad,
|
|
6809
6872
|
scrollYLoad,
|
|
6810
6873
|
isAllOverflow,
|
|
@@ -6828,7 +6891,7 @@ const renderType = 'body';
|
|
|
6828
6891
|
let renderColumnList = tableColumn;
|
|
6829
6892
|
let isOptimizeMode = false;
|
|
6830
6893
|
// 如果是使用优化模式
|
|
6831
|
-
if (scrollXLoad || scrollYLoad ||
|
|
6894
|
+
if (scrollXLoad || scrollYLoad || isAllOverflow) {
|
|
6832
6895
|
if (expandColumn || spanMethod || footerSpanMethod) {
|
|
6833
6896
|
// 如果不支持优化模式
|
|
6834
6897
|
} else {
|
|
@@ -6947,9 +7010,9 @@ const renderType = 'body';
|
|
|
6947
7010
|
});
|
|
6948
7011
|
})),
|
|
6949
7012
|
/**
|
|
6950
|
-
|
|
6951
|
-
|
|
6952
|
-
rowOpts.drag && rowDragOpts.animation ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(external_commonjs_vue_commonjs2_vue_root_Vue_.TransitionGroup, {
|
|
7013
|
+
* 内容
|
|
7014
|
+
*/
|
|
7015
|
+
!(isRowLoading || isColLoading) && rowOpts.drag && rowDragOpts.animation ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(external_commonjs_vue_commonjs2_vue_root_Vue_.TransitionGroup, {
|
|
6953
7016
|
ref: refBodyTBody,
|
|
6954
7017
|
name: `vxe-body--row-list${isDragRowMove ? '' : '-disabled'}`,
|
|
6955
7018
|
tag: 'tbody'
|
|
@@ -6982,6 +7045,8 @@ const renderType = 'body';
|
|
|
6982
7045
|
class: 'vxe-table--cell-multi-area'
|
|
6983
7046
|
}), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
|
|
6984
7047
|
class: 'vxe-table--cell-active-area'
|
|
7048
|
+
}), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
|
|
7049
|
+
class: 'vxe-table--cell-row-status-area'
|
|
6985
7050
|
})]) : body_renderEmptyElement($xeTable), !fixedType ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
6986
7051
|
class: 'vxe-table--empty-block',
|
|
6987
7052
|
ref: refBodyEmptyBlock
|
|
@@ -7000,10 +7065,7 @@ const renderType = 'body';
|
|
|
7000
7065
|
|
|
7001
7066
|
|
|
7002
7067
|
|
|
7003
|
-
|
|
7004
|
-
|
|
7005
7068
|
const {
|
|
7006
|
-
getI18n: header_getI18n,
|
|
7007
7069
|
renderer: header_renderer,
|
|
7008
7070
|
renderEmptyElement: header_renderEmptyElement
|
|
7009
7071
|
} = core_.VxeUI;
|
|
@@ -7028,18 +7090,13 @@ const header_renderType = 'header';
|
|
|
7028
7090
|
reactData: tableReactData,
|
|
7029
7091
|
internalData: tableInternalData
|
|
7030
7092
|
} = $xeTable;
|
|
7031
|
-
const {
|
|
7032
|
-
refElem: tableRefElem,
|
|
7033
|
-
refLeftContainer,
|
|
7034
|
-
refRightContainer,
|
|
7035
|
-
refCellResizeBar,
|
|
7036
|
-
refCellResizeTip
|
|
7037
|
-
} = $xeTable.getRefMaps();
|
|
7038
7093
|
const {
|
|
7039
7094
|
computeColumnOpts,
|
|
7040
7095
|
computeColumnDragOpts,
|
|
7041
|
-
|
|
7042
|
-
|
|
7096
|
+
computeCellOpts,
|
|
7097
|
+
computeMouseOpts,
|
|
7098
|
+
computeHeaderCellOpts,
|
|
7099
|
+
computeDefaultRowHeight
|
|
7043
7100
|
} = $xeTable.getComputeMaps();
|
|
7044
7101
|
const headerColumn = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)([]);
|
|
7045
7102
|
const refElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
@@ -7055,153 +7112,6 @@ const header_renderType = 'header';
|
|
|
7055
7112
|
} = tableReactData;
|
|
7056
7113
|
headerColumn.value = isGroup ? convertHeaderColumnToRows(props.tableGroupColumn) : [];
|
|
7057
7114
|
};
|
|
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
7115
|
const renderRows = (isGroup, isOptimizeMode, cols, $rowIndex) => {
|
|
7206
7116
|
const {
|
|
7207
7117
|
fixedType
|
|
@@ -7228,6 +7138,10 @@ const header_renderType = 'header';
|
|
|
7228
7138
|
} = tableInternalData;
|
|
7229
7139
|
const columnOpts = computeColumnOpts.value;
|
|
7230
7140
|
const columnDragOpts = computeColumnDragOpts.value;
|
|
7141
|
+
const cellOpts = computeCellOpts.value;
|
|
7142
|
+
const defaultRowHeight = computeDefaultRowHeight.value;
|
|
7143
|
+
const headerCellOpts = computeHeaderCellOpts.value;
|
|
7144
|
+
const currCellHeight = getCellHeight(headerCellOpts.height || cellOpts.height) || defaultRowHeight;
|
|
7231
7145
|
const {
|
|
7232
7146
|
disabledMethod: dragDisabledMethod,
|
|
7233
7147
|
isCrossDrag,
|
|
@@ -7249,6 +7163,7 @@ const header_renderType = 'header';
|
|
|
7249
7163
|
const compConf = renderOpts ? header_renderer.get(renderOpts.name) : null;
|
|
7250
7164
|
const isColGroup = column.children && column.children.length;
|
|
7251
7165
|
const fixedHiddenColumn = fixedType ? column.fixed !== fixedType && !isColGroup : !!column.fixed && overflowX;
|
|
7166
|
+
const isPadding = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(headerCellOpts.padding) ? headerCellOpts.padding : cellOpts.padding;
|
|
7252
7167
|
const headOverflow = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(showHeaderOverflow) ? allColumnHeaderOverflow : showHeaderOverflow;
|
|
7253
7168
|
const headAlign = headerAlign || (compConf ? compConf.tableHeaderCellAlign : '') || allHeaderAlign || align || (compConf ? compConf.tableCellAlign : '') || allAlign;
|
|
7254
7169
|
let showEllipsis = headOverflow === 'ellipsis';
|
|
@@ -7263,7 +7178,7 @@ const header_renderType = 'header';
|
|
|
7263
7178
|
}
|
|
7264
7179
|
const columnIndex = $xeTable.getColumnIndex(column);
|
|
7265
7180
|
const _columnIndex = $xeTable.getVTColumnIndex(column);
|
|
7266
|
-
const
|
|
7181
|
+
const cellParams = {
|
|
7267
7182
|
$table: $xeTable,
|
|
7268
7183
|
$grid: $xeTable.xegrid,
|
|
7269
7184
|
$rowIndex,
|
|
@@ -7283,8 +7198,8 @@ const header_renderType = 'header';
|
|
|
7283
7198
|
rowspan: column.rowSpan > 1 ? column.rowSpan : null
|
|
7284
7199
|
};
|
|
7285
7200
|
const thOns = {
|
|
7286
|
-
onClick: evnt => $xeTable.triggerHeaderCellClickEvent(evnt,
|
|
7287
|
-
onDblclick: evnt => $xeTable.triggerHeaderCellDblclickEvent(evnt,
|
|
7201
|
+
onClick: evnt => $xeTable.triggerHeaderCellClickEvent(evnt, cellParams),
|
|
7202
|
+
onDblclick: evnt => $xeTable.triggerHeaderCellDblclickEvent(evnt, cellParams)
|
|
7288
7203
|
};
|
|
7289
7204
|
// 横向虚拟滚动不支持动态行高
|
|
7290
7205
|
if (scrollXLoad && !hasEllipsis) {
|
|
@@ -7293,11 +7208,11 @@ const header_renderType = 'header';
|
|
|
7293
7208
|
const isColDragCell = columnOpts.drag && columnDragOpts.trigger === 'cell';
|
|
7294
7209
|
let isDisabledDrag = false;
|
|
7295
7210
|
if (isColDragCell) {
|
|
7296
|
-
isDisabledDrag = !!(dragDisabledMethod && dragDisabledMethod(
|
|
7211
|
+
isDisabledDrag = !!(dragDisabledMethod && dragDisabledMethod(cellParams));
|
|
7297
7212
|
}
|
|
7298
7213
|
// 按下事件处理
|
|
7299
7214
|
if (mouseConfig || isColDragCell) {
|
|
7300
|
-
thOns.onMousedown = evnt => $xeTable.triggerHeaderCellMousedownEvent(evnt,
|
|
7215
|
+
thOns.onMousedown = evnt => $xeTable.triggerHeaderCellMousedownEvent(evnt, cellParams);
|
|
7301
7216
|
}
|
|
7302
7217
|
// 拖拽列事件
|
|
7303
7218
|
if (columnOpts.drag) {
|
|
@@ -7315,6 +7230,12 @@ const header_renderType = 'header';
|
|
|
7315
7230
|
if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
|
|
7316
7231
|
isVNPreEmptyStatus = true;
|
|
7317
7232
|
}
|
|
7233
|
+
const tcStyle = {};
|
|
7234
|
+
if (hasEllipsis) {
|
|
7235
|
+
tcStyle.height = `${currCellHeight}px`;
|
|
7236
|
+
} else {
|
|
7237
|
+
tcStyle.minHeight = `${currCellHeight}px`;
|
|
7238
|
+
}
|
|
7318
7239
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('th', {
|
|
7319
7240
|
class: ['vxe-header--column', colid, {
|
|
7320
7241
|
[`col--${headAlign}`]: headAlign,
|
|
@@ -7325,14 +7246,15 @@ const header_renderType = 'header';
|
|
|
7325
7246
|
'col--ellipsis': hasEllipsis,
|
|
7326
7247
|
'fixed--width': !isAutoCellWidth,
|
|
7327
7248
|
'fixed--hidden': fixedHiddenColumn,
|
|
7249
|
+
'is--padding': isPadding,
|
|
7328
7250
|
'is--sortable': column.sortable,
|
|
7329
7251
|
'col--filter': !!filters,
|
|
7330
7252
|
'is--filter-active': hasFilter,
|
|
7331
7253
|
'is--drag-active': !column.fixed && !isDisabledDrag && (isCrossDrag || isPeerDrag || !column.parentId),
|
|
7332
7254
|
'is--drag-disabled': isDisabledDrag,
|
|
7333
7255
|
'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(
|
|
7256
|
+
}, 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 : ''],
|
|
7257
|
+
style: headerCellStyle ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(headerCellStyle) ? headerCellStyle(cellParams) : headerCellStyle : null,
|
|
7336
7258
|
...thAttrs,
|
|
7337
7259
|
...thOns,
|
|
7338
7260
|
key: columnKey || scrollXLoad || scrollYLoad || columnOpts.useKey || columnOpts.drag || isColGroup ? colid : $columnIndex
|
|
@@ -7341,17 +7263,21 @@ const header_renderType = 'header';
|
|
|
7341
7263
|
'c--title': showTitle,
|
|
7342
7264
|
'c--tooltip': showTooltip,
|
|
7343
7265
|
'c--ellipsis': showEllipsis
|
|
7344
|
-
}]
|
|
7345
|
-
|
|
7266
|
+
}],
|
|
7267
|
+
style: tcStyle
|
|
7268
|
+
}, isVNPreEmptyStatus || isOptimizeMode && fixedHiddenColumn ? [] : [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
7269
|
+
colid,
|
|
7270
|
+
class: 'vxe-cell--wrapper'
|
|
7271
|
+
}, column.renderHeader(cellParams))]),
|
|
7346
7272
|
/**
|
|
7347
7273
|
* 列宽拖动
|
|
7348
7274
|
*/
|
|
7349
7275
|
!fixedHiddenColumn && showResizable ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
7350
|
-
class: ['vxe-resizable', {
|
|
7276
|
+
class: ['vxe-cell--col-resizable', {
|
|
7351
7277
|
'is--line': !border || border === 'none'
|
|
7352
7278
|
}],
|
|
7353
|
-
onMousedown: evnt =>
|
|
7354
|
-
onDblclick: evnt => $xeTable.
|
|
7279
|
+
onMousedown: evnt => $xeTable.handleColResizeMousedownEvent(evnt, fixedType, cellParams),
|
|
7280
|
+
onDblclick: evnt => $xeTable.handleColResizeDblclickEvent(evnt, cellParams)
|
|
7355
7281
|
}) : header_renderEmptyElement($xeTable)]);
|
|
7356
7282
|
});
|
|
7357
7283
|
};
|
|
@@ -7364,6 +7290,7 @@ const header_renderType = 'header';
|
|
|
7364
7290
|
headerRowStyle
|
|
7365
7291
|
} = tableProps;
|
|
7366
7292
|
const {
|
|
7293
|
+
isColLoading,
|
|
7367
7294
|
isDragColMove
|
|
7368
7295
|
} = tableReactData;
|
|
7369
7296
|
const columnOpts = computeColumnOpts.value;
|
|
@@ -7375,7 +7302,7 @@ const header_renderType = 'header';
|
|
|
7375
7302
|
fixed: fixedType,
|
|
7376
7303
|
type: header_renderType
|
|
7377
7304
|
};
|
|
7378
|
-
if (columnOpts.drag && columnDragOpts.animation) {
|
|
7305
|
+
if (!isColLoading && columnOpts.drag && columnDragOpts.animation) {
|
|
7379
7306
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(external_commonjs_vue_commonjs2_vue_root_Vue_.TransitionGroup, {
|
|
7380
7307
|
key: $rowIndex,
|
|
7381
7308
|
name: `vxe-header--col-list${isDragColMove ? '' : '-disabled'}`,
|
|
@@ -7400,6 +7327,7 @@ const header_renderType = 'header';
|
|
|
7400
7327
|
tableColumn
|
|
7401
7328
|
} = props;
|
|
7402
7329
|
const {
|
|
7330
|
+
mouseConfig,
|
|
7403
7331
|
showHeaderOverflow: allColumnHeaderOverflow,
|
|
7404
7332
|
spanMethod,
|
|
7405
7333
|
footerSpanMethod
|
|
@@ -7414,6 +7342,7 @@ const header_renderType = 'header';
|
|
|
7414
7342
|
visibleColumn,
|
|
7415
7343
|
fullColumnIdData
|
|
7416
7344
|
} = tableInternalData;
|
|
7345
|
+
const mouseOpts = computeMouseOpts.value;
|
|
7417
7346
|
let renderHeaderList = headerColumn.value;
|
|
7418
7347
|
let renderColumnList = tableColumn;
|
|
7419
7348
|
let isOptimizeMode = false;
|
|
@@ -7500,14 +7429,21 @@ const header_renderType = 'header';
|
|
|
7500
7429
|
*/
|
|
7501
7430
|
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('thead', {
|
|
7502
7431
|
ref: refHeaderTHead
|
|
7503
|
-
}, renderHeads(isGroup, isOptimizeMode, renderHeaderList))])
|
|
7504
|
-
|
|
7505
|
-
|
|
7506
|
-
|
|
7507
|
-
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('
|
|
7508
|
-
|
|
7509
|
-
|
|
7510
|
-
|
|
7432
|
+
}, renderHeads(isGroup, isOptimizeMode, renderHeaderList))]), mouseConfig && mouseOpts.area ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
7433
|
+
class: 'vxe-table--cell-area'
|
|
7434
|
+
}, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
|
|
7435
|
+
class: 'vxe-table--cell-main-area'
|
|
7436
|
+
}), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
|
|
7437
|
+
class: 'vxe-table--cell-copy-area'
|
|
7438
|
+
}), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
|
|
7439
|
+
class: 'vxe-table--cell-extend-area'
|
|
7440
|
+
}), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
|
|
7441
|
+
class: 'vxe-table--cell-multi-area'
|
|
7442
|
+
}), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
|
|
7443
|
+
class: 'vxe-table--cell-active-area'
|
|
7444
|
+
}), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
|
|
7445
|
+
class: 'vxe-table--cell-col-status-area'
|
|
7446
|
+
})]) : header_renderEmptyElement($xeTable)])]);
|
|
7511
7447
|
};
|
|
7512
7448
|
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.tableColumn, uploadColumn);
|
|
7513
7449
|
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.onMounted)(() => {
|
|
@@ -7560,6 +7496,7 @@ const header_renderType = 'header';
|
|
|
7560
7496
|
|
|
7561
7497
|
|
|
7562
7498
|
|
|
7499
|
+
|
|
7563
7500
|
const {
|
|
7564
7501
|
renderer: footer_renderer,
|
|
7565
7502
|
renderEmptyElement: footer_renderEmptyElement
|
|
@@ -7620,7 +7557,11 @@ function mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex) {
|
|
|
7620
7557
|
const {
|
|
7621
7558
|
computeTooltipOpts,
|
|
7622
7559
|
computeColumnOpts,
|
|
7623
|
-
computeColumnDragOpts
|
|
7560
|
+
computeColumnDragOpts,
|
|
7561
|
+
computeCellOpts,
|
|
7562
|
+
computeFooterCellOpts,
|
|
7563
|
+
computeDefaultRowHeight,
|
|
7564
|
+
computeResizableOpts
|
|
7624
7565
|
} = $xeTable.getComputeMaps();
|
|
7625
7566
|
const refElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
7626
7567
|
const refFooterScroll = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
@@ -7633,6 +7574,8 @@ function mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex) {
|
|
|
7633
7574
|
fixedType
|
|
7634
7575
|
} = props;
|
|
7635
7576
|
const {
|
|
7577
|
+
resizable: allResizable,
|
|
7578
|
+
border,
|
|
7636
7579
|
footerCellClassName,
|
|
7637
7580
|
footerCellStyle,
|
|
7638
7581
|
footerAlign: allFooterAlign,
|
|
@@ -7652,7 +7595,15 @@ function mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex) {
|
|
|
7652
7595
|
scrollXStore
|
|
7653
7596
|
} = tableInternalData;
|
|
7654
7597
|
const tooltipOpts = computeTooltipOpts.value;
|
|
7598
|
+
const resizableOpts = computeResizableOpts.value;
|
|
7599
|
+
const {
|
|
7600
|
+
isAllColumnDrag
|
|
7601
|
+
} = resizableOpts;
|
|
7655
7602
|
const columnOpts = computeColumnOpts.value;
|
|
7603
|
+
const defaultRowHeight = computeDefaultRowHeight.value;
|
|
7604
|
+
const cellOpts = computeCellOpts.value;
|
|
7605
|
+
const footerCellOpts = computeFooterCellOpts.value;
|
|
7606
|
+
const currCellHeight = getCellHeight(footerCellOpts.height || cellOpts.height) || defaultRowHeight;
|
|
7656
7607
|
return tableColumn.map((column, $columnIndex) => {
|
|
7657
7608
|
const {
|
|
7658
7609
|
type,
|
|
@@ -7663,19 +7614,22 @@ function mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex) {
|
|
|
7663
7614
|
editRender,
|
|
7664
7615
|
cellRender
|
|
7665
7616
|
} = column;
|
|
7617
|
+
const colid = column.id;
|
|
7666
7618
|
const renderOpts = editRender || cellRender;
|
|
7667
7619
|
const compConf = renderOpts ? footer_renderer.get(renderOpts.name) : null;
|
|
7668
7620
|
const showAllTip = tooltipOpts.showAll;
|
|
7669
7621
|
const isColGroup = column.children && column.children.length;
|
|
7670
7622
|
const fixedHiddenColumn = fixedType ? column.fixed !== fixedType && !isColGroup : column.fixed && overflowX;
|
|
7623
|
+
const isPadding = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(footerCellOpts.padding) ? footerCellOpts.padding : cellOpts.padding;
|
|
7671
7624
|
const footOverflow = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eqNull(showFooterOverflow) ? allColumnFooterOverflow : showFooterOverflow;
|
|
7672
7625
|
const footAlign = footerAlign || (compConf ? compConf.tableFooterCellAlign : '') || allFooterAlign || align || (compConf ? compConf.tableCellAlign : '') || allAlign;
|
|
7673
7626
|
let showEllipsis = footOverflow === 'ellipsis';
|
|
7674
7627
|
const showTitle = footOverflow === 'title';
|
|
7675
7628
|
const showTooltip = footOverflow === true || footOverflow === 'tooltip';
|
|
7676
7629
|
let hasEllipsis = showTitle || showTooltip || showEllipsis;
|
|
7630
|
+
const showResizable = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isBoolean(column.resizable) ? column.resizable : columnOpts.resizable || allResizable;
|
|
7677
7631
|
const attrs = {
|
|
7678
|
-
colid
|
|
7632
|
+
colid
|
|
7679
7633
|
};
|
|
7680
7634
|
const tfOns = {};
|
|
7681
7635
|
const columnIndex = $xeTable.getColumnIndex(column);
|
|
@@ -7768,6 +7722,12 @@ function mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex) {
|
|
|
7768
7722
|
if (scrollXLoad && !column.fixed && (_columnIndex < scrollXStore.visibleStartIndex - scrollXStore.preloadSize || _columnIndex > scrollXStore.visibleEndIndex + scrollXStore.preloadSize)) {
|
|
7769
7723
|
isVNPreEmptyStatus = true;
|
|
7770
7724
|
}
|
|
7725
|
+
const tcStyle = {};
|
|
7726
|
+
if (hasEllipsis) {
|
|
7727
|
+
tcStyle.height = `${currCellHeight}px`;
|
|
7728
|
+
} else {
|
|
7729
|
+
tcStyle.minHeight = `${currCellHeight}px`;
|
|
7730
|
+
}
|
|
7771
7731
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('td', {
|
|
7772
7732
|
class: ['vxe-footer--column', column.id, {
|
|
7773
7733
|
[`col--${footAlign}`]: footAlign,
|
|
@@ -7775,6 +7735,7 @@ function mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex) {
|
|
|
7775
7735
|
'col--last': isLastColumn,
|
|
7776
7736
|
'fixed--width': !isAutoCellWidth,
|
|
7777
7737
|
'fixed--hidden': fixedHiddenColumn,
|
|
7738
|
+
'is--padding': isPadding,
|
|
7778
7739
|
'col--ellipsis': hasEllipsis,
|
|
7779
7740
|
'col--current': currentColumn === column
|
|
7780
7741
|
}, getPropClass(footerClassName, cellParams), getPropClass(footerCellClassName, cellParams)],
|
|
@@ -7787,8 +7748,22 @@ function mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex) {
|
|
|
7787
7748
|
'c--title': showTitle,
|
|
7788
7749
|
'c--tooltip': showTooltip,
|
|
7789
7750
|
'c--ellipsis': showEllipsis
|
|
7790
|
-
}]
|
|
7791
|
-
|
|
7751
|
+
}],
|
|
7752
|
+
style: tcStyle
|
|
7753
|
+
}, isVNPreEmptyStatus ? [] : [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
7754
|
+
colid,
|
|
7755
|
+
class: 'vxe-cell--wrapper'
|
|
7756
|
+
}, column.renderFooter(cellParams))]),
|
|
7757
|
+
/**
|
|
7758
|
+
* 列宽拖动
|
|
7759
|
+
*/
|
|
7760
|
+
!fixedHiddenColumn && showResizable && isAllColumnDrag ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
7761
|
+
class: ['vxe-cell--col-resizable', {
|
|
7762
|
+
'is--line': !border || border === 'none'
|
|
7763
|
+
}],
|
|
7764
|
+
onMousedown: evnt => $xeTable.handleColResizeMousedownEvent(evnt, fixedType, cellParams),
|
|
7765
|
+
onDblclick: evnt => $xeTable.handleColResizeDblclickEvent(evnt, cellParams)
|
|
7766
|
+
}) : footer_renderEmptyElement($xeTable)]);
|
|
7792
7767
|
});
|
|
7793
7768
|
};
|
|
7794
7769
|
const renderHeads = renderColumnList => {
|
|
@@ -7801,6 +7776,7 @@ function mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex) {
|
|
|
7801
7776
|
footerRowStyle
|
|
7802
7777
|
} = tableProps;
|
|
7803
7778
|
const {
|
|
7779
|
+
isColLoading,
|
|
7804
7780
|
isDragColMove
|
|
7805
7781
|
} = tableReactData;
|
|
7806
7782
|
const columnOpts = computeColumnOpts.value;
|
|
@@ -7815,7 +7791,7 @@ function mergeFooterMethod(mergeFooterList, _rowIndex, _columnIndex) {
|
|
|
7815
7791
|
fixed: fixedType,
|
|
7816
7792
|
type: footer_renderType
|
|
7817
7793
|
};
|
|
7818
|
-
if (columnOpts.drag && columnDragOpts.animation) {
|
|
7794
|
+
if (!isColLoading && columnOpts.drag && columnDragOpts.animation) {
|
|
7819
7795
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(external_commonjs_vue_commonjs2_vue_root_Vue_.TransitionGroup, {
|
|
7820
7796
|
key: $rowIndex,
|
|
7821
7797
|
name: `vxe-header--col-list${isDragColMove ? '' : '-disabled'}`,
|
|
@@ -8002,10 +7978,10 @@ const {
|
|
|
8002
7978
|
type: [Boolean, String],
|
|
8003
7979
|
default: () => props_getConfig().table.border
|
|
8004
7980
|
},
|
|
8005
|
-
//
|
|
7981
|
+
// 已废弃,被 cell-config.padding 替换
|
|
8006
7982
|
padding: {
|
|
8007
7983
|
type: Boolean,
|
|
8008
|
-
default:
|
|
7984
|
+
default: null
|
|
8009
7985
|
},
|
|
8010
7986
|
// 是否圆角边框
|
|
8011
7987
|
round: {
|
|
@@ -8054,12 +8030,18 @@ const {
|
|
|
8054
8030
|
type: Boolean,
|
|
8055
8031
|
default: () => props_getConfig().table.highlightHoverRow
|
|
8056
8032
|
},
|
|
8057
|
-
|
|
8033
|
+
/**
|
|
8034
|
+
* (即将废弃)是否要高亮当前选中列
|
|
8035
|
+
* @deprecated
|
|
8036
|
+
*/
|
|
8058
8037
|
highlightCurrentColumn: {
|
|
8059
8038
|
type: Boolean,
|
|
8060
8039
|
default: () => props_getConfig().table.highlightCurrentColumn
|
|
8061
8040
|
},
|
|
8062
|
-
|
|
8041
|
+
/**
|
|
8042
|
+
* (即将废弃)鼠标移到列是否要高亮显示
|
|
8043
|
+
* @deprecated
|
|
8044
|
+
*/
|
|
8063
8045
|
highlightHoverColumn: {
|
|
8064
8046
|
type: Boolean,
|
|
8065
8047
|
default: () => props_getConfig().table.highlightHoverColumn
|
|
@@ -8151,6 +8133,10 @@ const {
|
|
|
8151
8133
|
columnConfig: Object,
|
|
8152
8134
|
// 单元格配置信息
|
|
8153
8135
|
cellConfig: Object,
|
|
8136
|
+
// 表头单元格配置信息
|
|
8137
|
+
headerCellConfig: Object,
|
|
8138
|
+
// 表尾单元格配置信息
|
|
8139
|
+
footerCellConfig: Object,
|
|
8154
8140
|
// 行配置信息
|
|
8155
8141
|
rowConfig: Object,
|
|
8156
8142
|
// 已废弃,被 rowDragConfig 替换
|
|
@@ -8231,7 +8217,7 @@ const {
|
|
|
8231
8217
|
params: Object
|
|
8232
8218
|
});
|
|
8233
8219
|
;// ./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']);
|
|
8220
|
+
/* 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
8221
|
;// ./packages/table/module/custom/panel.ts
|
|
8236
8222
|
|
|
8237
8223
|
|
|
@@ -10342,7 +10328,6 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
10342
10328
|
computeSize
|
|
10343
10329
|
} = useFns.useSize(props);
|
|
10344
10330
|
const reactData = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.reactive)({
|
|
10345
|
-
isCalcColumn: false,
|
|
10346
10331
|
// 低性能的静态列
|
|
10347
10332
|
staticColumns: [],
|
|
10348
10333
|
// 渲染的列分组
|
|
@@ -10555,15 +10540,17 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
10555
10540
|
isFooter: false
|
|
10556
10541
|
},
|
|
10557
10542
|
scrollVMLoading: false,
|
|
10558
|
-
|
|
10543
|
+
calcCellHeightFlag: 0,
|
|
10544
|
+
resizeHeightFlag: 0,
|
|
10559
10545
|
isCustomStatus: false,
|
|
10560
10546
|
isDragRowMove: false,
|
|
10561
10547
|
dragRow: null,
|
|
10562
10548
|
isDragColMove: false,
|
|
10563
10549
|
dragCol: null,
|
|
10564
10550
|
dragTipText: '',
|
|
10565
|
-
|
|
10566
|
-
|
|
10551
|
+
isDragResize: false,
|
|
10552
|
+
isRowLoading: false,
|
|
10553
|
+
isColLoading: false
|
|
10567
10554
|
});
|
|
10568
10555
|
const internalData = {
|
|
10569
10556
|
tZindex: 0,
|
|
@@ -10637,10 +10624,6 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
10637
10624
|
fullDataRowIdData: {},
|
|
10638
10625
|
fullColumnIdData: {},
|
|
10639
10626
|
fullColumnFieldData: {},
|
|
10640
|
-
// 列选取状态
|
|
10641
|
-
columnStatusMaps: {},
|
|
10642
|
-
// 行选取状态
|
|
10643
|
-
rowStatusMaps: {},
|
|
10644
10627
|
// prevDragRow: null,
|
|
10645
10628
|
inited: false,
|
|
10646
10629
|
tooltipTimeout: null,
|
|
@@ -10668,8 +10651,8 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
10668
10651
|
const refTableRightFooter = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
10669
10652
|
const refLeftContainer = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
10670
10653
|
const refRightContainer = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
10671
|
-
const
|
|
10672
|
-
const
|
|
10654
|
+
const refColResizeBar = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
10655
|
+
const refRowResizeBar = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
10673
10656
|
const refEmptyPlaceholder = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
10674
10657
|
const refDragTipElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
10675
10658
|
const refDragRowLineElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
|
|
@@ -10768,7 +10751,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
10768
10751
|
const computeDefaultRowHeight = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
10769
10752
|
const vSize = computeSize.value;
|
|
10770
10753
|
const rowHeightMaps = computeRowHeightMaps.value;
|
|
10771
|
-
return rowHeightMaps[vSize || 'default'];
|
|
10754
|
+
return rowHeightMaps[vSize || 'default'] || 18;
|
|
10772
10755
|
});
|
|
10773
10756
|
const computeColumnOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
10774
10757
|
return Object.assign({}, table_getConfig().table.columnConfig, props.columnConfig);
|
|
@@ -10776,6 +10759,12 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
10776
10759
|
const computeCellOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
10777
10760
|
return Object.assign({}, table_getConfig().table.cellConfig, props.cellConfig);
|
|
10778
10761
|
});
|
|
10762
|
+
const computeHeaderCellOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
10763
|
+
return Object.assign({}, table_getConfig().table.headerCellConfig, props.headerCellConfig);
|
|
10764
|
+
});
|
|
10765
|
+
const computeFooterCellOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
10766
|
+
return Object.assign({}, table_getConfig().table.footerCellConfig, props.footerCellConfig);
|
|
10767
|
+
});
|
|
10779
10768
|
const computeRowOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
10780
10769
|
return Object.assign({}, table_getConfig().table.rowConfig, props.rowConfig);
|
|
10781
10770
|
});
|
|
@@ -10805,6 +10794,17 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
10805
10794
|
const computeTooltipOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
10806
10795
|
return Object.assign({}, table_getConfig().tooltip, table_getConfig().table.tooltipConfig, props.tooltipConfig);
|
|
10807
10796
|
});
|
|
10797
|
+
const computeTableTipConfig = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
10798
|
+
const {
|
|
10799
|
+
tooltipStore
|
|
10800
|
+
} = reactData;
|
|
10801
|
+
const tooltipOpts = computeTooltipOpts.value;
|
|
10802
|
+
return Object.assign({}, tooltipOpts, tooltipStore.currOpts);
|
|
10803
|
+
});
|
|
10804
|
+
const computeValidTipConfig = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
10805
|
+
const tooltipOpts = computeTooltipOpts.value;
|
|
10806
|
+
return Object.assign({}, tooltipOpts);
|
|
10807
|
+
});
|
|
10808
10808
|
const computeEditOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
|
|
10809
10809
|
return Object.assign({}, table_getConfig().table.editConfig, props.editConfig);
|
|
10810
10810
|
});
|
|
@@ -11035,8 +11035,8 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
11035
11035
|
refTableRightFooter,
|
|
11036
11036
|
refLeftContainer,
|
|
11037
11037
|
refRightContainer,
|
|
11038
|
-
|
|
11039
|
-
|
|
11038
|
+
refColResizeBar,
|
|
11039
|
+
refRowResizeBar,
|
|
11040
11040
|
refScrollXVirtualElem,
|
|
11041
11041
|
refScrollYVirtualElem,
|
|
11042
11042
|
refScrollXHandleElem,
|
|
@@ -11058,6 +11058,8 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
11058
11058
|
computeScrollYThreshold,
|
|
11059
11059
|
computeDefaultRowHeight,
|
|
11060
11060
|
computeCellOpts,
|
|
11061
|
+
computeHeaderCellOpts,
|
|
11062
|
+
computeFooterCellOpts,
|
|
11061
11063
|
computeRowOpts,
|
|
11062
11064
|
computeRowDragOpts,
|
|
11063
11065
|
computeColumnDragOpts,
|
|
@@ -11209,14 +11211,14 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
11209
11211
|
};
|
|
11210
11212
|
const computeRowHeight = () => {
|
|
11211
11213
|
const {
|
|
11212
|
-
|
|
11213
|
-
} =
|
|
11214
|
+
isAllOverflow
|
|
11215
|
+
} = reactData;
|
|
11214
11216
|
const tableHeader = refTableHeader.value;
|
|
11215
11217
|
const tableBody = refTableBody.value;
|
|
11216
11218
|
const tableBodyElem = tableBody ? tableBody.$el : null;
|
|
11217
11219
|
const defaultRowHeight = computeDefaultRowHeight.value;
|
|
11218
11220
|
let rowHeight = 0;
|
|
11219
|
-
if (
|
|
11221
|
+
if (isAllOverflow) {
|
|
11220
11222
|
if (tableBodyElem) {
|
|
11221
11223
|
const tableHeaderElem = tableHeader ? tableHeader.$el : null;
|
|
11222
11224
|
let firstTrElem;
|
|
@@ -11239,16 +11241,17 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
11239
11241
|
};
|
|
11240
11242
|
const handleVirtualYVisible = currScrollTop => {
|
|
11241
11243
|
const {
|
|
11242
|
-
|
|
11243
|
-
} = props;
|
|
11244
|
-
const {
|
|
11245
|
-
rowHeight
|
|
11244
|
+
isAllOverflow
|
|
11246
11245
|
} = reactData;
|
|
11247
11246
|
const {
|
|
11248
11247
|
elemStore,
|
|
11248
|
+
isResizeCellHeight,
|
|
11249
11249
|
afterFullData,
|
|
11250
11250
|
fullAllDataRowIdData
|
|
11251
11251
|
} = internalData;
|
|
11252
|
+
const rowOpts = computeRowOpts.value;
|
|
11253
|
+
const cellOpts = computeCellOpts.value;
|
|
11254
|
+
const defaultRowHeight = computeDefaultRowHeight.value;
|
|
11252
11255
|
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
11253
11256
|
if (bodyScrollElem) {
|
|
11254
11257
|
const clientHeight = bodyScrollElem.clientHeight;
|
|
@@ -11257,15 +11260,16 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
11257
11260
|
let toVisibleIndex = -1;
|
|
11258
11261
|
let offsetTop = 0;
|
|
11259
11262
|
let visibleSize = 0;
|
|
11260
|
-
|
|
11261
|
-
|
|
11262
|
-
|
|
11263
|
+
const isCustomCellHeight = isResizeCellHeight || cellOpts.height || rowOpts.height;
|
|
11264
|
+
if (!isCustomCellHeight && isAllOverflow) {
|
|
11265
|
+
toVisibleIndex = Math.floor(scrollTop / defaultRowHeight);
|
|
11266
|
+
visibleSize = Math.ceil(clientHeight / defaultRowHeight) + 1;
|
|
11263
11267
|
} else {
|
|
11264
11268
|
for (let rIndex = 0, rLen = afterFullData.length; rIndex < rLen; rIndex++) {
|
|
11265
11269
|
const row = afterFullData[rIndex];
|
|
11266
11270
|
const rowid = getRowid($xeTable, row);
|
|
11267
|
-
const rowRest = fullAllDataRowIdData[rowid];
|
|
11268
|
-
offsetTop += rowRest
|
|
11271
|
+
const rowRest = fullAllDataRowIdData[rowid] || {};
|
|
11272
|
+
offsetTop += rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight;
|
|
11269
11273
|
if (toVisibleIndex === -1 && scrollTop < offsetTop) {
|
|
11270
11274
|
toVisibleIndex = rIndex;
|
|
11271
11275
|
}
|
|
@@ -11656,56 +11660,40 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
11656
11660
|
internalData.customMaxHeight = calcTableHeight('maxHeight');
|
|
11657
11661
|
};
|
|
11658
11662
|
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;
|
|
11663
|
+
const cellElemList = wrapperEl.querySelectorAll(`.vxe-cell--wrapper[colid="${column.id}"]`);
|
|
11664
|
+
let leftRightPadding = 0;
|
|
11665
|
+
const firstCellEl = cellElemList[0];
|
|
11666
|
+
if (firstCellEl && firstCellEl.parentElement) {
|
|
11667
|
+
const cellStyle = getComputedStyle(firstCellEl.parentElement);
|
|
11668
|
+
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));
|
|
11669
|
+
}
|
|
11670
|
+
let colWidth = column.renderAutoWidth - leftRightPadding;
|
|
11671
|
+
for (let i = 0; i < cellElemList.length; i++) {
|
|
11672
|
+
const celEl = cellElemList[i];
|
|
11673
|
+
colWidth = Math.max(colWidth, celEl ? Math.ceil(celEl.scrollWidth) + 4 : 0);
|
|
11674
|
+
}
|
|
11675
|
+
return colWidth + leftRightPadding;
|
|
11686
11676
|
};
|
|
11687
11677
|
const calcCellWidth = () => {
|
|
11688
11678
|
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
|
-
});
|
|
11679
|
+
const {
|
|
11680
|
+
fullColumnIdData
|
|
11681
|
+
} = internalData;
|
|
11682
|
+
const el = refElem.value;
|
|
11683
|
+
if (el) {
|
|
11684
|
+
el.setAttribute('data-calc-col', 'Y');
|
|
11685
|
+
autoWidthColumnList.forEach(column => {
|
|
11686
|
+
const colid = column.id;
|
|
11687
|
+
const colRest = fullColumnIdData[colid];
|
|
11688
|
+
const colWidth = calcColumnAutoWidth(column, el);
|
|
11689
|
+
if (colRest) {
|
|
11690
|
+
colRest.width = Math.max(colWidth, colRest.width);
|
|
11691
|
+
}
|
|
11692
|
+
column.renderAutoWidth = colWidth;
|
|
11693
|
+
});
|
|
11694
|
+
$xeTable.analyColumnWidth();
|
|
11695
|
+
el.removeAttribute('data-calc-col');
|
|
11696
|
+
}
|
|
11709
11697
|
};
|
|
11710
11698
|
/**
|
|
11711
11699
|
* 列宽算法,计算单元格列宽,动态分配可用剩余空间
|
|
@@ -11761,39 +11749,39 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
11761
11749
|
});
|
|
11762
11750
|
// 最小自适应
|
|
11763
11751
|
autoMinList.forEach(column => {
|
|
11764
|
-
const
|
|
11765
|
-
tableWidth +=
|
|
11766
|
-
column.renderWidth =
|
|
11752
|
+
const caWidth = Math.max(60, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toInteger(column.renderAutoWidth));
|
|
11753
|
+
tableWidth += caWidth;
|
|
11754
|
+
column.renderWidth = caWidth;
|
|
11767
11755
|
});
|
|
11768
11756
|
// 最小百分比
|
|
11769
11757
|
scaleMinList.forEach(column => {
|
|
11770
|
-
const
|
|
11771
|
-
tableWidth +=
|
|
11772
|
-
column.renderWidth =
|
|
11758
|
+
const smWidth = Math.floor(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toInteger(column.minWidth) * meanWidth);
|
|
11759
|
+
tableWidth += smWidth;
|
|
11760
|
+
column.renderWidth = smWidth;
|
|
11773
11761
|
});
|
|
11774
11762
|
// 固定百分比
|
|
11775
11763
|
scaleList.forEach(column => {
|
|
11776
|
-
const
|
|
11777
|
-
tableWidth +=
|
|
11778
|
-
column.renderWidth =
|
|
11764
|
+
const sfWidth = Math.floor(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toInteger(column.width) * meanWidth);
|
|
11765
|
+
tableWidth += sfWidth;
|
|
11766
|
+
column.renderWidth = sfWidth;
|
|
11779
11767
|
});
|
|
11780
11768
|
// 固定宽
|
|
11781
11769
|
pxList.forEach(column => {
|
|
11782
|
-
const
|
|
11783
|
-
tableWidth +=
|
|
11784
|
-
column.renderWidth =
|
|
11770
|
+
const pWidth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toInteger(column.width);
|
|
11771
|
+
tableWidth += pWidth;
|
|
11772
|
+
column.renderWidth = pWidth;
|
|
11785
11773
|
});
|
|
11786
11774
|
// 自适应宽
|
|
11787
11775
|
autoList.forEach(column => {
|
|
11788
|
-
const
|
|
11789
|
-
tableWidth +=
|
|
11790
|
-
column.renderWidth =
|
|
11776
|
+
const aWidth = Math.max(60, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toInteger(column.renderAutoWidth));
|
|
11777
|
+
tableWidth += aWidth;
|
|
11778
|
+
column.renderWidth = aWidth;
|
|
11791
11779
|
});
|
|
11792
11780
|
// 调整了列宽
|
|
11793
11781
|
resizeList.forEach(column => {
|
|
11794
|
-
const
|
|
11795
|
-
tableWidth +=
|
|
11796
|
-
column.renderWidth =
|
|
11782
|
+
const reWidth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toInteger(column.resizeWidth);
|
|
11783
|
+
tableWidth += reWidth;
|
|
11784
|
+
column.renderWidth = reWidth;
|
|
11797
11785
|
});
|
|
11798
11786
|
remainWidth -= tableWidth;
|
|
11799
11787
|
meanWidth = remainWidth > 0 ? Math.floor(remainWidth / (scaleMinList.length + pxMinList.length + autoMinList.length + remainList.length)) : 0;
|
|
@@ -11833,7 +11821,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
11833
11821
|
}
|
|
11834
11822
|
const tableHeight = bodyElem.offsetHeight;
|
|
11835
11823
|
const overflowY = yHandleEl.scrollHeight > yHandleEl.clientHeight;
|
|
11836
|
-
reactData.scrollbarWidth =
|
|
11824
|
+
reactData.scrollbarWidth = Math.max(scrollbarOpts.width || 0, yHandleEl.offsetWidth - yHandleEl.clientWidth);
|
|
11837
11825
|
reactData.overflowY = overflowY;
|
|
11838
11826
|
internalData.tableWidth = tableWidth;
|
|
11839
11827
|
internalData.tableHeight = tableHeight;
|
|
@@ -11842,7 +11830,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
11842
11830
|
const headerHeight = headerTableElem ? headerTableElem.clientHeight : 0;
|
|
11843
11831
|
const overflowX = tableWidth > bodyWidth;
|
|
11844
11832
|
const footerHeight = footerTableElem ? footerTableElem.clientHeight : 0;
|
|
11845
|
-
reactData.scrollbarHeight =
|
|
11833
|
+
reactData.scrollbarHeight = Math.max(scrollbarOpts.height || 0, xHandleEl.offsetHeight - xHandleEl.clientHeight);
|
|
11846
11834
|
internalData.headerHeight = headerHeight;
|
|
11847
11835
|
internalData.footerHeight = footerHeight;
|
|
11848
11836
|
reactData.overflowX = overflowX;
|
|
@@ -11852,64 +11840,43 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
11852
11840
|
$xeTable.checkScrolling();
|
|
11853
11841
|
}
|
|
11854
11842
|
};
|
|
11855
|
-
|
|
11856
|
-
|
|
11857
|
-
|
|
11858
|
-
|
|
11859
|
-
|
|
11860
|
-
|
|
11861
|
-
|
|
11862
|
-
|
|
11863
|
-
|
|
11864
|
-
|
|
11865
|
-
|
|
11866
|
-
|
|
11867
|
-
// }
|
|
11843
|
+
const calcCellAutoHeight = (rowRest, wrapperEl) => {
|
|
11844
|
+
const cellElemList = wrapperEl.querySelectorAll(`.vxe-cell--wrapper[rowid="${rowRest.rowid}"]`);
|
|
11845
|
+
let colHeight = rowRest.height;
|
|
11846
|
+
for (let i = 0; i < cellElemList.length; i++) {
|
|
11847
|
+
const cellElem = cellElemList[i];
|
|
11848
|
+
const tdEl = cellElem.parentElement;
|
|
11849
|
+
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));
|
|
11850
|
+
const cellHeight = cellElem ? cellElem.clientHeight : 0;
|
|
11851
|
+
colHeight = Math.max(colHeight - topBottomPadding, Math.ceil(cellHeight));
|
|
11852
|
+
}
|
|
11853
|
+
return colHeight;
|
|
11854
|
+
};
|
|
11868
11855
|
const calcCellHeight = () => {
|
|
11869
|
-
const {
|
|
11870
|
-
showOverflow
|
|
11871
|
-
} = props;
|
|
11872
11856
|
const {
|
|
11873
11857
|
tableData,
|
|
11858
|
+
isAllOverflow,
|
|
11859
|
+
scrollYLoad,
|
|
11874
11860
|
scrollXLoad
|
|
11875
11861
|
} = reactData;
|
|
11876
11862
|
const {
|
|
11877
11863
|
fullAllDataRowIdData
|
|
11878
11864
|
} = internalData;
|
|
11865
|
+
const defaultRowHeight = computeDefaultRowHeight.value;
|
|
11879
11866
|
const el = refElem.value;
|
|
11880
|
-
if (!
|
|
11881
|
-
|
|
11882
|
-
let paddingBottom = 0;
|
|
11883
|
-
let calcPadding = false;
|
|
11867
|
+
if (!isAllOverflow && scrollYLoad && el) {
|
|
11868
|
+
el.setAttribute('data-calc-row', 'Y');
|
|
11884
11869
|
tableData.forEach(row => {
|
|
11885
11870
|
const rowid = getRowid($xeTable, row);
|
|
11886
11871
|
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;
|
|
11872
|
+
if (rowRest) {
|
|
11873
|
+
const reHeight = calcCellAutoHeight(rowRest, el);
|
|
11874
|
+
rowRest.height = Math.max(defaultRowHeight, scrollXLoad ? Math.max(rowRest.height, reHeight) : reHeight);
|
|
11908
11875
|
}
|
|
11876
|
+
el.removeAttribute('data-calc-row');
|
|
11909
11877
|
});
|
|
11910
|
-
reactData.
|
|
11878
|
+
reactData.calcCellHeightFlag++;
|
|
11911
11879
|
}
|
|
11912
|
-
// updateCellOffset()
|
|
11913
11880
|
};
|
|
11914
11881
|
const getOrderField = column => {
|
|
11915
11882
|
const {
|
|
@@ -11963,6 +11930,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
11963
11930
|
parent: null,
|
|
11964
11931
|
level: 0,
|
|
11965
11932
|
height: 0,
|
|
11933
|
+
resizeHeight: 0,
|
|
11966
11934
|
oTop: 0
|
|
11967
11935
|
};
|
|
11968
11936
|
fullAllDataRowIdData[rowid] = rest;
|
|
@@ -12012,6 +11980,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
12012
11980
|
parent: null,
|
|
12013
11981
|
level: 0,
|
|
12014
11982
|
height: 0,
|
|
11983
|
+
resizeHeight: 0,
|
|
12015
11984
|
oTop: 0
|
|
12016
11985
|
};
|
|
12017
11986
|
fullAllDataRowIdData[rowid] = rest;
|
|
@@ -12281,7 +12250,6 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
12281
12250
|
const updateStyle = () => {
|
|
12282
12251
|
const {
|
|
12283
12252
|
border,
|
|
12284
|
-
showOverflow: allColumnOverflow,
|
|
12285
12253
|
showHeaderOverflow: allColumnHeaderOverflow,
|
|
12286
12254
|
showFooterOverflow: allColumnFooterOverflow,
|
|
12287
12255
|
mouseConfig,
|
|
@@ -12294,7 +12262,9 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
12294
12262
|
tableColumn,
|
|
12295
12263
|
scrollXLoad,
|
|
12296
12264
|
scrollYLoad,
|
|
12265
|
+
overflowX,
|
|
12297
12266
|
scrollbarWidth,
|
|
12267
|
+
overflowY,
|
|
12298
12268
|
scrollbarHeight,
|
|
12299
12269
|
columnStore,
|
|
12300
12270
|
editStore,
|
|
@@ -12318,6 +12288,8 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
12318
12288
|
return;
|
|
12319
12289
|
}
|
|
12320
12290
|
const containerList = ['main', 'left', 'right'];
|
|
12291
|
+
const osbWidth = overflowY ? scrollbarWidth : 0;
|
|
12292
|
+
const osbHeight = overflowX ? scrollbarHeight : 0;
|
|
12321
12293
|
const emptyPlaceholderElem = refEmptyPlaceholder.value;
|
|
12322
12294
|
const cellOffsetWidth = computeCellOffsetWidth.value;
|
|
12323
12295
|
const mouseOpts = computeMouseOpts.value;
|
|
@@ -12325,16 +12297,16 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
12325
12297
|
const bodyTableElem = getRefElem(elemStore['main-body-table']);
|
|
12326
12298
|
if (emptyPlaceholderElem) {
|
|
12327
12299
|
emptyPlaceholderElem.style.top = `${headerHeight}px`;
|
|
12328
|
-
emptyPlaceholderElem.style.height = bodyWrapperElem ? `${bodyWrapperElem.offsetHeight -
|
|
12300
|
+
emptyPlaceholderElem.style.height = bodyWrapperElem ? `${bodyWrapperElem.offsetHeight - osbHeight}px` : '';
|
|
12329
12301
|
}
|
|
12330
12302
|
let bodyHeight = 0;
|
|
12331
12303
|
let bodyMaxHeight = 0;
|
|
12332
|
-
const bodyMinHeight = customMinHeight - headerHeight - footerHeight -
|
|
12304
|
+
const bodyMinHeight = customMinHeight - headerHeight - footerHeight - osbHeight;
|
|
12333
12305
|
if (customMaxHeight) {
|
|
12334
|
-
bodyMaxHeight = Math.max(bodyMinHeight, customMaxHeight - headerHeight - footerHeight -
|
|
12306
|
+
bodyMaxHeight = Math.max(bodyMinHeight, customMaxHeight - headerHeight - footerHeight - osbHeight);
|
|
12335
12307
|
}
|
|
12336
12308
|
if (customHeight) {
|
|
12337
|
-
bodyHeight = customHeight - headerHeight - footerHeight -
|
|
12309
|
+
bodyHeight = customHeight - headerHeight - footerHeight - osbHeight;
|
|
12338
12310
|
}
|
|
12339
12311
|
if (!bodyHeight) {
|
|
12340
12312
|
if (bodyTableElem) {
|
|
@@ -12352,27 +12324,27 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
12352
12324
|
const scrollbarXToTop = computeScrollbarXToTop.value;
|
|
12353
12325
|
const scrollXVirtualEl = refScrollXVirtualElem.value;
|
|
12354
12326
|
if (scrollXVirtualEl) {
|
|
12355
|
-
scrollXVirtualEl.style.height = `${
|
|
12356
|
-
scrollXVirtualEl.style.visibility =
|
|
12327
|
+
scrollXVirtualEl.style.height = `${osbHeight}px`;
|
|
12328
|
+
scrollXVirtualEl.style.visibility = overflowX ? 'visible' : 'hidden';
|
|
12357
12329
|
}
|
|
12358
12330
|
const xWrapperEl = refScrollXWrapperElem.value;
|
|
12359
12331
|
if (xWrapperEl) {
|
|
12360
|
-
xWrapperEl.style.left = scrollbarXToTop ? `${
|
|
12361
|
-
xWrapperEl.style.width = `${el.clientWidth -
|
|
12332
|
+
xWrapperEl.style.left = scrollbarXToTop ? `${osbWidth}px` : '';
|
|
12333
|
+
xWrapperEl.style.width = `${el.clientWidth - osbWidth}px`;
|
|
12362
12334
|
}
|
|
12363
12335
|
if (xLeftCornerEl) {
|
|
12364
|
-
xLeftCornerEl.style.width = scrollbarXToTop ? `${
|
|
12365
|
-
xLeftCornerEl.style.display = scrollbarXToTop ?
|
|
12336
|
+
xLeftCornerEl.style.width = scrollbarXToTop ? `${osbWidth}px` : '';
|
|
12337
|
+
xLeftCornerEl.style.display = scrollbarXToTop ? osbWidth && osbHeight ? 'block' : '' : '';
|
|
12366
12338
|
}
|
|
12367
12339
|
if (xRightCornerEl) {
|
|
12368
|
-
xRightCornerEl.style.width = scrollbarXToTop ? '' : `${
|
|
12369
|
-
xRightCornerEl.style.display = scrollbarXToTop ? '' :
|
|
12340
|
+
xRightCornerEl.style.width = scrollbarXToTop ? '' : `${osbWidth}px`;
|
|
12341
|
+
xRightCornerEl.style.display = scrollbarXToTop ? '' : osbWidth && osbHeight ? 'block' : '';
|
|
12370
12342
|
}
|
|
12371
12343
|
const scrollYVirtualEl = refScrollYVirtualElem.value;
|
|
12372
12344
|
if (scrollYVirtualEl) {
|
|
12373
|
-
scrollYVirtualEl.style.width = `${
|
|
12345
|
+
scrollYVirtualEl.style.width = `${osbWidth}px`;
|
|
12374
12346
|
scrollYVirtualEl.style.height = `${bodyHeight + headerHeight + footerHeight}px`;
|
|
12375
|
-
scrollYVirtualEl.style.visibility =
|
|
12347
|
+
scrollYVirtualEl.style.visibility = overflowY ? 'visible' : 'hidden';
|
|
12376
12348
|
}
|
|
12377
12349
|
const yTopCornerEl = refScrollYTopCornerElem.value;
|
|
12378
12350
|
if (yTopCornerEl) {
|
|
@@ -12491,14 +12463,14 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
12491
12463
|
if (wrapperElem) {
|
|
12492
12464
|
wrapperElem.style.top = `${headerHeight}px`;
|
|
12493
12465
|
}
|
|
12494
|
-
fixedWrapperElem.style.height = `${customHeight > 0 ? customHeight : tableHeight + headerHeight + footerHeight +
|
|
12466
|
+
fixedWrapperElem.style.height = `${customHeight > 0 ? customHeight : tableHeight + headerHeight + footerHeight + osbHeight}px`;
|
|
12495
12467
|
fixedWrapperElem.style.width = `${fixedColumn.reduce((previous, column) => previous + column.renderWidth, 0)}px`;
|
|
12496
12468
|
}
|
|
12497
12469
|
let tWidth = tableWidth;
|
|
12498
12470
|
let renderColumnList = tableColumn;
|
|
12499
12471
|
let isOptimizeMode = false;
|
|
12500
12472
|
// 如果是使用优化模式
|
|
12501
|
-
if (scrollXLoad || scrollYLoad ||
|
|
12473
|
+
if (scrollXLoad || scrollYLoad || isAllOverflow) {
|
|
12502
12474
|
if (expandColumn || spanMethod || footerSpanMethod) {
|
|
12503
12475
|
// 如果不支持优化模式
|
|
12504
12476
|
} else {
|
|
@@ -12520,7 +12492,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
12520
12492
|
if (tableElem) {
|
|
12521
12493
|
tableElem.style.width = tWidth ? `${tWidth}px` : '';
|
|
12522
12494
|
// 兼容性处理
|
|
12523
|
-
tableElem.style.paddingRight =
|
|
12495
|
+
tableElem.style.paddingRight = osbWidth && fixedType && (browse['-moz'] || browse.safari) ? `${osbWidth}px` : '';
|
|
12524
12496
|
}
|
|
12525
12497
|
const emptyBlockElem = getRefElem(elemStore[`${name}-${layout}-emptyBlock`]);
|
|
12526
12498
|
if (emptyBlockElem) {
|
|
@@ -12555,7 +12527,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
12555
12527
|
// 如果是固定列
|
|
12556
12528
|
if (fixedWrapperElem) {
|
|
12557
12529
|
if (wrapperElem) {
|
|
12558
|
-
wrapperElem.style.top = `${customHeight > 0 ? customHeight - footerHeight -
|
|
12530
|
+
wrapperElem.style.top = `${customHeight > 0 ? customHeight - footerHeight - osbHeight : tableHeight + headerHeight}px`;
|
|
12559
12531
|
}
|
|
12560
12532
|
}
|
|
12561
12533
|
}
|
|
@@ -12582,7 +12554,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
12582
12554
|
} else if (layout === 'footer') {
|
|
12583
12555
|
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
12556
|
} 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) ?
|
|
12557
|
+
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
12558
|
}
|
|
12587
12559
|
const showEllipsis = cellOverflow === 'ellipsis';
|
|
12588
12560
|
const showTitle = cellOverflow === 'title';
|
|
@@ -13282,11 +13254,10 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
13282
13254
|
* 加载表格数据
|
|
13283
13255
|
* @param {Array} datas 数据
|
|
13284
13256
|
*/
|
|
13285
|
-
const loadTableData = datas => {
|
|
13257
|
+
const loadTableData = (datas, isReset) => {
|
|
13286
13258
|
const {
|
|
13287
13259
|
keepSource,
|
|
13288
|
-
treeConfig
|
|
13289
|
-
showOverflow
|
|
13260
|
+
treeConfig
|
|
13290
13261
|
} = props;
|
|
13291
13262
|
const {
|
|
13292
13263
|
editStore,
|
|
@@ -13299,7 +13270,6 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
13299
13270
|
lastScrollTop
|
|
13300
13271
|
} = internalData;
|
|
13301
13272
|
const treeOpts = computeTreeOpts.value;
|
|
13302
|
-
const rowOpts = computeRowOpts.value;
|
|
13303
13273
|
const {
|
|
13304
13274
|
transform
|
|
13305
13275
|
} = treeOpts;
|
|
@@ -13346,42 +13316,30 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
13346
13316
|
scrollYStore.endIndex = 1;
|
|
13347
13317
|
scrollXStore.startIndex = 0;
|
|
13348
13318
|
scrollXStore.endIndex = 1;
|
|
13319
|
+
reactData.isRowLoading = true;
|
|
13349
13320
|
reactData.scrollVMLoading = false;
|
|
13350
13321
|
editStore.insertMaps = {};
|
|
13351
13322
|
editStore.removeMaps = {};
|
|
13352
13323
|
const sYLoad = updateScrollYStatus(fullData);
|
|
13324
|
+
reactData.isDragColMove = false;
|
|
13353
13325
|
reactData.isDragRowMove = false;
|
|
13354
13326
|
// 全量数据
|
|
13355
13327
|
internalData.tableFullData = fullData;
|
|
13356
13328
|
internalData.tableFullTreeData = treeData;
|
|
13357
13329
|
// 缓存数据
|
|
13358
|
-
|
|
13330
|
+
$xeTable.cacheRowMap(true, isReset);
|
|
13359
13331
|
// 原始数据
|
|
13360
13332
|
internalData.tableSynchData = datas;
|
|
13333
|
+
if (isReset) {
|
|
13334
|
+
internalData.isResizeCellHeight = false;
|
|
13335
|
+
reactData.rowExpandedMaps = {};
|
|
13336
|
+
reactData.rowExpandLazyLoadedMaps = {};
|
|
13337
|
+
reactData.treeExpandedMaps = {};
|
|
13338
|
+
reactData.treeExpandLazyLoadedMaps = {};
|
|
13339
|
+
}
|
|
13361
13340
|
// 克隆原数据,用于显示编辑状态,与编辑值做对比
|
|
13362
13341
|
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
|
-
}
|
|
13342
|
+
$xeTable.cacheSourceMap(fullData);
|
|
13385
13343
|
}
|
|
13386
13344
|
if ($xeTable.clearCellAreas && props.mouseConfig) {
|
|
13387
13345
|
$xeTable.clearCellAreas();
|
|
@@ -13401,6 +13359,27 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
13401
13359
|
if (sYLoad) {
|
|
13402
13360
|
scrollYStore.endIndex = scrollYStore.visibleSize;
|
|
13403
13361
|
}
|
|
13362
|
+
if (sYLoad) {
|
|
13363
|
+
// if (showOverflow) {
|
|
13364
|
+
// if (!rowOpts.height) {
|
|
13365
|
+
// const errColumn = internalData.tableFullColumn.find(column => column.showOverflow === false)
|
|
13366
|
+
// if (errColumn) {
|
|
13367
|
+
// errLog('vxe.error.errProp', [`column[field="${errColumn.field}"].show-overflow=false`, 'show-overflow=true'])
|
|
13368
|
+
// }
|
|
13369
|
+
// }
|
|
13370
|
+
// }
|
|
13371
|
+
if (true) {
|
|
13372
|
+
if (!(props.height || props.maxHeight)) {
|
|
13373
|
+
errLog('vxe.error.reqProp', ['table.height | table.max-height | table.scroll-y={enabled: false}']);
|
|
13374
|
+
}
|
|
13375
|
+
// if (!props.showOverflow) {
|
|
13376
|
+
// warnLog('vxe.error.reqProp', ['table.show-overflow'])
|
|
13377
|
+
// }
|
|
13378
|
+
if (props.spanMethod) {
|
|
13379
|
+
warnLog('vxe.error.scrollErrProp', ['table.span-method']);
|
|
13380
|
+
}
|
|
13381
|
+
}
|
|
13382
|
+
}
|
|
13404
13383
|
handleReserveStatus();
|
|
13405
13384
|
tablePrivateMethods.checkSelectionStatus();
|
|
13406
13385
|
return new Promise(resolve => {
|
|
@@ -13416,6 +13395,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
13416
13395
|
if (sYOpts.scrollToTopOnChange) {
|
|
13417
13396
|
targetScrollTop = 0;
|
|
13418
13397
|
}
|
|
13398
|
+
reactData.isRowLoading = false;
|
|
13419
13399
|
calcCellHeight();
|
|
13420
13400
|
// 是否变更虚拟滚动
|
|
13421
13401
|
if (oldScrollYLoad === sYLoad) {
|
|
@@ -13679,11 +13659,10 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
13679
13659
|
internalData.collectColumn = collectColumn;
|
|
13680
13660
|
const tableFullColumn = getColumnList(collectColumn);
|
|
13681
13661
|
internalData.tableFullColumn = tableFullColumn;
|
|
13682
|
-
reactData.
|
|
13662
|
+
reactData.isColLoading = true;
|
|
13683
13663
|
reactData.isDragColMove = false;
|
|
13684
13664
|
initColumnSort();
|
|
13685
13665
|
return Promise.resolve(restoreCustomStorage()).then(() => {
|
|
13686
|
-
reactData.isLoading = false;
|
|
13687
13666
|
cacheColumnMap();
|
|
13688
13667
|
parseColumns(true).then(() => {
|
|
13689
13668
|
if (reactData.scrollXLoad) {
|
|
@@ -13708,6 +13687,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
13708
13687
|
if ($xeTable.handleUpdateCustomColumn) {
|
|
13709
13688
|
$xeTable.handleUpdateCustomColumn();
|
|
13710
13689
|
}
|
|
13690
|
+
reactData.isColLoading = false;
|
|
13711
13691
|
return $xeTable.recalculate();
|
|
13712
13692
|
});
|
|
13713
13693
|
});
|
|
@@ -13851,10 +13831,8 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
13851
13831
|
*/
|
|
13852
13832
|
const loadScrollYData = scrollTop => {
|
|
13853
13833
|
const {
|
|
13854
|
-
|
|
13855
|
-
|
|
13856
|
-
const {
|
|
13857
|
-
mergeList
|
|
13834
|
+
mergeList,
|
|
13835
|
+
isAllOverflow
|
|
13858
13836
|
} = reactData;
|
|
13859
13837
|
const {
|
|
13860
13838
|
scrollYStore
|
|
@@ -13865,7 +13843,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
13865
13843
|
endIndex,
|
|
13866
13844
|
offsetSize
|
|
13867
13845
|
} = scrollYStore;
|
|
13868
|
-
const autoOffsetYSize =
|
|
13846
|
+
const autoOffsetYSize = isAllOverflow ? offsetSize : offsetSize + 1;
|
|
13869
13847
|
const {
|
|
13870
13848
|
toVisibleIndex,
|
|
13871
13849
|
visibleSize
|
|
@@ -13927,7 +13905,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
13927
13905
|
const {
|
|
13928
13906
|
visibleSize
|
|
13929
13907
|
} = scrollXStore;
|
|
13930
|
-
const fpsTime = Math.max(5, Math.min(
|
|
13908
|
+
const fpsTime = Math.max(5, Math.min(10, Math.floor(visibleSize / 3)));
|
|
13931
13909
|
if (lxTimeout) {
|
|
13932
13910
|
clearTimeout(lxTimeout);
|
|
13933
13911
|
}
|
|
@@ -13944,9 +13922,13 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
13944
13922
|
const lazyScrollYData = () => {
|
|
13945
13923
|
const {
|
|
13946
13924
|
lyTimeout,
|
|
13947
|
-
lyRunTime
|
|
13925
|
+
lyRunTime,
|
|
13926
|
+
scrollYStore
|
|
13948
13927
|
} = internalData;
|
|
13949
|
-
const
|
|
13928
|
+
const {
|
|
13929
|
+
visibleSize
|
|
13930
|
+
} = scrollYStore;
|
|
13931
|
+
const fpsTime = Math.floor(Math.max(4, Math.min(10, visibleSize / 3)));
|
|
13950
13932
|
if (lyTimeout) {
|
|
13951
13933
|
clearTimeout(lyTimeout);
|
|
13952
13934
|
}
|
|
@@ -13974,6 +13956,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
13974
13956
|
internalData.lcsTimeout = setTimeout(() => {
|
|
13975
13957
|
internalData.lcsRunTime = Date.now();
|
|
13976
13958
|
internalData.lcsTimeout = undefined;
|
|
13959
|
+
internalData.intoRunScroll = false;
|
|
13977
13960
|
internalData.inVirtualScroll = false;
|
|
13978
13961
|
internalData.inWheelScroll = false;
|
|
13979
13962
|
internalData.inHeaderScroll = false;
|
|
@@ -13993,6 +13976,43 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
13993
13976
|
$xeTable.updateCellAreas();
|
|
13994
13977
|
}, 200);
|
|
13995
13978
|
};
|
|
13979
|
+
const getWheelSpeed = lastScrollTime => {
|
|
13980
|
+
let multiple = 1;
|
|
13981
|
+
const currTime = Date.now();
|
|
13982
|
+
if (lastScrollTime + 25 > currTime) {
|
|
13983
|
+
multiple = 1.18;
|
|
13984
|
+
} else if (lastScrollTime + 30 > currTime) {
|
|
13985
|
+
multiple = 1.15;
|
|
13986
|
+
} else if (lastScrollTime + 40 > currTime) {
|
|
13987
|
+
multiple = 1.12;
|
|
13988
|
+
} else if (lastScrollTime + 55 > currTime) {
|
|
13989
|
+
multiple = 1.09;
|
|
13990
|
+
} else if (lastScrollTime + 75 > currTime) {
|
|
13991
|
+
multiple = 1.06;
|
|
13992
|
+
} else if (lastScrollTime + 100 > currTime) {
|
|
13993
|
+
multiple = 1.03;
|
|
13994
|
+
}
|
|
13995
|
+
return multiple;
|
|
13996
|
+
};
|
|
13997
|
+
const wheelScrollTo = (diffNum, cb) => {
|
|
13998
|
+
const duration = Math.abs(diffNum);
|
|
13999
|
+
const startTime = performance.now();
|
|
14000
|
+
let countTop = 0;
|
|
14001
|
+
const step = timestamp => {
|
|
14002
|
+
let progress = (timestamp - startTime) / duration;
|
|
14003
|
+
if (progress > 1) {
|
|
14004
|
+
progress = 1;
|
|
14005
|
+
}
|
|
14006
|
+
const easedProgress = Math.pow(progress, 2);
|
|
14007
|
+
const offsetTop = Math.floor(diffNum * easedProgress) - countTop;
|
|
14008
|
+
countTop += offsetTop;
|
|
14009
|
+
cb(offsetTop);
|
|
14010
|
+
if (progress < 1) {
|
|
14011
|
+
requestAnimationFrame(step);
|
|
14012
|
+
}
|
|
14013
|
+
};
|
|
14014
|
+
requestAnimationFrame(step);
|
|
14015
|
+
};
|
|
13996
14016
|
const dispatchEvent = (type, params, evnt) => {
|
|
13997
14017
|
emit(type, createEvent(evnt, {
|
|
13998
14018
|
$table: $xeTable,
|
|
@@ -14009,12 +14029,31 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
14009
14029
|
}
|
|
14010
14030
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
14011
14031
|
};
|
|
14012
|
-
|
|
14032
|
+
const handleUpdateResize = () => {
|
|
14013
14033
|
const el = refElem.value;
|
|
14014
14034
|
if (el && el.clientWidth && el.clientHeight) {
|
|
14015
14035
|
tableMethods.recalculate();
|
|
14016
14036
|
}
|
|
14017
|
-
}
|
|
14037
|
+
};
|
|
14038
|
+
const handleUpdateColResize = (evnt, params) => {
|
|
14039
|
+
$xeTable.analyColumnWidth();
|
|
14040
|
+
$xeTable.recalculate(true).then(() => {
|
|
14041
|
+
$xeTable.saveCustomStore('update:width');
|
|
14042
|
+
$xeTable.updateCellAreas();
|
|
14043
|
+
$xeTable.dispatchEvent('column-resizable-change', params, evnt);
|
|
14044
|
+
// 已废弃 resizable-change
|
|
14045
|
+
$xeTable.dispatchEvent('resizable-change', params, evnt);
|
|
14046
|
+
setTimeout(() => $xeTable.recalculate(true), 300);
|
|
14047
|
+
});
|
|
14048
|
+
};
|
|
14049
|
+
const handleUpdateRowResize = (evnt, params) => {
|
|
14050
|
+
reactData.resizeHeightFlag++;
|
|
14051
|
+
$xeTable.recalculate(true).then(() => {
|
|
14052
|
+
$xeTable.updateCellAreas();
|
|
14053
|
+
$xeTable.dispatchEvent('row-resizable-change', params, evnt);
|
|
14054
|
+
setTimeout(() => $xeTable.recalculate(true), 300);
|
|
14055
|
+
});
|
|
14056
|
+
};
|
|
14018
14057
|
tableMethods = {
|
|
14019
14058
|
dispatchEvent,
|
|
14020
14059
|
/**
|
|
@@ -14072,7 +14111,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
14072
14111
|
const {
|
|
14073
14112
|
initStatus
|
|
14074
14113
|
} = internalData;
|
|
14075
|
-
return loadTableData(datas).then(() => {
|
|
14114
|
+
return loadTableData(datas, false).then(() => {
|
|
14076
14115
|
internalData.inited = true;
|
|
14077
14116
|
internalData.initStatus = true;
|
|
14078
14117
|
if (!initStatus) {
|
|
@@ -14089,7 +14128,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
14089
14128
|
return tableMethods.clearAll().then(() => {
|
|
14090
14129
|
internalData.inited = true;
|
|
14091
14130
|
internalData.initStatus = true;
|
|
14092
|
-
return loadTableData(datas);
|
|
14131
|
+
return loadTableData(datas, true);
|
|
14093
14132
|
}).then(() => {
|
|
14094
14133
|
handleLoadDefaults();
|
|
14095
14134
|
return tableMethods.recalculate();
|
|
@@ -14208,6 +14247,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
14208
14247
|
parent: parentRow,
|
|
14209
14248
|
level: parentLevel + nodes.length,
|
|
14210
14249
|
height: 0,
|
|
14250
|
+
resizeHeight: 0,
|
|
14211
14251
|
oTop: 0
|
|
14212
14252
|
};
|
|
14213
14253
|
fullDataRowIdData[rowid] = rest;
|
|
@@ -14448,29 +14488,32 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
14448
14488
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
14449
14489
|
},
|
|
14450
14490
|
getCellElement(row, fieldOrColumn) {
|
|
14491
|
+
const {
|
|
14492
|
+
elemStore
|
|
14493
|
+
} = internalData;
|
|
14451
14494
|
const column = handleFieldOrColumn($xeTable, fieldOrColumn);
|
|
14452
14495
|
if (!column) {
|
|
14453
14496
|
return null;
|
|
14454
14497
|
}
|
|
14455
14498
|
const rowid = getRowid($xeTable, row);
|
|
14456
|
-
const
|
|
14457
|
-
const
|
|
14458
|
-
const
|
|
14499
|
+
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
14500
|
+
const leftScrollElem = getRefElem(elemStore['left-body-scroll']);
|
|
14501
|
+
const rightScrollElem = getRefElem(elemStore['right-body-scroll']);
|
|
14459
14502
|
let bodyElem;
|
|
14460
14503
|
if (column) {
|
|
14461
14504
|
if (column.fixed) {
|
|
14462
14505
|
if (column.fixed === 'left') {
|
|
14463
|
-
if (
|
|
14464
|
-
bodyElem =
|
|
14506
|
+
if (leftScrollElem) {
|
|
14507
|
+
bodyElem = leftScrollElem;
|
|
14465
14508
|
}
|
|
14466
14509
|
} else {
|
|
14467
|
-
if (
|
|
14468
|
-
bodyElem =
|
|
14510
|
+
if (rightScrollElem) {
|
|
14511
|
+
bodyElem = rightScrollElem;
|
|
14469
14512
|
}
|
|
14470
14513
|
}
|
|
14471
14514
|
}
|
|
14472
14515
|
if (!bodyElem) {
|
|
14473
|
-
bodyElem =
|
|
14516
|
+
bodyElem = bodyScrollElem;
|
|
14474
14517
|
}
|
|
14475
14518
|
if (bodyElem) {
|
|
14476
14519
|
return bodyElem.querySelector(`.vxe-body--row[rowid="${rowid}"] .${column.id}`);
|
|
@@ -14943,29 +14986,40 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
14943
14986
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
14944
14987
|
},
|
|
14945
14988
|
setColumnWidth(fieldOrColumn, width) {
|
|
14989
|
+
const {
|
|
14990
|
+
elemStore
|
|
14991
|
+
} = internalData;
|
|
14946
14992
|
let status = false;
|
|
14947
14993
|
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
|
-
|
|
14994
|
+
let cWidth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toInteger(width);
|
|
14995
|
+
if (isScale(width)) {
|
|
14996
|
+
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
14997
|
+
const bodyWidth = bodyScrollElem ? bodyScrollElem.clientWidth - 1 : 0;
|
|
14998
|
+
cWidth = Math.floor(cWidth * bodyWidth);
|
|
14999
|
+
}
|
|
15000
|
+
if (cWidth) {
|
|
15001
|
+
cols.forEach(item => {
|
|
15002
|
+
const column = handleFieldOrColumn($xeTable, item);
|
|
15003
|
+
if (column) {
|
|
15004
|
+
column.resizeWidth = cWidth;
|
|
15005
|
+
if (!status) {
|
|
15006
|
+
status = true;
|
|
15007
|
+
}
|
|
14962
15008
|
}
|
|
15009
|
+
});
|
|
15010
|
+
if (status) {
|
|
15011
|
+
return $xeTable.refreshColumn().then(() => {
|
|
15012
|
+
return {
|
|
15013
|
+
status
|
|
15014
|
+
};
|
|
15015
|
+
});
|
|
14963
15016
|
}
|
|
14964
|
-
});
|
|
14965
|
-
if (status) {
|
|
14966
|
-
return tableMethods.refreshColumn();
|
|
14967
15017
|
}
|
|
14968
|
-
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)()
|
|
15018
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(() => {
|
|
15019
|
+
return {
|
|
15020
|
+
status
|
|
15021
|
+
};
|
|
15022
|
+
});
|
|
14969
15023
|
},
|
|
14970
15024
|
getColumnWidth(fieldOrColumn) {
|
|
14971
15025
|
const column = handleFieldOrColumn($xeTable, fieldOrColumn);
|
|
@@ -14998,6 +15052,106 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
14998
15052
|
return tableMethods.recalculate();
|
|
14999
15053
|
});
|
|
15000
15054
|
},
|
|
15055
|
+
setRowHeightConf(heightConf) {
|
|
15056
|
+
const {
|
|
15057
|
+
fullAllDataRowIdData
|
|
15058
|
+
} = internalData;
|
|
15059
|
+
let status = false;
|
|
15060
|
+
if (heightConf) {
|
|
15061
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(heightConf, (height, rowid) => {
|
|
15062
|
+
const rowRest = fullAllDataRowIdData[rowid];
|
|
15063
|
+
if (rowRest) {
|
|
15064
|
+
const rHeight = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toInteger(height);
|
|
15065
|
+
if (rHeight) {
|
|
15066
|
+
rowRest.resizeHeight = rHeight;
|
|
15067
|
+
if (!status) {
|
|
15068
|
+
status = true;
|
|
15069
|
+
}
|
|
15070
|
+
}
|
|
15071
|
+
}
|
|
15072
|
+
});
|
|
15073
|
+
if (status) {
|
|
15074
|
+
internalData.isResizeCellHeight = true;
|
|
15075
|
+
reactData.resizeHeightFlag++;
|
|
15076
|
+
}
|
|
15077
|
+
}
|
|
15078
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(() => {
|
|
15079
|
+
return {
|
|
15080
|
+
status
|
|
15081
|
+
};
|
|
15082
|
+
});
|
|
15083
|
+
},
|
|
15084
|
+
getRowHeightConf(isFull) {
|
|
15085
|
+
const {
|
|
15086
|
+
fullAllDataRowIdData,
|
|
15087
|
+
afterFullData
|
|
15088
|
+
} = internalData;
|
|
15089
|
+
const rowOpts = computeRowOpts.value;
|
|
15090
|
+
const cellOpts = computeCellOpts.value;
|
|
15091
|
+
const defaultRowHeight = computeDefaultRowHeight.value;
|
|
15092
|
+
const rest = {};
|
|
15093
|
+
afterFullData.forEach(row => {
|
|
15094
|
+
const rowid = getRowid($xeTable, row);
|
|
15095
|
+
const rowRest = fullAllDataRowIdData[rowid];
|
|
15096
|
+
if (rowRest) {
|
|
15097
|
+
const resizeHeight = rowRest.resizeHeight;
|
|
15098
|
+
if (resizeHeight || isFull) {
|
|
15099
|
+
const currCellHeight = resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight;
|
|
15100
|
+
rest[rowid] = currCellHeight;
|
|
15101
|
+
}
|
|
15102
|
+
}
|
|
15103
|
+
});
|
|
15104
|
+
return rest;
|
|
15105
|
+
},
|
|
15106
|
+
setRowHeight(rowOrId, height) {
|
|
15107
|
+
const {
|
|
15108
|
+
fullAllDataRowIdData
|
|
15109
|
+
} = internalData;
|
|
15110
|
+
let status = false;
|
|
15111
|
+
const rows = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(rowOrId) ? rowOrId : [rowOrId];
|
|
15112
|
+
let rHeight = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toInteger(height);
|
|
15113
|
+
if (isScale(height)) {
|
|
15114
|
+
const tableBody = refTableBody.value;
|
|
15115
|
+
const bodyElem = tableBody ? tableBody.$el : null;
|
|
15116
|
+
const bodyHeight = bodyElem ? bodyElem.clientHeight - 1 : 0;
|
|
15117
|
+
rHeight = Math.floor(rHeight * bodyHeight);
|
|
15118
|
+
}
|
|
15119
|
+
if (rHeight) {
|
|
15120
|
+
rows.forEach(row => {
|
|
15121
|
+
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);
|
|
15122
|
+
const rowRest = fullAllDataRowIdData[rowid];
|
|
15123
|
+
if (rowRest) {
|
|
15124
|
+
rowRest.resizeHeight = rHeight;
|
|
15125
|
+
if (!status) {
|
|
15126
|
+
status = true;
|
|
15127
|
+
}
|
|
15128
|
+
}
|
|
15129
|
+
});
|
|
15130
|
+
if (status) {
|
|
15131
|
+
internalData.isResizeCellHeight = true;
|
|
15132
|
+
reactData.resizeHeightFlag++;
|
|
15133
|
+
}
|
|
15134
|
+
}
|
|
15135
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(() => {
|
|
15136
|
+
return {
|
|
15137
|
+
status
|
|
15138
|
+
};
|
|
15139
|
+
});
|
|
15140
|
+
},
|
|
15141
|
+
getRowHeight(rowOrId) {
|
|
15142
|
+
const {
|
|
15143
|
+
fullAllDataRowIdData
|
|
15144
|
+
} = internalData;
|
|
15145
|
+
const rowOpts = computeRowOpts.value;
|
|
15146
|
+
const cellOpts = computeCellOpts.value;
|
|
15147
|
+
const defaultRowHeight = computeDefaultRowHeight.value;
|
|
15148
|
+
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);
|
|
15149
|
+
const rowRest = fullAllDataRowIdData[rowid];
|
|
15150
|
+
if (rowRest) {
|
|
15151
|
+
return rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight;
|
|
15152
|
+
}
|
|
15153
|
+
return 0;
|
|
15154
|
+
},
|
|
15001
15155
|
/**
|
|
15002
15156
|
* 刷新滚动操作,手动同步滚动相关位置(对于某些特殊的操作,比如滚动条错位、固定列不同步)
|
|
15003
15157
|
*/
|
|
@@ -16208,13 +16362,15 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
16208
16362
|
scrollXLoad,
|
|
16209
16363
|
scrollYLoad
|
|
16210
16364
|
} = reactData;
|
|
16211
|
-
const
|
|
16212
|
-
|
|
16365
|
+
const {
|
|
16366
|
+
elemStore
|
|
16367
|
+
} = internalData;
|
|
16368
|
+
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
16213
16369
|
return {
|
|
16214
16370
|
virtualX: scrollXLoad,
|
|
16215
16371
|
virtualY: scrollYLoad,
|
|
16216
|
-
scrollTop:
|
|
16217
|
-
scrollLeft:
|
|
16372
|
+
scrollTop: bodyScrollElem ? bodyScrollElem.scrollTop : 0,
|
|
16373
|
+
scrollLeft: bodyScrollElem ? bodyScrollElem.scrollLeft : 0
|
|
16218
16374
|
};
|
|
16219
16375
|
},
|
|
16220
16376
|
/**
|
|
@@ -16265,9 +16421,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
16265
16421
|
*/
|
|
16266
16422
|
scrollToRow(row, fieldOrColumn) {
|
|
16267
16423
|
const {
|
|
16268
|
-
|
|
16269
|
-
} = props;
|
|
16270
|
-
const {
|
|
16424
|
+
isAllOverflow,
|
|
16271
16425
|
scrollYLoad,
|
|
16272
16426
|
scrollXLoad
|
|
16273
16427
|
} = reactData;
|
|
@@ -16284,7 +16438,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
16284
16438
|
}
|
|
16285
16439
|
return Promise.all(rest).then(() => {
|
|
16286
16440
|
if (row) {
|
|
16287
|
-
if (!
|
|
16441
|
+
if (!isAllOverflow && (scrollYLoad || scrollXLoad)) {
|
|
16288
16442
|
calcCellHeight();
|
|
16289
16443
|
calcCellWidth();
|
|
16290
16444
|
}
|
|
@@ -17354,13 +17508,17 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
17354
17508
|
return;
|
|
17355
17509
|
}
|
|
17356
17510
|
const {
|
|
17511
|
+
overflowX,
|
|
17357
17512
|
scrollbarWidth,
|
|
17513
|
+
overflowY,
|
|
17358
17514
|
scrollbarHeight
|
|
17359
17515
|
} = reactData;
|
|
17360
17516
|
const {
|
|
17361
17517
|
prevDragToChild
|
|
17362
17518
|
} = internalData;
|
|
17363
17519
|
const wrapperRect = el.getBoundingClientRect();
|
|
17520
|
+
const osbWidth = overflowY ? scrollbarWidth : 0;
|
|
17521
|
+
const osbHeight = overflowX ? scrollbarHeight : 0;
|
|
17364
17522
|
const tableWidth = el.clientWidth;
|
|
17365
17523
|
const tableHeight = el.clientHeight;
|
|
17366
17524
|
if (trEl) {
|
|
@@ -17371,14 +17529,14 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
17371
17529
|
const trRect = trEl.getBoundingClientRect();
|
|
17372
17530
|
let trHeight = trEl.clientHeight;
|
|
17373
17531
|
const offsetTop = Math.max(1, trRect.y - wrapperRect.y);
|
|
17374
|
-
if (offsetTop + trHeight > tableHeight -
|
|
17375
|
-
trHeight = tableHeight - offsetTop -
|
|
17532
|
+
if (offsetTop + trHeight > tableHeight - osbHeight) {
|
|
17533
|
+
trHeight = tableHeight - offsetTop - osbHeight;
|
|
17376
17534
|
}
|
|
17377
17535
|
rdLineEl.style.display = 'block';
|
|
17378
|
-
rdLineEl.style.left = `${scrollbarYToLeft ?
|
|
17536
|
+
rdLineEl.style.left = `${scrollbarYToLeft ? osbWidth : 0}px`;
|
|
17379
17537
|
rdLineEl.style.top = `${offsetTop}px`;
|
|
17380
17538
|
rdLineEl.style.height = `${trHeight}px`;
|
|
17381
|
-
rdLineEl.style.width = `${tableWidth -
|
|
17539
|
+
rdLineEl.style.width = `${tableWidth - osbWidth}px`;
|
|
17382
17540
|
rdLineEl.setAttribute('drag-pos', dragPos);
|
|
17383
17541
|
rdLineEl.setAttribute('drag-to-child', prevDragToChild ? 'y' : 'n');
|
|
17384
17542
|
} else {
|
|
@@ -17403,7 +17561,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
17403
17561
|
thWidth -= startX - offsetLeft;
|
|
17404
17562
|
offsetLeft = startX;
|
|
17405
17563
|
}
|
|
17406
|
-
const endX = tableWidth - rightContainerWidth - (rightContainerWidth ? 0 :
|
|
17564
|
+
const endX = tableWidth - rightContainerWidth - (rightContainerWidth ? 0 : osbWidth);
|
|
17407
17565
|
if (offsetLeft + thWidth > endX) {
|
|
17408
17566
|
thWidth = endX - offsetLeft;
|
|
17409
17567
|
}
|
|
@@ -17414,7 +17572,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
17414
17572
|
if (prevDragToChild) {
|
|
17415
17573
|
cdLineEl.style.height = `${thRect.height}px`;
|
|
17416
17574
|
} else {
|
|
17417
|
-
cdLineEl.style.height = `${tableHeight - offsetTop - (scrollbarXToTop ? 0 :
|
|
17575
|
+
cdLineEl.style.height = `${tableHeight - offsetTop - (scrollbarXToTop ? 0 : osbHeight)}px`;
|
|
17418
17576
|
}
|
|
17419
17577
|
cdLineEl.setAttribute('drag-pos', dragPos);
|
|
17420
17578
|
cdLineEl.setAttribute('drag-to-child', prevDragToChild ? 'y' : 'n');
|
|
@@ -17450,11 +17608,11 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
17450
17608
|
* @param {Event} evnt 事件
|
|
17451
17609
|
* @param {Row} row 行对象
|
|
17452
17610
|
*/
|
|
17453
|
-
const handleTooltip = (evnt,
|
|
17611
|
+
const handleTooltip = (evnt, tdEl, overflowElem, tipElem, params) => {
|
|
17454
17612
|
if (!overflowElem) {
|
|
17455
17613
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
|
|
17456
17614
|
}
|
|
17457
|
-
params.cell =
|
|
17615
|
+
params.cell = tdEl;
|
|
17458
17616
|
const {
|
|
17459
17617
|
tooltipStore
|
|
17460
17618
|
} = reactData;
|
|
@@ -17626,9 +17784,8 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
17626
17784
|
},
|
|
17627
17785
|
/**
|
|
17628
17786
|
* 更新数据行的 Map
|
|
17629
|
-
* 牺牲数据组装的耗时,用来换取使用过程中的流畅
|
|
17630
17787
|
*/
|
|
17631
|
-
cacheRowMap(isSource) {
|
|
17788
|
+
cacheRowMap(isReset, isSource) {
|
|
17632
17789
|
const {
|
|
17633
17790
|
treeConfig
|
|
17634
17791
|
} = props;
|
|
@@ -17656,7 +17813,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
17656
17813
|
row[childrenField] = null;
|
|
17657
17814
|
}
|
|
17658
17815
|
let cacheItem = fullAllDataRowIdData[rowid];
|
|
17659
|
-
if (!cacheItem) {
|
|
17816
|
+
if (isReset || !cacheItem) {
|
|
17660
17817
|
cacheItem = {
|
|
17661
17818
|
row,
|
|
17662
17819
|
rowid,
|
|
@@ -17669,6 +17826,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
17669
17826
|
parent: parentRow,
|
|
17670
17827
|
level,
|
|
17671
17828
|
height: 0,
|
|
17829
|
+
resizeHeight: 0,
|
|
17672
17830
|
oTop: 0
|
|
17673
17831
|
};
|
|
17674
17832
|
}
|
|
@@ -17782,13 +17940,167 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
17782
17940
|
remainList
|
|
17783
17941
|
});
|
|
17784
17942
|
},
|
|
17785
|
-
|
|
17943
|
+
handleColResizeMousedownEvent(evnt, fixedType, params) {
|
|
17944
|
+
evnt.stopPropagation();
|
|
17945
|
+
evnt.preventDefault();
|
|
17946
|
+
const {
|
|
17947
|
+
column
|
|
17948
|
+
} = params;
|
|
17949
|
+
const {
|
|
17950
|
+
overflowX,
|
|
17951
|
+
scrollbarHeight
|
|
17952
|
+
} = reactData;
|
|
17953
|
+
const {
|
|
17954
|
+
elemStore,
|
|
17955
|
+
visibleColumn
|
|
17956
|
+
} = internalData;
|
|
17957
|
+
const resizableOpts = computeResizableOpts.value;
|
|
17958
|
+
const osbHeight = overflowX ? scrollbarHeight : 0;
|
|
17959
|
+
const tableEl = refElem.value;
|
|
17960
|
+
const leftContainerElem = refLeftContainer.value;
|
|
17961
|
+
const rightContainerElem = refRightContainer.value;
|
|
17962
|
+
const resizeBarElem = refColResizeBar.value;
|
|
17963
|
+
if (!resizeBarElem) {
|
|
17964
|
+
return;
|
|
17965
|
+
}
|
|
17966
|
+
const resizeTipElem = resizeBarElem.firstElementChild;
|
|
17967
|
+
const scrollbarXToTop = computeScrollbarXToTop.value;
|
|
17968
|
+
const {
|
|
17969
|
+
clientX: dragClientX
|
|
17970
|
+
} = evnt;
|
|
17971
|
+
const wrapperElem = refElem.value;
|
|
17972
|
+
const dragBtnElem = evnt.target;
|
|
17973
|
+
let resizeColumn = column;
|
|
17974
|
+
if (column.children && column.children.length) {
|
|
17975
|
+
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(column.children, childColumn => {
|
|
17976
|
+
resizeColumn = childColumn;
|
|
17977
|
+
});
|
|
17978
|
+
}
|
|
17979
|
+
const cell = dragBtnElem.parentNode;
|
|
17980
|
+
const cellParams = Object.assign(params, {
|
|
17981
|
+
cell
|
|
17982
|
+
});
|
|
17983
|
+
let dragLeft = 0;
|
|
17984
|
+
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
17985
|
+
if (!bodyScrollElem) {
|
|
17986
|
+
return;
|
|
17987
|
+
}
|
|
17988
|
+
const pos = getOffsetPos(dragBtnElem, wrapperElem);
|
|
17989
|
+
const dragBtnWidth = dragBtnElem.clientWidth;
|
|
17990
|
+
const dragBtnOffsetWidth = Math.floor(dragBtnWidth / 2);
|
|
17991
|
+
const minInterval = getColReMinWidth(cellParams) - dragBtnOffsetWidth; // 列之间的最小间距
|
|
17992
|
+
let dragMinLeft = pos.left - cell.clientWidth + dragBtnWidth + minInterval;
|
|
17993
|
+
let dragPosLeft = pos.left + dragBtnOffsetWidth;
|
|
17994
|
+
const isLeftFixed = fixedType === 'left';
|
|
17995
|
+
const isRightFixed = fixedType === 'right';
|
|
17996
|
+
// 计算左右侧固定列偏移量
|
|
17997
|
+
let fixedOffsetWidth = 0;
|
|
17998
|
+
if (isLeftFixed || isRightFixed) {
|
|
17999
|
+
const siblingProp = isLeftFixed ? 'nextElementSibling' : 'previousElementSibling';
|
|
18000
|
+
let tempCellElem = cell[siblingProp];
|
|
18001
|
+
while (tempCellElem) {
|
|
18002
|
+
if (hasClass(tempCellElem, 'fixed--hidden')) {
|
|
18003
|
+
break;
|
|
18004
|
+
} else if (!hasClass(tempCellElem, 'col--group')) {
|
|
18005
|
+
fixedOffsetWidth += tempCellElem.offsetWidth;
|
|
18006
|
+
}
|
|
18007
|
+
tempCellElem = tempCellElem[siblingProp];
|
|
18008
|
+
}
|
|
18009
|
+
if (isRightFixed && rightContainerElem) {
|
|
18010
|
+
dragPosLeft = rightContainerElem.offsetLeft + fixedOffsetWidth;
|
|
18011
|
+
}
|
|
18012
|
+
}
|
|
18013
|
+
// 处理拖动事件
|
|
18014
|
+
const updateEvent = evnt => {
|
|
18015
|
+
evnt.stopPropagation();
|
|
18016
|
+
evnt.preventDefault();
|
|
18017
|
+
const tableHeight = tableEl.clientHeight;
|
|
18018
|
+
const offsetX = evnt.clientX - dragClientX;
|
|
18019
|
+
let left = dragPosLeft + offsetX;
|
|
18020
|
+
const scrollLeft = fixedType ? 0 : bodyScrollElem.scrollLeft;
|
|
18021
|
+
if (isLeftFixed) {
|
|
18022
|
+
// 左固定列(不允许超过右侧固定列、不允许超过右边距)
|
|
18023
|
+
left = Math.min(left, (rightContainerElem ? rightContainerElem.offsetLeft : bodyScrollElem.clientWidth) - fixedOffsetWidth - minInterval);
|
|
18024
|
+
} else if (isRightFixed) {
|
|
18025
|
+
// 右侧固定列(不允许超过左侧固定列、不允许超过左边距)
|
|
18026
|
+
dragMinLeft = (leftContainerElem ? leftContainerElem.clientWidth : 0) + fixedOffsetWidth + minInterval;
|
|
18027
|
+
left = Math.min(left, dragPosLeft + cell.clientWidth - minInterval);
|
|
18028
|
+
} else {
|
|
18029
|
+
dragMinLeft = Math.max(bodyScrollElem.scrollLeft, dragMinLeft);
|
|
18030
|
+
// left = Math.min(left, bodyScrollElem.clientWidth + bodyScrollElem.scrollLeft - 40)
|
|
18031
|
+
}
|
|
18032
|
+
dragLeft = Math.max(left, dragMinLeft);
|
|
18033
|
+
const resizeBarLeft = Math.max(1, dragLeft - scrollLeft);
|
|
18034
|
+
resizeBarElem.style.left = `${resizeBarLeft}px`;
|
|
18035
|
+
resizeBarElem.style.top = `${scrollbarXToTop ? osbHeight : 0}px`;
|
|
18036
|
+
resizeBarElem.style.height = `${scrollbarXToTop ? tableHeight - osbHeight : tableHeight}px`;
|
|
18037
|
+
if (resizableOpts.showDragTip && resizeTipElem) {
|
|
18038
|
+
resizeTipElem.textContent = table_getI18n('vxe.table.resizeColTip', [resizeColumn.renderWidth + (isRightFixed ? dragPosLeft - dragLeft : dragLeft - dragPosLeft)]);
|
|
18039
|
+
const tableWidth = tableEl.clientWidth;
|
|
18040
|
+
const wrapperRect = wrapperElem.getBoundingClientRect();
|
|
18041
|
+
const resizeBarWidth = resizeBarElem.clientWidth;
|
|
18042
|
+
const resizeTipWidth = resizeTipElem.clientWidth;
|
|
18043
|
+
const resizeTipHeight = resizeTipElem.clientHeight;
|
|
18044
|
+
let resizeTipLeft = -resizeTipWidth;
|
|
18045
|
+
if (resizeBarLeft < resizeTipWidth + resizeBarWidth) {
|
|
18046
|
+
resizeTipLeft = 0;
|
|
18047
|
+
} else if (resizeBarLeft > tableWidth) {
|
|
18048
|
+
resizeTipLeft += tableWidth - resizeBarLeft;
|
|
18049
|
+
}
|
|
18050
|
+
resizeTipElem.style.left = `${resizeTipLeft}px`;
|
|
18051
|
+
resizeTipElem.style.top = `${Math.min(tableHeight - resizeTipHeight, Math.max(0, evnt.clientY - wrapperRect.y - resizeTipHeight / 2))}px`;
|
|
18052
|
+
}
|
|
18053
|
+
reactData.isDragResize = true;
|
|
18054
|
+
};
|
|
18055
|
+
reactData.isDragResize = true;
|
|
18056
|
+
addClass(tableEl, 'col-drag--resize');
|
|
18057
|
+
resizeBarElem.style.display = 'block';
|
|
18058
|
+
document.onmousemove = updateEvent;
|
|
18059
|
+
document.onmouseup = function (evnt) {
|
|
18060
|
+
document.onmousemove = null;
|
|
18061
|
+
document.onmouseup = null;
|
|
18062
|
+
resizeBarElem.style.display = 'none';
|
|
18063
|
+
internalData._lastResizeTime = Date.now();
|
|
18064
|
+
setTimeout(() => {
|
|
18065
|
+
reactData.isDragResize = false;
|
|
18066
|
+
}, 50);
|
|
18067
|
+
const resizeWidth = resizeColumn.renderWidth + (isRightFixed ? dragPosLeft - dragLeft : dragLeft - dragPosLeft);
|
|
18068
|
+
const resizeParams = {
|
|
18069
|
+
...params,
|
|
18070
|
+
resizeWidth,
|
|
18071
|
+
resizeColumn
|
|
18072
|
+
};
|
|
18073
|
+
if (resizableOpts.dragMode === 'fixed') {
|
|
18074
|
+
visibleColumn.forEach(item => {
|
|
18075
|
+
if (item.id !== resizeColumn.id) {
|
|
18076
|
+
if (!item.resizeWidth) {
|
|
18077
|
+
item.resizeWidth = item.renderWidth;
|
|
18078
|
+
}
|
|
18079
|
+
}
|
|
18080
|
+
});
|
|
18081
|
+
}
|
|
18082
|
+
if ($xeTable.handleColResizeCellAreaEvent) {
|
|
18083
|
+
$xeTable.handleColResizeCellAreaEvent(evnt, resizeParams);
|
|
18084
|
+
} else {
|
|
18085
|
+
resizeColumn.resizeWidth = resizeWidth;
|
|
18086
|
+
handleUpdateColResize(evnt, resizeParams);
|
|
18087
|
+
}
|
|
18088
|
+
removeClass(tableEl, 'col-drag--resize');
|
|
18089
|
+
};
|
|
18090
|
+
updateEvent(evnt);
|
|
18091
|
+
if ($xeTable.closeMenu) {
|
|
18092
|
+
$xeTable.closeMenu();
|
|
18093
|
+
}
|
|
18094
|
+
},
|
|
18095
|
+
handleColResizeDblclickEvent(evnt, params) {
|
|
17786
18096
|
const resizableOpts = computeResizableOpts.value;
|
|
17787
18097
|
const {
|
|
17788
18098
|
isDblclickAutoWidth
|
|
17789
18099
|
} = resizableOpts;
|
|
17790
18100
|
const el = refElem.value;
|
|
17791
18101
|
if (isDblclickAutoWidth && el) {
|
|
18102
|
+
evnt.stopPropagation();
|
|
18103
|
+
evnt.preventDefault();
|
|
17792
18104
|
const {
|
|
17793
18105
|
fullColumnIdData
|
|
17794
18106
|
} = internalData;
|
|
@@ -17809,23 +18121,195 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
17809
18121
|
cell
|
|
17810
18122
|
});
|
|
17811
18123
|
const colMinWidth = getColReMinWidth(cellParams);
|
|
18124
|
+
el.setAttribute('data-calc-col', 'Y');
|
|
17812
18125
|
let resizeWidth = calcColumnAutoWidth(resizeColumn, el);
|
|
18126
|
+
el.removeAttribute('data-calc-col');
|
|
17813
18127
|
if (colRest) {
|
|
17814
18128
|
resizeWidth = Math.max(resizeWidth, colRest.width);
|
|
17815
18129
|
}
|
|
17816
|
-
|
|
17817
|
-
|
|
18130
|
+
resizeWidth = Math.max(colMinWidth, resizeWidth);
|
|
18131
|
+
const resizeParams = {
|
|
18132
|
+
...params,
|
|
18133
|
+
resizeWidth,
|
|
18134
|
+
resizeColumn
|
|
18135
|
+
};
|
|
18136
|
+
reactData.isDragResize = false;
|
|
18137
|
+
internalData._lastResizeTime = Date.now();
|
|
18138
|
+
if ($xeTable.handleColResizeDblclickCellAreaEvent) {
|
|
18139
|
+
$xeTable.handleColResizeDblclickCellAreaEvent(evnt, resizeParams);
|
|
18140
|
+
} else {
|
|
18141
|
+
resizeColumn.resizeWidth = resizeWidth;
|
|
18142
|
+
handleUpdateColResize(evnt, resizeParams);
|
|
18143
|
+
}
|
|
18144
|
+
}
|
|
18145
|
+
},
|
|
18146
|
+
handleRowResizeMousedownEvent(evnt, params) {
|
|
18147
|
+
evnt.stopPropagation();
|
|
18148
|
+
evnt.preventDefault();
|
|
18149
|
+
const {
|
|
18150
|
+
row
|
|
18151
|
+
} = params;
|
|
18152
|
+
const {
|
|
18153
|
+
overflowX,
|
|
18154
|
+
scrollbarWidth,
|
|
18155
|
+
overflowY,
|
|
18156
|
+
scrollbarHeight
|
|
18157
|
+
} = reactData;
|
|
18158
|
+
const {
|
|
18159
|
+
elemStore,
|
|
18160
|
+
fullAllDataRowIdData
|
|
18161
|
+
} = internalData;
|
|
18162
|
+
const osbWidth = overflowY ? scrollbarWidth : 0;
|
|
18163
|
+
const osbHeight = overflowX ? scrollbarHeight : 0;
|
|
18164
|
+
const scrollbarYToLeft = computeScrollbarYToLeft.value;
|
|
18165
|
+
const resizableOpts = computeResizableOpts.value;
|
|
18166
|
+
const rowOpts = computeRowOpts.value;
|
|
18167
|
+
const cellOpts = computeCellOpts.value;
|
|
18168
|
+
const tableEl = refElem.value;
|
|
18169
|
+
const resizeBarElem = refRowResizeBar.value;
|
|
18170
|
+
if (!resizeBarElem) {
|
|
18171
|
+
return;
|
|
18172
|
+
}
|
|
18173
|
+
const {
|
|
18174
|
+
clientY: dragClientY
|
|
18175
|
+
} = evnt;
|
|
18176
|
+
const resizeTipElem = resizeBarElem.firstElementChild;
|
|
18177
|
+
const dragBtnElem = evnt.currentTarget;
|
|
18178
|
+
const tdEl = dragBtnElem.parentNode;
|
|
18179
|
+
const trEl = tdEl.parentNode;
|
|
18180
|
+
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
18181
|
+
if (!bodyScrollElem) {
|
|
18182
|
+
return;
|
|
18183
|
+
}
|
|
18184
|
+
const rowid = getRowid($xeTable, row);
|
|
18185
|
+
const rowRest = fullAllDataRowIdData[rowid];
|
|
18186
|
+
if (!rowRest) {
|
|
18187
|
+
return;
|
|
18188
|
+
}
|
|
18189
|
+
const defaultRowHeight = computeDefaultRowHeight.value;
|
|
18190
|
+
const currCellHeight = rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight;
|
|
18191
|
+
const tableRect = tableEl.getBoundingClientRect();
|
|
18192
|
+
const trRect = trEl.getBoundingClientRect();
|
|
18193
|
+
const targetOffsetY = dragClientY - trRect.y - trEl.clientHeight;
|
|
18194
|
+
let resizeHeight = currCellHeight;
|
|
18195
|
+
const cellEl = tdEl.querySelector('.vxe-cell');
|
|
18196
|
+
let cellMinHeight = 0;
|
|
18197
|
+
if (cellEl) {
|
|
18198
|
+
const cellStyle = getComputedStyle(cellEl);
|
|
18199
|
+
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)));
|
|
18200
|
+
}
|
|
18201
|
+
const minTop = trRect.y - tableRect.y + cellMinHeight;
|
|
18202
|
+
// 处理拖动事件
|
|
18203
|
+
const updateEvent = evnt => {
|
|
18204
|
+
evnt.stopPropagation();
|
|
18205
|
+
evnt.preventDefault();
|
|
18206
|
+
const tableWidth = tableEl.clientWidth - osbWidth;
|
|
18207
|
+
const tableHeight = tableEl.clientHeight - osbHeight;
|
|
18208
|
+
let dragTop = evnt.clientY - tableRect.y - targetOffsetY;
|
|
18209
|
+
if (dragTop < minTop) {
|
|
18210
|
+
dragTop = minTop;
|
|
18211
|
+
} else {
|
|
18212
|
+
resizeHeight = Math.max(cellMinHeight, currCellHeight + evnt.clientY - dragClientY);
|
|
18213
|
+
}
|
|
18214
|
+
resizeBarElem.style.left = `${scrollbarYToLeft ? osbWidth : 0}px`;
|
|
18215
|
+
resizeBarElem.style.top = `${dragTop}px`;
|
|
18216
|
+
resizeBarElem.style.width = `${tableWidth}px`;
|
|
18217
|
+
if (resizableOpts.showDragTip && resizeTipElem) {
|
|
18218
|
+
resizeTipElem.textContent = table_getI18n('vxe.table.resizeRowTip', [resizeHeight]);
|
|
18219
|
+
const resizeTipWidth = resizeTipElem.clientWidth;
|
|
18220
|
+
const resizeTipHeight = resizeTipElem.clientHeight;
|
|
18221
|
+
let resizeBarLeft = Math.max(2, evnt.clientX - tableRect.x);
|
|
18222
|
+
let resizeBarTop = 0;
|
|
18223
|
+
if (resizeBarLeft + resizeTipWidth >= tableWidth - 2) {
|
|
18224
|
+
resizeBarLeft = tableWidth - resizeTipWidth - 2;
|
|
18225
|
+
}
|
|
18226
|
+
if (dragTop + resizeTipHeight >= tableHeight) {
|
|
18227
|
+
resizeBarTop = tableHeight - (dragTop + resizeTipHeight);
|
|
18228
|
+
}
|
|
18229
|
+
resizeTipElem.style.left = `${resizeBarLeft}px`;
|
|
18230
|
+
resizeTipElem.style.top = `${resizeBarTop}px`;
|
|
18231
|
+
}
|
|
18232
|
+
reactData.isDragResize = true;
|
|
18233
|
+
};
|
|
18234
|
+
reactData.isDragResize = true;
|
|
18235
|
+
addClass(tableEl, 'row-drag--resize');
|
|
18236
|
+
resizeBarElem.style.display = 'block';
|
|
18237
|
+
document.onmousemove = updateEvent;
|
|
18238
|
+
document.onmouseup = function (evnt) {
|
|
18239
|
+
document.onmousemove = null;
|
|
18240
|
+
document.onmouseup = null;
|
|
18241
|
+
resizeBarElem.style.display = 'none';
|
|
17818
18242
|
internalData._lastResizeTime = Date.now();
|
|
17819
|
-
|
|
17820
|
-
|
|
17821
|
-
|
|
17822
|
-
|
|
17823
|
-
|
|
18243
|
+
setTimeout(() => {
|
|
18244
|
+
reactData.isDragResize = false;
|
|
18245
|
+
}, 50);
|
|
18246
|
+
if (resizeHeight !== currCellHeight) {
|
|
18247
|
+
const resizeParams = {
|
|
17824
18248
|
...params,
|
|
17825
|
-
|
|
17826
|
-
|
|
17827
|
-
|
|
17828
|
-
|
|
18249
|
+
resizeHeight,
|
|
18250
|
+
resizeRow: row
|
|
18251
|
+
};
|
|
18252
|
+
internalData.isResizeCellHeight = true;
|
|
18253
|
+
if ($xeTable.handleRowResizeCellAreaEvent) {
|
|
18254
|
+
$xeTable.handleRowResizeCellAreaEvent(evnt, resizeParams);
|
|
18255
|
+
} else {
|
|
18256
|
+
rowRest.resizeHeight = resizeHeight;
|
|
18257
|
+
handleUpdateRowResize(evnt, resizeParams);
|
|
18258
|
+
}
|
|
18259
|
+
}
|
|
18260
|
+
removeClass(tableEl, 'row-drag--resize');
|
|
18261
|
+
};
|
|
18262
|
+
updateEvent(evnt);
|
|
18263
|
+
},
|
|
18264
|
+
handleRowResizeDblclickEvent(evnt, params) {
|
|
18265
|
+
const resizableOpts = computeResizableOpts.value;
|
|
18266
|
+
const {
|
|
18267
|
+
isDblclickAutoHeight
|
|
18268
|
+
} = resizableOpts;
|
|
18269
|
+
const el = refElem.value;
|
|
18270
|
+
if (isDblclickAutoHeight && el) {
|
|
18271
|
+
evnt.stopPropagation();
|
|
18272
|
+
evnt.preventDefault();
|
|
18273
|
+
const {
|
|
18274
|
+
editStore
|
|
18275
|
+
} = reactData;
|
|
18276
|
+
const {
|
|
18277
|
+
fullAllDataRowIdData
|
|
18278
|
+
} = internalData;
|
|
18279
|
+
const {
|
|
18280
|
+
actived
|
|
18281
|
+
} = editStore;
|
|
18282
|
+
const {
|
|
18283
|
+
row
|
|
18284
|
+
} = params;
|
|
18285
|
+
const rowid = getRowid($xeTable, row);
|
|
18286
|
+
const rowRest = fullAllDataRowIdData[rowid];
|
|
18287
|
+
if (!rowRest) {
|
|
18288
|
+
return;
|
|
18289
|
+
}
|
|
18290
|
+
const handleRsHeight = () => {
|
|
18291
|
+
el.setAttribute('data-calc-row', 'Y');
|
|
18292
|
+
const resizeHeight = calcCellAutoHeight(rowRest, el);
|
|
18293
|
+
el.removeAttribute('data-calc-row');
|
|
18294
|
+
const resizeParams = {
|
|
18295
|
+
...params,
|
|
18296
|
+
resizeHeight,
|
|
18297
|
+
resizeRow: row
|
|
18298
|
+
};
|
|
18299
|
+
reactData.isDragResize = false;
|
|
18300
|
+
internalData._lastResizeTime = Date.now();
|
|
18301
|
+
if ($xeTable.handleRowResizeDblclickCellAreaEvent) {
|
|
18302
|
+
$xeTable.handleRowResizeDblclickCellAreaEvent(evnt, resizeParams);
|
|
18303
|
+
} else {
|
|
18304
|
+
rowRest.resizeHeight = resizeHeight;
|
|
18305
|
+
handleUpdateRowResize(evnt, resizeParams);
|
|
18306
|
+
}
|
|
18307
|
+
};
|
|
18308
|
+
if (actived.row || actived.column) {
|
|
18309
|
+
$xeTable.clearEdit().then(handleRsHeight);
|
|
18310
|
+
} else {
|
|
18311
|
+
handleRsHeight();
|
|
18312
|
+
}
|
|
17829
18313
|
}
|
|
17830
18314
|
},
|
|
17831
18315
|
saveCustomStore(type) {
|
|
@@ -18231,10 +18715,21 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
18231
18715
|
const {
|
|
18232
18716
|
column
|
|
18233
18717
|
} = params;
|
|
18234
|
-
const titleElem = evnt.currentTarget;
|
|
18235
18718
|
handleTargetEnterEvent(true);
|
|
18719
|
+
const titleElem = evnt.currentTarget;
|
|
18720
|
+
if (!titleElem) {
|
|
18721
|
+
return;
|
|
18722
|
+
}
|
|
18723
|
+
const cellEl = titleElem.parentElement;
|
|
18724
|
+
if (!cellEl) {
|
|
18725
|
+
return;
|
|
18726
|
+
}
|
|
18727
|
+
const thEl = cellEl.parentElement;
|
|
18728
|
+
if (!thEl) {
|
|
18729
|
+
return;
|
|
18730
|
+
}
|
|
18236
18731
|
if (tooltipStore.column !== column || !tooltipStore.visible) {
|
|
18237
|
-
handleTooltip(evnt,
|
|
18732
|
+
handleTooltip(evnt, thEl, cellEl, null, params);
|
|
18238
18733
|
}
|
|
18239
18734
|
},
|
|
18240
18735
|
/**
|
|
@@ -18258,7 +18753,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
18258
18753
|
row,
|
|
18259
18754
|
column
|
|
18260
18755
|
} = params;
|
|
18261
|
-
const
|
|
18756
|
+
const tdEl = evnt.currentTarget;
|
|
18262
18757
|
handleTargetEnterEvent(tooltipStore.column !== column || tooltipStore.row !== row);
|
|
18263
18758
|
// 单元格处于编辑状态时不触发提示框
|
|
18264
18759
|
if (column.editRender && isEnableConf(editConfig)) {
|
|
@@ -18272,17 +18767,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
18272
18767
|
}
|
|
18273
18768
|
}
|
|
18274
18769
|
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);
|
|
18770
|
+
handleTooltip(evnt, tdEl, tdEl.querySelector('.vxe-cell--wrapper'), null, params);
|
|
18286
18771
|
}
|
|
18287
18772
|
},
|
|
18288
18773
|
/**
|
|
@@ -18298,7 +18783,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
18298
18783
|
const cell = evnt.currentTarget;
|
|
18299
18784
|
handleTargetEnterEvent(tooltipStore.column !== column || !!tooltipStore.row);
|
|
18300
18785
|
if (tooltipStore.column !== column || !tooltipStore.visible) {
|
|
18301
|
-
handleTooltip(evnt, cell, cell.querySelector('.vxe-cell--
|
|
18786
|
+
handleTooltip(evnt, cell, cell.querySelector('.vxe-cell--wrapper') || cell.children[0], null, params);
|
|
18302
18787
|
}
|
|
18303
18788
|
},
|
|
18304
18789
|
handleTargetLeaveEvent() {
|
|
@@ -18311,11 +18796,11 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
18311
18796
|
internalData.tooltipTimeout = setTimeout(() => {
|
|
18312
18797
|
$tooltip = refTooltip.value;
|
|
18313
18798
|
if ($tooltip && $tooltip.isActived && !$tooltip.isActived()) {
|
|
18314
|
-
|
|
18799
|
+
$xeTable.closeTooltip();
|
|
18315
18800
|
}
|
|
18316
18801
|
}, tooltipOpts.leaveDelay);
|
|
18317
18802
|
} else {
|
|
18318
|
-
|
|
18803
|
+
$xeTable.closeTooltip();
|
|
18319
18804
|
}
|
|
18320
18805
|
},
|
|
18321
18806
|
triggerHeaderCellClickEvent(evnt, params) {
|
|
@@ -18360,8 +18845,12 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
18360
18845
|
editConfig
|
|
18361
18846
|
} = props;
|
|
18362
18847
|
const {
|
|
18363
|
-
editStore
|
|
18848
|
+
editStore,
|
|
18849
|
+
isDragResize
|
|
18364
18850
|
} = reactData;
|
|
18851
|
+
if (isDragResize) {
|
|
18852
|
+
return;
|
|
18853
|
+
}
|
|
18365
18854
|
const expandOpts = computeExpandOpts.value;
|
|
18366
18855
|
const editOpts = computeEditOpts.value;
|
|
18367
18856
|
const treeOpts = computeTreeOpts.value;
|
|
@@ -18471,8 +18960,12 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
18471
18960
|
editConfig
|
|
18472
18961
|
} = props;
|
|
18473
18962
|
const {
|
|
18474
|
-
editStore
|
|
18963
|
+
editStore,
|
|
18964
|
+
isDragResize
|
|
18475
18965
|
} = reactData;
|
|
18966
|
+
if (isDragResize) {
|
|
18967
|
+
return;
|
|
18968
|
+
}
|
|
18476
18969
|
const editOpts = computeEditOpts.value;
|
|
18477
18970
|
const {
|
|
18478
18971
|
actived
|
|
@@ -18763,13 +19256,19 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
18763
19256
|
*/
|
|
18764
19257
|
triggerSortEvent(evnt, column, order) {
|
|
18765
19258
|
const sortOpts = computeSortOpts.value;
|
|
19259
|
+
const {
|
|
19260
|
+
multiple,
|
|
19261
|
+
allowClear
|
|
19262
|
+
} = sortOpts;
|
|
18766
19263
|
const {
|
|
18767
19264
|
field,
|
|
18768
19265
|
sortable
|
|
18769
19266
|
} = column;
|
|
18770
19267
|
if (sortable) {
|
|
18771
19268
|
if (!order || column.order === order) {
|
|
18772
|
-
|
|
19269
|
+
if (allowClear) {
|
|
19270
|
+
tableMethods.clearSort(multiple ? column : null);
|
|
19271
|
+
}
|
|
18773
19272
|
} else {
|
|
18774
19273
|
tableMethods.sort({
|
|
18775
19274
|
field,
|
|
@@ -18896,7 +19395,8 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
18896
19395
|
isPeerDrag,
|
|
18897
19396
|
isCrossDrag,
|
|
18898
19397
|
isSelfToChildDrag,
|
|
18899
|
-
dragEndMethod
|
|
19398
|
+
dragEndMethod,
|
|
19399
|
+
dragToChildMethod
|
|
18900
19400
|
} = rowDragOpts;
|
|
18901
19401
|
const treeOpts = computeTreeOpts.value;
|
|
18902
19402
|
const {
|
|
@@ -18915,13 +19415,15 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
18915
19415
|
if (prevDragRow && dragRow) {
|
|
18916
19416
|
// 判断是否有拖动
|
|
18917
19417
|
if (prevDragRow !== dragRow) {
|
|
18918
|
-
|
|
19418
|
+
const dragParams = {
|
|
18919
19419
|
oldRow: dragRow,
|
|
18920
19420
|
newRow: prevDragRow,
|
|
18921
19421
|
dragPos: prevDragPos,
|
|
18922
19422
|
dragToChild: !!prevDragToChild,
|
|
18923
19423
|
offsetIndex: dragOffsetIndex
|
|
18924
|
-
}
|
|
19424
|
+
};
|
|
19425
|
+
const isDragToChildFlag = isSelfToChildDrag && dragToChildMethod ? dragToChildMethod(dragParams) : prevDragToChild;
|
|
19426
|
+
return Promise.resolve(dEndMethod ? dEndMethod(dragParams) : true).then(status => {
|
|
18925
19427
|
if (!status) {
|
|
18926
19428
|
return;
|
|
18927
19429
|
}
|
|
@@ -18999,7 +19501,9 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
18999
19501
|
// 根到根
|
|
19000
19502
|
}
|
|
19001
19503
|
const fullList = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toTreeArray(internalData.afterTreeFullData, {
|
|
19002
|
-
|
|
19504
|
+
key: rowField,
|
|
19505
|
+
parentKey: parentField,
|
|
19506
|
+
children: mapChildrenField
|
|
19003
19507
|
});
|
|
19004
19508
|
// 移出
|
|
19005
19509
|
const otfIndex = $xeTable.findRowIndexOf(fullList, dragRow);
|
|
@@ -19014,12 +19518,12 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
19014
19518
|
childRow[parentField] = dragRow[parentField];
|
|
19015
19519
|
});
|
|
19016
19520
|
}
|
|
19017
|
-
dragRow[parentField] =
|
|
19521
|
+
dragRow[parentField] = isDragToChildFlag ? prevDragRow[rowField] : prevDragRow[parentField];
|
|
19018
19522
|
internalData.tableFullTreeData = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toArrayTree(fullList, {
|
|
19019
|
-
key:
|
|
19020
|
-
parentKey:
|
|
19523
|
+
key: rowField,
|
|
19524
|
+
parentKey: parentField,
|
|
19021
19525
|
children: childrenField,
|
|
19022
|
-
mapChildren:
|
|
19526
|
+
mapChildren: mapChildrenField
|
|
19023
19527
|
});
|
|
19024
19528
|
}
|
|
19025
19529
|
}
|
|
@@ -19039,7 +19543,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
19039
19543
|
}
|
|
19040
19544
|
reactData.isDragRowMove = true;
|
|
19041
19545
|
$xeTable.handleTableData(treeConfig && transform);
|
|
19042
|
-
$xeTable.cacheRowMap();
|
|
19546
|
+
$xeTable.cacheRowMap(false);
|
|
19043
19547
|
updateScrollYStatus();
|
|
19044
19548
|
if (!(treeConfig && transform)) {
|
|
19045
19549
|
$xeTable.updateAfterDataIndex();
|
|
@@ -19056,7 +19560,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
19056
19560
|
oldRow: dragRow,
|
|
19057
19561
|
newRow: prevDragRow,
|
|
19058
19562
|
dragPos: prevDragPos,
|
|
19059
|
-
dragToChild:
|
|
19563
|
+
dragToChild: isDragToChildFlag,
|
|
19060
19564
|
offsetIndex: dragOffsetIndex,
|
|
19061
19565
|
_index: {
|
|
19062
19566
|
newIndex: nafIndex,
|
|
@@ -19088,18 +19592,16 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
19088
19592
|
prevDragRow,
|
|
19089
19593
|
prevDragPos
|
|
19090
19594
|
} = internalData;
|
|
19091
|
-
if (treeConfig && prevDragToChild) {
|
|
19595
|
+
if (treeConfig && lazy && prevDragToChild) {
|
|
19092
19596
|
// 懒加载
|
|
19093
|
-
|
|
19094
|
-
|
|
19095
|
-
|
|
19096
|
-
if (
|
|
19097
|
-
if (rowRest && rowRest.treeLoaded) {
|
|
19098
|
-
$xeTable.handleRowDragSwapEvent(evnt, true, dragRow, prevDragRow, prevDragPos, prevDragToChild);
|
|
19099
|
-
}
|
|
19100
|
-
} else {
|
|
19597
|
+
const newRowid = getRowid($xeTable, prevDragRow);
|
|
19598
|
+
const rowRest = fullAllDataRowIdData[newRowid];
|
|
19599
|
+
if (prevDragRow[hasChildField]) {
|
|
19600
|
+
if (rowRest && rowRest.treeLoaded) {
|
|
19101
19601
|
$xeTable.handleRowDragSwapEvent(evnt, true, dragRow, prevDragRow, prevDragPos, prevDragToChild);
|
|
19102
19602
|
}
|
|
19603
|
+
} else {
|
|
19604
|
+
$xeTable.handleRowDragSwapEvent(evnt, true, dragRow, prevDragRow, prevDragPos, prevDragToChild);
|
|
19103
19605
|
}
|
|
19104
19606
|
} else {
|
|
19105
19607
|
$xeTable.handleRowDragSwapEvent(evnt, true, dragRow, prevDragRow, prevDragPos, prevDragToChild);
|
|
@@ -19229,7 +19731,8 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
19229
19731
|
isCrossDrag,
|
|
19230
19732
|
isSelfToChildDrag,
|
|
19231
19733
|
isToChildDrag,
|
|
19232
|
-
dragEndMethod
|
|
19734
|
+
dragEndMethod,
|
|
19735
|
+
dragToChildMethod
|
|
19233
19736
|
} = columnDragOpts;
|
|
19234
19737
|
const {
|
|
19235
19738
|
collectColumn
|
|
@@ -19240,13 +19743,15 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
19240
19743
|
if (prevDragCol !== dragCol) {
|
|
19241
19744
|
const oldColumn = dragCol;
|
|
19242
19745
|
const newColumn = prevDragCol;
|
|
19243
|
-
|
|
19746
|
+
const dragParams = {
|
|
19244
19747
|
oldColumn,
|
|
19245
19748
|
newColumn,
|
|
19246
19749
|
dragPos: prevDragPos,
|
|
19247
19750
|
dragToChild: !!prevDragToChild,
|
|
19248
19751
|
offsetIndex: dragOffsetIndex
|
|
19249
|
-
}
|
|
19752
|
+
};
|
|
19753
|
+
const isDragToChildFlag = isSelfToChildDrag && dragToChildMethod ? dragToChildMethod(dragParams) : prevDragToChild;
|
|
19754
|
+
return Promise.resolve(dragEndMethod ? dragEndMethod(dragParams) : true).then(status => {
|
|
19250
19755
|
if (!status) {
|
|
19251
19756
|
return;
|
|
19252
19757
|
}
|
|
@@ -19342,7 +19847,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
19342
19847
|
parent: nParent
|
|
19343
19848
|
} = newMatchRest;
|
|
19344
19849
|
// 转子级
|
|
19345
|
-
if (isCrossDrag && isToChildDrag &&
|
|
19850
|
+
if (isCrossDrag && isToChildDrag && isDragToChildFlag) {
|
|
19346
19851
|
oldColumn.parentId = newColumn.id;
|
|
19347
19852
|
newColumn.children = (newColumn.children || []).concat([oldColumn]);
|
|
19348
19853
|
} else {
|
|
@@ -19373,7 +19878,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
19373
19878
|
oldColumn,
|
|
19374
19879
|
newColumn,
|
|
19375
19880
|
dragPos: prevDragPos,
|
|
19376
|
-
dragToChild:
|
|
19881
|
+
dragToChild: isDragToChildFlag,
|
|
19377
19882
|
offsetIndex: dragOffsetIndex,
|
|
19378
19883
|
_index: {
|
|
19379
19884
|
newIndex: nafIndex,
|
|
@@ -19641,6 +20146,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
19641
20146
|
triggerBodyScrollEvent(evnt, fixedType) {
|
|
19642
20147
|
const {
|
|
19643
20148
|
elemStore,
|
|
20149
|
+
intoRunScroll,
|
|
19644
20150
|
lastScrollTop,
|
|
19645
20151
|
lastScrollLeft,
|
|
19646
20152
|
inWheelScroll,
|
|
@@ -19660,6 +20166,9 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
19660
20166
|
if (inWheelScroll || inVirtualScroll || inHeaderScroll || inFooterScroll) {
|
|
19661
20167
|
return;
|
|
19662
20168
|
}
|
|
20169
|
+
if (intoRunScroll) {
|
|
20170
|
+
return;
|
|
20171
|
+
}
|
|
19663
20172
|
if (!bodyScrollElem) {
|
|
19664
20173
|
return;
|
|
19665
20174
|
}
|
|
@@ -19716,6 +20225,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
19716
20225
|
triggerHeaderScrollEvent(evnt, fixedType) {
|
|
19717
20226
|
const {
|
|
19718
20227
|
elemStore,
|
|
20228
|
+
intoRunScroll,
|
|
19719
20229
|
inWheelScroll,
|
|
19720
20230
|
inVirtualScroll,
|
|
19721
20231
|
inBodyScroll,
|
|
@@ -19726,16 +20236,10 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
19726
20236
|
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
19727
20237
|
const headerScrollElem = getRefElem(elemStore['main-header-scroll']);
|
|
19728
20238
|
const footerScrollElem = getRefElem(elemStore['main-footer-scroll']);
|
|
19729
|
-
if (inWheelScroll) {
|
|
19730
|
-
return;
|
|
19731
|
-
}
|
|
19732
|
-
if (inVirtualScroll) {
|
|
19733
|
-
return;
|
|
19734
|
-
}
|
|
19735
|
-
if (inBodyScroll) {
|
|
20239
|
+
if (inWheelScroll || inVirtualScroll || inBodyScroll || inFooterScroll) {
|
|
19736
20240
|
return;
|
|
19737
20241
|
}
|
|
19738
|
-
if (
|
|
20242
|
+
if (intoRunScroll) {
|
|
19739
20243
|
return;
|
|
19740
20244
|
}
|
|
19741
20245
|
if (!headerScrollElem) {
|
|
@@ -19764,6 +20268,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
19764
20268
|
triggerFooterScrollEvent(evnt, fixedType) {
|
|
19765
20269
|
const {
|
|
19766
20270
|
elemStore,
|
|
20271
|
+
intoRunScroll,
|
|
19767
20272
|
inWheelScroll,
|
|
19768
20273
|
inVirtualScroll,
|
|
19769
20274
|
inHeaderScroll,
|
|
@@ -19774,16 +20279,10 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
19774
20279
|
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
19775
20280
|
const headerScrollElem = getRefElem(elemStore['main-header-scroll']);
|
|
19776
20281
|
const footerScrollElem = getRefElem(elemStore['main-footer-scroll']);
|
|
19777
|
-
if (inWheelScroll) {
|
|
19778
|
-
return;
|
|
19779
|
-
}
|
|
19780
|
-
if (inVirtualScroll) {
|
|
19781
|
-
return;
|
|
19782
|
-
}
|
|
19783
|
-
if (inHeaderScroll) {
|
|
20282
|
+
if (inWheelScroll || inVirtualScroll || inHeaderScroll || inBodyScroll) {
|
|
19784
20283
|
return;
|
|
19785
20284
|
}
|
|
19786
|
-
if (
|
|
20285
|
+
if (intoRunScroll) {
|
|
19787
20286
|
return;
|
|
19788
20287
|
}
|
|
19789
20288
|
if (!footerScrollElem) {
|
|
@@ -19811,9 +20310,13 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
19811
20310
|
},
|
|
19812
20311
|
triggerBodyWheelEvent(evnt) {
|
|
19813
20312
|
const {
|
|
20313
|
+
target,
|
|
19814
20314
|
deltaY,
|
|
19815
20315
|
deltaX
|
|
19816
20316
|
} = evnt;
|
|
20317
|
+
if (target && /^textarea$/i.test(target.tagName)) {
|
|
20318
|
+
return;
|
|
20319
|
+
}
|
|
19817
20320
|
const {
|
|
19818
20321
|
highlightHoverRow
|
|
19819
20322
|
} = src_props;
|
|
@@ -19837,26 +20340,13 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
19837
20340
|
if (!bodyScrollElem) {
|
|
19838
20341
|
return;
|
|
19839
20342
|
}
|
|
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;
|
|
20343
|
+
const wheelSpeed = getWheelSpeed(reactData.lastScrollTime);
|
|
20344
|
+
const deltaTop = deltaY * wheelSpeed;
|
|
20345
|
+
const deltaLeft = deltaX * wheelSpeed;
|
|
19856
20346
|
const isTopWheel = deltaTop < 0;
|
|
19857
|
-
const currScrollTop =
|
|
20347
|
+
const currScrollTop = bodyScrollElem.scrollTop;
|
|
19858
20348
|
// 如果滚动位置已经是顶部或底部,则不需要触发
|
|
19859
|
-
if (isTopWheel ? currScrollTop <= 0 : currScrollTop >=
|
|
20349
|
+
if (isTopWheel ? currScrollTop <= 0 : currScrollTop >= bodyScrollElem.scrollHeight - bodyScrollElem.clientHeight) {
|
|
19860
20350
|
return;
|
|
19861
20351
|
}
|
|
19862
20352
|
const scrollTop = bodyScrollElem.scrollTop + deltaTop;
|
|
@@ -19869,16 +20359,29 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
19869
20359
|
if (rowOpts.isHover || highlightHoverRow) {
|
|
19870
20360
|
$xeTable.clearHoverRow();
|
|
19871
20361
|
}
|
|
19872
|
-
|
|
19873
|
-
|
|
19874
|
-
|
|
19875
|
-
|
|
19876
|
-
|
|
19877
|
-
|
|
19878
|
-
|
|
19879
|
-
|
|
19880
|
-
|
|
20362
|
+
wheelScrollTo(scrollTop - bodyScrollElem.scrollTop, offsetTop => {
|
|
20363
|
+
const currTopNum = bodyScrollElem.scrollTop + offsetTop;
|
|
20364
|
+
internalData.inWheelScroll = true;
|
|
20365
|
+
setScrollTop(yHandleEl, currTopNum);
|
|
20366
|
+
setScrollTop(bodyScrollElem, currTopNum);
|
|
20367
|
+
setScrollTop(leftScrollElem, currTopNum);
|
|
20368
|
+
setScrollTop(rightScrollElem, currTopNum);
|
|
20369
|
+
$xeTable.triggerScrollYEvent(evnt);
|
|
20370
|
+
$xeTable.handleScrollEvent(evnt, isRollY, isRollX, currTopNum, scrollLeft, {
|
|
20371
|
+
type: 'table',
|
|
20372
|
+
fixed: ''
|
|
20373
|
+
});
|
|
19881
20374
|
});
|
|
20375
|
+
// internalData.inWheelScroll = true
|
|
20376
|
+
// setScrollTop(yHandleEl, scrollTop)
|
|
20377
|
+
// setScrollTop(bodyScrollElem, scrollTop)
|
|
20378
|
+
// setScrollTop(leftScrollElem, scrollTop)
|
|
20379
|
+
// setScrollTop(rightScrollElem, scrollTop)
|
|
20380
|
+
// loadScrollYData(scrollTop)
|
|
20381
|
+
// $xeTable.handleScrollEvent(evnt, isRollY, isRollX, scrollTop, scrollLeft, {
|
|
20382
|
+
// type: 'footer',
|
|
20383
|
+
// fixed: ''
|
|
20384
|
+
// })
|
|
19882
20385
|
}
|
|
19883
20386
|
},
|
|
19884
20387
|
triggerVirtualScrollXEvent(evnt) {
|
|
@@ -20048,45 +20551,43 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20048
20551
|
// 更新纵向 Y 可视渲染上下剩余空间大小
|
|
20049
20552
|
updateScrollYSpace() {
|
|
20050
20553
|
const {
|
|
20051
|
-
|
|
20052
|
-
|
|
20053
|
-
const {
|
|
20054
|
-
scrollYLoad,
|
|
20055
|
-
rowHeight
|
|
20554
|
+
isAllOverflow,
|
|
20555
|
+
scrollYLoad
|
|
20056
20556
|
} = reactData;
|
|
20057
20557
|
const {
|
|
20058
20558
|
scrollYStore,
|
|
20059
20559
|
elemStore,
|
|
20560
|
+
isResizeCellHeight,
|
|
20060
20561
|
afterFullData,
|
|
20061
20562
|
fullAllDataRowIdData
|
|
20062
20563
|
} = internalData;
|
|
20063
20564
|
const {
|
|
20064
20565
|
startIndex
|
|
20065
20566
|
} = scrollYStore;
|
|
20567
|
+
const rowOpts = computeRowOpts.value;
|
|
20568
|
+
const cellOpts = computeCellOpts.value;
|
|
20569
|
+
const defaultRowHeight = computeDefaultRowHeight.value;
|
|
20066
20570
|
const bodyTableElem = getRefElem(elemStore['main-body-table']);
|
|
20067
20571
|
const containerList = ['main', 'left', 'right'];
|
|
20068
20572
|
let topSpaceHeight = 0;
|
|
20069
20573
|
let ySpaceHeight = 0;
|
|
20070
20574
|
if (scrollYLoad) {
|
|
20071
|
-
|
|
20072
|
-
|
|
20073
|
-
|
|
20575
|
+
const isCustomCellHeight = isResizeCellHeight || cellOpts.height || rowOpts.height;
|
|
20576
|
+
if (!isCustomCellHeight && isAllOverflow) {
|
|
20577
|
+
ySpaceHeight = afterFullData.length * defaultRowHeight;
|
|
20578
|
+
topSpaceHeight = Math.max(0, startIndex * defaultRowHeight);
|
|
20074
20579
|
} else {
|
|
20075
20580
|
for (let i = 0; i < afterFullData.length; i++) {
|
|
20076
20581
|
const row = afterFullData[i];
|
|
20077
20582
|
const rowid = getRowid($xeTable, row);
|
|
20078
|
-
const rowRest = fullAllDataRowIdData[rowid];
|
|
20079
|
-
|
|
20080
|
-
ySpaceHeight += rowRest.height || rowHeight;
|
|
20081
|
-
}
|
|
20583
|
+
const rowRest = fullAllDataRowIdData[rowid] || {};
|
|
20584
|
+
ySpaceHeight += rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight;
|
|
20082
20585
|
}
|
|
20083
20586
|
for (let i = 0; i < startIndex; i++) {
|
|
20084
20587
|
const row = afterFullData[i];
|
|
20085
20588
|
const rowid = getRowid($xeTable, row);
|
|
20086
|
-
const rowRest = fullAllDataRowIdData[rowid];
|
|
20087
|
-
|
|
20088
|
-
topSpaceHeight += rowRest.height || rowHeight;
|
|
20089
|
-
}
|
|
20589
|
+
const rowRest = fullAllDataRowIdData[rowid] || {};
|
|
20590
|
+
topSpaceHeight += rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight;
|
|
20090
20591
|
}
|
|
20091
20592
|
}
|
|
20092
20593
|
} else {
|
|
@@ -20111,19 +20612,19 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20111
20612
|
if (scrollYSpaceEl) {
|
|
20112
20613
|
scrollYSpaceEl.style.height = ySpaceHeight ? `${ySpaceHeight}px` : '';
|
|
20113
20614
|
}
|
|
20114
|
-
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => {
|
|
20615
|
+
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(() => {
|
|
20115
20616
|
updateStyle();
|
|
20116
20617
|
});
|
|
20117
20618
|
},
|
|
20118
20619
|
updateScrollXData() {
|
|
20119
20620
|
const {
|
|
20120
|
-
|
|
20121
|
-
} =
|
|
20621
|
+
isAllOverflow
|
|
20622
|
+
} = reactData;
|
|
20122
20623
|
handleTableColumn();
|
|
20123
20624
|
return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(() => {
|
|
20124
20625
|
handleTableColumn();
|
|
20125
20626
|
$xeTable.updateScrollXSpace();
|
|
20126
|
-
if (!
|
|
20627
|
+
if (!isAllOverflow) {
|
|
20127
20628
|
$xeTable.updateScrollYSpace();
|
|
20128
20629
|
}
|
|
20129
20630
|
});
|
|
@@ -20475,7 +20976,6 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20475
20976
|
editRules
|
|
20476
20977
|
} = props;
|
|
20477
20978
|
const {
|
|
20478
|
-
isCalcColumn,
|
|
20479
20979
|
isGroup,
|
|
20480
20980
|
overflowX,
|
|
20481
20981
|
overflowY,
|
|
@@ -20485,15 +20985,15 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20485
20985
|
initStore,
|
|
20486
20986
|
columnStore,
|
|
20487
20987
|
filterStore,
|
|
20488
|
-
customStore
|
|
20489
|
-
tooltipStore
|
|
20988
|
+
customStore
|
|
20490
20989
|
} = reactData;
|
|
20491
20990
|
const {
|
|
20492
20991
|
leftList,
|
|
20493
20992
|
rightList
|
|
20494
20993
|
} = columnStore;
|
|
20495
20994
|
const loadingSlot = slots.loading;
|
|
20496
|
-
const
|
|
20995
|
+
const tableTipConfig = computeTableTipConfig.value;
|
|
20996
|
+
const validTipConfig = computeValidTipConfig.value;
|
|
20497
20997
|
const validOpts = computeValidOpts.value;
|
|
20498
20998
|
const checkboxOpts = computeCheckboxOpts.value;
|
|
20499
20999
|
const treeOpts = computeTreeOpts.value;
|
|
@@ -20505,7 +21005,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20505
21005
|
const areaOpts = computeAreaOpts.value;
|
|
20506
21006
|
const loadingOpts = computeLoadingOpts.value;
|
|
20507
21007
|
const isMenu = computeIsMenu.value;
|
|
20508
|
-
const currLoading = reactData.
|
|
21008
|
+
const currLoading = reactData.isColLoading || reactData.isRowLoading || loading;
|
|
20509
21009
|
const resizableOpts = computeResizableOpts.value;
|
|
20510
21010
|
const isArea = mouseConfig && mouseOpts.area;
|
|
20511
21011
|
const columnDragOpts = computeColumnDragOpts.value;
|
|
@@ -20526,7 +21026,6 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20526
21026
|
'row--highlight': rowOpts.isHover || highlightHoverRow,
|
|
20527
21027
|
'column--highlight': columnOpts.isHover || highlightHoverColumn,
|
|
20528
21028
|
'checkbox--range': checkboxOpts.range,
|
|
20529
|
-
'column--calc': isCalcColumn,
|
|
20530
21029
|
'col--drag-cell': columnOpts.drag && columnDragOpts.trigger === 'cell',
|
|
20531
21030
|
'is--header': showHeader,
|
|
20532
21031
|
'is--footer': showFooter,
|
|
@@ -20535,7 +21034,6 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20535
21034
|
'is--fixed-left': leftList.length,
|
|
20536
21035
|
'is--fixed-right': rightList.length,
|
|
20537
21036
|
'is--animat': !!props.animat,
|
|
20538
|
-
'is--padding': props.padding,
|
|
20539
21037
|
'is--round': props.round,
|
|
20540
21038
|
'is--stripe': !treeConfig && stripe,
|
|
20541
21039
|
'is--loading': currLoading,
|
|
@@ -20578,11 +21076,20 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20578
21076
|
* 列宽线
|
|
20579
21077
|
*/
|
|
20580
21078
|
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
20581
|
-
key: '
|
|
20582
|
-
ref:
|
|
20583
|
-
class: 'vxe-table--resizable-bar'
|
|
21079
|
+
key: 'tcl',
|
|
21080
|
+
ref: refColResizeBar,
|
|
21081
|
+
class: 'vxe-table--resizable-col-bar'
|
|
21082
|
+
}, resizableOpts.showDragTip ? [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
21083
|
+
class: 'vxe-table--resizable-number-tip'
|
|
21084
|
+
})] : []),
|
|
21085
|
+
/**
|
|
21086
|
+
* 行高线
|
|
21087
|
+
*/
|
|
21088
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
21089
|
+
key: 'trl',
|
|
21090
|
+
ref: refRowResizeBar,
|
|
21091
|
+
class: 'vxe-table--resizable-row-bar'
|
|
20584
21092
|
}, resizableOpts.showDragTip ? [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
|
|
20585
|
-
ref: refCellResizeTip,
|
|
20586
21093
|
class: 'vxe-table--resizable-number-tip'
|
|
20587
21094
|
})] : []),
|
|
20588
21095
|
/**
|
|
@@ -20668,10 +21175,14 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20668
21175
|
/**
|
|
20669
21176
|
* 工具提示
|
|
20670
21177
|
*/
|
|
20671
|
-
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(VxeUITooltipComponent,
|
|
21178
|
+
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)(VxeUITooltipComponent, {
|
|
20672
21179
|
key: 'btp',
|
|
20673
|
-
ref: refTooltip
|
|
20674
|
-
|
|
21180
|
+
ref: refTooltip,
|
|
21181
|
+
theme: tableTipConfig.theme,
|
|
21182
|
+
enterable: tableTipConfig.enterable,
|
|
21183
|
+
enterDelay: tableTipConfig.enterDelay,
|
|
21184
|
+
leaveDelay: tableTipConfig.leaveDelay
|
|
21185
|
+
}),
|
|
20675
21186
|
/**
|
|
20676
21187
|
* 校验提示
|
|
20677
21188
|
*/
|
|
@@ -20681,9 +21192,10 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20681
21192
|
class: [{
|
|
20682
21193
|
'old-cell-valid': editRules && table_getConfig().cellVaildMode === 'obsolete'
|
|
20683
21194
|
}, 'vxe-table--valid-error'],
|
|
20684
|
-
|
|
20685
|
-
|
|
20686
|
-
|
|
21195
|
+
theme: validTipConfig.theme,
|
|
21196
|
+
enterable: validTipConfig.enterable,
|
|
21197
|
+
enterDelay: validTipConfig.enterDelay,
|
|
21198
|
+
leaveDelay: validTipConfig.leaveDelay
|
|
20687
21199
|
}) : table_renderEmptyElement($xeTable)]) : table_renderEmptyElement($xeTable)]);
|
|
20688
21200
|
};
|
|
20689
21201
|
const dataFlag = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)(0);
|
|
@@ -20701,7 +21213,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20701
21213
|
if (value && value.length >= 50000) {
|
|
20702
21214
|
warnLog('vxe.error.errLargeData', ['loadData(data), reloadData(data)']);
|
|
20703
21215
|
}
|
|
20704
|
-
loadTableData(value).then(() => {
|
|
21216
|
+
loadTableData(value, true).then(() => {
|
|
20705
21217
|
const {
|
|
20706
21218
|
scrollXLoad,
|
|
20707
21219
|
scrollYLoad,
|
|
@@ -20796,10 +21308,10 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20796
21308
|
});
|
|
20797
21309
|
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.syncResize, value => {
|
|
20798
21310
|
if (value) {
|
|
20799
|
-
|
|
21311
|
+
handleUpdateResize();
|
|
20800
21312
|
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => {
|
|
20801
|
-
|
|
20802
|
-
setTimeout(() =>
|
|
21313
|
+
handleUpdateResize();
|
|
21314
|
+
setTimeout(() => handleUpdateResize());
|
|
20803
21315
|
});
|
|
20804
21316
|
}
|
|
20805
21317
|
});
|
|
@@ -20914,6 +21426,9 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
20914
21426
|
if (props.showFooter && !(props.footerMethod || props.footerData)) {
|
|
20915
21427
|
warnLog('vxe.error.reqProp', ['footer-data | footer-method']);
|
|
20916
21428
|
}
|
|
21429
|
+
if (rowOpts.height) {
|
|
21430
|
+
warnLog('vxe.error.delProp', ['row-config.height', 'cell-config.height']);
|
|
21431
|
+
}
|
|
20917
21432
|
// if (props.highlightCurrentRow) {
|
|
20918
21433
|
// warnLog('vxe.error.delProp', ['highlight-current-row', 'row-config.isCurrent'])
|
|
20919
21434
|
// }
|
|
@@ -21024,7 +21539,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
|
|
|
21024
21539
|
endIndex: 0,
|
|
21025
21540
|
visibleSize: 0
|
|
21026
21541
|
});
|
|
21027
|
-
loadTableData(data || []).then(() => {
|
|
21542
|
+
loadTableData(data || [], true).then(() => {
|
|
21028
21543
|
if (data && data.length) {
|
|
21029
21544
|
internalData.inited = true;
|
|
21030
21545
|
internalData.initStatus = true;
|
|
@@ -22133,6 +22648,7 @@ edit_hook_hooks.add('tableEditModule', {
|
|
|
22133
22648
|
parent: parentRow,
|
|
22134
22649
|
level: parentLevel + 1,
|
|
22135
22650
|
height: 0,
|
|
22651
|
+
resizeHeight: 0,
|
|
22136
22652
|
oTop: 0
|
|
22137
22653
|
};
|
|
22138
22654
|
fullDataRowIdData[rowid] = rest;
|
|
@@ -22157,6 +22673,7 @@ edit_hook_hooks.add('tableEditModule', {
|
|
|
22157
22673
|
parent: null,
|
|
22158
22674
|
level: 0,
|
|
22159
22675
|
height: 0,
|
|
22676
|
+
resizeHeight: 0,
|
|
22160
22677
|
oTop: 0
|
|
22161
22678
|
};
|
|
22162
22679
|
fullDataRowIdData[rowid] = rest;
|
|
@@ -22212,6 +22729,7 @@ edit_hook_hooks.add('tableEditModule', {
|
|
|
22212
22729
|
parent: null,
|
|
22213
22730
|
level: 0,
|
|
22214
22731
|
height: 0,
|
|
22732
|
+
resizeHeight: 0,
|
|
22215
22733
|
oTop: 0
|
|
22216
22734
|
};
|
|
22217
22735
|
fullDataRowIdData[rowid] = rest;
|
|
@@ -22249,6 +22767,7 @@ edit_hook_hooks.add('tableEditModule', {
|
|
|
22249
22767
|
parent: null,
|
|
22250
22768
|
level: 0,
|
|
22251
22769
|
height: 0,
|
|
22770
|
+
resizeHeight: 0,
|
|
22252
22771
|
oTop: 0
|
|
22253
22772
|
};
|
|
22254
22773
|
fullDataRowIdData[rowid] = rest;
|
|
@@ -22309,6 +22828,7 @@ edit_hook_hooks.add('tableEditModule', {
|
|
|
22309
22828
|
parent: parentRow,
|
|
22310
22829
|
level: parentLevel + 1,
|
|
22311
22830
|
height: 0,
|
|
22831
|
+
resizeHeight: 0,
|
|
22312
22832
|
oTop: 0
|
|
22313
22833
|
};
|
|
22314
22834
|
fullDataRowIdData[rowid] = rest;
|
|
@@ -22383,7 +22903,7 @@ edit_hook_hooks.add('tableEditModule', {
|
|
|
22383
22903
|
const rowid = getRowid($xeTable, newRow);
|
|
22384
22904
|
insertMaps[rowid] = newRow;
|
|
22385
22905
|
});
|
|
22386
|
-
$xeTable.cacheRowMap();
|
|
22906
|
+
$xeTable.cacheRowMap(false);
|
|
22387
22907
|
$xeTable.updateScrollYStatus();
|
|
22388
22908
|
$xeTable.handleTableData(treeConfig && transform);
|
|
22389
22909
|
if (!(treeConfig && transform)) {
|
|
@@ -22646,7 +23166,7 @@ edit_hook_hooks.add('tableEditModule', {
|
|
|
22646
23166
|
editStore.insertMaps = insertDataRowMaps;
|
|
22647
23167
|
reactData.pendingRowMaps = pendingDataRowMaps;
|
|
22648
23168
|
$xeTable.updateFooter();
|
|
22649
|
-
$xeTable.cacheRowMap();
|
|
23169
|
+
$xeTable.cacheRowMap(false);
|
|
22650
23170
|
$xeTable.handleTableData(treeConfig && transform);
|
|
22651
23171
|
if (!(treeConfig && transform)) {
|
|
22652
23172
|
$xeTable.updateAfterDataIndex();
|
|
@@ -23369,7 +23889,21 @@ function getTxtCellValue(val, vMaps) {
|
|
|
23369
23889
|
const rest = replaceTxtCell(val, vMaps);
|
|
23370
23890
|
return rest.replace(/^"+$/g, qVal => '"'.repeat(Math.ceil(qVal.length / 2)));
|
|
23371
23891
|
}
|
|
23372
|
-
function
|
|
23892
|
+
function toExportField(tableConf, field) {
|
|
23893
|
+
const {
|
|
23894
|
+
fieldMaps,
|
|
23895
|
+
titleMaps
|
|
23896
|
+
} = tableConf;
|
|
23897
|
+
// title 转 field
|
|
23898
|
+
if (!fieldMaps[field]) {
|
|
23899
|
+
const teCol = titleMaps[field];
|
|
23900
|
+
if (teCol && teCol.field) {
|
|
23901
|
+
field = teCol.field;
|
|
23902
|
+
}
|
|
23903
|
+
}
|
|
23904
|
+
return field;
|
|
23905
|
+
}
|
|
23906
|
+
function parseCsvAndTxt(tableConf, content, cellSeparator) {
|
|
23373
23907
|
const list = content.split(enterSymbol);
|
|
23374
23908
|
const rows = [];
|
|
23375
23909
|
let fields = [];
|
|
@@ -23390,7 +23924,7 @@ function parseCsvAndTxt(columns, content, cellSeparator) {
|
|
|
23390
23924
|
});
|
|
23391
23925
|
const cells = rVal.split(cellSeparator);
|
|
23392
23926
|
if (!fields.length) {
|
|
23393
|
-
fields = cells.map(val => getTxtCellValue(val.trim(), vMaps));
|
|
23927
|
+
fields = cells.map(val => toExportField(tableConf, getTxtCellValue(val.trim(), vMaps)));
|
|
23394
23928
|
} else {
|
|
23395
23929
|
cells.forEach((val, colIndex) => {
|
|
23396
23930
|
if (colIndex < fields.length) {
|
|
@@ -23407,13 +23941,13 @@ function parseCsvAndTxt(columns, content, cellSeparator) {
|
|
|
23407
23941
|
rows
|
|
23408
23942
|
};
|
|
23409
23943
|
}
|
|
23410
|
-
function parseCsv(
|
|
23411
|
-
return parseCsvAndTxt(
|
|
23944
|
+
function parseCsv(tableConf, content) {
|
|
23945
|
+
return parseCsvAndTxt(tableConf, content, ',');
|
|
23412
23946
|
}
|
|
23413
|
-
function parseTxt(
|
|
23414
|
-
return parseCsvAndTxt(
|
|
23947
|
+
function parseTxt(tableConf, content) {
|
|
23948
|
+
return parseCsvAndTxt(tableConf, content, '\t');
|
|
23415
23949
|
}
|
|
23416
|
-
function parseHTML(
|
|
23950
|
+
function parseHTML(tableConf, content) {
|
|
23417
23951
|
const domParser = new DOMParser();
|
|
23418
23952
|
const xmlDoc = domParser.parseFromString(content, 'text/html');
|
|
23419
23953
|
const bodyNodes = getElementsByTagName(xmlDoc, 'body');
|
|
@@ -23426,7 +23960,7 @@ function parseHTML(columns, content) {
|
|
|
23426
23960
|
if (theadNodes.length) {
|
|
23427
23961
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(getElementsByTagName(theadNodes[0], 'tr'), rowNode => {
|
|
23428
23962
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(getElementsByTagName(rowNode, 'th'), cellNode => {
|
|
23429
|
-
fields.push(cellNode.textContent);
|
|
23963
|
+
fields.push(toExportField(tableConf, cellNode.textContent || ''));
|
|
23430
23964
|
});
|
|
23431
23965
|
});
|
|
23432
23966
|
const tbodyNodes = getElementsByTagName(tableNodes[0], 'tbody');
|
|
@@ -23449,7 +23983,7 @@ function parseHTML(columns, content) {
|
|
|
23449
23983
|
rows
|
|
23450
23984
|
};
|
|
23451
23985
|
}
|
|
23452
|
-
function parseXML(
|
|
23986
|
+
function parseXML(tableConf, content) {
|
|
23453
23987
|
const domParser = new DOMParser();
|
|
23454
23988
|
const xmlDoc = domParser.parseFromString(content, 'application/xml');
|
|
23455
23989
|
const sheetNodes = getElementsByTagName(xmlDoc, 'Worksheet');
|
|
@@ -23461,7 +23995,7 @@ function parseXML(columns, content) {
|
|
|
23461
23995
|
const rowNodes = getElementsByTagName(tableNodes[0], 'Row');
|
|
23462
23996
|
if (rowNodes.length) {
|
|
23463
23997
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(getElementsByTagName(rowNodes[0], 'Cell'), cellNode => {
|
|
23464
|
-
fields.push(cellNode.textContent);
|
|
23998
|
+
fields.push(toExportField(tableConf, cellNode.textContent || ''));
|
|
23465
23999
|
});
|
|
23466
24000
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().arrayEach(rowNodes, (rowNode, index) => {
|
|
23467
24001
|
if (index) {
|
|
@@ -23494,21 +24028,6 @@ function clearColumnConvert(columns) {
|
|
|
23494
24028
|
children: 'children'
|
|
23495
24029
|
});
|
|
23496
24030
|
}
|
|
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
24031
|
const tableExportMethodKeys = ['exportData', 'importByFile', 'importData', 'saveFile', 'readFile', 'print', 'getPrintHtml', 'openImport', 'closeImport', 'openExport', 'closeExport', 'openPrint', 'closePrint'];
|
|
23513
24032
|
export_hook_hooks.add('tableExportModule', {
|
|
23514
24033
|
setupTable($xeTable) {
|
|
@@ -24137,25 +24656,41 @@ export_hook_hooks.add('tableExportModule', {
|
|
|
24137
24656
|
fields: [],
|
|
24138
24657
|
rows: []
|
|
24139
24658
|
};
|
|
24659
|
+
const tableFieldMaps = {};
|
|
24660
|
+
const tableTitleMaps = {};
|
|
24661
|
+
tableFullColumn.forEach(column => {
|
|
24662
|
+
const field = column.field;
|
|
24663
|
+
const title = column.getTitle();
|
|
24664
|
+
if (field) {
|
|
24665
|
+
tableFieldMaps[field] = column;
|
|
24666
|
+
}
|
|
24667
|
+
if (title) {
|
|
24668
|
+
tableTitleMaps[column.getTitle()] = column;
|
|
24669
|
+
}
|
|
24670
|
+
});
|
|
24671
|
+
const tableConf = {
|
|
24672
|
+
fieldMaps: tableFieldMaps,
|
|
24673
|
+
titleMaps: tableTitleMaps
|
|
24674
|
+
};
|
|
24140
24675
|
switch (opts.type) {
|
|
24141
24676
|
case 'csv':
|
|
24142
|
-
rest = parseCsv(
|
|
24677
|
+
rest = parseCsv(tableConf, content);
|
|
24143
24678
|
break;
|
|
24144
24679
|
case 'txt':
|
|
24145
|
-
rest = parseTxt(
|
|
24680
|
+
rest = parseTxt(tableConf, content);
|
|
24146
24681
|
break;
|
|
24147
24682
|
case 'html':
|
|
24148
|
-
rest = parseHTML(
|
|
24683
|
+
rest = parseHTML(tableConf, content);
|
|
24149
24684
|
break;
|
|
24150
24685
|
case 'xml':
|
|
24151
|
-
rest = parseXML(
|
|
24686
|
+
rest = parseXML(tableConf, content);
|
|
24152
24687
|
break;
|
|
24153
24688
|
}
|
|
24154
24689
|
const {
|
|
24155
24690
|
fields,
|
|
24156
24691
|
rows
|
|
24157
24692
|
} = rest;
|
|
24158
|
-
const status =
|
|
24693
|
+
const status = fields.some(field => tableFieldMaps[field] || tableTitleMaps[field]);
|
|
24159
24694
|
if (status) {
|
|
24160
24695
|
$xeTable.createData(rows).then(data => {
|
|
24161
24696
|
let loadRest;
|
|
@@ -24313,6 +24848,43 @@ export_hook_hooks.add('tableExportModule', {
|
|
|
24313
24848
|
return Promise.reject(e);
|
|
24314
24849
|
});
|
|
24315
24850
|
};
|
|
24851
|
+
const handleFilterColumns = (exportOpts, column, columns) => {
|
|
24852
|
+
return columns.some(item => {
|
|
24853
|
+
if (isColumnInfo(item)) {
|
|
24854
|
+
return column.id === item.id;
|
|
24855
|
+
} else if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isString(item)) {
|
|
24856
|
+
return column.field === item;
|
|
24857
|
+
} else {
|
|
24858
|
+
const colid = item.id || item.colId;
|
|
24859
|
+
const type = item.type;
|
|
24860
|
+
const field = item.field;
|
|
24861
|
+
if (colid) {
|
|
24862
|
+
return column.id === colid;
|
|
24863
|
+
} else if (field && type) {
|
|
24864
|
+
return column.field === field && column.type === type;
|
|
24865
|
+
} else if (field) {
|
|
24866
|
+
return column.field === field;
|
|
24867
|
+
} else if (type) {
|
|
24868
|
+
return column.type === type;
|
|
24869
|
+
}
|
|
24870
|
+
}
|
|
24871
|
+
return false;
|
|
24872
|
+
});
|
|
24873
|
+
};
|
|
24874
|
+
const handleFilterFields = (exportOpts, column, includeFields, excludeFields) => {
|
|
24875
|
+
if (excludeFields) {
|
|
24876
|
+
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().includes(excludeFields, column.field)) {
|
|
24877
|
+
return false;
|
|
24878
|
+
}
|
|
24879
|
+
}
|
|
24880
|
+
if (includeFields) {
|
|
24881
|
+
if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().includes(includeFields, column.field)) {
|
|
24882
|
+
return true;
|
|
24883
|
+
}
|
|
24884
|
+
return false;
|
|
24885
|
+
}
|
|
24886
|
+
return exportOpts.original ? column.field : defaultFilterExportColumn(column);
|
|
24887
|
+
};
|
|
24316
24888
|
const handleExportAndPrint = (options, isPrint) => {
|
|
24317
24889
|
const {
|
|
24318
24890
|
treeConfig,
|
|
@@ -24353,7 +24925,9 @@ export_hook_hooks.add('tableExportModule', {
|
|
|
24353
24925
|
const checkMethod = customOpts.checkMethod;
|
|
24354
24926
|
const exportColumns = collectColumn.slice(0);
|
|
24355
24927
|
const {
|
|
24356
|
-
columns
|
|
24928
|
+
columns,
|
|
24929
|
+
excludeFields,
|
|
24930
|
+
includeFields
|
|
24357
24931
|
} = defOpts;
|
|
24358
24932
|
// 处理类型
|
|
24359
24933
|
const typeList = types.map(value => {
|
|
@@ -24377,33 +24951,19 @@ export_hook_hooks.add('tableExportModule', {
|
|
|
24377
24951
|
// 默认选中
|
|
24378
24952
|
external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().eachTree(exportColumns, (column, index, items, path, parent) => {
|
|
24379
24953
|
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);
|
|
24954
|
+
let isChecked = false;
|
|
24955
|
+
if (columns && columns.length) {
|
|
24956
|
+
isChecked = handleFilterColumns(defOpts, column, columns);
|
|
24957
|
+
} else if (excludeFields || includeFields) {
|
|
24958
|
+
isChecked = handleFilterFields(defOpts, column, includeFields, excludeFields);
|
|
24959
|
+
} else {
|
|
24960
|
+
isChecked = column.visible && (isColGroup || defaultFilterExportColumn(column));
|
|
24406
24961
|
}
|
|
24962
|
+
column.checked = isChecked;
|
|
24963
|
+
column.halfChecked = false;
|
|
24964
|
+
column.disabled = parent && parent.disabled || (checkMethod ? !checkMethod({
|
|
24965
|
+
column
|
|
24966
|
+
}) : false);
|
|
24407
24967
|
});
|
|
24408
24968
|
// 更新条件
|
|
24409
24969
|
Object.assign(exportStore, {
|
|
@@ -25040,38 +25600,75 @@ keyboard_hook_hooks.add('tableKeyboardModule', {
|
|
|
25040
25600
|
computeEditOpts,
|
|
25041
25601
|
computeCheckboxOpts,
|
|
25042
25602
|
computeMouseOpts,
|
|
25043
|
-
computeTreeOpts
|
|
25603
|
+
computeTreeOpts,
|
|
25604
|
+
computeRowOpts,
|
|
25605
|
+
computeCellOpts,
|
|
25606
|
+
computeDefaultRowHeight
|
|
25044
25607
|
} = $xeTable.getComputeMaps();
|
|
25045
25608
|
function getCheckboxRangeRows(evnt, params, targetTrElem, trRect, offsetClientTop, moveRange) {
|
|
25609
|
+
const {
|
|
25610
|
+
showOverflow
|
|
25611
|
+
} = props;
|
|
25612
|
+
const {
|
|
25613
|
+
fullAllDataRowIdData,
|
|
25614
|
+
isResizeCellHeight
|
|
25615
|
+
} = internalData;
|
|
25616
|
+
const rowOpts = computeRowOpts.value;
|
|
25617
|
+
const cellOpts = computeCellOpts.value;
|
|
25618
|
+
const defaultRowHeight = computeDefaultRowHeight.value;
|
|
25619
|
+
const {
|
|
25620
|
+
row
|
|
25621
|
+
} = params;
|
|
25046
25622
|
let countHeight = 0;
|
|
25047
25623
|
let rangeRows = [];
|
|
25048
25624
|
let moveSize = 0;
|
|
25049
25625
|
const isDown = moveRange > 0;
|
|
25050
25626
|
const {
|
|
25051
|
-
scrollYLoad
|
|
25052
|
-
rowHeight
|
|
25627
|
+
scrollYLoad
|
|
25053
25628
|
} = reactData;
|
|
25054
25629
|
const {
|
|
25055
25630
|
afterFullData
|
|
25056
25631
|
} = internalData;
|
|
25632
|
+
if (isDown) {
|
|
25633
|
+
moveSize = offsetClientTop + moveRange;
|
|
25634
|
+
} else {
|
|
25635
|
+
moveSize = trRect.height - offsetClientTop + Math.abs(moveRange);
|
|
25636
|
+
}
|
|
25057
25637
|
if (scrollYLoad) {
|
|
25058
|
-
|
|
25059
|
-
|
|
25060
|
-
|
|
25061
|
-
|
|
25062
|
-
|
|
25063
|
-
|
|
25064
|
-
|
|
25065
|
-
|
|
25638
|
+
const _rowIndex = $xeTable.getVTRowIndex(row);
|
|
25639
|
+
const isCustomCellHeight = isResizeCellHeight || cellOpts.height || rowOpts.height;
|
|
25640
|
+
if (!isCustomCellHeight && showOverflow) {
|
|
25641
|
+
if (isDown) {
|
|
25642
|
+
rangeRows = afterFullData.slice(_rowIndex, _rowIndex + Math.ceil(moveSize / defaultRowHeight));
|
|
25643
|
+
} else {
|
|
25644
|
+
rangeRows = afterFullData.slice(_rowIndex - Math.floor(moveSize / defaultRowHeight), _rowIndex + 1);
|
|
25645
|
+
}
|
|
25066
25646
|
} else {
|
|
25067
|
-
|
|
25647
|
+
if (isDown) {
|
|
25648
|
+
for (let i = _rowIndex; i < afterFullData.length; i++) {
|
|
25649
|
+
const item = afterFullData[i];
|
|
25650
|
+
const rowid = $xeTable.getRowid(item);
|
|
25651
|
+
const rowRest = fullAllDataRowIdData[rowid] || {};
|
|
25652
|
+
countHeight += rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight;
|
|
25653
|
+
rangeRows.push(item);
|
|
25654
|
+
if (countHeight > moveSize) {
|
|
25655
|
+
return rangeRows;
|
|
25656
|
+
}
|
|
25657
|
+
}
|
|
25658
|
+
} else {
|
|
25659
|
+
for (let len = _rowIndex; len >= 0; len--) {
|
|
25660
|
+
const item = afterFullData[len];
|
|
25661
|
+
const rowid = $xeTable.getRowid(item);
|
|
25662
|
+
const rowRest = fullAllDataRowIdData[rowid] || {};
|
|
25663
|
+
countHeight += rowRest.resizeHeight || cellOpts.height || rowOpts.height || rowRest.height || defaultRowHeight;
|
|
25664
|
+
rangeRows.push(item);
|
|
25665
|
+
if (countHeight > moveSize) {
|
|
25666
|
+
return rangeRows;
|
|
25667
|
+
}
|
|
25668
|
+
}
|
|
25669
|
+
}
|
|
25068
25670
|
}
|
|
25069
25671
|
} else {
|
|
25070
|
-
if (isDown) {
|
|
25071
|
-
moveSize = evnt.clientY - trRect.y;
|
|
25072
|
-
} else {
|
|
25073
|
-
moveSize = trRect.y - evnt.clientY + trRect.height;
|
|
25074
|
-
}
|
|
25075
25672
|
const siblingProp = isDown ? 'next' : 'previous';
|
|
25076
25673
|
while (targetTrElem && countHeight < moveSize) {
|
|
25077
25674
|
const rowNodeRest = $xeTable.getRowNode(targetTrElem);
|
|
@@ -25085,24 +25682,30 @@ keyboard_hook_hooks.add('tableKeyboardModule', {
|
|
|
25085
25682
|
return rangeRows;
|
|
25086
25683
|
}
|
|
25087
25684
|
const handleCheckboxRangeEvent = (evnt, params) => {
|
|
25685
|
+
const {
|
|
25686
|
+
elemStore
|
|
25687
|
+
} = internalData;
|
|
25688
|
+
const bodyScrollElem = getRefElem(elemStore['main-body-scroll']);
|
|
25689
|
+
const leftScrollElem = getRefElem(elemStore['left-body-scroll']);
|
|
25690
|
+
const rightScrollElem = getRefElem(elemStore['right-body-scroll']);
|
|
25088
25691
|
const {
|
|
25089
25692
|
column,
|
|
25090
25693
|
cell
|
|
25091
25694
|
} = params;
|
|
25092
25695
|
if (column.type === 'checkbox') {
|
|
25093
|
-
|
|
25094
|
-
|
|
25095
|
-
|
|
25096
|
-
}
|
|
25097
|
-
|
|
25098
|
-
|
|
25099
|
-
const bodyWrapperElem = getRefElem(elemStore[`${column.fixed || 'main'}-body-wrapper`] || elemStore['main-body-wrapper']);
|
|
25696
|
+
let bodyWrapperElem = bodyScrollElem;
|
|
25697
|
+
if (leftScrollElem && column.fixed === 'left') {
|
|
25698
|
+
bodyWrapperElem = leftScrollElem;
|
|
25699
|
+
} else if (rightScrollElem && column.fixed === 'right') {
|
|
25700
|
+
bodyWrapperElem = rightScrollElem;
|
|
25701
|
+
}
|
|
25100
25702
|
if (!bodyWrapperElem) {
|
|
25101
25703
|
return;
|
|
25102
25704
|
}
|
|
25705
|
+
const el = refElem.value;
|
|
25706
|
+
const disX = evnt.clientX;
|
|
25707
|
+
const disY = evnt.clientY;
|
|
25103
25708
|
const checkboxRangeElem = bodyWrapperElem.querySelector('.vxe-table--checkbox-range');
|
|
25104
|
-
const domMousemove = document.onmousemove;
|
|
25105
|
-
const domMouseup = document.onmouseup;
|
|
25106
25709
|
const trElem = cell.parentElement;
|
|
25107
25710
|
const selectRecords = $xeTable.getCheckboxRecords();
|
|
25108
25711
|
let lastRangeRows = [];
|
|
@@ -25245,8 +25848,8 @@ keyboard_hook_hooks.add('tableKeyboardModule', {
|
|
|
25245
25848
|
stopMouseScroll();
|
|
25246
25849
|
removeClass(el, 'drag--range');
|
|
25247
25850
|
checkboxRangeElem.removeAttribute('style');
|
|
25248
|
-
document.onmousemove =
|
|
25249
|
-
document.onmouseup =
|
|
25851
|
+
document.onmousemove = null;
|
|
25852
|
+
document.onmouseup = null;
|
|
25250
25853
|
triggerEvent('end', evnt);
|
|
25251
25854
|
};
|
|
25252
25855
|
triggerEvent('start', evnt);
|
|
@@ -28229,7 +28832,7 @@ const {
|
|
|
28229
28832
|
renderEmptyElement: grid_renderEmptyElement
|
|
28230
28833
|
} = core_.VxeUI;
|
|
28231
28834
|
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'];
|
|
28835
|
+
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
28836
|
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
28837
|
/* harmony default export */ var grid = ((0,external_commonjs_vue_commonjs2_vue_root_Vue_.defineComponent)({
|
|
28235
28838
|
name: 'VxeGrid',
|
|
@@ -29869,7 +30472,8 @@ const Grid = VxeGrid;
|
|
|
29869
30472
|
customRestore: '恢复默认',
|
|
29870
30473
|
maxFixedCol: '最大冻结列的数量不能超过 {0} 个',
|
|
29871
30474
|
dragTip: '移动:{0}',
|
|
29872
|
-
resizeColTip: '{0} 像素'
|
|
30475
|
+
resizeColTip: '宽:{0} 像素',
|
|
30476
|
+
resizeRowTip: '高:{0} 像素'
|
|
29873
30477
|
},
|
|
29874
30478
|
grid: {
|
|
29875
30479
|
selectOneRecord: '请至少选择一条记录!',
|