Преглед на файлове

Merge remote-tracking branch 'origin/ChronicMag' into ChronicMag

zhouna преди 6 години
родител
ревизия
ef17678ea6
променени са 3 файла, в които са добавени 25 реда и са изтрити 16 реда
  1. 3 4
      src/components/AddInspect/SlideExcel/index.jsx
  2. 2 3
      src/containers/Inspect.js
  3. 20 9
      src/store/async-actions/inspect.js

+ 3 - 4
src/components/AddInspect/SlideExcel/index.jsx

@@ -38,17 +38,16 @@ class SlideExcel extends Component {
           <span className={styles.excelDataTitle}>
               <span className={styles.tagSpan}>
                 {item.menus}
-                <span className={styles.imgInfo} onClick={()=>getInfomation('',item.lisExcelItem[0].uniquemealName)}></span>
+                <span className={styles.imgInfo} onClick={()=>getInfomation('',item.lisExcelItem[0].uniquemealName || '','excel')}></span>
               </span>
           </span>
           <table className={styles.table}>
              {  show ? (item.lisExcelItem && item.lisExcelItem.map((value,idx)=>{
-                console.log(value,788778)
                   return <tr>
                       <td style={{width:'30%'}}>
                         <span className={styles.tagSpan}>
                           {value.itemName}
-                          <span className={styles.imgInfo} onClick={()=>getInfomation('',value.uniqueName || '')}></span>
+                          <span className={styles.imgInfo} onClick={()=>getInfomation('',value.uniqueName || '','excel')}></span>
                         </span>
                       </td>
                       <td style={{width:'20%'}}><span className={value.type == 1?'red':null}>{value.value}</span> {value.unit}</td>
@@ -63,7 +62,7 @@ class SlideExcel extends Component {
                         <td style={{width:'30%'}}>
                           <span className={styles.tagSpan}>
                             {value.itemName}
-                            <span className={styles.imgInfo} onClick={()=>getInfomation('',value.uniqueName || '')}></span>
+                            <span className={styles.imgInfo} onClick={()=>getInfomation('',value.uniqueName || '','excel')}></span>
                           </span>
                         </td>
                         <td style={{width:'20%'}}><span className={value.type == 1?'red':null}>{value.value}</span> {value.unit}</td>

+ 2 - 3
src/containers/Inspect.js

@@ -20,9 +20,8 @@ function mapDispatchToProps(dispatch, store) {
         handleChangeValue(val){
             dispatch(getSearchList(val))
         },
-        getInfomation(id,name){
-            console.log(id,name)
-            dispatch(getInstroduce(id,name))
+        getInfomation(id,name,type){
+            dispatch(getInstroduce(id,name,type))
         },
         handleSign(id,idx,type){
             dispatch(setLabel(idx,type))

+ 20 - 9
src/store/async-actions/inspect.js

@@ -50,21 +50,32 @@ export const getSublableList = (id,idx) => {
     }
 };
 
-export const getInstroduce = (id,name)=>{    //获取化验的提示信息
-  console.log(id,name,78878788787)
+export const getInstroduce = (id,name,type)=>{    //获取化验的提示信息
+  let url = '',param={};
+  if(type == 'excel'){
+    url = '/api/icss/introduceInfo/getByQuestionName'
+    param = {
+      type: 5,
+      tagName:name?name:'',
+      position: 1
+    }
+  }else{
+    url = '/api/icss/introduceInfo/getByQuestionId'
+    param = {
+      questionId: id?id:'',
+      type: 5,
+      tagName:name?name:'',
+      position: 1
+    }
+  }
   return (dispatch, getState) =>{
-      axios.json('/api/icss/introduceInfo/getByQuestionId', {
-        questionId: id?id:'',
-        type: 5,
-        tagName:name?name:'',
-        position: 1
-    })
+    axios.json(url, param)
     .then((data)=>{
         dispatch({
           type: SET_TIPS,
           tips: data.data.data,
           tmpFlg:'midPart'
-      })          
+        })          
     }).catch((e) => {
         console.log(e)
     })