Explorar el Código

Merge remote-tracking branch 'origin/dev5.3.2' into dev/new1

zhouna hace 5 años
padre
commit
e93780988c

+ 8 - 39
src/common/components/EditableSpan/index.jsx

@@ -243,22 +243,7 @@ class EditableSpan extends Component{
         if(preObj[0].nodeName !=="DIV"){
           this.moveEnd(preObj[0]);
         }
-      }
-      
-      if(innerVal !== preVal){
-        
-      }
-      else{
-        // 中英文数字和下划线--单独删除标签
-        /*const reg = new RegExp("([\u4E00-\uFA29]|[\uE7C7-\uE7F3]|[a-zA-Z0-9_])");
-        if(index!==0 && reg.test(innerVal)){
-          let obj = preObj[0].nodeName=="DIV"?preObj.prev():preObj;
-          delSingleLable && delSingleLable({boxMark,i:index});
-          this.moveEnd(obj[0]);  
-          this.setState({
-            index: null
-          })
-        }*/
+      }else{
         let data = innerVal.trim();
         //判断是否为空、中英文:, 。、;,且不是第一位
         // let pattern = new RegExp(/^\,?$|^\,?$|^\.?$|^\。?$|^\、?$|^\;?$|^\;?$|^\:?$|^\:?$|\s/);
@@ -268,7 +253,7 @@ class EditableSpan extends Component{
           // let preObj = $(this.$span.current).prev();
           let obj = preObj[0].nodeName=="DIV"?preObj.prev():preObj;
           handleKeydown&&handleKeydown({boxMark,i:index,text:data,flag:'backsp'});
-          this.moveEnd(obj[0]);  
+          this.moveEnd(obj[0]);
           this.setState({
             index: null
           })
@@ -291,40 +276,24 @@ class EditableSpan extends Component{
     $(this.$span.current).attr({"contentEditable":true}).focus()
   }
   componentDidMount(){
-    const {preIsExt,afterIsExt,value} = this.props;
-    const br = preIsExt&&!afterIsExt;       //最后一个体征标签
-    const val = br&&!config.punctuationReg.test(value)?'':value;
+    const {value} = this.props;
     if(value){
-      this.$span.current.innerText?(this.$span.current.innerText = val||''):(this.$span.current.innerHTML = val||'');
+      this.$span.current.innerText?(this.$span.current.innerText = value||''):(this.$span.current.innerHTML = value||'');
     }
   }
   getClass(){
-    const {full,value,saveText,i,preIsExt} = this.props;
+    const {full,value,saveText,i,preIsExt,afterIsExt} = this.props;
+    const br = preIsExt&&!afterIsExt;       //最后一个体征标签
     const preSelected = saveText[i-1];
     const isFull = full?' '+style['full']:'';       //是否宽度设为整行宽度
     //有标点符号之外的字符或者前一个标签有选中值时,显示为黑色,否则查体中,有体征标记显示蓝色,否则灰显
     const ext = preIsExt?style['ext']:style['unselect'];
     const unselect = value.match(config.punctuationReg)||preSelected?'':ext;
-    return classNames(style['editable-span'],isFull,unselect);
+    const hasBr = br?style['editable-br']:'';       //最后一个体征标签换行
+    return classNames(style['editable-span'],isFull,unselect,hasBr);
   }
 
   render() {
-    const {preIsExt,afterIsExt} = this.props;
-    const br = preIsExt&&!afterIsExt;       //最后一个体征标签
-    if(br){
-      return <React.Fragment>
-      <span className={this.getClass()}
-            contentEditable='true'
-            ref={this.$span}
-            onInput={this.onChange}
-            onFocus={this.handleFocus}
-            onBlur={this.handleBlur}
-            onKeyDown={this.handleKeydown}
-            onClick={this.handleClick}
-            onKeyUp={this.handleKeyup}></span>
-        <br/>
-      </React.Fragment>;
-    }
     return <span className={this.getClass()}
                  contentEditable='true'
                  ref={this.$span}

+ 8 - 0
src/common/components/EditableSpan/index.less

@@ -11,6 +11,14 @@
   text-align: left;
   padding-right: 1px;//火狐左右移动需要
 }
+.editable-br{
+  .editable-span;
+  display: inline;
+}
+.editable-br:after{
+  content: "\A";
+  white-space: pre;
+}
 .full{
   width: 100%;
   line-height: 22px;

+ 20 - 2
src/components/AddAssistCheck/Textarea/index.jsx

@@ -1,6 +1,7 @@
 import React, { Component } from "react";
 import style from "./index.less";
 import config from '@config/index';
+import ScrollArea from 'react-scrollbar';
 import $ from 'jquery';
 
 class Textarea extends Component {
@@ -69,7 +70,24 @@ class Textarea extends Component {
   }
   render() {
     const {idx,disabled} = this.props;
-    return (
+    //出现滚动条时阻止滚动冒泡,未出现时不阻止,否则外部滚动条滚不动
+    const showedBar = $("#datePick .scrollbar-container").length===1;
+    const contStyle={
+      opacity:'0.4',
+      right:'0',
+      top:'1px',
+      zIndex:'15',
+      width:'8px',
+      background:'#f1f1f1'};
+    const barStyle={background:'#777',width:'100%'};
+    return (<ScrollArea speed={0.8}
+                        horizontal={false}
+                        stopScrollPropagation={showedBar?true:false}
+                        style={{maxHeight:'100px'}}
+                        className={style["area"]}
+                        verticalContainerStyle={contStyle}
+                        verticalScrollbarStyle={barStyle}
+                        contentClassName="content">
       <div className={style.textWap}>
         <div className={style.divTextarea}
             contenteditable={disabled?false:true}
@@ -78,7 +96,7 @@ class Textarea extends Component {
             onKeyUp={this.handleInput}
         ></div>
         <p ref={this.textInput} onClick={this.handleFocus} className={style.textareaWarring}></p>
-      </div>
+      </div></ScrollArea>
     );
   }
 }

+ 3 - 2
src/components/AddAssistCheck/Textarea/index.less

@@ -1,7 +1,7 @@
 .divTextarea {
-  overflow-y: auto;
+  /*overflow-y: auto;*/
   overflow-x: hidden;
-  max-height: 100px;
+  /*max-height: 100px;*/
   border-bottom: 1px dashed #333;
   box-sizing: border-box;
   min-height: 21px;
@@ -14,6 +14,7 @@
   // z-index: 10;
   word-break: break-all;
   word-wrap:break-word;
+  padding-right: 6px;
 }
 .textWap {
   overflow: hidden;

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

@@ -105,7 +105,7 @@
     }
 
     .textareaWrap {
-      padding-right: 250px;
+      padding-right: 245px;
       width: 100%;
     }
   }

+ 1 - 1
src/containers/CurrentIll.js

@@ -80,7 +80,7 @@ function mapDispatchToProps(dispatch) {
          //右侧推送
          setTimeout(function(){      //延迟待确定后的数据更新后推送,避免获取的参数还是旧的
            if(didPushParamChange()){     //操作后内容有变化才推送
-             dispatch(billing());
+             dispatch(billing('',2));       //参数意义:点到现病史时查体无数据则提前获取查体模板,避免点查体时模板返回慢
            }
          },500);
        },

+ 6 - 3
src/containers/MultSpread.js

@@ -27,10 +27,13 @@ const getCopyData = (copyId,inx,boxMark)=>{
       data:JSON.stringify(copy),
       i:inx
     });
-    //自由文本组件更新
-    dispatch({
-      type:ISREAD
+    setTimeout(function () {      //血压添加时后面逗号不显示bug
+      dispatch({
+        type:ISREAD
+      })
     })
+    //自由文本组件更新
+
   }
 };