Procházet zdrojové kódy

Merge remote-tracking branch 'origin/dev/otherHis' into dev/new1

zhouna před 6 roky
rodič
revize
4f214b2a23

+ 3 - 0
src/components/NumberDrop/index.jsx

@@ -81,6 +81,9 @@ class NumberDrop extends Component{
   }
   numInpBlur(e){        //数字框失焦,保存值到store中
     e.stopPropagation();
+    if(this.props.show){      //修改清空后第一次点击键盘不触发click事件bug
+      return;
+    }
     this.setState({
       hasSelect:false
     });

+ 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
+            });
+          }
         }
       }
     });

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

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

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

@@ -17,7 +17,7 @@ export default function(state=initState,action){//console.log(state)
   switch (action.type){
     case SETDATA:
       res.data = action.data;
-      res.selecteds = action.selecteds;
+      res.selecteds = action.selecteds||[];
       res.saveText = action.save||[];
       res.isEmpty = action.isEmpty;
       return res;