Browse Source

【bug】数据源新增查找数据链接时即使不满足搜索条件也展示已选数据链接

zhuth 7 years ago
parent
commit
0c2794fda7
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/components/dataSourceDetail/dataConnectConfig.jsx

+ 2 - 2
src/components/dataSourceDetail/dataConnectConfig.jsx

@@ -23,14 +23,14 @@ class DataConnectConfig extends React.Component {
     }
 
     generateCard() {
-        const { dataConnect, dispatch } = this.props;
+        const { dataConnect, dataSourceDetail, dispatch } = this.props;
         const { filterLabel: stateFilterLabel } = this.state;
         const reg = new RegExp('([+ \\- & | ! ( ) { } \\[ \\] ^ \" ~ * ? : ( ) \/])', 'g'); // 需要转义的字符
         let filterLabel = stateFilterLabel ? (stateFilterLabel + '').replace(new RegExp('(\\\\)', 'g'), '\\$1').replace(reg, '\\$1') : ''; // 添加转义符号
         let filterReg = new RegExp('(' + filterLabel + '){1}', 'ig');
         let cards = dataConnect.list.map(l => {
             let o = Object.assign({}, l);
-            return ((o['name'] + '').search(filterReg) > -1) ? o : null
+            return o.code === dataSourceDetail.connectCode || ((o['name'] + '').search(filterReg) > -1) ? o : null
         }).filter(a => a!==null).map( (l, i) => (
             <CardGrid className='dataconnect-card' key={i}>
                 <Card