瀏覽代碼

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

# Conflicts:
#	src/components/CheckBody/index.jsx
#	src/components/NumberDrop/index.jsx
#	src/store/actions/checkBody.js
#	src/utils/config.js
#	src/utils/tools.js
zhouna 6 年之前
父節點
當前提交
4f2324b930
共有 2 個文件被更改,包括 4 次插入6 次删除
  1. 3 2
      src/common/components/EditableSpan/index.jsx
  2. 1 4
      src/store/actions/mainSuit.js

+ 3 - 2
src/common/components/EditableSpan/index.jsx

@@ -224,8 +224,9 @@ class EditableSpan extends Component{
         }*/
         let data = innerVal.trim();
         //判断是否为空、中英文:, 。、;,且不是第一位
-        let pattern = new RegExp(/^\,?$|^\,?$|^\.?$|^\。?$|^\、?$|^\;?$|^\;?$|^\:?$|^\:?$|\s/);
-        if(index!==0 && pattern.test(data)){
+        // let pattern = new RegExp(/^\,?$|^\,?$|^\.?$|^\。?$|^\、?$|^\;?$|^\;?$|^\:?$|^\:?$|\s/);
+        // if(index!==0 && pattern.test(data)){
+        if(index!==0 && !config.punctuationReg.test(data)){
           // let preObj = $(this.$span.current).prev();
           let obj = preObj[0].nodeName=="DIV"?preObj.prev():preObj;
           handleKeydown&&handleKeydown({boxMark,i:index,text:data});

+ 1 - 4
src/store/actions/mainSuit.js

@@ -384,22 +384,19 @@ export const insertSearch = (state,action)=>{
     if(index < 1){//前
       if(data[focusIndex].value==searchStr){//为空标签则替换
         res.data.splice(focusIndex,1,nText);
-        res.saveText.splice(focusIndex,1,searchData);
       }else{
         res.data.splice(focusIndex,0,nText);
-        res.saveText.splice(focusIndex,0,searchData);
         res.data[focusIndex+1].value = value;
         res.saveText[focusIndex+1] = value;
       }  
     }else{
       res.data.splice(focusIndex+1,0,nText);
-      res.saveText.splice(focusIndex+1,0,searchData);
       res.data[focusIndex].value = value;
     }
     span.current.innerText?(span.current.innerText = value):(span.current.innerHTML=value);
     res.mainIds.push(id);
   }
-  // console.log(456,res,action);
+  res.saveText = fullfillText(res.data).saveText;
   res.update=Math.random();
   return res;
 }