Explorar el Código

月经史公式显示重新获取bug修改

zhouna hace 6 años
padre
commit
d2ea785237

+ 1 - 0
src/containers/OtherHistory.js

@@ -52,6 +52,7 @@ function mapDispatchToProps(dispatch,store){
           type:SETDATA,
           data:listObj.newArr,
           selecteds:selects,
+          period:initData.period,
           save:listObj.saveText,
           isEmpty:false
         });

+ 7 - 1
src/store/async-actions/fetchModules.js

@@ -87,7 +87,7 @@ export const getOtherHisRecord = ()=>{
         const data = res.data.data;
         const obj = JSON.parse(data.dataJson||'{}');
         const objStr = JSON.parse(data.otherStr||'[]');
-        let arr = [];
+        let arr = [];//console.log(obj)
         if((!obj||!obj.other||obj.other.length==0)&&!objStr[0]){        //无其他史历史记录用默认模板
           if(mode=='1'){      //文本模式
             dispatch({
@@ -113,6 +113,12 @@ export const getOtherHisRecord = ()=>{
             dispatch({
               type:SETOTHERHISTORY,
               data:arr,
+              period:{
+                yjs_1: obj.yjs_1,
+                yjs_2: obj.yjs_2,
+                yjs_3: obj.yjs_3,
+                yjs_4: obj.yjs_4,
+              },
               selecteds:obj.otherHistorySelecteds,
               save:objStr
             });

+ 1 - 0
src/store/reducers/homePage.js

@@ -50,6 +50,7 @@ export default function (state=initState,action) {
       res.initData.otherHisSave = action.save;
       res.initData.otherSelecteds = action.selecteds||[];
       res.initData.otherIsHis = action.otherIsHis!=undefined?action.otherIsHis:true;
+      res.initData.period = action.period;
       return res;
     /*case SETTEXTFOCUS:
       res.focusTextIndex = action.index;

+ 7 - 0
src/store/reducers/otherHistory.js

@@ -21,6 +21,13 @@ export default function(state=initState,action){//console.log(state)
     case SETDATA:
       res.data = action.data;
       res.selecteds = action.selecteds||[];
+      const period = action.period;
+      if(period){
+        res.yjs_1=period.yjs_1;
+        res.yjs_2=period.yjs_2;
+        res.yjs_3=period.yjs_3;
+        res.yjs_4=period.yjs_4;
+      }
       res.saveText = action.save||[];
       res.isEmpty = action.isEmpty;
       return res;