瀏覽代碼

Squashed commit of the following:

commit 50e03ffa0a5ceaac50f9585ebefae27a05e838c7
Author: Luolei <16657115156@163.com>
Date:   Tue Jan 29 14:17:40 2019 +0800

    顿号去重

commit d01d40bd967f15acc0872e83174ee8ad3e684b6f
Merge: 4095b3f b09559b
Author: Luolei <16657115156@163.com>
Date:   Tue Jan 29 13:59:54 2019 +0800

    Merge branch 'dev/new1' into dev/byll

commit 4095b3ffaf8aa6c98e912bcbc5eef7f66ecb25b4
Author: Luolei <16657115156@163.com>
Date:   Tue Jan 29 13:55:47 2019 +0800

    样式宽度更改和逗号处理

commit 79e0195a9b13069db729afe732bc5b466d43a37f
Author: Luolei <16657115156@163.com>
Date:   Fri Jan 25 14:06:09 2019 +0800

    date修改
liucf 6 年之前
父節點
當前提交
aa84581e6e

+ 2 - 1
src/common/js/util.js

@@ -32,4 +32,5 @@ export const setLastPosition=(dom)=>{
 //         range.collapse(false);//光标移至最后
 //         range.select();
 //     }
-// }
+// }
+

+ 1 - 1
src/common/less/variables.less

@@ -46,7 +46,7 @@
 @selected-bg:#fff;
 
 /*********推送内容容器宽度*************/
-@push-width: 460px;
+@push-width: 450px;
 /****电子病历容器宽度*****/
 @EMR-width: calc(~"100% - "@push-width);
 

+ 3 - 3
src/components/PushItems/index.less

@@ -1,12 +1,12 @@
 @import "~@less/variables.less";
 .push-content-wrapper{
   // padding-top: 50px;
-  padding: 0px 20px;
+  padding: 0px 15px;
   line-height: 20px; 
-  width: 460px;
+  width: @push-width;
   overflow: hidden;
   .push-content {
-    width: 480px;
+    width: 467px;
     overflow-y: scroll;
   }
   .vigilant{

+ 1 - 1
src/components/TemplateItems/index.jsx

@@ -68,7 +68,7 @@ class TemplateItems extends React.Component {
                             <span className={`${style['fr-element']} ${style['manger']}`} onClick={handleMangerTemplate}>管理</span>
                     </div>) : null
                 }
-                <div style={{width:'460px',overflow:'hidden'}}>
+                <div style={{width:'450px',overflow:'hidden'}}>
                     <div className={style.tempLists} ref={this.$cont}>
                         {
                             this.genItems().length > 0?this.genItems():

+ 1 - 1
src/components/TemplateItems/index.less

@@ -7,7 +7,7 @@
     .tempLists {
         overflow-y: scroll;
         background-color: #fff;
-        width: 475px;
+        width: 466px;
         // &::-webkit-scrollbar {
         //     display: none;
         // }

+ 16 - 3
src/utils/tools.js

@@ -474,23 +474,36 @@ function filterArr(arr){
     return tmpArr.join("").replace(/\s/g,'');
 }
 
-function filterDataArr(arr){   //数据处理
+function filterDataArr(arrTmp){   //数据处理
     let tmpArr = [];
+    let arr = arrTmp.join('').split('');
     for(let i = 0;i < arr.length;i++){
         if(arr[i] && arr[i].indexOf('undefined') == -1){
             if(tmpArr[tmpArr.length-1] != ',' && tmpArr[tmpArr.length-1] != ',' ){
                 tmpArr.push(arr[i])
             }else if((tmpArr[tmpArr.length-1] == ',' && (arr[i] != ',' || arr[i] != ',')) || (tmpArr[tmpArr.length-1] == ',' && (arr[i] != ',' || arr[i] != ','))) {
-              if(arr[i] == '。'){
+              if(arr[i] == '。'){     //前面逗号后面句号 [',','。']
                 tmpArr.pop();
                 tmpArr.push(arr[i]);
+              }else if(tmpArr[tmpArr.length-2] == '。' && (tmpArr[tmpArr.length-1] == ',' || tmpArr[tmpArr.length-1] == ',')){//前面句号后面逗号 ['。',',']
+                tmpArr.pop();
+                tmpArr.push(arr[i]);
+              }else if(arr[i] == ',' || arr[i] == ','){    //  中英文逗号交替[',',',']
+                tmpArr.pop();
+                tmpArr.push(arr[i]);
+              }else if(arr[i] == '、'){    //前面逗号后面句号 [',','、']
+                tmpArr.pop();
+                tmpArr.push(arr[i]);
+              }else if(tmpArr[tmpArr.length-2] == '、' && (tmpArr[tmpArr.length-1] == ',' || tmpArr[tmpArr.length-1] == ',')){    //前面逗号后面句号 ['、',',']
+                tmpArr.splice(tmpArr.length-2,1);
+                tmpArr.push(arr[i]);
               }else{
                 tmpArr.push(arr[i]);
               }
             }
         }
     }
-    return (tmpArr.join('')).replace(/,^|,^|,$|,$/gi,"");
+    return (tmpArr.join('')).replace(/^,+/,"").replace(/,+$/,"").replace(/,+$/,"").replace(/,+$/,"");
 }
 // 取消默认行为
 function preventDefault(event) {