ソースを参照

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

zhouna 6 年 前
コミット
c7033dc0fa

+ 2 - 0
src/containers/OtherHistory.js

@@ -40,11 +40,13 @@ function mapDispatchToProps(dispatch,store){
         const model = JSON.parse(JSON.stringify(initData.otherHisModel));
         const arr = JSON.parse(JSON.stringify(initData.otherHis||null));
         const arrSave = JSON.parse(JSON.stringify(initData.otherHisSave||null));
+        const selects = JSON.parse(JSON.stringify(initData.otherSelecteds||null));
         const isHis = initData.otherIsHis;
         const listObj = isHis?{newArr:arr,saveText:arrSave||[]}:fullfillText(model);
         dispatch({
           type:SETDATA,
           data:listObj.newArr,
+          selecteds:selects,
           save:listObj.saveText,
           isEmpty:false
         });

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

@@ -78,6 +78,7 @@ export const getOtherHisRecord = ()=>{
           dispatch({
             type:SETOTHERHISTORY,
             data:arr,
+            selecteds:obj.otherHistorySelecteds,
             save:objStr
           });
         }

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

@@ -44,6 +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.otherIsHis = action.otherIsHis!=undefined?action.otherIsHis:true;
       return res;
     /*case SETTEXTFOCUS:

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

@@ -17,6 +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.saveText = action.save||[];
       res.isEmpty = action.isEmpty;
       return res;

+ 3 - 3
src/utils/tools.js

@@ -499,9 +499,9 @@ function filterDataArr(arrTmp){   //数据处理
       });
     });
 
-    return tmpArr.join('').replace(/^[,,.。;;、]+/,'').replace(/[,,.。;;、]+$/,function(word){
-        return word.substr(0,1);
-    });      //去掉开头的标点符号,最后的标点保留第一个
+    return tmpArr.join('').replace(config.punReg,function(word){
+      return word.substr(0,1);
+    }).replace(/^[,,.。;;、]+/,'');      //去掉开头的标点符号,最后的标点保留第一个,中间连续的保留第一个
 }
 // 取消默认行为
 function preventDefault(event) {