Selaa lähdekoodia

知识搜索传参修改

zhouna 6 vuotta sitten
vanhempi
commit
83e2d7b9d0
2 muutettua tiedostoa jossa 16 lisäystä ja 9 poistoa
  1. 9 7
      src/components/MedicalInfo/index.jsx
  2. 7 2
      src/store/async-actions/pushMessage.js

+ 9 - 7
src/components/MedicalInfo/index.jsx

@@ -21,14 +21,16 @@ class MedicalInfo extends Component {
     }
     getSearchList() {
         const { getAllConceptDetail,searchResult } = this.props;
+      let showSubName = false;
         return searchResult && searchResult.map((item) => {
-                return <li key={item.conceptId}
-                           title='点击查看详情'
-                           onClick={() =>getAllConceptDetail({name: item.name, type: item.type})}>
-                            <span>{item.name}</span>
-                            <i>( {item.libTypeName} )</i>
-                            {/*<button>查看</button>*/}
-                        </li>;
+          showSubName = item.type == 51 ? true : false;
+          return <li key={item.conceptId}
+                     title='点击查看详情'
+                     onClick={() => getAllConceptDetail({name: item.name, type: item.type, uname: item.uniqueName})}>
+            <span>{item.name}{showSubName ? '(' + item.retrievalName + ')' : ''}</span>
+            <i>( {item.libTypeName} )</i>
+            {/*<button>查看</button>*/}
+          </li>;
             });
     }
     search(){

+ 7 - 2
src/store/async-actions/pushMessage.js

@@ -183,11 +183,16 @@ export const getConceptDetail = (item) => {
 export const getAllConceptDetail = (item) => {
     return(dispatch, getState) => {
         const state = getState();
-        const params = {
+      let params = {
             type: item.type,
             name: item.name,
             position:item.position
-        }
+      };
+      if (item.type == 5 || item.type == 51) {
+        params.type = 12;
+        params.position = 0;
+        params.name = item.uname;
+      }
         json(api.getConceptDetail, params)
         .then((res)=>{
             if(res.data.code == '0') {