Browse Source

数据视图增删列时不改变原有列顺序

zhuth 6 years ago
parent
commit
57af470b5c
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/components/chartDesigner/sections/displayColumnBox.jsx

+ 1 - 1
src/components/chartDesigner/sections/displayColumnBox.jsx

@@ -48,7 +48,7 @@ class DisplayColumnBox extends React.Component {
 
 
     handleChange = (targetKeys, direction, moveKeys) => {
     handleChange = (targetKeys, direction, moveKeys) => {
         const { allColumns } = this.props;
         const { allColumns } = this.props;
-        let targetColumns = allColumns.filter(c => targetKeys.indexOf(c.name) !== -1);
+        let targetColumns = targetKeys.map(k => allColumns.find(c => c.name === k));
         this.setState({ targetColumns });
         this.setState({ targetColumns });
     }
     }