Browse Source

全部量表接口对接

zhouna 6 năm trước cách đây
mục cha
commit
0af6118938

+ 1 - 0
src/components/MedicalInfo/index.less

@@ -46,6 +46,7 @@
         li{
             border-bottom:1px #CECECE solid;
             line-height: 42px;
+            cursor: pointer;
             span{
                 font-size: 14px;
                 color: #000;

+ 3 - 4
src/components/ScaleSearch/index.jsx

@@ -16,11 +16,10 @@ class ScaleSearch extends Component {
     this.clear = this.clear.bind(this);
   }
   getSearchList() {
-    const { getAllConceptDetail,searchResult } = this.props;
+    const { searchResult,getScale } = this.props;
     return searchResult && searchResult.map((item) => {
-      return <li key={item.conceptId} onClick={() =>getAllConceptDetail({name: item.name, type: item.type})}>
-        <span>{item.name}</span>
-        <i>( {item.libTypeName} )</i>
+      return <li key={item.conceptId} onClick={()=>getScale(item.name)}>
+        <span className={style['scale-name']}>{item.name}</span>
         <button>查看</button>
       </li>;
     });

+ 5 - 3
src/components/ScaleSearch/index.less

@@ -46,13 +46,15 @@
     li{
       border-bottom:1px #CECECE solid;
       line-height: 42px;
+      cursor: pointer;
       span{
         font-size: 14px;
         color: #000;
       }
-      i{
-        font-size: 12px;
-        color: #2A9BD5;
+      .scale-name{
+        display: inline-block;
+        max-width: 320px;
+        line-height: 22px;
       }
       button{
         float: right;

+ 3 - 2
src/containers/ScaleSearchContainer.js

@@ -2,6 +2,7 @@ import React from 'react';
 import { connect } from 'react-redux';
 import { getSearchList } from '@store/async-actions/ScaleSearch';
 import ScaleSearch from '@components/ScaleSearch';
+import {getTableList} from '../store/async-actions/pushMessage';
 
 function mapStateToProps(state) {
     return{
@@ -14,8 +15,8 @@ function mapDispatchToProps(dispatch) {
         handleChangeValue(val){
             dispatch(getSearchList(val))
         },
-        getAllConceptDetail(item) {
-            //dispatch(getAllConceptDetail(item))
+        getScale(name) {
+            dispatch(getTableList(name))
         }
     }
 }

+ 4 - 4
src/store/async-actions/scaleSearch.js

@@ -11,10 +11,10 @@ export const getSearchList = (val) => {
         })
     }
    
-    return (dispatch, getState) => {
-        json('/retrieval/getStaticKnowledge',{
-            inputStr:val,
-            inputIds:[]
+    return (dispatch) => {
+        json('/scale/index',{
+            name:val,
+            filterName:[]
         })
         .then((res)=>{
             const data = res.data.data;

+ 1 - 1
src/store/reducers/scaleSearch.js

@@ -8,7 +8,7 @@ export default function (state=initState, action) {
     const res = Object.assign({},state);
     switch(action.type) {
         case GET_SCALE_SEARCH_RESULT:
-            res.searchResult = data;
+            res.searchResult = action.data;
             return res;
         default: 
             return res;