mirror of
https://github.com/dataease/dataease.git
synced 2025-02-24 11:32:57 +08:00
fix(视图-表格): 横向拖动滚动条表头显示异常#7510
This commit is contained in:
parent
38a80e196d
commit
29f47068dd
@ -1,4 +1,4 @@
|
||||
import { DataCell, S2Event, S2Options, TableSheet } from '@antv/s2/esm/index'
|
||||
import { S2Event, S2Options, TableColCell, TableDataCell, TableSheet } from '@antv/s2/esm/index'
|
||||
import { formatterItem, valueFormatter } from '../../../formatter'
|
||||
import { parseJson } from '../../../util'
|
||||
import { S2ChartView, S2DrawOptions } from '../../types/impl/s2'
|
||||
@ -104,22 +104,25 @@ export class TableInfo extends S2ChartView<TableSheet> {
|
||||
}
|
||||
// 开启序号之后,第一列就是序号列,修改 label 即可
|
||||
if (s2Options.showSeriesNumber) {
|
||||
s2Options.colCell = node => {
|
||||
s2Options.colCell = (node, sheet, config) => {
|
||||
if (node.colIndex === 0) {
|
||||
if (!customAttr.tableHeader.indexLabel) {
|
||||
node.label = ' '
|
||||
} else {
|
||||
node.label = customAttr.tableHeader.indexLabel
|
||||
let indexLabel = customAttr.tableHeader.indexLabel
|
||||
if (!indexLabel) {
|
||||
indexLabel = ''
|
||||
}
|
||||
const cell = new TableColCell(node, sheet, config)
|
||||
const shape = cell.getTextShape() as any
|
||||
shape.attrs.text = indexLabel
|
||||
return cell
|
||||
}
|
||||
return node.belongsCell
|
||||
return new TableColCell(node, sheet, config)
|
||||
}
|
||||
s2Options.dataCell = viewMeta => {
|
||||
if (viewMeta.colIndex === 0) {
|
||||
viewMeta.fieldValue =
|
||||
pageInfo.pageSize * (pageInfo.currentPage - 1) + viewMeta.rowIndex + 1
|
||||
}
|
||||
return new DataCell(viewMeta, viewMeta?.spreadsheet)
|
||||
return new TableDataCell(viewMeta, viewMeta?.spreadsheet)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -6,6 +6,7 @@ import { getCurrentField } from '@/views/chart/components/js/panel/common/common
|
||||
import { TABLE_EDITOR_PROPERTY, TABLE_EDITOR_PROPERTY_INNER } from './common'
|
||||
import { useI18n } from '@/hooks/web/useI18n'
|
||||
import { isNumber } from 'lodash-es'
|
||||
import { TableColCell } from '@antv/s2'
|
||||
|
||||
const { t } = useI18n()
|
||||
/**
|
||||
@ -106,15 +107,18 @@ export class TableNormal extends S2ChartView<TableSheet> {
|
||||
}
|
||||
// 开启序号之后,第一列就是序号列,修改 label 即可
|
||||
if (s2Options.showSeriesNumber) {
|
||||
s2Options.colCell = node => {
|
||||
s2Options.colCell = (node, sheet, config) => {
|
||||
if (node.colIndex === 0) {
|
||||
if (!customAttr.tableHeader.indexLabel) {
|
||||
node.label = ' '
|
||||
} else {
|
||||
node.label = customAttr.tableHeader.indexLabel
|
||||
let indexLabel = customAttr.tableHeader.indexLabel
|
||||
if (!indexLabel) {
|
||||
indexLabel = ''
|
||||
}
|
||||
const cell = new TableColCell(node, sheet, config)
|
||||
const shape = cell.getTextShape() as any
|
||||
shape.attrs.text = indexLabel
|
||||
return cell
|
||||
}
|
||||
return node.belongsCell
|
||||
return new TableColCell(node, sheet, config)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user