liucf пре 6 година
родитељ
комит
6d55c5960a

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

@@ -24,7 +24,8 @@ class EditableSpan extends Component{
       oldText:props.value,
       labelVal:'',  //存放标签原有的值--主诉字数限制用
       preVal:'',
-      index:null
+      index:null,
+      searchPre:''
     };
     this.$span = React.createRef();
     this.handleFocus = this.handleFocus.bind(this);
@@ -40,13 +41,14 @@ class EditableSpan extends Component{
     setFocusIndex&&setFocusIndex({i,boxMark,dom:this.$span});
     this.setState({
       labelVal:text,
-      index:i
+      index:i,
+      searchPre:text
     });
   }
   onChange(e){
     e.stopPropagation();
     const {handleChange,boxMark,i,handleSearch,value,mainSaveText,mainIds} = this.props;
-    const {labelVal,oldText} = this.state;
+    const {labelVal,oldText,searchPre} = this.state;
     const text1 =e.target.innerText;
     let mainText = filterArr(mainSaveText);//主诉字数
     if(+boxMark==1){
@@ -80,9 +82,9 @@ class EditableSpan extends Component{
       let search='';
       clearTimeout(that.state.timer);
       // temp = newText.replace(oldText.replace(/(^\s*)|(\s*$)/g,''),'');
-      temp = newText.replace(labelVal.replace(/(^\s*)|(\s*$)/g,''),'');
-      search = temp.replace(/(^\s*)|(\s*$)/g,'');
-      // console.log(111,labelVal,333,newText,444,search);
+      temp = newText.replace(searchPre.replace(/(^\s*)|(\s*$)|(^\,*)|(\,*$)/g,''),'');
+      search = temp.replace(/(^\s*)|(\s*$)|(^\,*)|(\,*$)/g,'');
+      // console.log(111,labelVal,searchPre,333,newText,444,search);
       handleSearch&&handleSearch({text:search,boxMark,mainIds});
       /*that.setState({
         oldText:newText.replace(search,'')

+ 1 - 11
src/common/components/TailInlineTag/index.less

@@ -10,22 +10,12 @@
   position: relative;
   cursor: pointer;
   line-height: 14px;
-  /* span:hover{
-    color: @blue;
-  } */
   .gray{
     display: inline-block;
-    // color: @placeholder-color;
     color: @blue;
     border-bottom: none; 
-    margin-left: 2px;
-  }
-  /* .gray:before{
-    content: '[';
+    margin: 0 3px 0 2px;
   }
-  .gray:after{
-    content: ']';
-  } */
 }
 .pre-block{
   display: inline-block;

+ 1 - 4
src/components/AddInspect/index.jsx

@@ -7,7 +7,6 @@ import date2 from './img/date2.png';
 import close from './img/close.png';
 import store from '@store';
 import $ from 'jquery';
-import more from '@common/images/addItem1.png';
 class Inspect extends React.Component {
     constructor(props) {
         super(props);
@@ -102,7 +101,7 @@ class Inspect extends React.Component {
         let date = info.year+'-'+(info.month<10?'0'+info.month:info.month)+'-'+(info.day<10?'0'+info.day:info.day);
         this.setState({dateTime:date,date:false})
     }
-    handleSearchShow(e) {console.log(666);
+    handleSearchShow(e) {
         let tmpShow = this.state.show;
         this.setState({ show: !tmpShow })
         // e.stopPropagation();
@@ -375,8 +374,6 @@ class Inspect extends React.Component {
                     </ul>
                 </div>
                 <div style={{position:"relative"}}>
-                    {/*<img src={more} id="addImg" style={{verticalAlign:'middle',marginRight:'2px'}} onClick={(e) => this.handleSearchShow(e)}/>
-                    <span id="searchWrap" className={`${styles.staticTag}`} onClick={(e) => this.handleSearchShow(e)}>添加化验项</span>*/}
                     <Add showText="添加化验项" handleClick={(e) => this.handleSearchShow(e)} id="searchWrap"/>
                     <SearchOption handleChangeValue={handleChangeValue} visible={this.state.show}>
                         {this.getSearchList(list)}