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