Browse Source

Merge branch 'optimize' of http://192.168.2.236:10080/zhouna/newICSS into optimize

liucf 6 years ago
parent
commit
71ba67ce9e
2 changed files with 7 additions and 7 deletions
  1. 1 1
      src/containers/AssistCheck.js
  2. 6 6
      src/store/reducers/assistCheck.js

+ 1 - 1
src/containers/AssistCheck.js

@@ -8,7 +8,7 @@ import { getSearchList,getInstroduce } from '@store/async-actions/assistCheck';
 import {ISREAD} from '@store/types/homePage.js';
 import {billing} from '@store/async-actions/pushMessage';
 
-function mapStateToProps(state) {
+function mapStateToProps(state) {//console.log(state)
     return {
         list:state.assistCheck.list,
         assistLabel:state.assistCheck.assistLabel,

+ 6 - 6
src/store/reducers/assistCheck.js

@@ -53,8 +53,9 @@ export default (state = initSearchList, action) => {
         const tempArrs = newState.assistLabel;
         let tempArr = [];
         let tmpString = '';
+        let tmpCommonLis = store.getState().homePage.assistList;
         if(action.sign == 'common'){
-          let tmpAssistList = store.getState().homePage.assistList
+          let tmpAssistList = JSON.parse(JSON.stringify(tmpCommonLis))
           tempArr = tmpAssistList;
         }else{
           tempArr = newState.list
@@ -84,16 +85,15 @@ export default (state = initSearchList, action) => {
             tempArrs.push(tempArr[k])
           }
         }
-        if(tempArr == []){
+        if(tempArrs == []){
           tmpString == ''
           return
         }
-        for (let i = 0; i < tempArr.length; i++) {
-          let tmpVal = tempArr[i].value?tempArr[i].value.trim():tempArr[i].value;
-          tmpString += (tempArr[i].name+(tmpVal?(':'+tmpVal)+', ':': ')+(tempArr[i].time?'报告日期:'+tempArr[i].time:'')+';')
+        for (let i = 0; i < tempArrs.length; i++) {
+          let tmpVal = tempArrs[i].value?tempArrs[i].value.trim():tempArrs[i].value;
+          tmpString += (tempArrs[i].name+(tmpVal?(':'+tmpVal)+', ':': ')+(tempArrs[i].time?'报告日期:'+tempArrs[i].time:'')+';')
         }
         newState.assistLabel = [...tempArrs]
-        // console.log(tempArrs)
         newState.dataString = tmpString
         return newState;
     }