forked from github/dataease
Merge pull request #9498 from dataease/pr@dev@fix_table_scroll_column_resize
fix(视图): 修复表格滚动时改变列宽表格会错位 #8810
This commit is contained in:
commit
a4aa7eea3b
@ -230,9 +230,7 @@ export function baseTableInfo(container, chart, action, tableData, pageInfo, vue
|
||||
// right click
|
||||
s2.on(S2Event.GLOBAL_CONTEXT_MENU, event => copyContent(s2, event, meta))
|
||||
// column resize
|
||||
if (size.tableColumnMode === 'field') {
|
||||
s2.on(S2Event.LAYOUT_RESIZE_COL_WIDTH, event => resizeFunc(event))
|
||||
}
|
||||
// theme
|
||||
const customTheme = getCustomTheme(chart)
|
||||
s2.setThemeCfg({ theme: customTheme })
|
||||
@ -436,9 +434,7 @@ export function baseTableNormal(container, chart, action, tableData, vueCom, res
|
||||
// right click
|
||||
s2.on(S2Event.GLOBAL_CONTEXT_MENU, event => copyContent(s2, event, meta))
|
||||
// column resize
|
||||
if (size.tableColumnMode === 'field') {
|
||||
s2.on(S2Event.LAYOUT_RESIZE_COL_WIDTH, event => resizeFunc(event))
|
||||
}
|
||||
// theme
|
||||
const customTheme = getCustomTheme(chart)
|
||||
s2.setThemeCfg({ theme: customTheme })
|
||||
|
@ -577,12 +577,18 @@ export default {
|
||||
this.remarkCfg = getRemark(this.chart)
|
||||
},
|
||||
columnResize(resizeColumn) {
|
||||
// 从头开始滚动
|
||||
this.myChart.facet.timer?.stop()
|
||||
this.$nextTick(this.initScroll)
|
||||
if (!this.inScreen) {
|
||||
// 预览/全屏预览不保存
|
||||
// 预览/全屏预览不保存宽度
|
||||
return
|
||||
}
|
||||
const size = JSON.parse(this.chart.customAttr).size
|
||||
if (size.tableColumnMode !== 'field') {
|
||||
return
|
||||
}
|
||||
const fieldId = resizeColumn.info.meta.field
|
||||
const size = JSON.parse(this.chart.customAttr).size
|
||||
const containerWidth = document.getElementById(this.chartId).offsetWidth
|
||||
const column = size.tableFieldWidth?.find(i => i.fieldId === fieldId)
|
||||
let tableWidth
|
||||
|
Loading…
Reference in New Issue
Block a user