Commit 8ef2a05a authored by Lijiao's avatar Lijiao
Browse files

keep removing final val when click other intermeidate keys

parent 31afa426
...@@ -247,7 +247,7 @@ class TableList extends React.Component<TableListProps, TableListState> { ...@@ -247,7 +247,7 @@ class TableList extends React.Component<TableListProps, TableListState> {
} }
// intermediateArr just store default val // intermediateArr just store default val
Object.keys(res.data).map(item => { Object.keys(res.data).map(item => {
if(res.data[item].type === 'PERIODICAL'){ if (res.data[item].type === 'PERIODICAL') {
const temp = parseMetrics(res.data[item].data); const temp = parseMetrics(res.data[item].data);
if (typeof temp === 'object') { if (typeof temp === 'object') {
intermediateArr.push(temp[intermediateKey]); intermediateArr.push(temp[intermediateKey]);
...@@ -278,11 +278,13 @@ class TableList extends React.Component<TableListProps, TableListState> { ...@@ -278,11 +278,13 @@ class TableList extends React.Component<TableListProps, TableListState> {
// just watch default key-val // just watch default key-val
if (isShowDefault === true) { if (isShowDefault === true) {
Object.keys(intermediateData).map(item => { Object.keys(intermediateData).map(item => {
const temp = parseMetrics(intermediateData[item].data); if (intermediateData[item].type === 'PERIODICAL') {
if (typeof temp === 'object') { const temp = parseMetrics(intermediateData[item].data);
intermediateArr.push(temp[value]); if (typeof temp === 'object') {
} else { intermediateArr.push(temp[value]);
intermediateArr.push(temp); } else {
intermediateArr.push(temp);
}
} }
}); });
} else { } else {
......
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