forked from github/dataease
fix(图表): 修复表格表头排序后点击获取的单元格数据错误 #8888
This commit is contained in:
parent
c25e5bc619
commit
e391bd456e
@ -237,7 +237,6 @@ onMounted(() => {
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
:label="t('chart.table_show_index')"
|
||||
class="form-item"
|
||||
:class="'form-item-' + themes"
|
||||
v-if="showProperty('tableHeaderSort')"
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { S2Event, S2Options, TableColCell, TableDataCell, TableSheet } from '@antv/s2'
|
||||
import { S2Event, S2Options, TableColCell, TableDataCell, TableSheet, ViewMeta } from '@antv/s2'
|
||||
import { formatterItem, valueFormatter } from '../../../formatter'
|
||||
import { parseJson } from '../../../util'
|
||||
import { S2ChartView, S2DrawOptions } from '../../types/impl/s2'
|
||||
@ -143,13 +143,13 @@ export class TableInfo extends S2ChartView<TableSheet> {
|
||||
// click
|
||||
newChart.on(S2Event.DATA_CELL_CLICK, ev => {
|
||||
const cell = newChart.getCell(ev.target)
|
||||
const meta = cell.getMeta()
|
||||
const meta = cell.getMeta() as ViewMeta
|
||||
const nameIdMap = fields.reduce((pre, next) => {
|
||||
pre[next['dataeaseName']] = next['id']
|
||||
return pre
|
||||
}, {})
|
||||
|
||||
const rowData = chart.data.tableRow[meta.rowIndex] as any
|
||||
const rowData = newChart.dataSet.getRowData(meta)
|
||||
const dimensionList = []
|
||||
for (const key in rowData) {
|
||||
if (nameIdMap[key]) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { S2ChartView, S2DrawOptions } from '@/views/chart/components/js/panel/types/impl/s2'
|
||||
import { S2Event, S2Options, TableSheet, TableColCell } from '@antv/s2'
|
||||
import { S2Event, S2Options, TableSheet, TableColCell, ViewMeta } from '@antv/s2'
|
||||
import { parseJson } from '@/views/chart/components/js/util'
|
||||
import { formatterItem, valueFormatter } from '@/views/chart/components/js/formatter'
|
||||
import { copyContent, getCurrentField } from '@/views/chart/components/js/panel/common/common_table'
|
||||
@ -139,13 +139,13 @@ export class TableNormal extends S2ChartView<TableSheet> {
|
||||
// click
|
||||
newChart.on(S2Event.DATA_CELL_CLICK, ev => {
|
||||
const cell = newChart.getCell(ev.target)
|
||||
const meta = cell.getMeta()
|
||||
const meta = cell.getMeta() as ViewMeta
|
||||
const nameIdMap = fields.reduce((pre, next) => {
|
||||
pre[next['dataeaseName']] = next['id']
|
||||
return pre
|
||||
}, {})
|
||||
|
||||
const rowData = chart.data.tableRow[meta.rowIndex] as any
|
||||
const rowData = newChart.dataSet.getRowData(meta)
|
||||
const dimensionList = []
|
||||
for (const key in rowData) {
|
||||
if (nameIdMap[key]) {
|
||||
|
Loading…
Reference in New Issue
Block a user