Browse Source

其他史文本模式数据bug修改

zhouna 6 years ago
parent
commit
c11b47d06e
1 changed files with 24 additions and 6 deletions
  1. 24 6
      src/store/async-actions/fetchModules.js

+ 24 - 6
src/store/async-actions/fetchModules.js

@@ -71,16 +71,34 @@ export const getOtherHisRecord = ()=>{
         const objStr = JSON.parse(data.otherStr||'[]');
         let arr = [];
         if((!obj||!obj.other||obj.other.length==0)&&!objStr[0]){        //无其他史历史记录用默认模板
+          if(mode=='1'){      //文本模式
+            dispatch({
+              type:SETOTHERHISTORY,
+              data:[],
+              selecteds:[],
+              save:[]
+            });
+          }
+
           //console.log('其他史最近数据无')
           //arr = state.homePage.initData.otherHis;
         }else{
           arr = obj.other;
-          dispatch({
-            type:SETOTHERHISTORY,
-            data:arr,
-            selecteds:obj.otherHistorySelecteds,
-            save:objStr
-          });
+          if(mode =='1'){     //文本模式
+            dispatch({
+              type:SETOTHERHISTORY,
+              data:[],
+              selecteds:[],
+              save:[objStr[0]]
+            });
+          }else{
+            dispatch({
+              type:SETOTHERHISTORY,
+              data:arr,
+              selecteds:obj.otherHistorySelecteds,
+              save:objStr
+            });
+          }
         }
       }
     });