Browse Source

全部量表合并到知识搜索-文件未删

zhouna 5 years ago
parent
commit
72ef5daef4

+ 10 - 1
src/components/MedicalInfo/index.jsx

@@ -22,6 +22,15 @@ class MedicalInfo extends Component {
         this.getSearchList = this.getSearchList.bind(this);
         this.handleEnter = this.handleEnter.bind(this);
         this.handleTypeCheck = this.handleTypeCheck.bind(this);
+        this.showScale=this.showScale.bind(this);
+    }
+    showScale(item){
+      const {scaleInfo,getScale,showScaleFn} = this.props;
+      if(scaleInfo&&scaleInfo[item.conceptId]){
+        showScaleFn&&showScaleFn(item);
+      }else{
+        getScale(item);
+      }
     }
     getSearchList() {
         const { getAllConceptDetail,searchResult } = this.props;
@@ -34,7 +43,7 @@ class MedicalInfo extends Component {
         return searchResult && searchResult.map((item) => {
           return <li key={item.conceptId}
                      title='点击查看详情'
-                     onClick={() => getAllConceptDetail({name: item.name, type: item.type, uname: item.uniqueName,position:0,showName:item.name})}>
+                     onClick={()=>+item.type===21?this.showScale(item):getAllConceptDetail({name: item.name, type: item.type, uname: item.uniqueName,position:0,showName:item.name})}>
             <span>{item.name}</span>
             <i>( {item.libTypeName} )</i>
             {item.retrievalName?<p>• {item.retrievalName}</p>:''}

+ 2 - 4
src/components/PushContainer/index.jsx

@@ -12,7 +12,6 @@ import PushItemsContainer from '@containers/PushItemsContainer';
 import { pushAllDataList, getWindowInnerHeight, didPushParamChange } from '@utils/tools';
 import CopyRightContainer from "@containers/CopyRightContainer";
 import MedicalInfoContainer from '@containers/MedicalInfoContainer';
-import ScaleSearchContainer from '@containers/ScaleSearchContainer';
 class PushContainer extends Component {
   constructor(props) {
     super(props);
@@ -27,9 +26,9 @@ class PushContainer extends Component {
       {
         title: '医学知识',
       },
-      {
+      /*{
         title: '全部量表',
-      }
+      }*/
       ],
       visible: false,
       message: '',                 //提示的内容
@@ -270,7 +269,6 @@ class PushContainer extends Component {
             templateSearch={this.templateSearch}
           ></TemplateItems>
           <MedicalInfoContainer></MedicalInfoContainer>
-          <ScaleSearchContainer></ScaleSearchContainer>
         </TemplateContainer>
       </Tab>
       <ConfirmModal

+ 19 - 3
src/containers/MedicalInfoContainer.js

@@ -2,15 +2,19 @@ import React from 'react';
 import { connect } from 'react-redux';
 import { getSearchList } from '@store/async-actions/medicalInfo';
 import MedicalInfo from '@components/MedicalInfo';
-import {getAllConceptDetail} from '../store/async-actions/pushMessage';
+import {getAllConceptDetail, getScaleInfo} from '../store/async-actions/pushMessage';
 import {getMedicalFilters} from '../store/async-actions/fetchModules';
+import {CLEAR_SCALE_SEARCH_LIST} from '@types/scaleSearch';
 import {CLEAR_INFO_SEARCH_LIST,SET_FILTER_LIST} from '@types/medicalInfo';
+import {SHOW_TABLE_LIST} from '@store/types/pushMessage';
 
 function mapStateToProps(state) {
-    const {medicalInfo} = state;
+    const {medicalInfo,pushMessage} = state;
     return{
         searchResult: medicalInfo.searchResult,
-        filterList:medicalInfo.filterList
+        filterList:medicalInfo.filterList,
+        formulaResult: pushMessage.formulaResult,
+        scaleInfo: pushMessage.scaleInfo,//量表内容
     }
 }
 
@@ -27,6 +31,18 @@ function mapDispatchToProps(dispatch) {
                 type:CLEAR_INFO_SEARCH_LIST
               })
         },
+        showScaleFn(item,isPop){
+          dispatch({
+            type:SHOW_TABLE_LIST,
+            name:'showTable',
+            value:true,
+            isPop,
+            item:Object.assign({},item)
+          });
+        },
+        getScale(item) {
+          dispatch(getScaleInfo(item))
+        },
         getFilters(){
               getMedicalFilters().then((res)=>{
                   if(res.data.code=='0'){