浏览代码

Squashed commit of the following:

commit b0c00a729612618f20f468d7354303097a8bbb3a
Merge: 8585a00 7badd32
Author: liucf <liucf@zjlantone.com>
Date:   Mon Mar 4 20:44:51 2019 +0800

    Merge branch 'dev/byll' of http://192.168.2.236:10080/zhouna/newICSS into dev/byll

commit 8585a0093ff723eacb191dc7403e3ce36e9b2c89
Author: liucf <liucf@zjlantone.com>
Date:   Mon Mar 4 20:43:40 2019 +0800

    冲突测试

commit 7badd324c95ce9228e4bc77018b95ef12ce8b478
Author: Luolei <16657115156@163.com>
Date:   Mon Mar 4 20:28:34 2019 +0800

    innerText兼容

commit bae44fbc4ec23f87680a8a990bb7b4beafe76bdb
Author: Luolei <16657115156@163.com>
Date:   Mon Mar 4 19:32:27 2019 +0800

    火狐div兼容

commit ae75e0b94813e902df0cb9fcfdb010a077da2bcc
Author: Luolei <16657115156@163.com>
Date:   Mon Mar 4 16:51:40 2019 +0800

    搜索结果位置变化,div换行问题

commit c4b7f3caf26cc03ee94e500988fa561a4a8cb6d0
Author: Luolei <16657115156@163.com>
Date:   Mon Mar 4 10:38:22 2019 +0800

    预览文字过多导致出现滚动条

commit 67c2971080b85bdef5a695642163cf1f55aa315e
Author: Luolei <16657115156@163.com>
Date:   Mon Mar 4 10:32:51 2019 +0800

    现病史查体其他史输入内容过多问题,默认回读辅检提示语

# Conflicts:
#	src/common/components/EditableSpan/index.jsx
#	src/common/components/Textarea/index.less
#	src/components/AddAssistCheck/Textarea/index.less
liucf 6 年之前
父节点
当前提交
7547aad071

+ 2 - 0
src/common/components/Calendar/index.less

@@ -35,6 +35,8 @@
       position: absolute;
       top: 2px;
       border: 1px solid #b1d2ec;
+      box-sizing: border-box;
+      width: 47px;
       color:#1F547E;
       background-color: #deecf8;
       outline: none;

+ 10 - 7
src/common/components/EditableSpan/index.jsx

@@ -62,7 +62,7 @@ class EditableSpan extends Component{
     e.stopPropagation();
     const {handleChange,boxMark,i,handleSearch,value,mainSaveText,mainIds,handleClear} = this.props;
     const {labelVal,searchPre} = this.state;
-    const text1 =e.target.innerText;
+    const text1 =e.target.innerText? e.target.innerText : e.target.innerHTML;
     let mainText = filterDataArr(mainSaveText);//主诉字数
     if(+boxMark==1){
       if(mainText.length >= config.limited){
@@ -158,7 +158,6 @@ class EditableSpan extends Component{
         preVal:innerVal
       })
     }
-
   }
   stopIt(e){  
     if(e.returnValue){  
@@ -170,11 +169,11 @@ class EditableSpan extends Component{
     return false;  
   }  
   handleKeyup(e){
-    const {boxMark,handleKeydown,i,value,removeId,handleClear,delSingleLable} = this.props;
+    const {boxMark,handleKeydown,i,value,removeId,handleClear,delSingleLable,setSearchLocation} = this.props;
     const {preVal,index} = this.state;
     const ev = e||window.event;
     const target = ev.target||ev.srcElement;
-    let innerVal = target.innerText;
+    let innerVal = target.innerText? target.innerText : target.innerHTML;
     if(ev.keyCode==8){
       const elem = ev.srcElement || ev.currentTarget;
       const nodeN = elem.nodeName;
@@ -216,18 +215,23 @@ class EditableSpan extends Component{
           index: null
         })
       }
+      let ele = document.activeElement;
+      let boxTop = getPageCoordinate(e).boxTop;
+      setSearchLocation(boxTop,ele.offsetLeft)     //搜索框的位置动态获取
     }
   }
   componentWillReceiveProps(next){
     const isRead = this.props.isRead;
     if(next.isRead != isRead){
-      this.$span.current.innerText = next.value||'';
+      this.$span.current.innerText = next.value||''
+      // this.$span.current.innerText?(this.$span.current.innerText = next.value||''):(this.$span.current.innerHTML = next.value||'');
     }
   }
   componentDidMount(){
     const {value} = this.props;
     if(value){
-      this.$span.current.innerText = value||'';
+      this.$span.current.innerText?(this.$span.current.innerText = value||''):(this.$span.current.innerHTML = value||'');
+      // this.$span.current.innerText = value||''
     }
     if(isIE()){
       $(this.$span.current).onIe8Input(function(e){
@@ -235,7 +239,6 @@ class EditableSpan extends Component{
       },this);
     }
   }
-
   /*cancelSelect(e){//双击不选中
     if(document.selection&&document.selection.empty){
         document.selection.empty();

+ 2 - 0
src/common/components/ItemBox/index.less

@@ -2,6 +2,8 @@
 
 .box{
   margin: 2px 20px;
+  word-break: break-all;
+  word-break: break-word;
   .title{
     width: 65px;
     float: left;

+ 10 - 16
src/components/AddAssistCheck/Textarea/index.jsx

@@ -13,11 +13,10 @@ class Textarea extends Component {
     this.$dom = React.createRef();
     this.$domW = React.createRef();
     this.handleInput = this.handleInput.bind(this);
-    this.handleBlur = this.handleBlur.bind(this);
   }
   handleInput(e){
     const {handleChangeAssistValue,idx,handlePush} = this.props;
-    const text = e.target.innerText;
+    const text = e.target.innerText || e.target.innerHTML;
     const stimer = this.state.timer;
     handleChangeAssistValue&&handleChangeAssistValue(text,idx);
     //右侧推送--延时推送
@@ -26,10 +25,13 @@ class Textarea extends Component {
       handlePush&&handlePush();
       clearTimeout(stimer);
     },config.delayPushTime);
-    if(text.trim() != ''){
+
+    if(text.trim() != '' && text != '<br>'){
       e.target.nextSibling.innerText = ''
+      e.target.nextSibling.innerHTML = ''
     }else{
       e.target.nextSibling.innerText = '报告描述或意见'
+      e.target.nextSibling.innerHTML = '报告描述或意见'
     }
     this.setState({
       timer
@@ -44,25 +46,18 @@ class Textarea extends Component {
   componentWillReceiveProps(next){
     const isRead = this.props.isRead;
     if(next.isRead != isRead){
-      this.$dom.current.innerText = next.value||'';
-    }
-    if(next.value && next.value.trim() != ''){
-      this.$dom.current.nextSibling.innerText = ''
+      this.$dom.current.innerText?(this.$dom.current.innerText = next.value||'') : (this.$dom.current.innerHTML = next.value||'')
     }
   }
   componentDidMount(){
     const {value} = this.props;
-    if(value){
-      this.$dom.current.innerText = value||'';
+    if(value && value.trim()){
+      this.$dom.current.innerText?(this.$dom.current.innerText = value) : (this.$dom.current.innerHTML = value)
       this.$dom.current.nextSibling.innerText = '';
+      this.$dom.current.nextSibling.innerHTML = '';
     }else{
       this.$dom.current.nextSibling.innerText = '报告描述或意见'
-    }
-  }
-  handleBlur(e){
-    let str = e.target.innerText
-    if(str.trim() == ''){
-      e.target.nextSibling.innerText = '报告描述或意见'
+      this.$dom.current.nextSibling.innerHTML = '报告描述或意见'
     }
   }
   render() {
@@ -73,7 +68,6 @@ class Textarea extends Component {
             contenteditable={true}
             ref={this.$dom}
             onInput={this.handleInput}
-            onBlur={this.handleBlur}
             onPropertyChange={this.handleInput}
         ></div>
         <p style={{position: "absolute",left: '0',top: '0',color: "#a5a3a3",zIndex: '5'}} className="textareaWarring"></p>

+ 10 - 9
src/components/CheckBody/index.jsx

@@ -21,6 +21,9 @@ class CheckBody extends Component{
     this.getData = this.getData.bind(this);
     //this.handleInput = this.handleInput.bind(this);
   }
+  componentWillReceiveProps(nextProps){
+    this.setState({boxLeft:nextProps.boxLeft})
+  }
   getLabels(){
     const {data,showArr,saveText,selecteds} = this.props;
     let arr = [],list=[];
@@ -35,7 +38,7 @@ class CheckBody extends Component{
   }
   handleClick(e){//让搜索框跟随鼠标点击移动
     // e.stopPropagation();
-    const {fetchPushInfos,totalHide} = this.props;
+    const {fetchPushInfos,totalHide,getSearchLocation} = this.props;
     //fetchPushInfos&&fetchPushInfos();
     this.getData();
     if(totalHide){
@@ -53,19 +56,18 @@ class CheckBody extends Component{
       }
       leftL = ele.offsetLeft+90
     }
-    // console.log(leftL,getPageCoordinate(e).boxLeft)
+    getSearchLocation(getPageCoordinate(e).boxTop,leftL)
     this.setState({
       // boxLeft:getPageCoordinate(e).boxLeft,
-      boxLeft:leftL,
-      boxTop:getPageCoordinate(e).boxTop,
+      // boxLeft:leftL,
+      // boxTop:getPageCoordinate(e).boxTop,
       tmpScroll: $("#addScrollEvent")[0].scrollTop,
       tmpTop:getPageCoordinate(e).boxTop
     });
     windowEventHandler('scroll',()=>{      //弹窗跟随滚动条滚动或者关闭弹窗
       let scrollYs = $("#addScrollEvent")[0].scrollTop;
-      this.setState({
-        boxTop:this.state.tmpTop - scrollYs + this.state.tmpScroll
-      })
+      let boxTop = this.state.tmpTop - scrollYs + this.state.tmpScroll
+      getSearchLocation(boxTop,this.state.boxLeft)
     },$("#addScrollEvent")[0])
   }
   handleSearchSelect(obj){
@@ -84,8 +86,7 @@ class CheckBody extends Component{
     }
   }
   render(){
-    const {searchData,totalHide,data} = this.props;
-    const {boxLeft,boxTop,boxMark} = this.state;
+    const {searchData,totalHide,data,boxLeft,boxTop} = this.props;
     return  <div className={style['container']}>
       <ItemBox title='查体' handleClick={this.handleClick}>
         {this.getLabels()}

+ 14 - 7
src/components/CurrentIll/index.jsx

@@ -29,6 +29,11 @@ class CurrentIll extends Component{
     this.handleSearchSelect = this.handleSearchSelect.bind(this);
     this.handleClick = this.handleClick.bind(this);
   }
+  
+  componentWillReceiveProps(nextProps){
+    this.setState({boxLeft:nextProps.boxLeft})
+  }
+
   toggleEditable(){
     this.setState({
       boxEditable:!this.state.boxEditable
@@ -82,6 +87,7 @@ class CurrentIll extends Component{
   handleClick(e){//让搜索框跟随鼠标点击移动
     // e.stopPropagation(); //冒泡到最顶层关闭其他下拉
     //若使用e.target,因为是onClick事件中,值可能是itembox的而不是span因此会有bug
+    const {getSearchLocation} = this.props;
     let leftL=0;      //用焦点元素的左边距替换鼠标点击的左边距,高度还是鼠标点击的位置
     if(isIE()){
       leftL = getPageCoordinate(e).boxLeft
@@ -92,18 +98,19 @@ class CurrentIll extends Component{
       }
       leftL = ele.offsetLeft+90
     }
+    console.log(getPageCoordinate(e).boxTop)
+    getSearchLocation(getPageCoordinate(e).boxTop,leftL)
     this.setState({
       // boxLeft:getPageCoordinate(e).boxLeft,
-      boxLeft:leftL,
-      boxTop:getPageCoordinate(e).boxTop,
+      // boxLeft:leftL,
+      // boxTop:getPageCoordinate(e).boxTop,
       tmpScroll: $("#addScrollEvent")[0].scrollTop,
       tmpTop:getPageCoordinate(e).boxTop
     });
     windowEventHandler('scroll',()=>{      //弹窗跟随滚动条滚动或者关闭弹窗
       let scrollYs = $("#addScrollEvent")[0].scrollTop;
-      this.setState({
-        boxTop:this.state.tmpTop - scrollYs + this.state.tmpScroll
-      })
+      let boxTop = this.state.tmpTop - scrollYs + this.state.tmpScroll
+      getSearchLocation(boxTop,this.state.boxLeft)
     },$("#addScrollEvent")[0])
   }
 
@@ -128,8 +135,8 @@ class CurrentIll extends Component{
   }
 
   render(){
-    const {fuzhen,type,fetchPushInfos,handleInput,isRead,saveText,searchData,totalHide,showArr,focusIndex,editClear,data} = this.props;
-    const {showMoudle,forbidInput,boxMark,boxLeft,boxTop,show} = this.state;
+    const {fuzhen,type,fetchPushInfos,handleInput,isRead,saveText,searchData,totalHide,showArr,focusIndex,editClear,data,boxLeft,boxTop} = this.props;
+    const {showMoudle,forbidInput,boxMark,show} = this.state;
     const searchFlag = searchData.length > 0 ? true : false;
 
     if(+type===1){      //文本模式

+ 12 - 7
src/components/MainSuit/index.jsx

@@ -38,6 +38,9 @@ class MainSuit extends Component{
     this.handleClick = this.handleClick.bind(this);
     this.handleBlur = this.handleBlur.bind(this);
   }
+  componentWillReceiveProps(nextProps){
+    this.setState({boxLeft:nextProps.boxLeft})
+  }
   toggleEditable(){
     this.setState({
       boxEditable:!this.state.boxEditable
@@ -146,6 +149,7 @@ class MainSuit extends Component{
   handleClick(e){//让搜索框跟随鼠标点击移动
     // e.stopPropagation(); //冒泡到最顶层关闭其他下拉
     //若使用e.target,因为是onClick事件中,值可能是itembox的而不是span因此会有bug
+    const {getSearchLocation} = this.props;
     let leftL=0;      //用焦点元素的左边距替换鼠标点击的左边距,高度还是鼠标点击的位置
     let num = this.props.datas.length == 0?0:60
     if(isIE()){
@@ -154,18 +158,18 @@ class MainSuit extends Component{
       const ele = document.activeElement;
       leftL = ele.offsetLeft+num
     }
+    getSearchLocation(getPageCoordinate(e).boxTop,leftL)
     this.setState({
       // boxLeft:getPageCoordinate(e).boxLeft,
-      boxLeft:leftL,
-      boxTop:getPageCoordinate(e).boxTop,
+      // boxLeft:leftL,
+      // boxTop:getPageCoordinate(e).boxTop,
       tmpScroll: $("#addScrollEvent")[0].scrollTop,
       tmpTop:getPageCoordinate(e).boxTop
     });
     windowEventHandler('scroll',()=>{      //弹窗跟随滚动条滚动或者关闭弹窗
       let scrollYs = $("#addScrollEvent")[0].scrollTop;
-      this.setState({
-        boxTop:this.state.tmpTop - scrollYs + this.state.tmpScroll
-      })
+      let boxTop = this.state.tmpTop - scrollYs + this.state.tmpScroll
+      getSearchLocation(boxTop,this.state.boxLeft)
     },$("#addScrollEvent")[0])
   }
 
@@ -185,6 +189,7 @@ class MainSuit extends Component{
       }
       ev.target.innerText = data.substr(0,config.limited);  //输入法内输入多个字再按enter的情况
       ev.target.blur();
+      
       this.setState({
         inpText:data.substr(0,config.limited),
         overFlag:true
@@ -252,8 +257,8 @@ class MainSuit extends Component{
 
 
   render(){
-    const {type,CommonSymptoms,searchData,fetchPushInfos,isRead,totalHide,handleInput,fuzhen,saveText,editClear,datas,commSymHide} = this.props;
-    const {showModule,boxLeft,boxTop,show,symptom,search} = this.state;
+    const {type,CommonSymptoms,searchData,fetchPushInfos,isRead,totalHide,handleInput,fuzhen,saveText,editClear,datas,commSymHide,boxLeft,boxTop} = this.props;
+    const {showModule,show,symptom,search} = this.state;
     const symptomFlag = CommonSymptoms.length>0 ? true : false;
     const searchFlag = searchData.length>0 ? true : false;
     if(+type===1){      //文本模式

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

@@ -173,7 +173,7 @@ class Operation extends Component {
         jsonStr.vital == JSON.stringify(eval('('+JSON.parse(dataStr).vital+')'))  &&
         JSON.stringify(jsonData.chief) == JSON.stringify(JSON.parse(dataJson).chief) &&    
         JSON.stringify(jsonData.present) == JSON.stringify(JSON.parse(dataJson).present)  &&     
-        JSON.stringify(jsonData.other) == JSON.stringify(JSON.parse(dataJson).other) &&      
+        whichSign == 1?true:JSON.stringify(jsonData.other) == JSON.stringify(JSON.parse(dataJson).other) &&      
         JSON.stringify(jsonData.vital) == JSON.stringify(JSON.parse(dataJson).vital) && 
         JSON.stringify(jsonData.lis) == JSON.stringify(JSON.parse(dataJson).lis) &&  
         JSON.stringify(jsonData.pacs) == JSON.stringify(JSON.parse(dataJson).pacs) &&     

+ 11 - 8
src/components/OtherHistory/index.jsx

@@ -20,6 +20,10 @@ class OtherHistory extends Component{
     this.handleSearchSelect = this.handleSearchSelect.bind(this);
     this.getData = this.getData.bind(this);
   }
+  
+  componentWillReceiveProps(nextProps){
+    this.setState({boxLeft:nextProps.boxLeft})
+  }
   handleSearchSelect(obj){
     const {questionId,name} = obj;
     const {fetchModules,focusTextIndex,span,searchInEnd} = this.props;
@@ -46,7 +50,7 @@ class OtherHistory extends Component{
   }
   handleClick(e){//让搜索框跟随鼠标点击移动
     //e.stopPropagation();
-    const {fetchPushInfos} = this.props;
+    const {fetchPushInfos,getSearchLocation} = this.props;
     //fetchPushInfos&&fetchPushInfos();
     //若使用e.target,因为是onClick事件中,值可能是itembox的而不是span因此会有bug
     this.getData();
@@ -60,23 +64,22 @@ class OtherHistory extends Component{
       }
       leftL = ele.offsetLeft+90
     }
+    getSearchLocation(getPageCoordinate(e).boxTop,leftL)
     this.setState({
       // boxLeft:getPageCoordinate(e).boxLeft,
-      boxLeft:leftL,
-      boxTop:getPageCoordinate(e).boxTop,
+      // boxLeft:leftL,
+      // boxTop:getPageCoordinate(e).boxTop,
       tmpScroll: $("#addScrollEvent")[0].scrollTop,
       tmpTop:getPageCoordinate(e).boxTop
     });
     windowEventHandler('scroll',()=>{      //弹窗跟随滚动条滚动或者关闭弹窗
       let scrollYs = $("#addScrollEvent")[0].scrollTop;
-      this.setState({
-        boxTop:this.state.tmpTop - scrollYs + this.state.tmpScroll
-      })
+      let boxTop = this.state.tmpTop - scrollYs + this.state.tmpScroll
+      getSearchLocation(boxTop,this.state.boxLeft)
     },$("#addScrollEvent")[0])
   }
   render(){
-    const {hasMain,searchData,totalHide,isRead,type,fetchPushInfos,handleInput,saveText} = this.props;
-    const {boxTop,boxLeft} = this.state;
+    const {hasMain,searchData,totalHide,isRead,type,fetchPushInfos,handleInput,saveText,boxTop,boxLeft} = this.props;
     if(+type===1){      //文本模式
       return <Textarea title='其他史' boxMark='3'
                        isRead={isRead}

+ 6 - 6
src/components/PreviewBody/index.jsx

@@ -151,7 +151,7 @@ class PreviewBody extends Component {
         <table style={{ width: "100%", borderCollapse: 'collapse' }}>
           <tr style={{ verticalAlign: 'top', borderBottom: "1px solid #e2e4e6" }}>
             <td style={{ textAlign: 'right', padding: '9px 5px 8px 0px', fontSize: '14px',width:'70px' }}>主诉:</td>
-            <td style={{ fontSize: '14px', padding: '9px 0px 8px 0px', lineHeight: '20px' }}>
+            <td style={{ fontSize: '14px', padding: '9px 0px 8px 0px', lineHeight: '20px',wordBreak:"break-word" }}>
               {
                 filterDataArr(JSON.parse(dataStr.chief))
               }
@@ -159,7 +159,7 @@ class PreviewBody extends Component {
           </tr>
           <tr style={{ verticalAlign: 'top', borderBottom: "1px solid #e2e4e6" }}>
             <td style={{ textAlign: 'right', padding: '9px 5px 8px 0px', fontSize: '14px',width:'70px' }}>现病史:</td>
-            <td style={{ fontSize: '14px', padding: '9px 0px 8px 0px', lineHeight: '20px' }}>
+            <td style={{ fontSize: '14px', padding: '9px 0px 8px 0px', lineHeight: '20px',wordBreak:"break-word" }}>
               {
                 filterDataArr(JSON.parse(dataStr.present))
               }
@@ -167,7 +167,7 @@ class PreviewBody extends Component {
           </tr>
           <tr style={{ verticalAlign: 'top', borderBottom: "1px solid #e2e4e6" }}>
             <td style={{ textAlign: 'right', padding: '9px 5px 8px 0px', fontSize: '14px',width:'70px' }}>其他史:</td>
-            <td style={{ fontSize: '14px', padding: '9px 0px 8px 0px', lineHeight: '20px' }}>
+            <td style={{ fontSize: '14px', padding: '9px 0px 8px 0px', lineHeight: '20px',wordBreak:"break-word" }}>
               {
                 filterDataArr(JSON.parse(dataStr.other))
               }
@@ -175,7 +175,7 @@ class PreviewBody extends Component {
           </tr>
           <tr style={{ verticalAlign: 'top', borderBottom: "1px solid #e2e4e6" }}>
             <td style={{ textAlign: 'right', padding: '9px 5px 8px 0px', fontSize: '14px',width:'70px' }}>查体:</td>
-            <td style={{ fontSize: '14px', padding: '9px 0px 8px 0px', lineHeight: '20px' }}>
+            <td style={{ fontSize: '14px', padding: '9px 0px 8px 0px', lineHeight: '20px',wordBreak:"break-word" }}>
               {
                 filterDataArr(JSON.parse(dataStr.vital))
               }
@@ -183,7 +183,7 @@ class PreviewBody extends Component {
           </tr>
           <tr style={{ verticalAlign: 'top', borderBottom: "1px solid #e2e4e6" }}>
             <td style={{ width: 70, textAlign: 'right', padding: '9px 5px 8px 0px', fontSize: '14px',width:'70px' }}>化验:</td>
-            <td style={{ fontSize: '14px', padding: '4px 0px 8px 0px', lineHeight: '20px', maxWidth: '650px' }}>
+            <td style={{ fontSize: '14px', padding: '4px 0px 8px 0px', lineHeight: '20px', maxWidth: '650px',wordBreak:"break-word" }}>
               {
                 dataJson.lis.getExcelDataList && dataJson.lis.getExcelDataList.map((items) => {
                   return items.lisExcelRes && items.lisExcelRes.map((item) => {
@@ -235,7 +235,7 @@ class PreviewBody extends Component {
             <td style={{ fontSize: '14px', padding: '9px 0px 8px 0px', lineHeight: '20px' }}>
               {
                 dataStr.pacs && dataStr.pacs != '' && dataStr.pacs.split(';').map((item) => {
-                  return <div style={{ fontSize: '14px',wordBreak:"break-all" }}>{item}</div>
+                  return <div style={{ fontSize: '14px',wordBreak:"break-word" }}>{item}</div>
                 })
               }
             </td>

+ 12 - 2
src/containers/CheckBody.js

@@ -1,7 +1,7 @@
 import {connect} from 'react-redux';
 import CheckBody from '@components/CheckBody';
 import {getModule,getInitData} from '@store/async-actions/fetchModules.js';
-import {HIDE,RESET,SETDROPSHOW,ISREAD} from '@store/types/homePage.js';
+import {HIDE,RESET,SETDROPSHOW,ISREAD,SEARCH_DROP_LOCATION} from '@store/types/homePage.js';
 import {SELECTSEARCHDATA} from "@store/types/checkBody";
 import {billing} from '@store/async-actions/pushMessage';
 import {filterDataArr} from '@utils/tools.js';
@@ -21,7 +21,9 @@ function mapStateToProps(state){
     focusTextIndex:checkBody.focusIndex,    //聚焦的自由文本标签index
     span:checkBody.span,
     searchInEnd:checkBody.searchInEnd,      //是否在搜索末尾插入结果
-    selecteds:checkBody.selecteds       //普通多选选中状态
+    selecteds:checkBody.selecteds,       //普通多选选中状态
+    boxTop:state.homePage.boxTop,
+    boxLeft:state.homePage.boxLeft,
   }
 }
 
@@ -54,6 +56,14 @@ function mapDispatchToProps(dispatch,state){
       //调右侧推送
       dispatch(billing());
     },
+    getSearchLocation(top,left){
+      dispatch({
+        type:SEARCH_DROP_LOCATION,
+        top:top,
+        left:left,
+        dis:0
+      })
+    }
   }
 }
 

+ 13 - 2
src/containers/CurrentIll.js

@@ -6,7 +6,7 @@ import {SET_CURRENT_ILL} from '@store/types/fillInfo'
 import {pushMessage} from '../store/async-actions/pushContainer';
 import {getModules} from '../store/async-actions/fetchModules.js';
 import {SETDROPSHOW} from '@types/homePage.js';
-import {HIDE,RESET,CLICKCOUNT,ISREAD} from '@store/types/homePage.js';
+import {HIDE,RESET,CLICKCOUNT,ISREAD,SEARCH_DROP_LOCATION} from '@store/types/homePage.js';
 import {billing} from '@store/async-actions/pushMessage';
 import {getModule} from '@store/async-actions/fetchModules.js';
 import {didPushParamChange} from '@utils/tools.js';
@@ -38,6 +38,8 @@ function mapStateToProps(state) { //console.log(111,state);
         symptomIds:state.currentIll.symptomIds,//症状id,去重用
         isRead:state.homePage.isRead,
         fuzhen:state.diagnosticList.mainSuitStr,//诊断第一个复诊值
+        boxTop:state.homePage.boxTop,
+        boxLeft:state.homePage.boxLeft,
 
     }
 }
@@ -125,7 +127,16 @@ function mapDispatchToProps(dispatch) {
               type:CLEAR_CURRENT_EDIT,
               editClear:bool
             })
-        }
+        },
+        
+      getSearchLocation(top,left){
+        dispatch({
+          type:SEARCH_DROP_LOCATION,
+          top:top,
+          left:left,
+          dis:0
+        })
+      }
     }
 }
 

+ 11 - 1
src/containers/EditableSpan.js

@@ -7,7 +7,7 @@ import {SET_CURRENT_SEARCH,CURRENT_CLEAR,SETCURRENTTEXT,CURRENT_FOCUS_INDEX,DEL_
 import {getSearch} from '@store/async-actions/fetchModules.js';
 import {billing} from '@store/async-actions/pushMessage';
 import {didPushParamChange} from '@utils/tools.js';
-import {SETTEXTFOCUS} from '@types/homePage';
+import {SETTEXTFOCUS,SEARCH_DROP_LOCATION} from '@types/homePage';
 import {RESET,SETDROPSHOW,ISREAD} from "@store/types/homePage";
 import config from '@config/index.js';
 
@@ -83,8 +83,18 @@ function otherHisSearch(obj) {
 }
 
 function mapDispatchToProps(dispatch,state) {
+  const dis = JSON.stringify(state.saveText) == '[]'?0:60;
   return {
+    setSearchLocation(top,left){
+      dispatch({
+        type:SEARCH_DROP_LOCATION,
+        top:top,
+        left:left,
+        dis:dis
+      })
+    },
     setFocusIndex(obj){//将选中值插入相应位置
+
       const {i,boxMark} = obj;
       switch (+obj.boxMark){
         case 1:

+ 11 - 1
src/containers/MainSuit.js

@@ -2,7 +2,7 @@ import React from 'react';
 import { connect } from 'react-redux';
 import MainSuit from '@components/MainSuit';
 import {CLEAR_COMSYMPTOMS,SHOW_TAIL,INSERT_MAIN,CLEAR_SEARCH,SET_SEARCH,SAVE_FREE,SET_DATA,INSERT_SEARCH,SETTEXTMODEVALUE} from '@store/types/mainSuit';
-import {RESET,CLICKCOUNT,ISREAD} from '@store/types/homePage.js';
+import {RESET,CLICKCOUNT,ISREAD,SEARCH_DROP_LOCATION} from '@store/types/homePage.js';
 import {getCommSymptoms,getCommSymptomPush} from '@store/async-actions/mainSuit.js'
 import {SET_MAIN_SUIT} from '@store/types/fillInfo';
 import {CLEAR_DIAGNOSE} from '@store/types/diagnosticList';
@@ -33,6 +33,8 @@ function mapStateToProps(state) {
     mainIds:state.mainSuit.mainIds,//选中症状的id,搜索去重用
     isRead:state.homePage.isRead,
     commSymHide:state.homePage.commSymHide,
+    boxTop:state.homePage.boxTop,
+    boxLeft:state.homePage.boxLeft,
   }
 }
 
@@ -156,6 +158,14 @@ function mapDispatchToProps(dispatch) {
         dispatch({
             type:CLEAR_DIAGNOSE,
           })
+      },
+      getSearchLocation(top,left){
+        dispatch({
+          type:SEARCH_DROP_LOCATION,
+          top:top,
+          left:left,
+          dis:0
+        })
       }
     }
 }

+ 12 - 2
src/containers/OtherHistory.js

@@ -2,7 +2,7 @@ import React from 'react';
 import {connect} from 'react-redux';
 import OtherHistory from "../components/OtherHistory";
 import {SETSELECTED,CLEARSELECTED,CONFIRMSELECTED,SELECTOTHERSEARCHDATA,SETDATA,SETTEXTMODEVALUE,OTHEREDICLEAR} from '@types/otherHistory';
-import {HIDE,RESET,ISREAD} from '@store/types/homePage.js';
+import {HIDE,RESET,ISREAD,SEARCH_DROP_LOCATION} from '@store/types/homePage.js';
 import {getModule} from '@store/async-actions/fetchModules.js';
 import {billing} from '@store/async-actions/pushMessage';
 import {fullfillText} from '@common/js/func';
@@ -27,7 +27,9 @@ function mapStateToProps(state){
     searchInEnd:otherHistory.searchInEnd,      //是否在搜索末尾插入结果
     selecteds:otherHistory.selecteds,       //普通多选选中状态
     editClear:otherHistory.editClear,       //编辑状态
-    isRead:state.homePage.isRead
+    isRead:state.homePage.isRead,
+    boxTop:state.homePage.boxTop,
+    boxLeft:state.homePage.boxLeft,
   }
 }
 
@@ -96,6 +98,14 @@ function mapDispatchToProps(dispatch,store){
         type:OTHEREDICLEAR,
         bool:bool
       })
+    },
+    getSearchLocation(top,left){
+      dispatch({
+        type:SEARCH_DROP_LOCATION,
+        top:top,
+        left:left,
+        dis:0
+      })
     }
   }
 }

+ 8 - 1
src/store/actions/homePage.js

@@ -91,4 +91,11 @@ export const setLabelToEdit = (state,action)=>{
   res.editState = Object.assign(temp,{[ikey]:action.edit!==undefined?action.edit:true});
   res.update=Math.random();
   return res;
-};
+};
+//编辑状态
+export const searchDropLocation = (state,action)=>{
+  let res = Object.assign({},state);
+  res.boxTop = action.top?action.top:res.boxTop;
+  res.boxLeft = action.left?action.left+action.dis:res.left;
+  return res;
+};

+ 8 - 3
src/store/reducers/homePage.js

@@ -1,6 +1,7 @@
 import {HIDE,RESET,SETINITDATA,SETDROPSHOW,SETADDITEMINIT,SETT0EDIT,SETREADDITEMS,
-  HIDEDROP,CLICKCOUNT,ISREAD,SETOTHERHISTORY,SETMINSCREEN,MODI_LOADING} from '../types/homePage.js';
-import {showDrop,setAddItemInit,setLabelToEdit,confirmHide,clickNum} from '../actions/homePage.js';
+  HIDEDROP,CLICKCOUNT,ISREAD,SETOTHERHISTORY,SETMINSCREEN,MODI_LOADING,SEARCH_DROP_LOCATION} from '../types/homePage.js';
+import {showDrop,setAddItemInit,setLabelToEdit,confirmHide,clickNum,searchDropLocation} from '../actions/homePage.js';
+import SearchDrop from '../../components/SearchDrop/index.jsx';
 
 const initState = {
   totalHide:false,
@@ -10,7 +11,9 @@ const initState = {
   clickData:[],
   addItems:{},
   commSymHide:false,
-  loadingFlag:true
+  loadingFlag:true,
+  boxTop:0,
+  boxLeft:0
 };
 
 export default function (state=initState,action) {
@@ -59,6 +62,8 @@ export default function (state=initState,action) {
     case MODI_LOADING:
       res.loadingFlag = false;
       return res;
+    case SEARCH_DROP_LOCATION:
+      return searchDropLocation(state,action);
     default:
       return res;
   }

+ 2 - 1
src/store/types/homePage.js

@@ -11,4 +11,5 @@ export const CLICKCOUNT = 'click_count';//埋点
 export const ISREAD = 'is_history_or_template';     //是否回读或模板数据
 export const SETOTHERHISTORY = 'set_otherHis_history';    //其他史历史数据暂存
 export const SETMINSCREEN = 'SETMINSCREEN';    //1024标识
-export const MODI_LOADING = 'MODI_LOADING';    //1024标识
+export const MODI_LOADING = 'MODI_LOADING';    //1024标识
+export const SEARCH_DROP_LOCATION = 'SEARCH_DROP_LOCATION';    //1024标识

+ 1 - 1
src/utils/tools.js

@@ -314,7 +314,7 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
             }else{    //结构化历史病历回读
                 let dataJson = JSON.parse(reData.dataJson);
                 let dataJsonStr = reData.detailList;
-                console.log(dataJson.chief,dataJsonStr[0].content,'结构化历史病历回读')
+                // console.log(dataJson.chief,dataJsonStr[0].content,'结构化历史病历回读')
                 // console.log(dataJson.mainSuitSelecteds,7887)
                 store.dispatch({
                     type: CLEAR_MAIN_SUIT,