Преглед на файлове

Merge branch 'dev/new1' into dev/otherHis

# Conflicts:
#	src/components/CheckBody/index.jsx
#	src/components/NumberDrop/index.jsx
#	src/components/PreviewBody/index.jsx
#	src/utils/tools.js
zhouna преди 6 години
родител
ревизия
64f3992272
променени са 49 файла, в които са добавени 496 реда и са изтрити 390 реда
  1. 2 0
      src/common/components/Calendar/index.less
  2. 46 10
      src/common/components/EditableSpan/index.jsx
  3. 4 4
      src/common/components/InlineTag/index.jsx
  4. 2 0
      src/common/components/ItemBox/index.less
  5. 1 1
      src/common/components/NumberPan/index.jsx
  6. 1 1
      src/common/components/NumberUnitPan/index.jsx
  7. 7 7
      src/common/components/Textarea/index.jsx
  8. 2 0
      src/common/components/Textarea/index.less
  9. BIN
      src/common/images/loading.gif
  10. 17 25
      src/components/AddAssistCheck/Textarea/index.jsx
  11. 2 0
      src/components/AddAssistCheck/Textarea/index.less
  12. 13 9
      src/components/CheckBody/index.jsx
  13. 15 8
      src/components/CurrentIll/index.jsx
  14. 22 69
      src/components/DiagResultSearch/index.jsx
  15. 30 34
      src/components/DiagResultSearch/index.less
  16. 3 2
      src/components/Diagnosis/index.jsx
  17. 16 12
      src/components/MainSuit/index.jsx
  18. 1 1
      src/components/MultSpread/index.jsx
  19. 5 5
      src/components/Multiple/index.jsx
  20. 4 4
      src/components/NumberUnitDrop/index.jsx
  21. 50 30
      src/components/Operation/index.jsx
  22. 11 8
      src/components/OtherHistory/index.jsx
  23. 30 16
      src/components/PreviewBody/index.jsx
  24. 2 2
      src/components/RadioDrop/index.jsx
  25. 2 1
      src/components/SearchDrop/index.jsx
  26. 5 5
      src/components/SpreadDrop/index.jsx
  27. 1 1
      src/components/Treat/DrugTreat/index.jsx
  28. 2 2
      src/config/index.js
  29. 12 2
      src/containers/CheckBody.js
  30. 13 2
      src/containers/CurrentIll.js
  31. 3 3
      src/containers/DiagResultSearch.js
  32. 0 3
      src/containers/DiagnosticList.js
  33. 11 1
      src/containers/EditableSpan.js
  34. 11 1
      src/containers/MainSuit.js
  35. 12 2
      src/containers/OtherHistory.js
  36. 6 1
      src/modules/HomePage/index.jsx
  37. 21 0
      src/modules/HomePage/index.less
  38. 2 2
      src/store/actions/checkBody.js
  39. 22 6
      src/store/actions/currentIll.js
  40. 8 1
      src/store/actions/homePage.js
  41. 4 4
      src/store/actions/mainSuit.js
  42. 2 2
      src/store/actions/otherHistory.js
  43. 23 23
      src/store/actions/patInfo.js
  44. 28 57
      src/store/async-actions/diagnosticSearch.js
  45. 3 17
      src/store/async-actions/homePage.js
  46. 3 1
      src/store/async-actions/patInfo.js
  47. 12 3
      src/store/reducers/homePage.js
  48. 3 1
      src/store/types/homePage.js
  49. 1 1
      src/utils/tools.js

+ 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;

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

@@ -37,6 +37,7 @@ class EditableSpan extends Component{
     this.handleKeydown = this.handleKeydown.bind(this);
     this.handleKeyup = this.handleKeyup.bind(this);
     this.moveEnd = this.moveEnd.bind(this);
+    this.stopIt = this.stopIt.bind(this);
   }
   handleFocus(e){
     e.stopPropagation();
@@ -49,7 +50,7 @@ class EditableSpan extends Component{
         return ;
       }
     }
-    let text = e.target.innerText;
+    let text = e.target.innerText || e.target.innerHTML;
     setFocusIndex&&setFocusIndex({i,boxMark,dom:this.$span});
     this.setState({
       labelVal:text,
@@ -61,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.innerHTML;
     let mainText = filterDataArr(mainSaveText);//主诉字数
     if(+boxMark==1){
       if(mainText.length >= config.limited){
@@ -89,14 +90,15 @@ class EditableSpan extends Component{
     //延迟搜索
     clearTimeout(this.state.timer);
     const timer = setTimeout(function(){
-      let newText = e.target.innerText;
+      let newText = e.target.innerText || e.target.innerHTML;
       let temp = '',isEnd=false;
       let search='';
       clearTimeout(that.state.timer);
       temp = newText.replace(searchPre,'');
       isEnd = !(newText.indexOf(searchPre)>0);
       search = temp.replace(/[(^\s*)|(\s*$)|(^\,*)|(\,*$)]/g,'');
-      if(!search&&searchPre){
+      // if(!search&&searchPre){
+      if(!temp&&searchPre){
         search = searchPre;
       }
       //console.log(labelVal,'旧:',searchPre,'新:',newText,'搜索:',search);
@@ -156,18 +158,35 @@ class EditableSpan extends Component{
         preVal:innerVal
       })
     }
-
   }
+  stopIt(e){  
+    if(e.returnValue){  
+        e.returnValue = false ;  
+    }  
+    if(e.preventDefault ){  
+        e.preventDefault();  
+    }                 
+    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.innerHTML;
     if(ev.keyCode==8){
+      const elem = ev.srcElement || ev.currentTarget;
+      const nodeN = elem.nodeName;
+      
+      let ele = document.activeElement;
+      let boxTop = target.innerText?getPageCoordinate(e).boxTop:NaN;
+      setSearchLocation(boxTop,ele.offsetLeft)     //搜索框的位置动态获取
+      if(nodeN != "SPAN"){//光标没落到span的时候阻止默认事件(backspace回退页面的情况)
+        return this.stopIt(ev);
+      }
       // 主诉现病史去重:删除最后一个字的时候移除该数据(将name、id和value替换成空)并移除id
       // 前面是标签,内容为空时再删一次才移除标签;前面是文本,则直接移除;
-      // console.log(77,innerVal,preVal);
+      // console.log(77,elem,nodeN);
       let preObj = $(this.$span.current).prev();
       if(index!==0&&preVal.trim().length==1&& !innerVal){
           removeId && removeId({boxMark,i:index,text:""});
@@ -205,13 +224,13 @@ class EditableSpan extends Component{
   componentWillReceiveProps(next){
     const isRead = this.props.isRead;
     if(next.isRead != isRead){
-      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||'');
     }
     if(isIE()){
       $(this.$span.current).onIe8Input(function(e){
@@ -219,6 +238,23 @@ class EditableSpan extends Component{
       },this);
     }
   }
+  /*cancelSelect(e){//双击不选中
+    if(document.selection&&document.selection.empty){
+        document.selection.empty();
+      }else if (window.getSelection) {
+        var sel=window.getSelection();
+        sel.removeAllRanges();
+      }
+    }*/
+
+  /*cancelSelect(e){//双击不选中
+    if(document.selection&&document.selection.empty){
+        document.selection.empty();
+      }else if (window.getSelection) {
+        var sel=window.getSelection();
+        sel.removeAllRanges();
+      }
+    }*/
 
   getClass(){
     const {full,value,saveText,i} = this.props;

+ 4 - 4
src/common/components/InlineTag/index.jsx

@@ -46,7 +46,7 @@ class InlineTag extends Component {
     });
   }
   handleInput(e){       //输入时保存临时值,在修改灰显为黑色时判断用
-    const text = e.target.innerText;console.log(text)
+    const text = e.target.innerText || e.target.innerHTML;
     this.setState({
       value:text
     });
@@ -55,15 +55,15 @@ class InlineTag extends Component {
   handleBlur(e){         //鼠标离开是保存值到store中
     const {value} = this.state;
     const {handleInput,ikey,prefix,suffix} = this.props;
-    this.$span.current.innerText='';      //修改生成文字变成输入的2倍bug
+    this.$span.current.innerText?(this.$span.current.innerText=''):(this.$span.current.innerHTML='');      //修改生成文字变成输入的2倍bug
     handleInput&&handleInput({text:value,ikey,prefix,suffix});
   }
   handleFocus(e){
     e.stopPropagation();
-    const text = e.target.innerText;
+    const text = e.target.innerText || e.target.innerHTML;
     const {placeholder} = this.props;
     if(text==placeholder){
-      e.target.innerText = '';
+      e.target.innerText?(e.target.innerText = ''):(e.target.innerHTML='');
     }
   }
   getStyle(){

+ 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;

+ 1 - 1
src/common/components/NumberPan/index.jsx

@@ -11,7 +11,7 @@ class NumberPan extends Component{
   }
   handleSelect(e){
     e.stopPropagation();
-    const text = e.target.innerText;
+    const text = e.target.innerText || e.target.innerHTML;
     const value = this.props.toClear?'':this.state.value;     //键盘输入替换已有的值
     const onSelect = this.props.handleSelect;
     this.setState({

+ 1 - 1
src/common/components/NumberUnitPan/index.jsx

@@ -14,7 +14,7 @@ class NumberUnitPan extends Component{
   }
   handleSelect(e){
     e.stopPropagation();
-    const text = e.target.innerText;
+    const text = e.target.innerText || e.target.innerHTML;
     const preValue = this.state.value;
     if(+text==0 && !preValue){//第一位不能是0
       Notify.info("请输入正确时间");

+ 7 - 7
src/common/components/Textarea/index.jsx

@@ -22,9 +22,9 @@ class Textarea extends Component {
   handleFocus(){            //初始显示props中的值,focus已经显示输入的值,避免值更新闪烁
     const {handleFocus,fuzhen,handleInput} = this.props;
     handleFocus&&handleFocus();         //其他史、查体获取数据的方法
-    if(fuzhen&&!this.$dom.current.innerText){
+    if(fuzhen&&!(this.$dom.current.innerText?this.$dom.current.innerText:this.$dom.current.innerHTML)){
       const text = config.currentText.replace("(**)",fuzhen);
-      this.$dom.current.innerText = text;
+      this.$dom.current.innerText?(this.$dom.current.innerText = text):(this.$dom.current.innerHTML = text);
       handleInput&&handleInput({text});
     }
 
@@ -32,14 +32,14 @@ class Textarea extends Component {
   handleInput(e){
     const {handleInput,boxMark,handlePush,hasMain} = this.props;
     const {inpText,overFlag} = this.state;
-    const text = e.target.innerText;
+    const text = e.target.innerText || e.target.innerHTML;
     const stimer = this.state.timer;
     if(boxMark=='1'&&text.length>config.limited){           //主诉字符数限制
-      e.target.innerText = text.substr(0,config.limited); 
+      e.target.innerText?(e.target.innerText = text.substr(0,config.limited)):(e.target.innerHTML = text.substr(0,config.limited)); 
       e.target.blur();
       Notify.error(config.limitText);
       if(overFlag){
-        e.target.innerText = inpText;
+        e.target.innerText?(e.target.innerText = inpText):(e.target.innerHTML = inpText);
         return
       }
       this.setState({
@@ -78,13 +78,13 @@ class Textarea extends Component {
   componentWillReceiveProps(next){
     const isRead = this.props.isRead;
     if(next.isRead != isRead||next.value!=this.props.value){      //value对比解决复诊不显示bug
-      this.$dom.current.innerText = next.value||'';
+      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||'';
+      this.$dom.current.innerText?(this.$dom.current.innerText = value||''):(this.$dom.current.innerText=value||'');
     }
     if(isIE()){
       $(this.$dom.current).onIe8Input(function(e){

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

@@ -23,6 +23,8 @@
     padding:5px;
     outline: none;
     border-bottom:1px @part-border-color dashed;
+    word-break: break-all;
+    word-wrap:break-word;
     textarea{
       width: 100%;
     }

BIN
src/common/images/loading.gif


+ 17 - 25
src/components/AddAssistCheck/Textarea/index.jsx

@@ -10,15 +10,15 @@ class Textarea extends Component {
       timer:null,
       val:'报告描述或意见'
     };
+    this.textInput = React.createRef();
     this.$dom = React.createRef();
     this.$domW = React.createRef();
     this.handleInput = this.handleInput.bind(this);
     this.handleFocus = this.handleFocus.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);
     //右侧推送--延时推送
@@ -27,10 +27,11 @@ class Textarea extends Component {
       handlePush&&handlePush();
       clearTimeout(stimer);
     },config.delayPushTime);
-    if(text.trim() != ''){
-      this.setState({val:''})
+    if(text.trim() != '' && text != '<br>'){
+      console.log(e.target.nextSibling)
+      e.target.nextSibling.innerText?(e.target.nextSibling.innerText = ''):(e.target.nextSibling.innerHTML = '')
     }else{
-      this.setState({val:'报告描述或意见'})
+      e.target.nextSibling.innerText?(e.target.nextSibling.innerText = '报告描述或意见'):(e.target.nextSibling.innerHTML = '报告描述或意见')
     }
     this.setState({
       timer
@@ -45,41 +46,32 @@ 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() != ''){
-      $("#textareaWarring").html('')
+      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||'';
-      this.setState({val:''})
+    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.innerText = ''):(this.$dom.current.nextSibling.innerHTML = '')
+    }else{
+      this.$dom.current.nextSibling.innerText?(this.$dom.current.nextSibling.innerText = '报告描述或意见'):(this.$dom.current.nextSibling.innerHTML = '报告描述或意见')
     }
   }
-  handleFocus(e){
-    this.setState({val:''})
-  }
-  handleBlur(e){
-    let str = this.$dom.current.innerText
-    if(str.trim() == ''){
-      this.setState({val:'报告描述或意见'})
-    }
+  handleFocus(){     //ie8下提示语挡住输入框,导致输入框无法聚焦
+    this.textInput.current.previousSibling.focus();
   }
   render() {
-    const {val} = this.state;
+    const {idx} = this.props;
     return (
       <div className={style.textWap}>
         <div className={style.divTextarea}
             contenteditable={true}
             ref={this.$dom}
             onInput={this.handleInput}
-            onFocus={this.handleFocus}
-            onBlur={this.handleBlur}
-            onPropertyChange={this.handleInput}
+            onKeyUp={this.handleInput}
         ></div>
-        <p className={style.textareaWarring} id="textareaWarring">{val}</p>
+        <p ref={this.textInput} onClick={this.handleFocus} className={style.textareaWarring}></p>
       </div>
     );
   }

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

@@ -12,6 +12,8 @@
   font-family: inherit;
   position: relative;
   z-index: 10;
+  word-break: break-all;
+  word-wrap:break-word;
 }
 .textWap {
   overflow: hidden;

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

@@ -26,6 +26,9 @@ class CheckBody extends Component{
     this.showHide = this.showHide.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=[];
@@ -41,7 +44,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){
@@ -59,17 +62,18 @@ class CheckBody extends Component{
       }
       leftL = ele.offsetLeft+90
     }
+    getSearchLocation(getPageCoordinate(e).boxTop,leftL)
     this.setState({
-      boxLeft:leftL,
-      boxTop:getPageCoordinate(e).boxTop,
+      // boxLeft:getPageCoordinate(e).boxLeft,
+      // 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){
@@ -93,9 +97,9 @@ class CheckBody extends Component{
     });
   }
   render(){
-    const {searchData,totalHide,data} = this.props;
-    const {boxLeft,boxTop,showAll} = this.state;
-    const more = showAll?<span className={style['more']} onClick={this.showHide}>收起<img src={hideImg} /></span>:<span className={style['more']} onClick={this.showHide}>展开<img src={showImg} /></span>
+    const {searchData,totalHide,data,boxLeft,boxTop} = this.props;
+    const {showAll} = this.state;
+    const more = showAll?<span className={style['more']} onClick={this.showHide}>收起<img src={hideImg} /></span>:<span className={style['more']} onClick={this.showHide}>展开<img src={showImg} /></span>;
     return  <div className={style['container']}>
       <ItemBox title='查体' handleClick={this.handleClick}>
         {this.getLabels()}

+ 15 - 8
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
@@ -76,12 +81,13 @@ class CurrentIll extends Component{
 
   onchange(e){//监听输入事件,主诉无数据不能输入
     const ev = e || window.event;
-    ev.target.innerText = "";
+    ev.target.innerText?(ev.target.innerText = ""):(ev.target.innerHTML="");
   }
 
   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){      //文本模式

+ 22 - 69
src/components/DiagResultSearch/index.jsx

@@ -3,29 +3,20 @@ import style from './index.less';
 import close from './img/close.png'
 import search from './img/search.png'
 import DiagnosticItem from '@containers/DiagnosticItem'
+import { SearchOption} from '@commonComp';
 import config from '@config/index';
 import $ from 'jquery';
 class DiagResultSearch extends Component {
     constructor(props) {
         super(props);
         this.state = {
-            showClose: false,
-            focus: true,
-            timer:null
+           
         };
-        this.searchInput = React.createRef();
-        this.handleInput = this.handleInput.bind(this);
-        this.clearInput = this.clearInput.bind(this);
-        this.handleFocus = this.handleFocus.bind(this);
-        this.handleBlur = this.handleBlur.bind(this);
+      
+        this.getSearchList =  this.getSearchList.bind(this)
 
     }
-    componentWillReceiveProps(){
-        const { searchResult, clearSearchResult } = this.props;
-        this.setState({focus: true})
-        if( searchResult && searchResult.length > 0) {
-            clearSearchResult();//清除上次搜索结果
-        }
+    componentWillReceiveProps(nextProps){
     }
     componentDidMount () {
         const that = this
@@ -38,10 +29,6 @@ class DiagResultSearch extends Component {
                     
                 } else {
                     if (e.target!= diagSearch && e.target!= addDiag && e.target.parentNode!= addDiag && !$.contains(diagSearch, e.target) ) {
-                        that.setState({
-                            showSearch: !that.props.showSearch
-                        });
-                        that.clearInput()
                         that.props.hideSearch();
                     }
 
@@ -53,63 +40,29 @@ class DiagResultSearch extends Component {
         })
     }
 
-    handleInput(value) {
-        const {  setSearchValue, getSearchResult } = this.props;
-        value.length > 0 ? this.setState({showClose: true}) : this.setState({showClose: false});
-        clearTimeout(this.state.timer);
-        let timer = setTimeout(()=>{
-            clearTimeout(this.state.timer);
-          if(value.trim() == ''){
-            return  getSearchResult('');
-          }
-          getSearchResult(value.trim());
-        },config.delayTime);
-        this.setState({
-          timer
-        });
-    }
-    clearInput() {
-        const {  setSearchValue, getSearchResult } = this.props;
-        this.searchInput.current.value = '';
-        getSearchResult('');
-        this.setState({showClose: false})
-    }
-
-    handleFocus() {
-        this.setState({focus: true})
-    }
-    handleBlur() {
-        this.setState({focus: false})
+    getSearchList(searchResult) {
+        return <div className={style['search-result']}>
+                    
+        {
+            searchResult && searchResult.map((item) => {
+                return(<div  key={item.id} className={style['search-result-item']}><DiagnosticItem title={true} item={item} clearInput={this.clearInput}/></div>)
+            })
+        }
+    </div>
     }
    
     render(){
-        const { showClose } = this.state
-        const  { show, searchResult, getSearchResult } = this.props
+        const  { show, searchResult, getSearchResult, handleChangeValue } = this.props
+       
         return(
-            show && <div id='diagSearch' className={style['search-box']}>
-                <div className={style['search']}>
-                    <input ref={this.searchInput} 
-                        type="text" 
-                        placeholder='搜索'
-                        onFocus={this.handleFocus}
-                        onBlur = {this.handleBlur}
-                        className={style['search-input']}   
-                        style = {this.state.focus ? {border: '1px solid #3B9ED0'} :{border: '1px solid #979797'}}
-                        onInput={(e)=>this.handleInput(e.target.value)}
-                        onPropertyChange={(e)=>this.handleInput(e.target.value)} 
-                        />
-                    <img  className={style['search-img']} src={search} alt="搜索"/>
-                     <img className={style['search-close']} onClick={this.clearInput} style={showClose ? '': {display: 'none'}} src={close} alt=""/>
-                </div>
-                <div className={style['search-result']}>
-                    {
-                        searchResult && searchResult.map((item) => {
-                            return(<div  key={item.id} className={style['search-result-item']}><DiagnosticItem title={true} item={item} clearInput={this.clearInput}/></div>)
-                        })
-                    }
-                </div>
+            show&&<div id='diagSearch' className={style['search-box']}>
+                <SearchOption handleChangeValue={handleChangeValue} visible={true}>
+                    {this.getSearchList(searchResult)}
+                </SearchOption>
             </div>
         )
+       
+       
     }
 }
 

+ 30 - 34
src/components/DiagResultSearch/index.less

@@ -1,51 +1,47 @@
 @import "~@less/variables.less";
 .search-box {
     position: absolute;
+    top: 20px;
     width: 316px;
-    margin: 0 10px 10px;
-    padding: 0 8px;
     // box-shadow: 0 6px 20px 0 #989DA3;
     background: #fff;
     z-index: 99;
     margin-bottom: 80px;
-    .llStyle;
     
 }
-.search {
-    width: 100%;
-    position: relative;
-    height: 44px;
-    padding: 10px 0px 0px 0px;
-}
-.search-input {
-    width: 300px;
-    height: 34px;
-    line-height: 34px;
-    position: relative;
-    padding: 0  30px;
-}
-.search-btn {
-    position: absolute;
-    right: 0;
-}
-.search-close {
-    position: absolute;
-    top: 17px;
-    right: 5px;
-    cursor: pointer;
+// .search {
+//     width: 100%;
+//     position: relative;
+//     height: 44px;
+//     padding: 10px 0px 0px 0px;
+// }
+// .search-input {
+//     width: 300px;
+//     height: 34px;
+//     line-height: 34px;
+//     position: relative;
+//     padding: 0  30px;
+// }
+// .search-btn {
+//     position: absolute;
+//     right: 0;
+// }
+// .search-close {
+//     position: absolute;
+//     top: 17px;
+//     right: 5px;
+//     cursor: pointer;
     
-}
-.search-img {
-    position: absolute;
-    top: 17px;
-    left: 5px;
-    cursor: pointer;
-}
+// }
+// .search-img {
+//     position: absolute;
+//     top: 17px;
+//     left: 5px;
+//     cursor: pointer;
+// }
 
 .search-result {
     max-height: 266px;
-    min-height: 80px;
-    overflow-y: auto;
 }
 
 .search-result-item {

+ 3 - 2
src/components/Diagnosis/index.jsx

@@ -44,10 +44,11 @@ class Diagnosis extends Component {
         return (<div>
             <ItemBox  id="diagnosis" title='诊断'  boxHeight='auto' titleTop='22px' marginTop='9px' backgroundColor='#EAF7FD'>
                 <DiagnosticList></DiagnosticList>
-                <div style={{marginLeft:'10px'}}>
+                <div style={{marginLeft:'10px', position:'relative'}}>
                     <Add showText="添加诊断结果" handleClick={this.handleshowSearch} id="addDiag" height="50px"/>
+                    <DiagResultSearch></DiagResultSearch>
                 </div>
-                <DiagResultSearch></DiagResultSearch>
+               
                 
             </ItemBox>
             {/* <TreatDrug></TreatDrug> */}

+ 16 - 12
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,24 +158,24 @@ 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])
   }
 
   handleChange(e){
     const ev = e || window.event;
-    const data = ev.target.innerText;
+    const data = ev.target.innerText || ev.target.innerHTML;
     const {getSearchData,searchData,datas,pushMessage,reTotalHide,saveText} = this.props;
     const {overFlag,inpText} = this.state;
     reTotalHide && reTotalHide();//重置homePage中的控制项
@@ -179,12 +183,13 @@ class MainSuit extends Component{
     if(data&&data.length > config.limited){
       Notify.info(config.limitText);
       if(overFlag){
-        ev.target.innerText = inpText;
+        ev.target.innerText?(ev.target.innerText = inpText) : (ev.target.innerHTML = inpText);
         ev.target.blur();
         return
       }
-      ev.target.innerText = data.substr(0,config.limited);  //输入法内输入多个字再按enter的情况
+      ev.target.innerText?(ev.target.innerText = data.substr(0,config.limited)):(ev.target.innerHTML = data.substr(0,config.limited));  //输入法内输入多个字再按enter的情况
       ev.target.blur();
+      
       this.setState({
         inpText:data.substr(0,config.limited),
         overFlag:true
@@ -225,8 +230,7 @@ class MainSuit extends Component{
     const that = this;
     let data = this.state.inpText;
     if(!isIE()){
-      e.target.innerText="";
-      e.target.innerHTML="";//兼容火狐43
+      e.target.innerText?(e.target.innerText=""):(e.target.innerHTML="")
       freeText && freeText(data.trim());
     }else{
       if(datas.length==0){
@@ -252,8 +256,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/MultSpread/index.jsx

@@ -120,7 +120,7 @@ class MultSpread extends Component{
     this.setState({
       editable: false
     });
-    let totalVal = e.target.innerText;
+    let totalVal = e.target.innerText || e.target.innerHTML;
     saveEditText && saveEditText({ikey,type:'4',totalVal});
   }
   componentDidMount(){

+ 5 - 5
src/components/Multiple/index.jsx

@@ -99,7 +99,7 @@ class Multiple extends react.Component{
 
   changeToEdit(e){//双击
     const {value,id,placeholder,handleDbclick,handleHide} = this.props;
-    let text = e.target.innerText;
+    let text = e.target.innerText || e.target.innerHTML;
     handleHide&&handleHide();       //展开情况下双击收起
     // clearTimeout(this.state.timer);//取消延时的单击事件
     e.stopPropagation();
@@ -135,11 +135,11 @@ class Multiple extends react.Component{
     const {labelVal,editable} = this.state;
     let mainText = filterDataArr(mainSaveText);//主诉字数
     if(editable){//避免IE中点击标签也会触发
-      let val = e.target.innerText;
+      let val = e.target.innerText || e.target.innerHTML;
       if(+type==1){// 主诉字数达到上限时不允许输入
         if(mainText.length >= config.limited){
           if(val.length > labelVal.length){
-            e.target.innerText = labelVal;
+            e.target.innerText?(e.target.innerText = labelVal):(e.target.innerHTML = labelVal);
             Notify.info(config.limitText);
             return
           }else if(val.length == labelVal.length){
@@ -161,9 +161,9 @@ class Multiple extends react.Component{
     const ev = e || window.event;
     if(editable){
       // 更改标签的value值
-      let changeVal = ev.target.innerText;
+      let changeVal = ev.target.innerText || e.target.innerHTML;
       if(!isIE()){
-        e.target.innerText = '';      //避免出现重复输入值
+        e.target.innerText?(e.target.innerText = ''):(e.target.innerHTML='');      //避免出现重复输入值
       }
       handleLabelChange && handleLabelChange({ikey,changeVal,type});
     }

+ 4 - 4
src/components/NumberUnitDrop/index.jsx

@@ -88,7 +88,7 @@ class NumberUnitDrop extends Component{
     const {handleSelect,ikey,suffix,prefix,mainSaveText,handleLabelChange,boxMark,formulaCode} = this.props;
     const {editable} = this.state;
     if(editable){
-      const text = e.target.innerText;
+      const text = e.target.innerText || e.target.innerHTML;
       // this.$span.current.innerText='';      //修改生成文字变成输入的2倍bug 
       // handleSelect&&handleSelect({ikey,text,suffix,prefix,mainSaveText});
       handleLabelChange&&handleLabelChange({ikey,changeVal:text,suffix,prefix,mainSaveText,type:boxMark,formulaCode});
@@ -110,11 +110,11 @@ class NumberUnitDrop extends Component{
     const {labelVal,editable} = this.state;
     let mainText = filterDataArr(mainSaveText);//主诉字数
     if(editable){//避免IE中点击标签也会触发
-      let val = e.target.innerText;
+      let val = e.target.innerText || e.target.innerHTML;
       if(+boxMark==1){
         if(mainText.length >= config.limited){
           if(val.length > labelVal.length){
-            e.target.innerText = labelVal;
+            e.target.innerText?(e.target.innerText = labelVal):(e.target.innerHTML = labelVal);
             Notify.info(config.limitText);
             return
           }else if(val.length == labelVal.length){
@@ -144,7 +144,7 @@ class NumberUnitDrop extends Component{
   changeToEdit(e){        //整个标签双击编辑状态
     e.stopPropagation();
     const {value,id,handleDbclick,patId} = this.props;
-    const text = e.target.innerText;
+    const text = e.target.innerText || e.target.innerHTML;
     // clearTimeout(this.state.timer);//取消延时的单击事件
     if(value&&value.trim()) {//有选中值的标签才能双击编辑
       this.setState({

+ 50 - 30
src/components/Operation/index.jsx

@@ -84,6 +84,7 @@ class Operation extends Component {
   keepHistory(){
     let baseList = store.getState();
     let jsonStr = getAllDataStringList(baseList);
+    // console.log(jsonStr)
     if(filterDataArr(JSON.parse(jsonStr.chief)) == ''){
         Notify.info('主诉不能为空');
         return false;
@@ -158,43 +159,62 @@ class Operation extends Component {
     let jsonStr = getAllDataStringList(baseList);
     let whichSign = baseList.typeConfig.typeConfig;
     let tmpLis = baseList.tabTemplate.items;
+    
+    let flg = isAllClear(jsonData,jsonStr,baseList)
+    if(!flg){
+      Notify.info('模板数据不能为空')
+      return false
+    }
     console.log(jsonStr,'文本')
     console.log(jsonData.chief,'结构')       //测试需要用到,不要删了
     for(let i = 0;i <tmpLis.length;i++){
       let dataStr = tmpLis[i].preview;
       let dataJson = tmpLis[i].dataJson;
-      // console.log(JSON.stringify(eval('('+JSON.parse(dataStr).chief+')')),111)
-      // console.log(JSON.stringify(jsonData.other) )
-      if(
-        jsonStr.chief == JSON.stringify(eval('('+JSON.parse(dataStr).chief+')')) && 
-        jsonStr.present == JSON.stringify(eval('('+JSON.parse(dataStr).present+')')) && 
-        jsonStr.other == JSON.stringify(eval('('+JSON.parse(dataStr).other+')')) && 
-        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) &&      
-        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) &&     
-        JSON.stringify(jsonData.diag) == JSON.stringify(JSON.parse(dataJson).diag) &&    
-        JSON.stringify(jsonData.advice) == JSON.stringify(JSON.parse(dataJson).advice) &&    
-        JSON.stringify(jsonData.mainSuitSelecteds) == JSON.stringify(JSON.parse(dataJson).mainSuitSelecteds) &&      
-        JSON.stringify(jsonData.currentIllSelecteds) == JSON.stringify(JSON.parse(dataJson).currentIllSelecteds) &&     
-        JSON.stringify(jsonData.otherHistorySelecteds) == JSON.stringify(JSON.parse(dataJson).otherHistorySelecteds) && 
-        JSON.stringify(jsonData.checkBodySelecteds) == JSON.stringify(JSON.parse(dataJson).checkBodySelecteds) &&     
-        JSON.stringify(jsonData.addItems) == JSON.stringify(JSON.parse(dataJson).addItems)
-      ){
-        Notify.info('该模板已保存');
-        return false;
+      // console.log(jsonStr.chief , JSON.stringify(eval('('+JSON.parse(dataStr).chief+')')))
+      // console.log(jsonData.chief , JSON.parse(dataJson).chief)
+      if(whichSign == 0){
+        if(
+          jsonStr.chief == JSON.stringify(eval('('+JSON.parse(dataStr).chief+')')) && 
+          jsonStr.present == JSON.stringify(eval('('+JSON.parse(dataStr).present+')')) && 
+          jsonStr.other == JSON.stringify(eval('('+JSON.parse(dataStr).other+')')) && 
+          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) &&
+          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) &&     
+          JSON.stringify(jsonData.diag) == JSON.stringify(JSON.parse(dataJson).diag) &&    
+          JSON.stringify(jsonData.advice) == JSON.stringify(JSON.parse(dataJson).advice) &&    
+          JSON.stringify(jsonData.mainSuitSelecteds) == JSON.stringify(JSON.parse(dataJson).mainSuitSelecteds) &&      
+          JSON.stringify(jsonData.currentIllSelecteds) == JSON.stringify(JSON.parse(dataJson).currentIllSelecteds) &&     
+          JSON.stringify(jsonData.otherHistorySelecteds) == JSON.stringify(JSON.parse(dataJson).otherHistorySelecteds) && 
+          JSON.stringify(jsonData.checkBodySelecteds) == JSON.stringify(JSON.parse(dataJson).checkBodySelecteds) &&     
+          JSON.stringify(jsonData.addItems) == JSON.stringify(JSON.parse(dataJson).addItems)
+        ){
+          Notify.info('该模板已保存');
+          return false;
+        }
+
+      }else if(whichSign == 1){
+        if(
+          jsonStr.chief == JSON.stringify(eval('('+JSON.parse(dataStr).chief+')')) && 
+          jsonStr.present == JSON.stringify(eval('('+JSON.parse(dataStr).present+')')) && 
+          jsonStr.other == JSON.stringify(eval('('+JSON.parse(dataStr).other+')')) && 
+          jsonStr.vital == JSON.stringify(eval('('+JSON.parse(dataStr).vital+')'))  &&
+          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) &&     
+          JSON.stringify(jsonData.diag) == JSON.stringify(JSON.parse(dataJson).diag) &&    
+          JSON.stringify(jsonData.advice) == JSON.stringify(JSON.parse(dataJson).advice) &&        
+          JSON.stringify(jsonData.addItems) == JSON.stringify(JSON.parse(dataJson).addItems)
+        ){
+          Notify.info('该模板已保存');
+          return false;
+        }
       }
     }
-    let flg = isAllClear(jsonData,jsonStr,baseList)
-    if(!flg){
-      Notify.info('模板数据不能为空')
-      return false
-    }else{
-      return true
-    }
+    return true;
   }
   changeTitle() {
     return <div className={style['box']}>

+ 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;
@@ -44,7 +48,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();
@@ -58,23 +62,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}

+ 30 - 16
src/components/PreviewBody/index.jsx

@@ -1,6 +1,6 @@
 import React, { Component } from "react";
 import style from "./index.less";
-import { normalVal, filterDataArr, filterOtherDataArr} from '@utils/tools';
+import { normalVal, filterDataArr, filterOtherDataArr,timestampToTime } from '@utils/tools';
 import Notify from '@commonComp/Notify';
 import $ from "jquery";
 
@@ -128,6 +128,19 @@ class PreviewBody extends Component {
       return <td style={{ width: '16%', fontSize: '12px' }}><span style={{ color: (val.value - 0).toString() == 'NaN' ? "red" : (val.maxValue || val.minValue) ? (val.value > val.maxValue || val.value < val.minValue ? "red" : null) : null }}>{val.value}</span> {val.labelSuffix}</td>
     }
   }
+
+  toTime(time){
+    let tmpTim = time.split(',').join('')-0
+    if(time && tmpTim.toString() != 'NaN'){
+      let date = new Date('1900-01-01');
+      let dateTim = date.getTime();
+      let times = (tmpTim-2)*24*60*60*1000;
+      let result = timestampToTime(dateTim+times).split(' ')[0]
+      return result;
+    }else{
+      return time;
+    }
+  }
   render() {
     const { show, preInfo, dataJson, dataStr, baseObj, flg } = this.props;
     const other_yjs = filterOtherDataArr(JSON.parse(dataStr.other),dataJson.other);
@@ -150,24 +163,24 @@ class PreviewBody extends Component {
         </table>
         <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' }}>主诉:</td>
-            <td style={{ fontSize: '14px', padding: '9px 0px 8px 0px', lineHeight: '20px' }}>
+            <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',wordBreak:"break-word" }}>
               {
                 filterDataArr(JSON.parse(dataStr.chief))
               }
             </td>
           </tr>
           <tr style={{ verticalAlign: 'top', borderBottom: "1px solid #e2e4e6" }}>
-            <td style={{ textAlign: 'right', padding: '9px 5px 8px 0px', fontSize: '14px' }}>现病史:</td>
-            <td style={{ fontSize: '14px', padding: '9px 0px 8px 0px', lineHeight: '20px' }}>
+            <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',wordBreak:"break-word" }}>
               {
                 filterDataArr(JSON.parse(dataStr.present))
               }
             </td>
           </tr>
           <tr style={{ verticalAlign: 'top', borderBottom: "1px solid #e2e4e6" }}>
-            <td style={{ textAlign: 'right', padding: '9px 5px 8px 0px', fontSize: '14px' }}>其他史:</td>
-            <td style={{ fontSize: '14px', padding: '9px 0px 8px 0px', lineHeight: '20px' }}>
+            <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',wordBreak:"break-word" }}>
               {
                 other_yjs.str1
               }
@@ -188,16 +201,16 @@ class PreviewBody extends Component {
             </td>
           </tr>
           <tr style={{ verticalAlign: 'top', borderBottom: "1px solid #e2e4e6" }}>
-            <td style={{ textAlign: 'right', padding: '9px 5px 8px 0px', fontSize: '14px' }}>查体:</td>
-            <td style={{ fontSize: '14px', padding: '9px 0px 8px 0px', lineHeight: '20px' }}>
+            <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',wordBreak:"break-word" }}>
               {
                 filterDataArr(JSON.parse(dataStr.vital))
               }
             </td>
           </tr>
           <tr style={{ verticalAlign: 'top', borderBottom: "1px solid #e2e4e6" }}>
-            <td style={{ width: 70, textAlign: 'right', padding: '9px 5px 8px 0px', fontSize: '14px' }}>化验:</td>
-            <td style={{ fontSize: '14px', padding: '4px 0px 8px 0px', lineHeight: '20px', maxWidth: '650px' }}>
+            <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',wordBreak:"break-word" }}>
               {
                 dataJson.lis.getExcelDataList && dataJson.lis.getExcelDataList.map((items) => {
                   return items.lisExcelRes && items.lisExcelRes.map((item) => {
@@ -211,7 +224,8 @@ class PreviewBody extends Component {
                             <td style={{ width: '24%', fontSize: '12px' }}>
                               {normalVal(value.min, value.max)}
                             </td>
-                            <td style={{ width: '28%', fontSize: '12px' }}>{value.time == '' ? ('导入时间: ' + this.state.dateTime) : '化验时间: ' + value.time}</td>
+                            <td style={{ width: '28%', fontSize: '12px' }}>{value.time == '' ? ('导入时间: ' + this.state.dateTime) : '化验时间: ' + this.toTime(value.time)
+                          }</td>
                           </tr>
                         })
                       }
@@ -245,17 +259,17 @@ class PreviewBody extends Component {
             </td>
           </tr>
           <tr style={{ verticalAlign: 'top', borderBottom: "1px solid #e2e4e6" }}>
-            <td style={{ textAlign: 'right', padding: '9px 5px 8px 0px', fontSize: '14px' }}>辅检:</td>
+            <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' }}>
               {
                 dataStr.pacs && dataStr.pacs != '' && dataStr.pacs.split(';').map((item) => {
-                  return <div style={{ fontSize: '14px' }}>{item}</div>
+                  return <div style={{ fontSize: '14px',wordBreak:"break-word" }}>{item}</div>
                 })
               }
             </td>
           </tr>
           <tr style={{ verticalAlign: 'top', borderBottom: "1px solid #e2e4e6" }}>
-            <td style={{ textAlign: 'right', padding: '9px 5px 8px 0px', fontSize: '14px' }}>诊断:</td>
+            <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' }}>
               {
                 dataStr.diag && dataStr.diag != '' && dataStr.diag.split(';').map((item) => {
@@ -265,7 +279,7 @@ class PreviewBody extends Component {
             </td>
           </tr>
           <tr style={{ verticalAlign: 'top', borderBottom: "1px solid #e2e4e6" }}>
-            <td style={{ textAlign: 'right', padding: '9px 5px 8px 0px', fontSize: '14px' }}>医嘱:</td>
+            <td style={{ textAlign: 'right', padding: '9px 5px 8px 0px', fontSize: '14px',width:'70px' }}>医嘱:</td>
             <td style={{ fontSize: '14px', padding: '1px 0px 8px 0px', lineHeight: '20px' }}>
               {
                 dataJson.advice.assay && dataJson.advice.assay.length > 0 || dataJson.advice.check && dataJson.advice.check.length > 0 ? <p style={{ fontSize: '14px', marginBottom: "8px" }}><span>开单项目</span></p> : ''

+ 2 - 2
src/components/RadioDrop/index.jsx

@@ -120,9 +120,9 @@ class RadioDrop extends Component{
     });  
    // 更改标签的value值
     const ev = e || window.event;
-    let changeVal = ev.target.innerText;
+    let changeVal = ev.target.innerText || ev.target.innerHTML;
     if(!this.isIE){
-      ev.target.innerText = '';
+      ev.target.innerText?(ev.target.innerText = ''):(ev.target.innerHTML = '');
     }
     handleLabelEdit && handleLabelEdit({ikey,changeVal,type:boxMark});
   }

+ 2 - 1
src/components/SearchDrop/index.jsx

@@ -47,6 +47,7 @@ class SearchDrop extends Component{
   }
 
   handleSelect(e,item){
+    // onClick事件换成onmouseup--点击清除后谷歌下搜索结果点击不上去的情况
     e.stopPropagation();
     const {onSelect,onShow} = this.props;
     onSelect&&onSelect(item);
@@ -60,7 +61,7 @@ class SearchDrop extends Component{
         <ul>
           {this.props.data&&this.props.data.map((it)=>{
             litext = it.showType==1?it.name:it.name+'('+it.retrievalName+')';
-            return <li onClick={(e)=>this.handleSelect(e,it)} title={litext}>{litext}</li>
+            return <li onmouseup={(e)=>this.handleSelect(e,it)} title={litext}>{litext}</li>
           })}
         </ul>
       </div>

+ 5 - 5
src/components/SpreadDrop/index.jsx

@@ -94,7 +94,7 @@ class SpreadDrop extends Component{
 
   changeToEdit(e){//双击
     const {value,id,placeholder,handleDbclick,handleHide} = this.props;
-    let text = e.target.innerText;
+    let text = e.target.innerText || e.target.innerHTML;
     handleHide&&handleHide();       //展开情况下双击收起
     // clearTimeout(this.state.timer);//取消延时的单击事件
     e.stopPropagation();
@@ -117,11 +117,11 @@ class SpreadDrop extends Component{
     const {labelVal,editable} = this.state;
     let mainText = filterDataArr(mainSaveText);//主诉字数
     if(editable){//避免IE中点击标签也会触发
-      let val = e.target.innerText;
+      let val = e.target.innerText || e.target.innerHTML;
       if(+type==1){// 主诉字数达到上限时不允许输入
         if(mainText.length >= config.limited){
           if(val.length > labelVal.length){
-            e.target.innerText = labelVal;
+            e.target.innerText?(e.target.innerText = labelVal):(e.target.innerHTML = labelVal);
             Notify.info(config.limitText);
             return
           }else if(val.length == labelVal.length){
@@ -143,9 +143,9 @@ class SpreadDrop extends Component{
     const ev = e || window.event;
     if(editable){
       // 更改标签的value值
-      let changeVal = ev.target.innerText;
+      let changeVal = ev.target.innerText || ev.target.innerHTML;
       if(!isIE()){
-        e.target.innerText = '';      //避免出现重复输入值
+        e.target.innerText?(e.target.innerText = ''):(e.target.innerHTML = '');      //避免出现重复输入值
       }
       handleLabelChange && handleLabelChange({ikey,changeVal,type});
     }

+ 1 - 1
src/components/Treat/DrugTreat/index.jsx

@@ -93,7 +93,7 @@ class DrugTreat extends Component {
                                               onMouseEnter={this.handleMouseEnterImg.bind(this, ii, index)}
                                               onMouseLeave = {this.handleMouseLeaveImg}
                                               onClick={() =>{this.setDrugInfo(it);showDrugInfo();}}/>}
-                                        {it.forbidden === '1' ? <span className={style['info-flag']} style={{opacity: '0.3',border: '1px solid #F4C051', background: '#F4C051',marginLeft: '5px'}}>慎用</span>: it.forbidden === '2' ? <span className={style['info-flag']} style={{opacity: '0.3',filter:'alpha(opacity=30)',filter:'progid:DXImageTransform.Microsoft.Alpha(opacity=30)',border: '1px solid #000',marginLeft: '5px'}}>禁用</span> : ''}, 
+                                        {it.forbidden === '1' ? <span className={style['info-flag']} style={{border: '1px solid #F4C051', background: '#F4C051',marginLeft: '5px'}}>慎用</span>: it.forbidden === '2' ? <span className={style['info-flag']} style={{opacity: '0.3',filter:'alpha(opacity=30)',filter:'progid:DXImageTransform.Microsoft.Alpha(opacity=30)',border: '1px solid #000',marginLeft: '5px'}}>禁用</span> : ''}, 
                                         <span  style={it.forbidden === '2' ? {opacity: '0.3', filter:'alpha(opacity=30)',filter:'progid:DXImageTransform.Microsoft.Alpha(opacity=30)'} : ''}> 使用率{it.rate}</span>
                                         
                                     </span>)

+ 2 - 2
src/config/index.js

@@ -30,8 +30,8 @@ export default {
     delayTime:500,      //延迟搜索的时间
     delayPushTime:1000,    //延迟推送时间
     pushDelay:1000,
-    punctuationReg:/[^,,.。::"“?”;;、!!]/g,       //正则表达式,全局查找不是括号内标点的字符
-    punReg:/[,,.。::"“?”;;、!!]+/g,
+    punctuationReg:/[^,,.。::"“??”;;、!!]/g,       //正则表达式,全局查找不是括号内标点的字符
+    punReg:/[,,.。::"“??”;;、!!]+/g,
     currentText:"患者XX因XX诊断为(**),经XX治疗后,目前XX症状已缓解,仍有XX,各项指标情况:XX,辅助检查:XX。今来复诊,进一步治疗",
     timeUnit:{
       minute:"分",

+ 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
+        })
+      }
     }
 }
 

+ 3 - 3
src/containers/DiagResultSearch.js

@@ -1,7 +1,7 @@
 import React from 'react';
 import { connect } from 'react-redux';
 import { SHOW_SEARCH,  HIDE_SEARCH, GET_SEARCH_RESULT } from '@store/types/diagnosticSearch';
-import { getSearchResult } from '@store/async-actions/diagnosticSearch';
+import { getSearchResult, getSearchList } from '@store/async-actions/diagnosticSearch';
 import DiagResultSearch from '@components/DiagResultSearch';
 
 function mapStateToProps(state) {
@@ -30,8 +30,8 @@ function mapDispatchToProps(dispatch) {
                 searchResult: []
             })
         },
-        getSearchResult:(value)=>{
-            dispatch(getSearchResult(value))
+        handleChangeValue: (val)=>{
+            dispatch(getSearchList(val))
         }
     }
 }

+ 0 - 3
src/containers/DiagnosticList.js

@@ -2,7 +2,6 @@ import React from 'react';
 import { connect } from 'react-redux';
 import DiagnosticList from '@components/DiagnosticList';
 import { ADD_DIAGNOSTIC,  DEL_DIAGNOSTIC, UP_DIAGNOSTIC, DOWN_DIAGNOSTIC, GET_DIAGNOSTIC_STR, GET_IS_FIRST } from '@store/types/diagnosticList'; 
-import { getSearchResult } from '@store/async-actions/diagnosticSearch';
 import { getTreatResult } from '@store/async-actions/treat';
 import { SHOW_TREAT } from '../store/types/treat';
 import {billing, getTips} from '../store/async-actions/pushMessage';
@@ -25,8 +24,6 @@ function mapDispatchToProps(dispatch) {
                 type: DEL_DIAGNOSTIC,
                 item: item
             });
-            dispatch(getSearchResult)
-            
             dispatch({
                 type: GET_DIAGNOSTIC_STR
             });

+ 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,
   }
 }
 
@@ -99,6 +101,14 @@ function mapDispatchToProps(dispatch,store){
         type:OTHEREDICLEAR,
         bool:bool
       })
+    },
+    getSearchLocation(top,left){
+      dispatch({
+        type:SEARCH_DROP_LOCATION,
+        top:top,
+        left:left,
+        dis:0
+      })
     }
   }
 }

+ 6 - 1
src/modules/HomePage/index.jsx

@@ -9,6 +9,7 @@ import style from './index.less';
 /*import {getInitModules} from '@store/async-actions/homePage.js';*/
 import { getUrlArgObject } from "@utils/tools";
 import $ from 'jquery';
+import loading from '@common/images/loading.gif';
 class HomePage extends Component {
     constructor() {
         super();
@@ -40,17 +41,21 @@ class HomePage extends Component {
 
     }
     render() {
+        const {flag} = this.props;
         return <div className={style['home-page']} onClick={this.props.hideAllDrop}>
             <BannerContainer />
             {/* <InfoTitle /> */}
             <BodyContainer></BodyContainer>
+            <div className={style['mask']} style={{display:flag?"block":"none"}}>
+                <img src={loading} className={style['load']}/>
+            </div>
         </div>;
     }
 }
 
 const mapStateToProps = function (state) {
   return {
-
+    flag:state.homePage.loadingFlag
   }
 };
 const mapDispatchToProps = function (dispatch) {

+ 21 - 0
src/modules/HomePage/index.less

@@ -0,0 +1,21 @@
+.mask {
+    position: fixed;
+    top: 0;
+    left: 0;
+    right: 0;
+    bottom: 0;
+    background: #000;
+    opacity: .4;
+    filter:alpha(opacity=40);
+    -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(opacity=40);";
+    z-index: 9998;
+}
+.load{
+    width: 40px;
+    height: 40px;
+    position: absolute;
+    top: 50%;
+    left:50%;
+    margin-top: -20px;
+    margin-left: -20px;
+}

+ 2 - 2
src/store/actions/checkBody.js

@@ -197,7 +197,7 @@ export function insertLabelData(state,action){
   let reg = searchInEnd?new RegExp(searchStr+"$"):new RegExp("^"+searchStr);
   const newText=showText.replace(reg,'')||'';
   if(!isReplace){
-    span.current.innerText = newText;
+    span.current.innerText?(span.current.innerText = newText):(span.current.innerHTML = newText);
     const pText = Object.assign({},text,{value:newText});
     if(searchInEnd){
       res.data.splice(index,1,pText,...spreadLabels,text);
@@ -212,7 +212,7 @@ export function insertLabelData(state,action){
     }
 
   }else{
-    span.current.innerText = ' ';
+    span.current.innerText?(span.current.innerText = ' '):(span.current.innerHTML = ' ');
     if(searchInEnd){
       res.data.splice(index+1,0,spreadLabels,text);
       res.saveText.splice(index+1,0,'','');

+ 22 - 6
src/store/actions/currentIll.js

@@ -104,7 +104,8 @@ export const setData = (state,action) =>{
   }
   
   if (useEmpty) {
-    res.data = res.emptyData;
+    // res.data = res.emptyData;
+    res.data = JSON.parse(JSON.stringify(res.emptyData));
   } else {
     // 目前只需要将第一个主诉病程移植到现病史
     let tongYong = "";
@@ -167,7 +168,15 @@ export const setData = (state,action) =>{
               let items = v.questionMapping.filter((item)=>{
                               return item.symptomType==0||item.symptomType==1;
                             })          
-              lengArr[k] = items.length;  //每一个主诉尾巴长度        
+              lengArr[k] = items.length;  //每一个主诉尾巴长度 
+              
+              if(items.length==0){//没有尾巴时给症状后加逗号(3.5)
+                for(let j=0; j<newMainCopy.length; j++){
+                  if(newMainCopy[j].id==mainCopy[k].id){
+                    newMainCopy[j].value = newMainCopy[j].name = mainCopy[k].value+',';
+                  }
+                }
+              }       
               /*if(ind==1){
                 preLength = items.length;
               }else{
@@ -185,7 +194,7 @@ export const setData = (state,action) =>{
      /* for(let b=0; b<withs.length; b++){
         withs[b].name = withs[b].name.replace('、',"");
       }*/
-      // let newWiths = JSON.parse(JSON.stringify(withs));console.log(123,withs,newWiths);
+      // let newWiths = JSON.parse(JSON.stringify(withs));
       let newWiths = [];
       if(withs.length>0){
         for(let b=0; b<withs.length; b++){
@@ -209,6 +218,13 @@ export const setData = (state,action) =>{
                 withInsertInd += withPreLength;
               }*/
               withLengArr[d] = items.length;
+              if(items.length==0){//没有尾巴时给症状后加逗号(3.5)
+                for(let j=0; j<newWiths.length; j++){
+                  if(newWiths[j].id==mainCopy[d].id){
+                    newWiths[j].value = newWiths[j].name = withs[d].value+',';
+                  }
+                }
+              }
               if(withInd>1){
                 withInsertInd += withLengArr[d-1];
               }
@@ -529,7 +545,7 @@ export function insertLabelData(state,action){
   let banIdx = saveText.indexOf("伴");
   
   if(isReplace){
-    span.current.innerText = '';
+    span.current.innerText?(span.current.innerText = ''):(span.current.innerHTML = '');
     // res.data.splice(focusIndex,1,text,data);
     // 搜索结果展开伴随symptomType==2的尾巴
     let resData = JSON.parse(JSON.stringify(res.data));
@@ -542,7 +558,7 @@ export function insertLabelData(state,action){
     let resData;
     // res.data.splice(index,0,data);
     const searchStr = res.searchStr;
-    let innerText = span.current.innerText;
+    let innerText = span.current.innerText || span.current.innerHTML;
     let strIndex = innerText.indexOf(searchStr);
     const value = innerText.replace(searchStr,"");
     // 没有伴展开主诉symptomType=0/1的尾巴,有伴一>第一个点选上去的伴为依据,伴前展开主诉,伴后展开伴随;多余的伴以及手动输入的伴不做处理(2-25)
@@ -610,7 +626,7 @@ export function insertLabelData(state,action){
         }
       }
     }
-    span.current.innerText = value;
+    span.current.innerText?(span.current.innerText = value):(span.current.innerHTML = value);
     res.data = fullfillText(resData).newArr;
     res.saveText = fullfillText(resData).saveText;
   }

+ 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;
+};

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

@@ -247,7 +247,7 @@ export const confirm = (state,action) =>{
     
     res.data = arr;
     res.saveText = fullfillText(arr).saveText;
-    res.update=Math.random();console.log(789,res);
+    res.update=Math.random();
     return res;
   };
 
@@ -358,7 +358,7 @@ export const insertSearch = (state,action)=>{
 
     // 从新插入一个span标签
     const searchStr = res.searchStr;
-    let innerText = span.current.innerText;
+    let innerText = span.current.innerText || span.current.innerHTML;
     const value = innerText.replace(searchStr,"");
     let index = innerText.indexOf(searchStr);
     if(index < 1){//前
@@ -376,7 +376,7 @@ export const insertSearch = (state,action)=>{
       res.saveText.splice(focusIndex+1,0,searchData);
       res.data[focusIndex].value = value;
     }
-    span.current.innerText = value;
+    span.current.innerText?(span.current.innerText = value):(span.current.innerHTML=value);
     res.mainIds.push(id);
   }
   // console.log(456,res,action);
@@ -548,7 +548,7 @@ export const clearMainSuit = (state,action)=>{//回读和清除
   if(action.editClear){
     res.editClear = action.editClear;
   }
-  if(res.data.length>0){//回读
+  if(res.data.length > 0){//回读
     res.editClear = false;
   }
   return res;

+ 2 - 2
src/store/actions/otherHistory.js

@@ -189,7 +189,7 @@ export function insertLabelData(state,action){
   let reg = searchInEnd?new RegExp(searchStr+"$"):new RegExp("^"+searchStr);
   const newText=showText.replace(reg,'')||' ';
   if(!isReplace){
-    span.current.innerText = newText;
+    span.current.innerText?(span.current.innerText = newText):(span.current.innerHTML = newText);
     const pText = Object.assign({},text,{value:newText});
     if(searchInEnd){
       res.data.splice(index,1,pText,...spreadLabels,text);
@@ -202,7 +202,7 @@ export function insertLabelData(state,action){
       res.selecteds.splice(index,1,...new Array(spreadLabels.length).fill(null),null,null);
     }
   }else{
-    span.current.innerText = ' ';
+    span.current.innerText?(span.current.innerText = ' '):(span.current.innerHTML = ' ');
     if(searchInEnd){
       res.data.splice(index+1,0,spreadLabels,text);
       res.saveText.splice(index+1,0,'','');

+ 23 - 23
src/store/actions/patInfo.js

@@ -1,29 +1,29 @@
 export const updatePatientMessage=(state,action)=>{
     const res=Object.assign({},state);
     const mock = {
-      doctorCode: "YS001",
-      doctorId: 1,
-      doctorName: "付",
-      hospitalCode: "A001",
-      hospitalDeptCode: "D01",
-      hospitalDeptId: 1,
-      hospitalDeptName: "全科",
-      hospitalId: 1,
-      hospitalName: "浙二医院",
-      modeClassify: 0,
-      modeValue: 1,
-      patientAge: 25,
-      patientCode: "1600",
-      patientId: 1,
-      patientIdNo: "9696969",
-      patientName: "沈强",
-      patientSex: "女",
-      recordId: "44",
-      selfDeptId: 5,
-      systemTime: "2018-12-20 11:52",
-      idNo: "9696969",
-      name: "沈强",
-      sex: 2
+      // doctorCode: "YS001",
+      // doctorId: 1,
+      // doctorName: "付",
+      // hospitalCode: "A001",
+      // hospitalDeptCode: "D01",
+      // hospitalDeptId: 1,
+      // hospitalDeptName: "全科",
+      // hospitalId: 1,
+      // hospitalName: "浙二医院",
+      // modeClassify: 0,
+      // modeValue: 1,
+      // patientAge: 25,
+      // patientCode: "1600",
+      // patientId: 1,
+      // patientIdNo: "9696969",
+      // patientName: "沈强",
+      // patientSex: "女",
+      // recordId: "44",
+      // selfDeptId: 5,
+      // systemTime: "2018-12-20 11:52",
+      // idNo: "9696969",
+      // name: "沈强",
+      // sex: 2
     };
     res.message = action.data;
     if(!action.data.selfDeptId){

+ 28 - 57
src/store/async-actions/diagnosticSearch.js

@@ -1,66 +1,37 @@
 import { json } from "@utils/ajax";
-import { GET_SEARCH_RESULT, SET_SEARCH_VALUE } from '@store/types/diagnosticSearch';
+import { GET_SEARCH_RESULT } from '@store/types/diagnosticSearch';
 
-export const getSearchResult = (value) =>{
-    
+
+export const getSearchList = (val) => {
+    if(val.trim() == ''){
+        const data = [];
+        return (dispatch) =>  dispatch({
+            type: GET_SEARCH_RESULT,
+            searchResult: []
+        })
+    }
+   
     return (dispatch, getState) => {
         const state = getState();
-        const url = '/api/icss/retrieval/getTagInfos'
-        const param={
-            type: 7,
-            age: state.patInfo.message.patientAge,
-            inputStr: value,
-            sexType: state.patInfo.message.sex
+        const diagnosticList = state.diagnosticList.diagnosticList
+        let noIds = []
+        for(let i = 0; i < diagnosticList.length; i++) {
+            noIds.push(diagnosticList[i].id)
         }
-        if(value === state.diagnosticSearch.searchValue) {
-            return
-        } else {
+        json('/api/icss/retrieval/getTagInfos',{
+            type:'7',
+            age:state.patInfo.message.patientAge,
+            inputStr:val,
+            sexType: state.patInfo.message.sex,
+            inputIds: noIds
+        })
+        .then((res)=>{
+            const data = res.data.data;
             dispatch({
-                type: SET_SEARCH_VALUE,
-                searchValue: value
-            })
-            //如果搜索值为空,则直接将搜索结果设为空
-            if(value === '') {
-                dispatch({
-                    type: GET_SEARCH_RESULT,
-                    searchResult: []
-                })
-                return
-            }
-            json(url, param).then((data)=>{
-                const searchRes = data.data.data;
-                const diagList = state.diagnosticList.diagnosticList;
-                let searchResult = [];
-                if(searchRes) {
-                    for(let i = 0; i < searchRes.length; i++) {
-                        let repeat = false;
-                        for (let j = 0; j < diagList.length; j++) {
-                            if(searchRes[i].questionId === diagList[j].id) {
-                                repeat = true;
-                            } 
-                        }
-                        if(!repeat) {
-                            searchResult.push(searchRes[i])
-                        }
-                    }
-                    dispatch({
-                        type: GET_SEARCH_RESULT,
-                        searchResult: searchResult
-                    })
-                } else {
-                    dispatch({
-                        type: GET_SEARCH_RESULT,
-                        searchResult: []
-                    })
-                }
-               
-            }).catch((e)=>{
-                console.log(e)
+                type: GET_SEARCH_RESULT,
+                searchResult: data
             })
-
-
-        }
-        
+        })
     }
+};
 
-}

+ 3 - 17
src/store/async-actions/homePage.js

@@ -1,5 +1,5 @@
 import {post,json} from '@utils/ajax.js';
-import {SETINITDATA} from '@store/types/homePage.js';
+import {SETINITDATA,MODI_LOADING} from '@store/types/homePage.js';
 import {SET_CURRENT} from '@store/types/currentIll';
 import {SET_MAINSUIT} from '@store/types/mainSuit';
 import config from '@config/index.js';
@@ -28,6 +28,7 @@ export const getInitModules= (dispatch,getStore)=>{
   const state = getStore();
   const {message} = state.patInfo;
   return json(api.getModules,{age:message.patientAge,sexType:message.sex}).then((res) => {
+      dispatch(initHistoryDetails(message));      //历史病历回读
       if (res.data.code == '0') {
         const newObj = modulesParseJson(res.data.data);
         const initData = newObj.json;
@@ -57,25 +58,10 @@ export const getInitModules= (dispatch,getStore)=>{
           saveEmpty:initSaveText.currentEmpty,
         });
         dispatch(getOtherHisRecord());          //获取其他史最近记录
-        initHis(dispatch)
-      }else{
-        initHis(dispatch)
       }
-    }).catch(()=>{
-        initHis(dispatch)
-    });
+    })
 };
 
-export const initHis = (dispatch)=> {
-    let timer = setInterval(()=>{
-        let baseDate = store.getState();
-        if(JSON.stringify(baseDate.patInfo.message) != '{}') {
-          dispatch(initHistoryDetails(baseDate.patInfo.message));
-          clearInterval(timer)
-        }
-    },500)
-}
-
 // 埋点事件,点击保存时调用
 export const saveClickNum = (dispatch,getState)=>{
   const state = getState();

+ 3 - 1
src/store/async-actions/patInfo.js

@@ -5,7 +5,7 @@ import {getInfos} from '@store/actions/getInfoByUuid';
 import {getUrlArgObject,pushAllDataList} from '@utils/tools';
 import {getInitModules} from '@store/async-actions/homePage.js';
 import store from '@store'
-import {ISREAD} from "../types/homePage";
+import {ISREAD,MODI_LOADING} from "../types/homePage";
 import { initItemList } from '@store/async-actions/tabTemplate';
 
 const api = {
@@ -60,7 +60,9 @@ export const initHistoryDetails = (dispatch) => {
                 }else{
                   dispatch(initItemList(baseList.typeConfig.typeConfig))
                 }
+                dispatch({type:MODI_LOADING});
             } else {
+                dispatch({type:MODI_LOADING});
                 console.log(res)
             }
         })

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

@@ -1,6 +1,7 @@
 import {HIDE,RESET,SETINITDATA,SETDROPSHOW,SETADDITEMINIT,SETT0EDIT,SETREADDITEMS,
-  HIDEDROP,CLICKCOUNT,ISREAD,SETOTHERHISTORY,SETMINSCREEN} 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,
@@ -9,7 +10,10 @@ const initState = {
   focusTextIndex:'',
   clickData:[],
   addItems:{},
-  commSymHide:false
+  commSymHide:false,
+  loadingFlag:true,
+  boxTop:0,
+  boxLeft:0
 };
 
 export default function (state=initState,action) {
@@ -55,6 +59,11 @@ export default function (state=initState,action) {
       res.windowWidth = action.obj.width;
       res.windowHeight = action.obj.height;
       return res;
+    case MODI_LOADING:
+      res.loadingFlag = false;
+      return res;
+    case SEARCH_DROP_LOCATION:
+      return searchDropLocation(state,action);
     default:
       return res;
   }

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

@@ -10,4 +10,6 @@ export const HIDEDROP = 'set_box_drop_hide';//点击确定隐藏
 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 SETMINSCREEN = 'SETMINSCREEN';    //1024标识
+export const MODI_LOADING = 'MODI_LOADING';    //1024标识
+export const SEARCH_DROP_LOCATION = 'SEARCH_DROP_LOCATION';    //1024标识

+ 1 - 1
src/utils/tools.js

@@ -554,7 +554,7 @@ function filterOtherDataArr(arrTmp,jsonArr){
 function trimDots(str){
   return str.replace(config.punReg,function(word){
     return word.substr(0,1);
-  }).replace(/^[,,.。::"“?”;;、!!]+/,'');
+  }).replace(/^[,,.。::"“??”;;、!!]+/,'');
 }
 
 // 取消默认行为