vxe-table 4.19.7 → 4.19.9
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/dist/all.esm.js +384 -73
- package/dist/style.css +1 -1
- package/es/grid/src/grid.js +1 -1
- package/es/style.css +1 -1
- package/es/table/render/index.js +153 -14
- package/es/table/src/table.js +210 -56
- package/es/table/src/util.js +19 -1
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/grid/src/grid.js +1 -1
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.umd.js +315 -31
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/render/index.js +259 -15
- package/lib/table/render/index.min.js +1 -1
- package/lib/table/src/table.js +31 -12
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +20 -1
- package/lib/table/src/util.min.js +1 -1
- package/lib/ui/index.js +1 -1
- 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/package.json +2 -2
- package/packages/grid/src/grid.ts +1 -1
- package/packages/table/render/index.ts +156 -15
- package/packages/table/src/table.ts +217 -58
- package/packages/table/src/util.ts +23 -1
- /package/es/{iconfont.1780638747281.ttf → iconfont.1780878117167.ttf} +0 -0
- /package/es/{iconfont.1780638747281.woff → iconfont.1780878117167.woff} +0 -0
- /package/es/{iconfont.1780638747281.woff2 → iconfont.1780878117167.woff2} +0 -0
- /package/lib/{iconfont.1780638747281.ttf → iconfont.1780878117167.ttf} +0 -0
- /package/lib/{iconfont.1780638747281.woff → iconfont.1780878117167.woff} +0 -0
- /package/lib/{iconfont.1780638747281.woff2 → iconfont.1780878117167.woff2} +0 -0
|
@@ -4,7 +4,7 @@ import XEUtils from 'xe-utils'
|
|
|
4
4
|
import { initTpImg, getTpImg, isPx, isScale, hasClass, addClass, removeClass, wheelScrollTopTo, wheelScrollLeftTo, getEventTargetNode, getPaddingTopBottomSize, setScrollTop, setScrollLeft, toCssUnit, hasControlKey, checkTargetElement, hasEventInputTarget } from '../../ui/src/dom'
|
|
5
5
|
import { getLastZIndex, nextZIndex, hasChildrenList, getFuncText, isEnableConf, formatText, eqEmptyValue } from '../../ui/src/utils'
|
|
6
6
|
import { VxeUI } from '../../ui'
|
|
7
|
-
import { createReactData, createInternalData, getRowUniqueId, createRowId, clearTableAllStatus, getColumnList, toFilters, hasDeepKey, getRowkey, getRowid, rowToVisible, colToVisible, getCellValue, setCellValue, handleRowidOrRow, handleFieldOrColumn, toTreePathSeq, restoreScrollLocation, getRootColumn, getRefElem, getColReMinWidth, getColReMaxWidth, createHandleUpdateRowId, createHandleGetRowId, getCalcHeight, getCellRestHeight, getLastChildColumn } from './util'
|
|
7
|
+
import { createReactData, createInternalData, getRowUniqueId, createRowId, clearTableAllStatus, getColumnList, toFilters, hasDeepKey, getRowkey, getRowid, rowToVisible, colToVisible, getCellValue, setCellValue, handleRowidOrRow, handleFieldOrColumn, toTreePathSeq, restoreScrollLocation, getRootColumn, getRefElem, getColReMinWidth, getColReMaxWidth, createHandleUpdateRowId, createHandleGetRowId, getCalcHeight, getCellRestHeight, getLastChildColumn, getRowMaxHeight } from './util'
|
|
8
8
|
import { getSlotVNs } from '../../ui/src/vn'
|
|
9
9
|
import { moveRowAnimateToTb, clearRowAnimate, moveColAnimateToLr, clearColAnimate } from '../../ui/src/anime'
|
|
10
10
|
import { warnLog, errLog } from '../../ui/src/log'
|
|
@@ -2098,34 +2098,38 @@ export default defineVxeComponent({
|
|
|
2098
2098
|
/**
|
|
2099
2099
|
* 计算自适应行高
|
|
2100
2100
|
*/
|
|
2101
|
-
const calcCellAutoHeight = (rowRest: VxeTableDefines.RowCacheItem, wrapperEl: HTMLDivElement) => {
|
|
2102
|
-
const {
|
|
2101
|
+
const calcCellAutoHeight = (rowid: string | number, rowRest: VxeTableDefines.RowCacheItem, wrapperEl: HTMLDivElement) => {
|
|
2102
|
+
const { fullCellHeightMaps } = internalData
|
|
2103
|
+
let chRest = fullCellHeightMaps[rowid]
|
|
2104
|
+
if (!chRest) {
|
|
2105
|
+
chRest = {}
|
|
2106
|
+
fullCellHeightMaps[rowid] = chRest
|
|
2107
|
+
}
|
|
2103
2108
|
const wrapperElemList = wrapperEl.querySelectorAll(`.vxe-cell--wrapper[rowid="${rowRest.rowid}"]`)
|
|
2104
|
-
let colHeight = 0
|
|
2105
2109
|
let firstCellStyle: CSSStyleDeclaration | null = null
|
|
2106
2110
|
let topBottomPadding = 0
|
|
2111
|
+
let changeCH = false
|
|
2107
2112
|
for (let i = 0; i < wrapperElemList.length; i++) {
|
|
2108
2113
|
const wrapperElem = wrapperElemList[i] as HTMLElement
|
|
2109
2114
|
const cellElem = wrapperElem.parentElement as HTMLTableCellElement
|
|
2110
2115
|
const cellStyle = cellElem.style
|
|
2111
2116
|
const orHeight = cellStyle.height
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
}
|
|
2117
|
+
const colid = wrapperElem.getAttribute('colid') || ''
|
|
2118
|
+
cellStyle.height = ''
|
|
2115
2119
|
if (!firstCellStyle) {
|
|
2116
2120
|
firstCellStyle = getComputedStyle(cellElem)
|
|
2117
2121
|
topBottomPadding = firstCellStyle ? Math.ceil(XEUtils.toNumber(firstCellStyle.paddingTop) + XEUtils.toNumber(firstCellStyle.paddingBottom)) : 0
|
|
2118
2122
|
}
|
|
2119
|
-
if (!scrollXLoad) {
|
|
2120
|
-
cellStyle.height = orHeight
|
|
2121
|
-
}
|
|
2122
2123
|
const cellHeight = wrapperElem ? wrapperElem.clientHeight : 0
|
|
2123
|
-
colHeight = Math.
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2124
|
+
const colHeight = Math.ceil(cellHeight + topBottomPadding)
|
|
2125
|
+
if (chRest[colid] !== colHeight) {
|
|
2126
|
+
changeCH = true
|
|
2127
|
+
chRest[colid] = colHeight
|
|
2128
|
+
}
|
|
2129
|
+
cellStyle.height = orHeight
|
|
2127
2130
|
}
|
|
2128
|
-
|
|
2131
|
+
const cellMaxHeight = getRowMaxHeight(chRest, changeCH)
|
|
2132
|
+
return cellMaxHeight
|
|
2129
2133
|
}
|
|
2130
2134
|
|
|
2131
2135
|
/**
|
|
@@ -2148,7 +2152,7 @@ export default defineVxeComponent({
|
|
|
2148
2152
|
const rowid = handleGetRowId(row)
|
|
2149
2153
|
const rowRest = fullAllDataRowIdData[rowid]
|
|
2150
2154
|
if (rowRest) {
|
|
2151
|
-
const reHeight = calcCellAutoHeight(rowRest, el)
|
|
2155
|
+
const reHeight = calcCellAutoHeight(rowid, rowRest, el)
|
|
2152
2156
|
rowRest.height = Math.max(defaultRowHeight, reHeight)
|
|
2153
2157
|
}
|
|
2154
2158
|
el.removeAttribute('data-calc-row')
|
|
@@ -3438,7 +3442,6 @@ export default defineVxeComponent({
|
|
|
3438
3442
|
|
|
3439
3443
|
const handleRecalculateStyle = (reFull: boolean, reWidth: boolean, reHeight: boolean) => {
|
|
3440
3444
|
const el = refElem.value
|
|
3441
|
-
internalData.rceRunTime = Date.now()
|
|
3442
3445
|
if (!el || !el.clientWidth) {
|
|
3443
3446
|
return nextTick()
|
|
3444
3447
|
}
|
|
@@ -3462,6 +3465,7 @@ export default defineVxeComponent({
|
|
|
3462
3465
|
if (reFull) {
|
|
3463
3466
|
updateTreeLineStyle()
|
|
3464
3467
|
}
|
|
3468
|
+
internalData.rceRunTime = Date.now()
|
|
3465
3469
|
return computeScrollLoad().then(() => {
|
|
3466
3470
|
// 初始化时需要在列计算之后再执行优化运算,达到最优显示效果
|
|
3467
3471
|
if (reWidth) {
|
|
@@ -3482,19 +3486,31 @@ export default defineVxeComponent({
|
|
|
3482
3486
|
if (reFull) {
|
|
3483
3487
|
updateTreeLineStyle()
|
|
3484
3488
|
}
|
|
3489
|
+
internalData.rceRunTime = Date.now()
|
|
3485
3490
|
if (reFull) {
|
|
3486
3491
|
return computeScrollLoad()
|
|
3487
3492
|
}
|
|
3488
3493
|
})
|
|
3489
3494
|
}
|
|
3490
3495
|
|
|
3496
|
+
const minRunDelay = 50
|
|
3497
|
+
|
|
3491
3498
|
const handleLazyRecalculate = (reFull: boolean, reWidth: boolean, reHeight: boolean) => {
|
|
3492
3499
|
return new Promise<void>(resolve => {
|
|
3493
3500
|
const $xeGanttView = internalData.xeGanttView
|
|
3494
3501
|
const { customStore } = reactData
|
|
3495
3502
|
const { rceTimeout, rceRunTime } = internalData
|
|
3496
3503
|
const resizeOpts = computeResizeOpts.value
|
|
3497
|
-
|
|
3504
|
+
let rceDelay = internalData.rceDelay
|
|
3505
|
+
// 如果在500毫秒内频繁执行,则执行次数减缓
|
|
3506
|
+
if (rceRunTime && rceRunTime > Date.now() - 500) {
|
|
3507
|
+
rceDelay += 50
|
|
3508
|
+
} else {
|
|
3509
|
+
rceDelay = 0
|
|
3510
|
+
}
|
|
3511
|
+
internalData.rceDelay = rceDelay
|
|
3512
|
+
const refreshDelay = resizeOpts.refreshDelay || 30
|
|
3513
|
+
const reDelay = rceDelay + refreshDelay
|
|
3498
3514
|
const el = refElem.value
|
|
3499
3515
|
if (el && el.clientWidth) {
|
|
3500
3516
|
autoCellWidth()
|
|
@@ -3505,7 +3521,7 @@ export default defineVxeComponent({
|
|
|
3505
3521
|
}
|
|
3506
3522
|
if (rceTimeout) {
|
|
3507
3523
|
clearTimeout(rceTimeout)
|
|
3508
|
-
if (rceRunTime && rceRunTime +
|
|
3524
|
+
if (rceRunTime && rceRunTime + minRunDelay < Date.now()) {
|
|
3509
3525
|
resolve(
|
|
3510
3526
|
handleRecalculateStyle(reFull, reWidth, reHeight)
|
|
3511
3527
|
)
|
|
@@ -3525,12 +3541,25 @@ export default defineVxeComponent({
|
|
|
3525
3541
|
internalData.rceTimeout = setTimeout(() => {
|
|
3526
3542
|
internalData.rceTimeout = undefined
|
|
3527
3543
|
handleRecalculateStyle(reFull, reWidth, reHeight)
|
|
3528
|
-
|
|
3544
|
+
if ($xeGanttView && $xeGanttView.handleLazyRecalculate) {
|
|
3545
|
+
$xeGanttView.handleLazyRecalculate()
|
|
3546
|
+
}
|
|
3547
|
+
}, reDelay)
|
|
3529
3548
|
})
|
|
3530
3549
|
}
|
|
3531
3550
|
|
|
3551
|
+
let resizePending = false
|
|
3552
|
+
|
|
3532
3553
|
const handleResizeEvent = () => {
|
|
3533
|
-
|
|
3554
|
+
if (resizePending) {
|
|
3555
|
+
return
|
|
3556
|
+
}
|
|
3557
|
+
resizePending = true
|
|
3558
|
+
handleLazyRecalculate(true, true, true).then(() => {
|
|
3559
|
+
resizePending = false
|
|
3560
|
+
}).catch(() => {
|
|
3561
|
+
resizePending = false
|
|
3562
|
+
})
|
|
3534
3563
|
}
|
|
3535
3564
|
|
|
3536
3565
|
const handleUpdateAggValues = () => {
|
|
@@ -3881,6 +3910,8 @@ export default defineVxeComponent({
|
|
|
3881
3910
|
reactData.insertRowFlag++
|
|
3882
3911
|
internalData.removeRowMaps = {}
|
|
3883
3912
|
reactData.removeRowFlag++
|
|
3913
|
+
internalData.fullCellHeightMaps = {}
|
|
3914
|
+
internalData.fullCellStoreMaps = {}
|
|
3884
3915
|
const sYLoad = updateScrollYStatus(fullData)
|
|
3885
3916
|
// 全量数据
|
|
3886
3917
|
internalData.tableFullData = fullData
|
|
@@ -4243,8 +4274,45 @@ export default defineVxeComponent({
|
|
|
4243
4274
|
internalData.fullColumnFieldData = fullColFieldData
|
|
4244
4275
|
}
|
|
4245
4276
|
|
|
4246
|
-
const
|
|
4277
|
+
const buildColumnInfo = () => {
|
|
4278
|
+
const { scrollXLoad, scrollYLoad, expandColumn } = reactData
|
|
4247
4279
|
const expandOpts = computeExpandOpts.value
|
|
4280
|
+
cacheColumnMap()
|
|
4281
|
+
parseColumns(true).then(() => {
|
|
4282
|
+
if (reactData.scrollXLoad) {
|
|
4283
|
+
loadScrollXData()
|
|
4284
|
+
}
|
|
4285
|
+
})
|
|
4286
|
+
$xeTable.clearHeaderFormatterCache()
|
|
4287
|
+
$xeTable.clearMergeCells()
|
|
4288
|
+
$xeTable.clearMergeFooterItems()
|
|
4289
|
+
$xeTable.handleTableData(true)
|
|
4290
|
+
$xeTable.handleAggregateSummaryData()
|
|
4291
|
+
|
|
4292
|
+
if ((scrollXLoad || scrollYLoad) && (expandColumn && expandOpts.mode !== 'fixed')) {
|
|
4293
|
+
warnLog('vxe.error.scrollErrProp', ['column.type=expand'])
|
|
4294
|
+
}
|
|
4295
|
+
|
|
4296
|
+
return nextTick().then(() => {
|
|
4297
|
+
if ($xeToolbar) {
|
|
4298
|
+
$xeToolbar.syncUpdate({
|
|
4299
|
+
collectColumn: internalData.collectColumn,
|
|
4300
|
+
$table: $xeTable
|
|
4301
|
+
})
|
|
4302
|
+
}
|
|
4303
|
+
if ($xeTable.handleUpdateCustomColumn) {
|
|
4304
|
+
$xeTable.handleUpdateCustomColumn()
|
|
4305
|
+
}
|
|
4306
|
+
const columnOpts = computeColumnOpts.value
|
|
4307
|
+
if (props.showCustomHeader && reactData.isGroup && (columnOpts.resizable || props.resizable)) {
|
|
4308
|
+
warnLog('vxe.error.notConflictProp', ['show-custom-header & colgroup', 'column-config.resizable=false'])
|
|
4309
|
+
}
|
|
4310
|
+
reactData.isColLoading = false
|
|
4311
|
+
return handleLazyRecalculate(false, true, true)
|
|
4312
|
+
})
|
|
4313
|
+
}
|
|
4314
|
+
|
|
4315
|
+
const handleInitColumn = (collectColumn: VxeTableDefines.ColumnInfo[]) => {
|
|
4248
4316
|
internalData.collectColumn = collectColumn
|
|
4249
4317
|
const tFullColumn = getColumnList(collectColumn)
|
|
4250
4318
|
internalData.tableFullColumn = tFullColumn
|
|
@@ -4254,40 +4322,7 @@ export default defineVxeComponent({
|
|
|
4254
4322
|
return Promise.resolve(
|
|
4255
4323
|
restoreCustomStorage()
|
|
4256
4324
|
).then(() => {
|
|
4257
|
-
|
|
4258
|
-
cacheColumnMap()
|
|
4259
|
-
parseColumns(true).then(() => {
|
|
4260
|
-
if (reactData.scrollXLoad) {
|
|
4261
|
-
loadScrollXData()
|
|
4262
|
-
}
|
|
4263
|
-
})
|
|
4264
|
-
$xeTable.clearHeaderFormatterCache()
|
|
4265
|
-
$xeTable.clearMergeCells()
|
|
4266
|
-
$xeTable.clearMergeFooterItems()
|
|
4267
|
-
$xeTable.handleTableData(true)
|
|
4268
|
-
$xeTable.handleAggregateSummaryData()
|
|
4269
|
-
|
|
4270
|
-
if ((scrollXLoad || scrollYLoad) && (expandColumn && expandOpts.mode !== 'fixed')) {
|
|
4271
|
-
warnLog('vxe.error.scrollErrProp', ['column.type=expand'])
|
|
4272
|
-
}
|
|
4273
|
-
|
|
4274
|
-
return nextTick().then(() => {
|
|
4275
|
-
if ($xeToolbar) {
|
|
4276
|
-
$xeToolbar.syncUpdate({
|
|
4277
|
-
collectColumn: internalData.collectColumn,
|
|
4278
|
-
$table: $xeTable
|
|
4279
|
-
})
|
|
4280
|
-
}
|
|
4281
|
-
if ($xeTable.handleUpdateCustomColumn) {
|
|
4282
|
-
$xeTable.handleUpdateCustomColumn()
|
|
4283
|
-
}
|
|
4284
|
-
const columnOpts = computeColumnOpts.value
|
|
4285
|
-
if (props.showCustomHeader && reactData.isGroup && (columnOpts.resizable || props.resizable)) {
|
|
4286
|
-
warnLog('vxe.error.notConflictProp', ['show-custom-header & colgroup', 'column-config.resizable=false'])
|
|
4287
|
-
}
|
|
4288
|
-
reactData.isColLoading = false
|
|
4289
|
-
return handleLazyRecalculate(false, true, true)
|
|
4290
|
-
})
|
|
4325
|
+
return buildColumnInfo()
|
|
4291
4326
|
})
|
|
4292
4327
|
}
|
|
4293
4328
|
|
|
@@ -5393,6 +5428,58 @@ export default defineVxeComponent({
|
|
|
5393
5428
|
}
|
|
5394
5429
|
return nextTick()
|
|
5395
5430
|
},
|
|
5431
|
+
effectCellData (row, column, options) {
|
|
5432
|
+
const { fullCellStoreMaps } = internalData
|
|
5433
|
+
const editOpts = computeEditOpts.value
|
|
5434
|
+
const { key, isChanged, setValue, getResult } = options
|
|
5435
|
+
const rowid = getRowid($xeTable, row)
|
|
5436
|
+
const colid = column.id
|
|
5437
|
+
let rowStore = fullCellStoreMaps[rowid]
|
|
5438
|
+
const cellValue = XEUtils.get(row, column.field)
|
|
5439
|
+
const restParams: VxeTableDefines.CellCacheHandleParams = {
|
|
5440
|
+
$table: $xeTable,
|
|
5441
|
+
row,
|
|
5442
|
+
rowid,
|
|
5443
|
+
column,
|
|
5444
|
+
colid,
|
|
5445
|
+
cellValue,
|
|
5446
|
+
oldValue: null
|
|
5447
|
+
}
|
|
5448
|
+
|
|
5449
|
+
if (editOpts.cache === false && key === 'render_table_cell') {
|
|
5450
|
+
const rest = restParams as VxeTableDefines.CellCacheResultObj
|
|
5451
|
+
rest.cellResult = getResult ? getResult(restParams) : cellValue
|
|
5452
|
+
return rest
|
|
5453
|
+
}
|
|
5454
|
+
|
|
5455
|
+
if (!rowStore) {
|
|
5456
|
+
rowStore = {}
|
|
5457
|
+
fullCellStoreMaps[rowid] = rowStore
|
|
5458
|
+
}
|
|
5459
|
+
let cellStore = rowStore[colid]
|
|
5460
|
+
if (!cellStore) {
|
|
5461
|
+
cellStore = {
|
|
5462
|
+
value: undefined,
|
|
5463
|
+
result: {}
|
|
5464
|
+
}
|
|
5465
|
+
rowStore[colid] = cellStore
|
|
5466
|
+
}
|
|
5467
|
+
const restData = rowStore[colid]
|
|
5468
|
+
const oldValue = restData.value
|
|
5469
|
+
restParams.oldValue = oldValue
|
|
5470
|
+
if (isChanged ? !isChanged(restParams) : oldValue !== cellValue) {
|
|
5471
|
+
restData.value = setValue ? setValue(restParams) : cellValue
|
|
5472
|
+
restData.result = {}
|
|
5473
|
+
}
|
|
5474
|
+
const storeData = restData.result
|
|
5475
|
+
if (XEUtils.isUndefined(storeData[key])) {
|
|
5476
|
+
storeData[key] = getResult ? getResult(restParams) : cellValue
|
|
5477
|
+
}
|
|
5478
|
+
const cellResult = storeData[key]
|
|
5479
|
+
const rest = restParams as VxeTableDefines.CellCacheResultObj
|
|
5480
|
+
rest.cellResult = cellResult
|
|
5481
|
+
return rest
|
|
5482
|
+
},
|
|
5396
5483
|
getCellElement (row, fieldOrColumn) {
|
|
5397
5484
|
const { elemStore } = internalData
|
|
5398
5485
|
const column = handleFieldOrColumn($xeTable, fieldOrColumn)
|
|
@@ -6229,7 +6316,7 @@ export default defineVxeComponent({
|
|
|
6229
6316
|
const rowid = XEUtils.isString(row) || XEUtils.isNumber(row) ? row : handleGetRowId(row)
|
|
6230
6317
|
const rowRest = fullAllDataRowIdData[rowid]
|
|
6231
6318
|
if (rowRest) {
|
|
6232
|
-
rowRest.resizeHeight = calcCellAutoHeight(rowRest, el)
|
|
6319
|
+
rowRest.resizeHeight = calcCellAutoHeight(rowid, rowRest, el)
|
|
6233
6320
|
}
|
|
6234
6321
|
el.removeAttribute('data-calc-row')
|
|
6235
6322
|
})
|
|
@@ -7979,6 +8066,66 @@ export default defineVxeComponent({
|
|
|
7979
8066
|
clearHistory () {
|
|
7980
8067
|
return $xeTable.handleClearStack()
|
|
7981
8068
|
},
|
|
8069
|
+
/**
|
|
8070
|
+
* 用于 custom-config,用于手动恢复自定义列设置信息,恢复表格重置为初始状态
|
|
8071
|
+
* @param storeData
|
|
8072
|
+
* @returns
|
|
8073
|
+
*/
|
|
8074
|
+
setCustomStoreData (storeData) {
|
|
8075
|
+
if (!storeData) {
|
|
8076
|
+
return nextTick()
|
|
8077
|
+
}
|
|
8078
|
+
const customOpts = computeCustomOpts.value
|
|
8079
|
+
const { checkMethod } = customOpts
|
|
8080
|
+
// 重置状态
|
|
8081
|
+
clearTableAllStatus($xeTable)
|
|
8082
|
+
// 恢复列
|
|
8083
|
+
const allCols: VxeTableDefines.ColumnInfo[] = []
|
|
8084
|
+
XEUtils.eachTree(internalData.collectColumn, (column) => {
|
|
8085
|
+
column.resizeWidth = 0
|
|
8086
|
+
column.fixed = column.defaultFixed
|
|
8087
|
+
column.renderSortNumber = column.sortNumber
|
|
8088
|
+
column.parentId = column.defaultParentId
|
|
8089
|
+
if (!checkMethod || checkMethod({ $table: $xeTable, column })) {
|
|
8090
|
+
column.visible = column.defaultVisible
|
|
8091
|
+
}
|
|
8092
|
+
column.aggFunc = column.defaultAggFunc
|
|
8093
|
+
column.renderAggFn = column.defaultAggFunc
|
|
8094
|
+
column.renderResizeWidth = column.renderWidth
|
|
8095
|
+
allCols.push(column)
|
|
8096
|
+
})
|
|
8097
|
+
const newCollectCols = XEUtils.toArrayTree(XEUtils.orderBy(allCols, 'renderSortNumber'), { key: 'id', parentKey: 'parentId', children: 'children' })
|
|
8098
|
+
internalData.collectColumn = newCollectCols
|
|
8099
|
+
internalData.tableFullColumn = getColumnList(newCollectCols)
|
|
8100
|
+
|
|
8101
|
+
reactData.updateColFlag++
|
|
8102
|
+
reactData.isColLoading = true
|
|
8103
|
+
initColumnHierarchy()
|
|
8104
|
+
return Promise.resolve(
|
|
8105
|
+
handleCustomRestore(storeData)
|
|
8106
|
+
).then(() => {
|
|
8107
|
+
return buildColumnInfo()
|
|
8108
|
+
}).then(() => {
|
|
8109
|
+
// 恢复数据聚合分组
|
|
8110
|
+
const { isRowGroupStatus, rowGroupList } = reactData
|
|
8111
|
+
if (isRowGroupStatus && !!$xeTable.handlePivotTableAggData) {
|
|
8112
|
+
const rowGroupFields = computeRowGroupFields.value
|
|
8113
|
+
if (rowGroupFields ? rowGroupFields.length : rowGroupList.length) {
|
|
8114
|
+
if (rowGroupFields && rowGroupFields.length) {
|
|
8115
|
+
$xeTable.setRowGroups(rowGroupFields)
|
|
8116
|
+
} else {
|
|
8117
|
+
$xeTable.clearRowGroups()
|
|
8118
|
+
}
|
|
8119
|
+
} else {
|
|
8120
|
+
$xeTable.handleUpdateAggData()
|
|
8121
|
+
}
|
|
8122
|
+
}
|
|
8123
|
+
})
|
|
8124
|
+
},
|
|
8125
|
+
/**
|
|
8126
|
+
* 用于 custom-config,用于获取自定义列设置信息,用于自定义保持
|
|
8127
|
+
* @returns
|
|
8128
|
+
*/
|
|
7982
8129
|
getCustomStoreData () {
|
|
7983
8130
|
const { id } = props
|
|
7984
8131
|
const customOpts = computeCustomOpts.value
|
|
@@ -9752,6 +9899,9 @@ export default defineVxeComponent({
|
|
|
9752
9899
|
}
|
|
9753
9900
|
}
|
|
9754
9901
|
},
|
|
9902
|
+
/**
|
|
9903
|
+
* @private
|
|
9904
|
+
*/
|
|
9755
9905
|
handleRowResizeMousedownEvent (evnt, params) {
|
|
9756
9906
|
evnt.stopPropagation()
|
|
9757
9907
|
evnt.preventDefault()
|
|
@@ -9869,6 +10019,9 @@ export default defineVxeComponent({
|
|
|
9869
10019
|
}
|
|
9870
10020
|
updateEvent(evnt)
|
|
9871
10021
|
},
|
|
10022
|
+
/**
|
|
10023
|
+
* @private
|
|
10024
|
+
*/
|
|
9872
10025
|
handleRowResizeDblclickEvent (evnt, params) {
|
|
9873
10026
|
const resizableOpts = computeResizableOpts.value
|
|
9874
10027
|
const { isDblclickAutoHeight } = resizableOpts
|
|
@@ -9887,7 +10040,7 @@ export default defineVxeComponent({
|
|
|
9887
10040
|
}
|
|
9888
10041
|
const handleRsHeight = () => {
|
|
9889
10042
|
el.setAttribute('data-calc-row', 'Y')
|
|
9890
|
-
const resizeHeight = calcCellAutoHeight(rowRest, el)
|
|
10043
|
+
const resizeHeight = calcCellAutoHeight(rowid, rowRest, el)
|
|
9891
10044
|
el.removeAttribute('data-calc-row')
|
|
9892
10045
|
const resizeParams = { ...params, resizeHeight, resizeRow: row }
|
|
9893
10046
|
reactData.isDragResize = false
|
|
@@ -9906,6 +10059,9 @@ export default defineVxeComponent({
|
|
|
9906
10059
|
}
|
|
9907
10060
|
}
|
|
9908
10061
|
},
|
|
10062
|
+
/**
|
|
10063
|
+
* @private
|
|
10064
|
+
*/
|
|
9909
10065
|
saveCustomStore (type) {
|
|
9910
10066
|
const { customConfig } = props
|
|
9911
10067
|
const tableId = computeTableId.value
|
|
@@ -9951,6 +10107,9 @@ export default defineVxeComponent({
|
|
|
9951
10107
|
}
|
|
9952
10108
|
return nextTick()
|
|
9953
10109
|
},
|
|
10110
|
+
/**
|
|
10111
|
+
* @private
|
|
10112
|
+
*/
|
|
9954
10113
|
handleCustom () {
|
|
9955
10114
|
const { mouseConfig } = props
|
|
9956
10115
|
if (mouseConfig) {
|
|
@@ -90,6 +90,9 @@ export function createInternalData (): TableInternalData {
|
|
|
90
90
|
sourceDataRowIdData: {},
|
|
91
91
|
fullColumnIdData: {},
|
|
92
92
|
fullColumnFieldData: {},
|
|
93
|
+
fullCellHeightMaps: {},
|
|
94
|
+
|
|
95
|
+
fullCellStoreMaps: {},
|
|
93
96
|
|
|
94
97
|
// 当前行
|
|
95
98
|
currentRow: null,
|
|
@@ -160,7 +163,9 @@ export function createInternalData (): TableInternalData {
|
|
|
160
163
|
inited: false,
|
|
161
164
|
tooltipTimeout: null,
|
|
162
165
|
initStatus: false,
|
|
163
|
-
isActivated: false
|
|
166
|
+
isActivated: false,
|
|
167
|
+
|
|
168
|
+
rceDelay: 0
|
|
164
169
|
|
|
165
170
|
// _sToTime: null
|
|
166
171
|
}
|
|
@@ -422,6 +427,23 @@ export function createReactData (): TableReactData {
|
|
|
422
427
|
}
|
|
423
428
|
}
|
|
424
429
|
|
|
430
|
+
const maxKey = '__max'
|
|
431
|
+
|
|
432
|
+
export function getRowMaxHeight (chRest: Record<string, number>, isForce: boolean) {
|
|
433
|
+
if (isForce || !chRest[maxKey]) {
|
|
434
|
+
let max = 0
|
|
435
|
+
for (const key in chRest) {
|
|
436
|
+
const val = chRest[key]
|
|
437
|
+
if (key !== maxKey && XEUtils.isNumber(val) && val > max) {
|
|
438
|
+
max = val
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
chRest[maxKey] = max
|
|
442
|
+
return max
|
|
443
|
+
}
|
|
444
|
+
return chRest[maxKey]
|
|
445
|
+
}
|
|
446
|
+
|
|
425
447
|
const getAllConvertColumns = (columns: any, parentColumn?: any) => {
|
|
426
448
|
const result: any[] = []
|
|
427
449
|
columns.forEach((column: any) => {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|