Unverified Commit 914cc1fe authored by Lijiao's avatar Lijiao Committed by GitHub
Browse files

fix bug of dict column list (#2076)

parent ebcd6024
...@@ -527,19 +527,9 @@ class TableList extends React.Component<TableListProps, TableListState> { ...@@ -527,19 +527,9 @@ class TableList extends React.Component<TableListProps, TableListState> {
minWidth: 100, minWidth: 100,
onRender: (record: TableRecord) => { onRender: (record: TableRecord) => {
const accDictionary = record.accDictionary; const accDictionary = record.accDictionary;
let decimals = 0;
let other = ''; let other = '';
if (accDictionary !== undefined) { if (accDictionary !== undefined) {
if (accDictionary[item].toString().indexOf('.') !== -1) { other = accDictionary[item].toString();
decimals = accDictionary[item].toString().length - accDictionary[item].toString().indexOf('.') - 1;
if (decimals > 6) {
other = `${accDictionary[item].toFixed(6)}`;
} else {
other = accDictionary[item].toString();
}
}
} else {
other = '--';
} }
return ( return (
<div>{other}</div> <div>{other}</div>
...@@ -557,7 +547,11 @@ class TableList extends React.Component<TableListProps, TableListState> { ...@@ -557,7 +547,11 @@ class TableList extends React.Component<TableListProps, TableListState> {
UNSAFE_componentWillReceiveProps(nextProps: TableListProps): void { UNSAFE_componentWillReceiveProps(nextProps: TableListProps): void {
const { columnList, tableSource } = nextProps; const { columnList, tableSource } = nextProps;
this.setState({ tableSourceForSort: tableSource, tableColumns: this.initTableColumnList(columnList) }); this.setState({
tableSourceForSort: tableSource,
tableColumns: this.initTableColumnList(columnList),
allColumnList: this.getAllColumnKeys()
});
} }
render(): React.ReactNode { render(): React.ReactNode {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment