소스 검색

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

zhuth 7 년 전
부모
커밋
57af470b5c
1개의 변경된 파일과 1개의 추가작업 그리고 1개의 파일을 삭제
  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) => {
         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 });
     }