Browse Source

Merge branch 'dev/new1' into dev/otherHis

zhouna 6 years ago
parent
commit
3f1b4bbfaa
56 changed files with 560 additions and 251 deletions
  1. 4 3
      src/common/components/EditableSpan/index.jsx
  2. 1 1
      src/common/components/InspectCommon/index.jsx
  3. 3 1
      src/common/components/InspectCommon/index.less
  4. 1 1
      src/common/components/Notify/index.less
  5. 2 2
      src/common/components/TailInlineTag/index.jsx
  6. 21 4
      src/common/components/Textarea/index.jsx
  7. 3 3
      src/components/AddInspect/SlideExcel/index.jsx
  8. 1 0
      src/components/AddInspect/index.less
  9. 4 3
      src/components/Advice/Textarea/index.jsx
  10. 2 1
      src/components/Advice/index.jsx
  11. 1 1
      src/components/AssistCheck/index.jsx
  12. 3 3
      src/components/CurrentIll/index.jsx
  13. 1 1
      src/components/Diagnosis/index.jsx
  14. 7 6
      src/components/DiagnosticItem/index.jsx
  15. 3 2
      src/components/DiagnosticList/index.jsx
  16. 1 0
      src/components/DiagnosticList/index.less
  17. 1 2
      src/components/Inspect/index.jsx
  18. 1 0
      src/components/Inspect/index.less
  19. 3 2
      src/components/MainSuit/index.jsx
  20. 1 1
      src/components/NumberDrop/index.jsx
  21. 35 18
      src/components/NumberUnitDrop/index.jsx
  22. 2 2
      src/components/Operation/index.jsx
  23. 7 3
      src/components/PreviewBody/index.jsx
  24. 20 6
      src/components/PushItems/index.jsx
  25. 2 2
      src/components/RadioDrop/index.jsx
  26. 1 1
      src/components/Treat/DrugTreat/index.jsx
  27. 18 62
      src/components/Treat/index.jsx
  28. 7 0
      src/components/Treat/index.less
  29. 18 10
      src/components/TreatDesc/DrugInfo/index.jsx
  30. 11 1
      src/components/TreatDesc/DrugInfo/index.less
  31. 2 2
      src/components/TreatDesc/index.jsx
  32. 1 0
      src/components/TreatDesc/index.less
  33. 3 2
      src/config/index.js
  34. 1 0
      src/containers/AdviceContainer.js
  35. 4 1
      src/containers/CurrentIll.js
  36. 1 1
      src/containers/Inspect.js
  37. 5 2
      src/containers/MainSuit.js
  38. 24 8
      src/containers/NumberUnitDrop.js
  39. 14 8
      src/containers/SpreadDrop.js
  40. 2 2
      src/store/actions/checkBody.js
  41. 49 30
      src/store/actions/currentIll.js
  42. 2 0
      src/store/actions/diagnosticList.js
  43. 35 25
      src/store/actions/mainSuit.js
  44. 5 5
      src/store/actions/otherHistory.js
  45. 6 0
      src/store/actions/treat.js
  46. 15 2
      src/store/async-actions/homePage.js
  47. 2 1
      src/store/async-actions/mainSuit.js
  48. 1 1
      src/store/async-actions/treat.js
  49. 2 1
      src/store/reducers/diagnosticList.js
  50. 6 2
      src/store/reducers/homePage.js
  51. 76 8
      src/store/reducers/inspect.js
  52. 4 2
      src/store/reducers/treat.js
  53. 2 1
      src/store/types/homePage.js
  54. 1 0
      src/store/types/treat.js
  55. 2 2
      src/utils/config.js
  56. 110 3
      src/utils/tools.js

+ 4 - 3
src/common/components/EditableSpan/index.jsx

@@ -185,9 +185,10 @@ class EditableSpan extends Component{
         obj.focus();
         obj.focus();
       }
       }
     }
     }
-    ele = document.activeElement;
-    boxTop = target.innerText?getPageCoordinate(e).boxTop:$(ele).offset().top+30;
-    setSearchLocation(boxTop,ele.offsetLeft)     //搜索框的位置动态获取
+    // 注释掉,放开会影响删除
+    // ele = document.activeElement;
+    // boxTop = target.innerText?getPageCoordinate(e).boxTop:$(ele).offset().top+30;
+    // setSearchLocation(boxTop,ele.offsetLeft)     //搜索框的位置动态获取
   }  
   }  
   handleKeyup(e){
   handleKeyup(e){
     const {boxMark,handleKeydown,i,value,removeId,handleClear,delSingleLable,setSearchLocation} = this.props;
     const {boxMark,handleKeydown,i,value,removeId,handleClear,delSingleLable,setSearchLocation} = this.props;

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

@@ -16,7 +16,7 @@ class InspectCommon extends React.Component {
             {children}
             {children}
             <div className={style.btnWrap}>
             <div className={style.btnWrap}>
                 <span className={style.clear + ' red'} onClick={handleClear}>清空选项</span>
                 <span className={style.clear + ' red'} onClick={handleClear}>清空选项</span>
-                <span className={style.sure} onClick={handleConfirm}>确 定</span>
+                <span className={style.sure} onClick={handleConfirm}>确定</span>
             </div>
             </div>
         </div>
         </div>
     }
     }

+ 3 - 1
src/common/components/InspectCommon/index.less

@@ -24,10 +24,12 @@
     .sure {
     .sure {
         float: right;
         float: right;
         color: @blue;
         color: @blue;
-        border: 1px solid @blue;
+        font-weight: bold;
     }
     }
     .clear {
     .clear {
         float: left;
         float: left;
+        // font-weight: bold;
+        bottom: 0;
     }
     }
 }
 }
 
 

+ 1 - 1
src/common/components/Notify/index.less

@@ -27,7 +27,7 @@
 .notify-text {
 .notify-text {
   min-width: 224px;
   min-width: 224px;
   height: 70px;
   height: 70px;
-  
+  padding:  0 40px 0 0;
   // overflow: hidden;
   // overflow: hidden;
   position: relative;
   position: relative;
   left: 66px;
   left: 66px;

+ 2 - 2
src/common/components/TailInlineTag/index.jsx

@@ -19,8 +19,8 @@ class TailInlineTag extends Component {
 
 
   handleClick(e){
   handleClick(e){
     // e.stopPropagation(); //冒泡到最顶层关闭其他下拉
     // e.stopPropagation(); //冒泡到最顶层关闭其他下拉
-    const {handleTailClick,questionMapping,id} = this.props;
-    handleTailClick && handleTailClick({questionMapping,id});
+    const {handleTailClick,questionMapping,id,relationModule} = this.props;
+    handleTailClick && handleTailClick({questionMapping,id,relationModule});
   }
   }
 
 
   render(){
   render(){

+ 21 - 4
src/common/components/Textarea/index.jsx

@@ -17,7 +17,8 @@ class Textarea extends Component {
     this.$dom = React.createRef();
     this.$dom = React.createRef();
     this.handleInput = this.handleInput.bind(this);
     this.handleInput = this.handleInput.bind(this);
     this.handleFocus = this.handleFocus.bind(this);
     this.handleFocus = this.handleFocus.bind(this);
-    //this.handleBlur = this.handleBlur.bind(this);
+    this.handleBlur = this.handleBlur.bind(this);
+    this.handleKeydown = this.handleKeydown.bind(this);
   }
   }
   handleFocus(){            //初始显示props中的值,focus已经显示输入的值,避免值更新闪烁
   handleFocus(){            //初始显示props中的值,focus已经显示输入的值,避免值更新闪烁
     const {handleFocus,fuzhen,handleInput} = this.props;
     const {handleFocus,fuzhen,handleInput} = this.props;
@@ -58,7 +59,7 @@ class Textarea extends Component {
     })
     })
 
 
     //存值到store
     //存值到store
-    handleInput&&handleInput({text});
+    // handleInput&&handleInput({text});
     //右侧推送--延时推送
     //右侧推送--延时推送
     clearTimeout(stimer);
     clearTimeout(stimer);
     let timer = setTimeout(function(){
     let timer = setTimeout(function(){
@@ -84,7 +85,7 @@ class Textarea extends Component {
   componentDidMount(){
   componentDidMount(){
     const {value} = this.props;
     const {value} = this.props;
     if(value){
     if(value){
-      this.$dom.current.innerText?(this.$dom.current.innerText = value||''):(this.$dom.current.innerText=value||'');
+      this.$dom.current.innerText?(this.$dom.current.innerText = value||''):(this.$dom.current.innerHTML=value||'');
     }
     }
     if(isIE()){
     if(isIE()){
       $(this.$dom.current).onIe8Input(function(e){
       $(this.$dom.current).onIe8Input(function(e){
@@ -92,6 +93,20 @@ class Textarea extends Component {
       },this);
       },this);
     }
     }
   }
   }
+  handleBlur(){
+    const {handleInput} = this.props;
+    const text = this.$dom.current.innerText||this.$dom.current.innerHTML;
+    //存值到store
+    handleInput&&handleInput({text});
+  }
+  handleKeydown(e){
+    const {boxMark} = this.props;
+    const ev = e||window.event;
+    if(+boxMark==1){
+      //禁止回车事件
+      if(ev.keyCode==13){return false;}
+    }
+  }
   render() {
   render() {
     const { title } = this.props;
     const { title } = this.props;
     return (
     return (
@@ -102,7 +117,9 @@ class Textarea extends Component {
              onFocus={this.handleFocus}
              onFocus={this.handleFocus}
              ref={this.$dom}
              ref={this.$dom}
              contentEditable={true}
              contentEditable={true}
-             onInput={this.handleInput}>
+             onInput={this.handleInput}
+             onBlur={this.handleBlur}
+             onkeydown={this.handleKeydown}>
         </div>
         </div>
       </div>
       </div>
     );
     );

+ 3 - 3
src/components/AddInspect/SlideExcel/index.jsx

@@ -31,7 +31,7 @@ class SlideExcel extends Component {
     })
     })
   }
   }
   render() {
   render() {
-    const {items,item,idx} = this.props;
+    const {items,item,idx,dateTime} = this.props;
     const {show} = this.state;
     const {show} = this.state;
     return (
     return (
       <li className={styles.excelDataLis} style={{border:items.lisExcelRes.length-1 == idx? 0:''}}>
       <li className={styles.excelDataLis} style={{border:items.lisExcelRes.length-1 == idx? 0:''}}>
@@ -46,7 +46,7 @@ class SlideExcel extends Component {
                       <td style={{width:'25%'}}>
                       <td style={{width:'25%'}}>
                           {normalVal(value.min,value.max)}
                           {normalVal(value.min,value.max)}
                       </td>
                       </td>
-                      <td style={{width:'25%'}}>{value.time == ''?('导入时间: '+this.state.dateTime):'化验时间: '+this.toTime(value.time)}</td>
+                      <td style={{width:'25%'}}>{value.time == ''?('导入时间: '+dateTime):'化验时间: '+this.toTime(value.time)}</td>
                   </tr>
                   </tr>
                 })):(item.lisExcelItem && item.lisExcelItem.map((value,idx)=>{
                 })):(item.lisExcelItem && item.lisExcelItem.map((value,idx)=>{
                   if(idx < 4){
                   if(idx < 4){
@@ -56,7 +56,7 @@ class SlideExcel extends Component {
                         <td style={{width:'25%'}}>
                         <td style={{width:'25%'}}>
                             {normalVal(value.min,value.max)}
                             {normalVal(value.min,value.max)}
                         </td>
                         </td>
-                        <td style={{width:'25%'}}>{value.time == ''?('导入时间: '+this.state.dateTime):'化验时间: '+this.toTime(value.time)}</td>
+                        <td style={{width:'25%'}}>{value.time == ''?('导入时间: '+dateTime):'化验时间: '+this.toTime(value.time)}</td>
                     </tr>
                     </tr>
                   }
                   }
                 }))
                 }))

+ 1 - 0
src/components/AddInspect/index.less

@@ -118,6 +118,7 @@
     margin-bottom: 5px;
     margin-bottom: 5px;
     border-top: 1px solid #EAEDF1;
     border-top: 1px solid #EAEDF1;
     overflow: hidden;
     overflow: hidden;
+    box-sizing: border-box;
 }
 }
 .itemPart {
 .itemPart {
     height: 28px;
     height: 28px;

+ 4 - 3
src/components/Advice/Textarea/index.jsx

@@ -32,11 +32,11 @@ class Textarea extends Component {
   componentWillReceiveProps(next){
   componentWillReceiveProps(next){
     const isRead = this.props.isRead;
     const isRead = this.props.isRead;
     // if(next.isRead != isRead && next.value!=this.props.value){      //value对比解决复诊不显示bug
     // if(next.isRead != isRead && next.value!=this.props.value){      //value对比解决复诊不显示bug
-    //   next.value ? this.$dom.current.innerText = next.value :  ''
+    //   next.value ? this.$dom.current.innerText = next.value :  this.$dom.current.innerText = next.value 
     //   // this.$dom.current.innerText?(this.$dom.current.innerText = next.value||''):(this.$dom.current.innerHTML = next.value||'');
     //   // this.$dom.current.innerText?(this.$dom.current.innerText = next.value||''):(this.$dom.current.innerHTML = next.value||'');
     // }
     // }
-    if(next.isRead != isRead && next.value){      //value对比解决复诊不显示bug
-      next.value ? this.$dom.current.innerText = next.value :  ''
+    if(next.isRead != isRead && next.value || next.isRead != isRead && next.value!=this.props.value){      //value对比解决复诊不显示bug
+      next.value ? this.$dom.current.innerText = next.value :  this.$dom.current.innerText = '' 
       // this.$dom.current.innerText?(this.$dom.current.innerText = next.value||''):(this.$dom.current.innerHTML = next.value||'');
       // this.$dom.current.innerText?(this.$dom.current.innerText = next.value||''):(this.$dom.current.innerHTML = next.value||'');
     }
     }
   }
   }
@@ -44,6 +44,7 @@ class Textarea extends Component {
     const {value} = this.props;
     const {value} = this.props;
     if(value && value.trim()){
     if(value && value.trim()){
       this.$dom.current.innerText = value
       this.$dom.current.innerText = value
+      // this.$dom.current.focus()
       // this.$dom.current.innerText ? (this.$dom.current.innerText = value) : (this.$dom.current.innerHTML = value)
       // 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 = '')
     //   this.$dom.current.nextSibling.innerText?(this.$dom.current.nextSibling.innerText = ''):(this.$dom.current.nextSibling.innerHTML = '')
     }
     }

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

@@ -60,7 +60,6 @@ class Advice extends Component{
   componentDidMount(){
   componentDidMount(){
   //   this.$dom.current.nextSibling.innerText?(this.$dom.current.nextSibling.innerText = ''):(this.$dom.current.nextSibling.innerHTML = '')
   //   this.$dom.current.nextSibling.innerText?(this.$dom.current.nextSibling.innerText = ''):(this.$dom.current.nextSibling.innerHTML = '')
   // const {advice} = this.props.pushMessage.advice
   // const {advice} = this.props.pushMessage.advice
-  // console.log('adviceInput', this.props.pushMessage)
   
   
 }
 }
 
 
@@ -101,6 +100,8 @@ class Advice extends Component{
           {scheme}
           {scheme}
         </div>}
         </div>}
         <div className={style['billing']} > 
         <div className={style['billing']} > 
+            {/* {!advice.adviceInput && <Textarea value='' isRead={isRead} handleChangeAssistValue={this.handleAdviceInput} ></Textarea>}
+            {advice.adviceInput && <Textarea value={advice.adviceInput} isRead={isRead} handleChangeAssistValue={this.handleAdviceInput} ></Textarea>} */}
             <Textarea value={advice.adviceInput} isRead={isRead} handleChangeAssistValue={this.handleAdviceInput} ></Textarea>
             <Textarea value={advice.adviceInput} isRead={isRead} handleChangeAssistValue={this.handleAdviceInput} ></Textarea>
         </div>
         </div>
       </ItemBox>
       </ItemBox>

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

@@ -14,7 +14,7 @@ class AssistCheck extends React.Component {
         return (
         return (
             <div className={styles.wrapper}>
             <div className={styles.wrapper}>
                 <div className={styles.top}>
                 <div className={styles.top}>
-                    <span>辅检结果数据</span>
+                    <span id="assistResultData">辅检结果数据</span>
                     {/* <button>导入化验结果</button> */}
                     {/* <button>导入化验结果</button> */}
                 </div>
                 </div>
                 <ItemBox 
                 <ItemBox 

+ 3 - 3
src/components/CurrentIll/index.jsx

@@ -128,12 +128,12 @@ class CurrentIll extends Component{
   }
   }
 
 
   getInlineTag(){  
   getInlineTag(){  
-    const {data,showArr,selecteds,processModuleName,saveText,insertProcess,symptomIds} = this.props;
+    const {data,showArr,selecteds,processModuleName,saveText,insertProcess,symptomIds,allModules} = this.props;
     const boxMark = '2';
     const boxMark = '2';
 
 
     let list = data&&data.map((item,i)=>{
     let list = data&&data.map((item,i)=>{
-      if(item.relationModule && item.relationModule==3){
-        return <TailInlineTag {...item} showText={processModuleName} handleTailClick={(obj)=>{insertProcess(obj)}}></TailInlineTag>
+      if(item.flag && item.flag==3){
+        return <TailInlineTag {...item} showText={item.relationModuleName} handleTailClick={(obj)=>{insertProcess(obj,allModules)}}></TailInlineTag>
       }else {
       }else {
         return chooseType({item,boxMark,i,hideTag:false,showArr,selecteds,saveText,mainIds:symptomIds});
         return chooseType({item,boxMark,i,hideTag:false,showArr,selecteds,saveText,mainIds:symptomIds});
       }
       }

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

@@ -41,7 +41,7 @@ class Diagnosis extends Component {
     render() {
     render() {
         
         
         
         
-        return (<div>
+        return (<div id="diagnosisResult">
             <ItemBox  id="diagnosis" title='诊断'  boxHeight='auto' titleTop='22px' marginTop='9px' backgroundColor='#EAF7FD'>
             <ItemBox  id="diagnosis" title='诊断'  boxHeight='auto' titleTop='22px' marginTop='9px' backgroundColor='#EAF7FD'>
                 <DiagnosticList></DiagnosticList>
                 <DiagnosticList></DiagnosticList>
                 <div style={{marginLeft:'10px', position:'relative'}}>
                 <div style={{marginLeft:'10px', position:'relative'}}>

+ 7 - 6
src/components/DiagnosticItem/index.jsx

@@ -54,17 +54,18 @@ class DiagnosticItem extends Component{
         //         visible: false,
         //         visible: false,
         //     },()=>{
         //     },()=>{
                 const { diagnosticList, addDiagnostic, clearInput, hideSearch } = this.props;
                 const { diagnosticList, addDiagnostic, clearInput, hideSearch } = this.props;
-                for (let i = 0; i < diagnosticList.length; i++) {
-                    if(diagnosticList[i].id === item.id && diagnosticList[i].name === item.name) {
-                        Notify.info('该诊断已存在');
-                        return
-                    }
-                }
+                // for (let i = 0; i < diagnosticList.length; i++) {
+                //     if(diagnosticList[i].id === item.id && diagnosticList[i].name === item.name) {
+                //         Notify.info('该诊断已存在');
+                //         return
+                //     }
+                // }
                 addDiagnostic&&addDiagnostic(item);
                 addDiagnostic&&addDiagnostic(item);
                 clearInput&&clearInput();
                 clearInput&&clearInput();
                 hideSearch&&hideSearch()
                 hideSearch&&hideSearch()
         //     })
         //     })
         // }, 0)
         // }, 0)
+        document.getElementById("diagnosisResult").scrollIntoView(true)
     }
     }
 
 
     render(){
     render(){

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

@@ -63,7 +63,7 @@ class DiagnosticList extends Component {
         })
         })
     }
     }
     showTreat(item, index) {
     showTreat(item, index) {
-        item.treatIndex = index
+        // item.treatIndex = index
         const  { showTreat, getTreatResult } = this.props;
         const  { showTreat, getTreatResult } = this.props;
         getTreatResult && getTreatResult(item);
         getTreatResult && getTreatResult(item);
         showTreat && showTreat();
         showTreat && showTreat();
@@ -92,7 +92,8 @@ class DiagnosticList extends Component {
                                     <span className={style['diag-name']} onClick={()=>{this.handleClickDiag(item)}}>{item.name}<span></span></span> 
                                     <span className={style['diag-name']} onClick={()=>{this.handleClickDiag(item)}}>{item.name}<span></span></span> 
                                     {item.type === 1 ? <span className={style['diag-first']}>初诊</span> :<span className={style['diag-second']}> 复诊</span>}
                                     {item.type === 1 ? <span className={style['diag-first']}>初诊</span> :<span className={style['diag-second']}> 复诊</span>}
                                     <span className={style['treat']}
                                     <span className={style['treat']}
-                                          style ={{ color: hasTreat ?'' : 'gray', border: hasTreat ?'1px solid #3B9ED0' : '1px solid gray'}}
+                                        //   style ={{ color: hasTreat ?'' : 'gray', border: hasTreat ?'1px solid #3B9ED0' : '1px solid gray', cursor: hasTreat ? '' : 'text'}}
+                                          style ={hasTreat ? '' : { color: 'gray', border: '1px solid gray', cursor: 'auto'}}
                                           onClick={() =>{hasTreat && this.showTreat(item, index)}}>
                                           onClick={() =>{hasTreat && this.showTreat(item, index)}}>
                                           治疗方案
                                           治疗方案
                                     </span>
                                     </span>

+ 1 - 0
src/components/DiagnosticList/index.less

@@ -101,4 +101,5 @@
 .diag-up, .diag-down, .diag-del {
 .diag-up, .diag-down, .diag-del {
     width: 20px;
     width: 20px;
     margin-bottom: 4px;
     margin-bottom: 4px;
+    cursor: pointer;
 }
 }

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

@@ -152,9 +152,8 @@ class Inspect extends React.Component {
         return (
         return (
             <div className={styles.wrapper} >
             <div className={styles.wrapper} >
                 {/* 导入功能插件,ie8/9权限问题暂未解决,先隐藏 */}
                 {/* 导入功能插件,ie8/9权限问题暂未解决,先隐藏 */}
-
                 <div className={styles.top}>
                 <div className={styles.top}>
-                    <span>化验结果数据</span>
+                    <span id="inspectResultData">化验结果数据</span>
                     <div className={this.getStyle()} onClick={ieVersion&&ieVersion<=9?null:this.handleImportExcel}>
                     <div className={this.getStyle()} onClick={ieVersion&&ieVersion<=9?null:this.handleImportExcel}>
                        {/* <button disabled={ieVersion&&ieVersion>9?true:false}>导入化验结果</button>*/}
                        {/* <button disabled={ieVersion&&ieVersion>9?true:false}>导入化验结果</button>*/}
                         <div className={styles.pushButton}>导入化验结果</div>
                         <div className={styles.pushButton}>导入化验结果</div>

+ 1 - 0
src/components/Inspect/index.less

@@ -40,6 +40,7 @@
         line-height: 28px;
         line-height: 28px;
         border-radius: 5px;
         border-radius: 5px;
         color: @template-color;
         color: @template-color;
+        cursor: pointer;
     }
     }
 }
 }
 .title {
 .title {

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

@@ -49,11 +49,12 @@ class MainSuit extends Component{
 
 
 
 
   getInlineTag(){
   getInlineTag(){
-    const {datas,showArr,handleTailClick,selecteds,saveText,addModuleName,mainIds} = this.props;
+    const {datas,showArr,handleTailClick,selecteds,saveText,addModuleName,mainIds,allModules} = this.props;
     const boxMark = '1';
     const boxMark = '1';
     let list = datas&&datas.map((item,i)=>{
     let list = datas&&datas.map((item,i)=>{
       if(item.flag && item.flag==3){
       if(item.flag && item.flag==3){
-        return <TailInlineTag {...item} showText={addModuleName} handleTailClick={(obj)=>{handleTailClick(obj,saveText)}}></TailInlineTag>
+        /*return <TailInlineTag {...item} showText={addModuleName} handleTailClick={(obj)=>{handleTailClick(obj,saveText)}}></TailInlineTag>*/
+        return <TailInlineTag {...item} showText={item.relationModuleName} handleTailClick={(obj)=>{handleTailClick(obj,saveText,allModules)}}></TailInlineTag>
       }else {
       }else {
         return chooseType({item,boxMark,i,hideTag:false,showArr,selecteds,saveText,mainIds});
         return chooseType({item,boxMark,i,hideTag:false,showArr,selecteds,saveText,mainIds});
       }
       }

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

@@ -77,7 +77,7 @@ class NumberDrop extends Component{
   }
   }
   beyondArea(){
   beyondArea(){
     const {handleSelect,ikey,suffix,prefix,mainSaveText} = this.props;
     const {handleSelect,ikey,suffix,prefix,mainSaveText} = this.props;
-    Notify.info("数值在正常值范围内,请重新输入");
+    Notify.info("输入数值不在合理值范围内,请重新输入!");
     handleSelect&&handleSelect({ikey,text:'',suffix,prefix,mainSaveText});
     handleSelect&&handleSelect({ikey,text:'',suffix,prefix,mainSaveText});
     this.setState({
     this.setState({
       placeholder:this.props.placeholder,
       placeholder:this.props.placeholder,

+ 35 - 18
src/components/NumberUnitDrop/index.jsx

@@ -33,6 +33,8 @@ class NumberUnitDrop extends Component{
       tmpScroll:0
       tmpScroll:0
     };
     };
     this.$span = React.createRef();
     this.$span = React.createRef();
+    this.$pre = React.createRef();
+    this.$suf = React.createRef();
     this.$cont = React.createRef();
     this.$cont = React.createRef();
     this.select = this.select.bind(this);
     this.select = this.select.bind(this);
     this.numInpBlur = this.numInpBlur.bind(this);
     this.numInpBlur = this.numInpBlur.bind(this);
@@ -41,7 +43,7 @@ class NumberUnitDrop extends Component{
     this.changeToEdit = this.changeToEdit.bind(this);
     this.changeToEdit = this.changeToEdit.bind(this);
   }
   }
   select(obj){         //选中键盘上数字事件
   select(obj){         //选中键盘上数字事件
-    const {handleSelect,ikey,suffix,prefix,mainSaveText,formulaCode} = this.props;
+    const {handleSelect,ikey,suffix,prefix,mainSaveText,formulaCode,mainData} = this.props;
     this.setState({
     this.setState({
       hasSelect:true
       hasSelect:true
     });
     });
@@ -50,7 +52,7 @@ class NumberUnitDrop extends Component{
         value:''
         value:''
       });
       });
     }
     }
-    handleSelect&&handleSelect({ikey,text:obj.text,suffix,prefix,mainSaveText,mark:obj.mark,formulaCode});
+    handleSelect&&handleSelect({ikey,text:obj.text,suffix,prefix,mainSaveText,mark:obj.mark,formulaCode,mainData});
   }
   }
   
   
   handleNumClick(e){ 
   handleNumClick(e){ 
@@ -85,13 +87,20 @@ class NumberUnitDrop extends Component{
   //数字框失焦,保存值到store中
   //数字框失焦,保存值到store中
   numInpBlur(e){
   numInpBlur(e){
     e.stopPropagation();
     e.stopPropagation();
-    const {handleSelect,ikey,suffix,prefix,mainSaveText,handleLabelChange,boxMark,formulaCode} = this.props;
+    // const {handleSelect,ikey,suffix,prefix,mainSaveText,handleLabelChange,boxMark,formulaCode} = this.props;
+    const {handleSelect,ikey,mainSaveText,handleLabelChange,boxMark,formulaCode} = this.props;
     const {editable} = this.state;
     const {editable} = this.state;
     if(editable){
     if(editable){
-      const text = e.target.innerText || e.target.innerHTML;
+      // const text = e.target.innerText || e.target.innerHTML;
       // this.$span.current.innerText='';      //修改生成文字变成输入的2倍bug 
       // this.$span.current.innerText='';      //修改生成文字变成输入的2倍bug 
+      let totalVal = e.target.innerText|| e.target.innerHTML;
+      let changeVal = this.$span.current.innerText.replace(/^\s*/,'');//数字框值-修改后;去掉前空格避免多空格叠加
+      let prefix = this.$pre.current.innerText.replace(/^\s*/,''); //前缀值-修改后
+      let suffix = this.$suf.current.innerText.replace(/^\s*/,''); //后缀值-修改后
+      // console.log('数字框:'+changeVal,";全部:"+totalVal,";前缀:"+prefix+";后缀:"+suffix);
+      handleLabelChange && handleLabelChange({ikey,changeVal,type:boxMark,totalVal,prefix,suffix,formulaCode});
       // handleSelect&&handleSelect({ikey,text,suffix,prefix,mainSaveText});
       // handleSelect&&handleSelect({ikey,text,suffix,prefix,mainSaveText});
-      handleLabelChange&&handleLabelChange({ikey,changeVal:text,suffix,prefix,mainSaveText,type:boxMark,formulaCode});
+      // handleLabelChange&&handleLabelChange({ikey,changeVal:text,suffix,prefix,mainSaveText,type:boxMark,formulaCode});
       
       
     }
     }
     this.setState({
     this.setState({
@@ -143,9 +152,13 @@ class NumberUnitDrop extends Component{
   }
   }
   changeToEdit(e){        //整个标签双击编辑状态
   changeToEdit(e){        //整个标签双击编辑状态
     e.stopPropagation();
     e.stopPropagation();
-    const {value,id,handleDbclick,patId} = this.props;
+    const {value,id,handleDbclick,patId,handleHide,show} = this.props;
     const text = e.target.innerText || e.target.innerHTML;
     const text = e.target.innerText || e.target.innerHTML;
-    // clearTimeout(this.state.timer);//取消延时的单击事件
+    clearTimeout(this.state.timer);//取消延时的单击事件
+    e.preventDefault();
+    if(show){
+      handleHide&&handleHide();
+    }
     if(value&&value.trim()) {//有选中值的标签才能双击编辑
     if(value&&value.trim()) {//有选中值的标签才能双击编辑
       this.setState({
       this.setState({
         editable: true,
         editable: true,
@@ -153,7 +166,8 @@ class NumberUnitDrop extends Component{
       });
       });
       //失焦关闭编辑状态
       //失焦关闭编辑状态
       setTimeout(()=>{
       setTimeout(()=>{
-        e.target.focus();
+        // e.target.focus();
+        this.$cont.current.focus();
       })
       })
       //双击埋点记录
       //双击埋点记录
       handleDbclick && handleDbclick({id:patId||id});
       handleDbclick && handleDbclick({id:patId||id});
@@ -161,7 +175,8 @@ class NumberUnitDrop extends Component{
   }
   }
   componentDidMount(){
   componentDidMount(){
     if(isIE()){
     if(isIE()){
-      $(this.$span.current).onIe8Input(function(e){
+      // $(this.$span.current).onIe8Input(function(e){
+      $(this.$cont.current).onIe8Input(function(e){
         this.handleSpanInp(e)
         this.handleSpanInp(e)
       },this);
       },this);
     }
     }
@@ -170,17 +185,19 @@ class NumberUnitDrop extends Component{
   render(){
   render(){
     const {placeholder,prefix,suffix,show,value,handleHide} = this.props;
     const {placeholder,prefix,suffix,show,value,handleHide} = this.props;
     const {numEditable,editable,hasSelect,placeholderFlag,boxLeft,boxTop} = this.state;
     const {numEditable,editable,hasSelect,placeholderFlag,boxLeft,boxTop} = this.state;
-    return <div className={this.getClasses()} ref={this.$cont}>
-      <span>{prefix}</span>
-      <span onClick={this.handleNumClick}
-            contentEditable={editable}
-            ref = {this.$span}
-            onBlur={this.numInpBlur}
-            onInput={this.handleSpanInp}
-            onDoubleClick={this.changeToEdit}
+    return <div className={this.getClasses()}
+                ref={this.$cont}
+                onClick={this.handleNumClick}
+                contentEditable={editable}
+                onBlur={this.numInpBlur}
+                onDoubleClick={this.changeToEdit}
+                onkeydown={handleEnter}
+                onInput={this.handleSpanInp}>
+      <span ref = {this.$pre}>{prefix?prefix+' ':prefix}</span>
+      <span ref = {this.$span}
             onkeydown={handleEnter}
             onkeydown={handleEnter}
             style={{cursor:editable?'text':'pointer'}}>{value||placeholder}</span>
             style={{cursor:editable?'text':'pointer'}}>{value||placeholder}</span>
-      <span>{suffix}</span>
+      <span ref = {this.$suf}>{suffix?' '+suffix:suffix}</span>
       <NumberUnitPan handleSelect={(obj)=>this.select(obj)}
       <NumberUnitPan handleSelect={(obj)=>this.select(obj)}
                  onClose={handleHide}
                  onClose={handleHide}
                  top={boxTop}
                  top={boxTop}

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

@@ -166,7 +166,7 @@ class Operation extends Component {
       return false
       return false
     }
     }
     console.log(jsonStr,'文本')
     console.log(jsonStr,'文本')
-    console.log(jsonData.chief,'结构')       //测试需要用到,不要删了
+    console.log(jsonData,'结构')       //测试需要用到,不要删了
     for(let i = 0;i <tmpLis.length;i++){
     for(let i = 0;i <tmpLis.length;i++){
       let dataStr = tmpLis[i].preview;
       let dataStr = tmpLis[i].preview;
       let dataJson = tmpLis[i].dataJson;
       let dataJson = tmpLis[i].dataJson;
@@ -346,4 +346,4 @@ class Operation extends Component {
   }
   }
 }
 }
 
 
-export default Operation;
+export default Operation;

+ 7 - 3
src/components/PreviewBody/index.jsx

@@ -3,6 +3,7 @@ import style from "./index.less";
 import { normalVal, filterDataArr, filterOtherDataArr,timestampToTime } from '@utils/tools';
 import { normalVal, filterDataArr, filterOtherDataArr,timestampToTime } from '@utils/tools';
 import Notify from '@commonComp/Notify';
 import Notify from '@commonComp/Notify';
 import $ from "jquery";
 import $ from "jquery";
+import { relative } from "path";
 
 
 (function ($) {
 (function ($) {
   var opt;
   var opt;
@@ -235,9 +236,12 @@ class PreviewBody extends Component {
               }
               }
               {
               {
                 dataJson.lis.labelList && dataJson.lis.labelList.map((item, idx) => {
                 dataJson.lis.labelList && dataJson.lis.labelList.map((item, idx) => {
-                  if (item.show) {
+                  // if (item.show) {
                     return <table style={{ margin: '8px 0', width: '100%' }}>
                     return <table style={{ margin: '8px 0', width: '100%' }}>
-                      <tr style={{ fontSize: '14px', lineHeight: '1.5' }}><td><span style={{ borderBottom: '1px solid #666666' }}>{item.name}</span></td></tr>
+                      {
+                        item.show?<tr style={{ fontSize: '14px', lineHeight: '1.5' }}><td><span style={{ borderBottom: '1px solid #666666' }}> {item.name} </span></td></tr>:
+                        <tr style={{ fontSize: '14px', lineHeight: '1.5' }}><td><span style={{ position:'relative',left:'-10px' }}>「{item.name}」</span></td></tr>
+                      }
                       {
                       {
                         item.details.map((val) => {
                         item.details.map((val) => {
                           if (val.value && val.value != '') {
                           if (val.value && val.value != '') {
@@ -253,7 +257,7 @@ class PreviewBody extends Component {
                         })
                         })
                       }
                       }
                     </table>
                     </table>
-                  }
+                  // }
                 })
                 })
               }
               }
             </td>
             </td>

+ 20 - 6
src/components/PushItems/index.jsx

@@ -78,12 +78,17 @@ class PushItems extends Component {
       value:''
       value:''
     }
     }
     if(checkedAssay.length > 0){
     if(checkedAssay.length > 0){
-      let assayArr = []
+      let assayArr = [],tmpDetail=[]
       for(let i = 0;i < checkedAssay.length;i++){
       for(let i = 0;i < checkedAssay.length;i++){
         let tmpObj = JSON.parse(JSON.stringify(obj));
         let tmpObj = JSON.parse(JSON.stringify(obj));
+        if (checkedAssay[i].controlType == 0) {
+          tmpDetail = checkedAssay[i].questionMapping
+        }else if(checkedAssay[i].controlType == 1 || checkedAssay[i].controlType == 6){
+          tmpDetail.push(checkedAssay[i])
+        }
         tmpObj.questionId = checkedAssay[i].id
         tmpObj.questionId = checkedAssay[i].id
         tmpObj.name = checkedAssay[i].name
         tmpObj.name = checkedAssay[i].name
-        tmpObj.details = checkedAssay[i].questionMapping
+        tmpObj.details = tmpDetail
         assayArr.push(tmpObj)
         assayArr.push(tmpObj)
       }
       }
       store.dispatch(addLabel(assayArr))
       store.dispatch(addLabel(assayArr))
@@ -98,6 +103,15 @@ class PushItems extends Component {
       }
       }
       store.dispatch(addAssistLabel(checkArr))
       store.dispatch(addAssistLabel(checkArr))
     }
     }
+    if(checkedAssay.length > 0){
+      document.getElementById("inspectResultData").scrollIntoView(true)
+    }else{
+      if(checkedCheck.length > 0){
+        document.getElementById("assistResultData").scrollIntoView(true)
+      }else{
+        return;
+      }
+    }
   }
   }
 
 
   changeAssay(item) {
   changeAssay(item) {
@@ -156,7 +170,7 @@ class PushItems extends Component {
       assayNum = assayNum + item.name.length + 2;
       assayNum = assayNum + item.name.length + 2;
       if (assayNum > 28) {
       if (assayNum > 28) {
         assayNum2 = assayNum2 + item.name.length + 2; 
         assayNum2 = assayNum2 + item.name.length + 2; 
-        if(assayNum2 > 23) {
+        if(assayNum2 > 21) {
           return;
           return;
         } else {
         } else {
           return (
           return (
@@ -208,7 +222,7 @@ class PushItems extends Component {
       checkNum = checkNum + item.name.length + 2;
       checkNum = checkNum + item.name.length + 2;
       if (checkNum > 28) {
       if (checkNum > 28) {
         checkNum2 = checkNum2 + item.name.length + 2; 
         checkNum2 = checkNum2 + item.name.length + 2; 
-        if(checkNum2 > 23) {
+        if(checkNum2 > 21) {
           return;
           return;
         }else {
         }else {
           return (
           return (
@@ -330,7 +344,7 @@ class PushItems extends Component {
                           : moreAssay
                           : moreAssay
                           ? assays
                           ? assays
                           : assayHide}
                           : assayHide}
-                        {assayNum2 > 23 ? (
+                        {assayNum2 > 21 ? (
                           <span
                           <span
                             style={
                             style={
                               moreAssay
                               moreAssay
@@ -368,7 +382,7 @@ class PushItems extends Component {
                           : moreCheck
                           : moreCheck
                           ? checks
                           ? checks
                           : checkHide}
                           : checkHide}
-                        {checkNum2 > 23 ? (
+                        {checkNum2 > 21 ? (
                           <span
                           <span
                             style={
                             style={
                               moreCheck
                               moreCheck

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

@@ -99,14 +99,14 @@ class RadioDrop extends Component{
     },$("#addScrollEvent")[0])
     },$("#addScrollEvent")[0])
   }
   }
   componentDidMount(){    //默认值选中
   componentDidMount(){    //默认值选中
-    const {data,ikey,handleSelect,hideTag} = this.props;
+    const {data,ikey,handleSelect,hideTag,mainSaveText,value} = this.props;
     const selected = data.find((it)=>{
     const selected = data.find((it)=>{
       return it.selected === undefined&&+it.defaultSelect===1;
       return it.selected === undefined&&+it.defaultSelect===1;
     });
     });
     if(!hideTag&&selected){
     if(!hideTag&&selected){
       // const text = selected.labelPrefix+selected.name+selected.labelSuffix;
       // const text = selected.labelPrefix+selected.name+selected.labelSuffix;
       const text = selected.name;
       const text = selected.name;
-      handleSelect&&handleSelect({ikey,id:selected.id,text});
+      handleSelect&&handleSelect({ikey,id:selected.id,text,mainSaveText,value});
     }
     }
   }
   }
   handleEditLabel(e){
   handleEditLabel(e){

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

@@ -78,7 +78,7 @@ class DrugTreat extends Component {
     }
     }
     showTreatDesc() {
     showTreatDesc() {
         $('#treatDescBox').css({'display': 'block'});
         $('#treatDescBox').css({'display': 'block'});
-        $('#treatWrapper').animate({'margin-left': '-470px'}, 300);
+        $('#treatWrapper').animate({'margin-left': '-471px','left':'50%'}, 300);
         $('#treatDescBox').animate({'width': '260px'}, 500);
         $('#treatDescBox').animate({'width': '260px'}, 500);
         
         
     }
     }

+ 18 - 62
src/components/Treat/index.jsx

@@ -3,6 +3,7 @@ import style from './index.less';
 import GeneralTreat from './GeneralTreat/index.jsx';
 import GeneralTreat from './GeneralTreat/index.jsx';
 import DrugTreat from './DrugTreat/index.jsx';
 import DrugTreat from './DrugTreat/index.jsx';
 import TreatDesc from '@components/TreatDesc'
 import TreatDesc from '@components/TreatDesc'
+import {dragBox,windowRemoveEventHandler} from '@utils/tools'
 import DrugInfo from '@components/TreatDesc/DrugInfo';
 import DrugInfo from '@components/TreatDesc/DrugInfo';
 import Notify from '@commonComp/Notify'
 import Notify from '@commonComp/Notify'
 import close from './img/close.png';
 import close from './img/close.png';
@@ -13,70 +14,23 @@ import $ from "jquery";
 class Treat extends Component {
 class Treat extends Component {
     constructor(props){
     constructor(props){
         super(props);
         super(props);
+        this.state = {
+          zIndex:301
+        }
         this.hideTreat = this.hideTreat.bind(this);
         this.hideTreat = this.hideTreat.bind(this);
         this.handlePrescription = this.handlePrescription.bind(this);
         this.handlePrescription = this.handlePrescription.bind(this);
         this.handleDetermine = this.handleDetermine.bind(this);
         this.handleDetermine = this.handleDetermine.bind(this);
+        this.setTreatBox = this.setTreatBox.bind(this);
     }
     }
     componentDidMount(){
     componentDidMount(){
-        let wrap = document.getElementById('treatWrapper')
-        let drag = document.getElementById('dragTreatTitle')
-        let width = $(window).width();
-        let height = $(window).height();
-        let mouseX = 0,mouseY = 0,dragX = 0,dragY = 0,isDrag = false,isMove = false;
-        
-        let maxDragX = width - wrap.offsetWidth
-        let maxDragY = height - wrap.offsetHeight
-        drag.onmousedown = (event)=>{    //鼠标位置获取,计算点击位置到拖拽元素左边的距离
-          let e = event || window.event;
-          mouseX = e.pageX - wrap.offsetLeft
-          mouseY = e.pageY - wrap.offsetTop
-          isDrag = true
-        }
-        document.onmousemove = (event)=>{      //移动的
-          let e = event || window.event;
-          if(isDrag){
-            dragX = e.pageX - mouseX
-            dragY = e.pageY - mouseY
-            if(dragX < 0){      //不能超出左边界
-              dragX = 0
-            }
-            if(dragY < 0){      //不能超出上边界
-              dragY = 0
-            }
-            // if(wrap.offsetLeft >= maxDragX){
-            //   dragX = maxDragX
-            // }else{
-            //   dragX = e.pageX - mouseX
-            // }
-
-            // if(height-drag.offsetHeight > wrap.offsetTop){
-            //   dragY = height-drag.offsetHeight
-            // }
-            isMove = true
-            wrap.style.left = dragX + 'px'
-            wrap.style.marginLeft = 0 + 'px'
-            wrap.style.top = dragY + 'px'
-          }
-        }
-        document.onmouseup = ()=>{
-          if(isMove){
-            wrap.style.left = dragX + 'px'
-            wrap.style.top = dragY + 'px'
-          }else{
-            wrap.style.left = '50%'
-            wrap.style.top = '10%'
-            wrap.style.marginLeft = '-340px'
-          }
-          isDrag = false
-          return false
-        }
+      dragBox('treatWrapper','dragTreatTitle')
     }
     }
+    
     hideTreat() {
     hideTreat() {
         const { hideTreat,clearTreat } = this.props;
         const { hideTreat,clearTreat } = this.props;
         clearTreat && clearTreat();
         clearTreat && clearTreat();
         hideTreat && hideTreat();
         hideTreat && hideTreat();
-        // document.onmousemove = null
-        // document.onmouseup = null
+        // windowRemoveEventHandler('mousemove',handleMove,document)
     }
     }
     handlePrescription() {
     handlePrescription() {
         Notify.info('该功能即将上线,敬请期待。', 2000)
         Notify.info('该功能即将上线,敬请期待。', 2000)
@@ -91,16 +45,22 @@ class Treat extends Component {
         const {  showDrugInfo } = this.props;
         const {  showDrugInfo } = this.props;
         showDrugInfo && showDrugInfo();
         showDrugInfo && showDrugInfo();
     }
     }
-
+    setTreatBox(idx){
+      this.setState({
+        zIndex:idx == 300?300 : 500
+      })
+    }
     render(){
     render(){
         const { generalTreat, treatment, treatItem, surgeryTreat, selectDrug, drugInfo, treatDesc, setOtherRecommend, setDrugInfo, showDrug, showDrugInfo,hideDrugInfo, title, drugInfoList, hideDrugInfoMore} = this.props;
         const { generalTreat, treatment, treatItem, surgeryTreat, selectDrug, drugInfo, treatDesc, setOtherRecommend, setDrugInfo, showDrug, showDrugInfo,hideDrugInfo, title, drugInfoList, hideDrugInfoMore} = this.props;
         const { setDrugInfoMore } = this.props
         const { setDrugInfoMore } = this.props
+        const { zIndex } = this.state
         return(
         return(
             <div   className={style['treat-wrapper']}>
             <div   className={style['treat-wrapper']}>
                 <div className={style['treat-mask']} onClick={this.hideTreat}>
                 <div className={style['treat-mask']} onClick={this.hideTreat}>
                 </div>
                 </div>
-                <div id="treatWrapper" className={style['treat-box']}  onselectstart="return false">
-                    <div id="dragTreatTitle" className={style['treat-title']}>治疗方案 ({treatItem.name})<img onClick={this.hideTreat} src={close}/></div>
+                <div id="treatWrapper" className={style['treat-box']}  onselectstart="return false" style={{zIndex:zIndex}}>
+                    <img className={style.close} onClick={this.hideTreat} src={close}/>
+                    <div onMouseDown={this.setTreatBox} id="dragTreatTitle" className={style['treat-title']}>治疗方案 ({treatItem.name})</div>
 
 
                     <div className={style['treat-inner-box']}>
                     <div className={style['treat-inner-box']}>
                         <GeneralTreat icon={generalIcon} title='一般治疗'   generalTreat={generalTreat}></GeneralTreat>
                         <GeneralTreat icon={generalIcon} title='一般治疗'   generalTreat={generalTreat}></GeneralTreat>
@@ -128,14 +88,10 @@ class Treat extends Component {
                     </TreatDesc>}
                     </TreatDesc>}
                 </div>
                 </div>
                 
                 
-                
-                {showDrug && drugInfo && <DrugInfo drugInfo = {drugInfo} hideDrugInfo = {hideDrugInfo}></DrugInfo>}
+                {showDrug && drugInfo && <DrugInfo setTreatBox={this.setTreatBox} drugInfo = {drugInfo} hideDrugInfo = {hideDrugInfo}></DrugInfo>}
                 {/* 查询多个药品说明书 (添加数据查看药品说明书用)*/}
                 {/* 查询多个药品说明书 (添加数据查看药品说明书用)*/}
                 {/* {showDrug && <DrugInfo drugInfoList = {drugInfoList} hideDrugInfoMore = {hideDrugInfoMore}></DrugInfo>} */}
                 {/* {showDrug && <DrugInfo drugInfoList = {drugInfoList} hideDrugInfoMore = {hideDrugInfoMore}></DrugInfo>} */}
             </div>
             </div>
-                
-            
-        
         )
         )
     }
     }
 }
 }

+ 7 - 0
src/components/Treat/index.less

@@ -14,6 +14,12 @@
     // z-index: 301;
     // z-index: 301;
     z-index: 300;
     z-index: 300;
 }
 }
+.close {
+  position: absolute;
+  z-index:9999;
+  top: 0;
+  right: 0;
+}
 .treat-mask {
 .treat-mask {
     position: fixed;
     position: fixed;
     width: 100%;
     width: 100%;
@@ -37,6 +43,7 @@
     z-index: 301;
     z-index: 301;
     padding-top: 40px;
     padding-top: 40px;
     padding-bottom: 80px;
     padding-bottom: 80px;
+    box-shadow: 2px 0px 5px -2px #ccc;
 }
 }
 .treat-title {
 .treat-title {
     width: 100%;
     width: 100%;

+ 18 - 10
src/components/TreatDesc/DrugInfo/index.jsx

@@ -2,14 +2,20 @@ import React, { Component } from 'react';
 import style from './index.less';
 import style from './index.less';
 import close from './../img/close.png';
 import close from './../img/close.png';
 import $ from "jquery";
 import $ from "jquery";
+import {dragBox} from '@utils/tools'
 
 
 
 
 class DrugInfo extends Component {
 class DrugInfo extends Component {
     constructor(props) {
     constructor(props) {
         super(props);
         super(props);
         this.state = {
         this.state = {
-            currentIndex: 0
+            currentIndex: 0,
+            zIndex:301
         }
         }
+        this.setDragBox = this.setDragBox.bind(this)
+    }
+    componentDidMount(){
+      dragBox('drugWrapper','drugTitle')
     }
     }
     handleClickMenu(index, item, drugDesc) {
     handleClickMenu(index, item, drugDesc) {
         const that = this
         const that = this
@@ -40,12 +46,19 @@ class DrugInfo extends Component {
             }
             }
         }
         }
     }
     }
-
+    setDragBox(){
+      const {zIndex,setTreatBox} = this.props
+      setTreatBox(300)
+      this.setState({
+        zIndex:zIndex+10
+      })
+    }
     render() {
     render() {
         const { drugInfo, hideDrugInfo, drugInfoList,hideDrugInfoMore } = this.props
         const { drugInfo, hideDrugInfo, drugInfoList,hideDrugInfoMore } = this.props
-        const { currentIndex } = this.state
-        return (<div className={style['drug-info-wrapper']}>
-                <h3 className={style['drug-title']}>{drugInfo.title}说明书  <img src={close} onClick={hideDrugInfo} className={style['close-drug-desc']}/> </h3>
+        const { currentIndex,zIndex } = this.state
+        return (<div className={style['drug-info-wrapper']} id="drugWrapper" style={{zIndex:zIndex}}>
+                <img src={close} onClick={hideDrugInfo} className={style['close-drug-desc']}/>
+                <h3 onMouseDown={this.setDragBox} id="drugTitle" className={style['drug-title']}>{drugInfo.title}说明书  </h3>
                 { drugInfo && drugInfo.drugDesc.length > 0 && <div className={style['drug-desc-wrapper']} id='drugDesc' onScroll={this.handleScrollModal.bind(this,  drugInfo.drugDesc)}>
                 { drugInfo && drugInfo.drugDesc.length > 0 && <div className={style['drug-desc-wrapper']} id='drugDesc' onScroll={this.handleScrollModal.bind(this,  drugInfo.drugDesc)}>
                     <div className={style['drug-title1']} >{drugInfo.title}说明书</div>
                     <div className={style['drug-title1']} >{drugInfo.title}说明书</div>
                     {drugInfo.drugDesc.map((item, index) =>{
                     {drugInfo.drugDesc.map((item, index) =>{
@@ -55,7 +68,6 @@ class DrugInfo extends Component {
                         </div>
                         </div>
                     })}
                     })}
                     <div className={style['content-menu-box']}>
                     <div className={style['content-menu-box']}>
-                        
                         <div className={style['content-menu']}>
                         <div className={style['content-menu']}>
                             {drugInfo.drugDesc.map((item, index) => {
                             {drugInfo.drugDesc.map((item, index) => {
                                 return (<div >
                                 return (<div >
@@ -67,18 +79,14 @@ class DrugInfo extends Component {
                                     </div>
                                     </div>
                                 </div>)
                                 </div>)
                             })}
                             })}
-
                         </div>
                         </div>
-                    
                     </div>
                     </div>
                 </div> }
                 </div> }
                 { !drugInfo || (drugInfo && drugInfo.drugDesc.length === 0) && <div className={style['drug-desc-wrapper']}>
                 { !drugInfo || (drugInfo && drugInfo.drugDesc.length === 0) && <div className={style['drug-desc-wrapper']}>
                     <div>
                     <div>
                         该药品暂无说明
                         该药品暂无说明
                     </div>
                     </div>
-                    
                 </div> }
                 </div> }
-
         </div>)
         </div>)
 
 
 
 

+ 11 - 1
src/components/TreatDesc/DrugInfo/index.less

@@ -9,7 +9,7 @@
     background: #fff;
     background: #fff;
     z-index: 303;
     z-index: 303;
     padding: 40px 0 60px;
     padding: 40px 0 60px;
-    
+    box-shadow: 2px 0px 5px -2px #ccc;
 }
 }
 .drug-desc-wrapper {
 .drug-desc-wrapper {
     height: 100%;
     height: 100%;
@@ -24,10 +24,20 @@
     line-height: 40px;
     line-height: 40px;
     padding: 0 40px;
     padding: 0 40px;
     border-bottom: 1px solid #979797;
     border-bottom: 1px solid #979797;
+    cursor: move;
+    moz-user-select: -moz-none;
+    -moz-user-select: none;
+    -o-user-select:none;
+    -khtml-user-select:none;
+    -webkit-user-select:none;
+    -ms-user-select:none;
+    user-select:none;
 }
 }
 .close-drug-desc {
 .close-drug-desc {
     position: absolute;
     position: absolute;
     right: 0;
     right: 0;
+    top: 0;
+    z-index: 9999;
     width: 40px;
     width: 40px;
 }
 }
 .drug-desc-item {
 .drug-desc-item {

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

@@ -25,7 +25,7 @@ class TreatDesc extends Component {
     }
     }
 
 
     handleMouseEnterDrug( index, item) {
     handleMouseEnterDrug( index, item) {
-        console.log('item', item)
+        // console.log('item', item)
         const drugNameWidth = parseInt($('#'+item.medicitionName)[0].offsetWidth)
         const drugNameWidth = parseInt($('#'+item.medicitionName)[0].offsetWidth)
         
         
         const imgLeft = drugNameWidth/2-10
         const imgLeft = drugNameWidth/2-10
@@ -58,7 +58,7 @@ class TreatDesc extends Component {
     hideTreatDesc() {
     hideTreatDesc() {
         $('#treatDescBox').css({'display': 'none'});
         $('#treatDescBox').css({'display': 'none'});
         $('#treatDescBox').animate({'display': 'none'}, 500);
         $('#treatDescBox').animate({'display': 'none'}, 500);
-        $('#treatWrapper').animate({'margin-left': '-340px'}, 500);
+        $('#treatWrapper').animate({'margin-left': '-340px','left':'50%'}, 500);
     }
     }
 
 
     render(){
     render(){

+ 1 - 0
src/components/TreatDesc/index.less

@@ -45,6 +45,7 @@
     top: 0;
     top: 0;
     background: #fff;
     background: #fff;
     padding: 60px 20px 80px;
     padding: 60px 20px 80px;
+    box-shadow: 2px 0px 5px -2px #ccc;
 }
 }
 .drug-name-box {
 .drug-name-box {
     display: inline-block;
     display: inline-block;

+ 3 - 2
src/config/index.js

@@ -26,7 +26,7 @@ export default {
     addOthSId:21,      //现病史 添加其他症状id
     addOthSId:21,      //现病史 添加其他症状id
     banId:10,       //伴 id
     banId:10,       //伴 id
     limited:30,    //主诉限制字数
     limited:30,    //主诉限制字数
-    limitText:"已超过30字符,请修改主诉",    //主诉限制提示
+    limitText:"已超过30字符(含标点),请修改主诉",    //主诉限制提示
     delayTime:500,      //延迟搜索的时间
     delayTime:500,      //延迟搜索的时间
     delayPushTime:1000,    //延迟推送时间
     delayPushTime:1000,    //延迟推送时间
     pushDelay:1000,
     pushDelay:1000,
@@ -44,5 +44,6 @@ export default {
     },
     },
     showCheckNum:16,        //查体默认展开非自由文本标签的个数
     showCheckNum:16,        //查体默认展开非自由文本标签的个数
     radioOptionPer:'()',     //单选项输入占位符
     radioOptionPer:'()',     //单选项输入占位符
-    Params
+    textReg:new RegExp("([\u4E00-\uFA29]|[\uE7C7-\uE7F3]|[a-zA-Z0-9])"), //包含中英文或数字
+  Params
 };
 };

+ 1 - 0
src/containers/AdviceContainer.js

@@ -7,6 +7,7 @@ function mapStateToProps(state) {
     return ({
     return ({
         pushMessage: state.pushMessage,
         pushMessage: state.pushMessage,
         isRead:state.homePage.isRead,
         isRead:state.homePage.isRead,
+        adviceInput: state.pushMessage.advice.adviceInput
     })
     })
 }
 }
 
 

+ 4 - 1
src/containers/CurrentIll.js

@@ -41,6 +41,7 @@ function mapStateToProps(state) { //console.log(111,state);
         fuzhen:state.diagnosticList.mainSuitStr,//诊断第一个复诊值
         fuzhen:state.diagnosticList.mainSuitStr,//诊断第一个复诊值
         boxTop:state.homePage.boxTop,
         boxTop:state.homePage.boxTop,
         boxLeft:state.homePage.boxLeft,
         boxLeft:state.homePage.boxLeft,
+        allModules:state.homePage.allModules,
 
 
     }
     }
 }
 }
@@ -48,7 +49,7 @@ function mapStateToProps(state) { //console.log(111,state);
 
 
 function mapDispatchToProps(dispatch) {
 function mapDispatchToProps(dispatch) {
     return {
     return {
-       insertProcess(obj){//点击病程变化
+       insertProcess(obj,allModules){//点击病程变化
         // 埋点dispatch
         // 埋点dispatch
         dispatch({
         dispatch({
           type:CLICKCOUNT,
           type:CLICKCOUNT,
@@ -58,6 +59,8 @@ function mapDispatchToProps(dispatch) {
         });
         });
         dispatch({
         dispatch({
           type:INSERT_PROCESS,
           type:INSERT_PROCESS,
+          id:obj.relationModule,
+          allModules:allModules
         });
         });
         dispatch({
         dispatch({
           type:ISREAD
           type:ISREAD

+ 1 - 1
src/containers/Inspect.js

@@ -4,7 +4,7 @@ import Inspect from '@components/Inspect';
 import {getSearchList,getSublableList} from '@store/async-actions/inspect';
 import {getSearchList,getSublableList} from '@store/async-actions/inspect';
 import {setLabel,fillActived,fillActiveDetail,checkValueIsChange,delExcelLis,clearLabel,delPartItem} from '@store/actions/inspect';
 import {setLabel,fillActived,fillActiveDetail,checkValueIsChange,delExcelLis,clearLabel,delPartItem} from '@store/actions/inspect';
 import {billing} from '@store/async-actions/pushMessage';
 import {billing} from '@store/async-actions/pushMessage';
-function mapStateToProps(state) {
+function mapStateToProps(state) {//console.log(state)
     return {
     return {
         list:state.inspect.list,
         list:state.inspect.list,
         labelList:state.inspect.labelList,
         labelList:state.inspect.labelList,

+ 5 - 2
src/containers/MainSuit.js

@@ -37,6 +37,7 @@ function mapStateToProps(state) {//console.log(11,state);
     boxTop:state.homePage.boxTop,
     boxTop:state.homePage.boxTop,
     boxLeft:state.homePage.boxLeft,
     boxLeft:state.homePage.boxLeft,
     currentData:state.currentIll.data,
     currentData:state.currentIll.data,
+    allModules:state.homePage.allModules,
   }
   }
 }
 }
 
 
@@ -55,7 +56,7 @@ function mapDispatchToProps(dispatch) {
             type: CLEAR_COMSYMPTOMS
             type: CLEAR_COMSYMPTOMS
           })
           })
         },
         },
-        handleTailClick:(obj,saveText)=>{//点击带尾巴的标签,如添加病程变化
+        handleTailClick:(obj,saveText,allModules)=>{//点击带尾巴的标签,如添加病程变化
           let text = filterDataArr(saveText);
           let text = filterDataArr(saveText);
           if(text.length >= config.limited){
           if(text.length >= config.limited){
             Notify.info(config.limitText);
             Notify.info(config.limitText);
@@ -70,7 +71,9 @@ function mapDispatchToProps(dispatch) {
           });
           });
           dispatch({
           dispatch({
             type: SHOW_TAIL,
             type: SHOW_TAIL,
-            info:obj.questionMapping
+            info:obj.questionMapping,
+            id:obj.relationModule,
+            allModules:allModules
           })
           })
           dispatch({
           dispatch({
             type:ISREAD
             type:ISREAD

+ 24 - 8
src/containers/NumberUnitDrop.js

@@ -15,6 +15,7 @@ import config from '@config/index.js';
 function mapStateToProps(state){
 function mapStateToProps(state){
   return {
   return {
     mainSaveText:state.mainSuit.saveText,
     mainSaveText:state.mainSuit.saveText,
+    mainData:state.mainSuit.data,
   }
   }
 }
 }
 //查体数字键盘选中
 //查体数字键盘选中
@@ -47,13 +48,22 @@ function currentSelect(dispatch,params){
 }
 }
 
 
 function handleModuleDiff(dispatch,params){
 function handleModuleDiff(dispatch,params){
-  const {mainSaveText,mark} = params;
+  const {mainSaveText,mark,mainData} = params;
   const type = params.ikey.substr(0,1);    //当前所在的项目
   const type = params.ikey.substr(0,1);    //当前所在的项目
+  let ikey = getLabelIndex(params.ikey);
   switch (+type){
   switch (+type){
     case 1:
     case 1:
       if(mark){//选中才限制,清空和回退无需验证
       if(mark){//选中才限制,清空和回退无需验证
-        let text = filterDataArr(mainSaveText);
-        if(text.length >= config.limited){
+        // let text = filterDataArr(mainSaveText);
+        let text = filterArr(mainSaveText);
+        const item = mainData[+ikey];
+        const nextItem = mainData[+ikey+1];
+        let lengths = text.length;
+        if(nextItem&&nextItem.tagType==8 && nextItem.tagName==',' && item.value){
+          lengths = text.length + 1;
+        }
+        // console.log(999,mainSaveText,lengths);
+        if(lengths >= config.limited){
           Notify.info(config.limitText);
           Notify.info(config.limitText);
           return
           return
         }
         }
@@ -80,7 +90,8 @@ function mainSuitLabel(dispatch,params){
   const {changeVal,totalVal} = params;
   const {changeVal,totalVal} = params;
   dispatch({
   dispatch({
     type:CHANGE_LABELVAL,
     type:CHANGE_LABELVAL,
-    data:{changeVal:changeVal,ikey:ikey,totalVal}
+    // data:{changeVal:changeVal,ikey:ikey,totalVal}
+    data:Object.assign({},params,{ikey})
   })
   })
 }
 }
 // 现病史
 // 现病史
@@ -89,7 +100,8 @@ function currentLabel(dispatch,params){
   let ikey = getLabelIndex(index);
   let ikey = getLabelIndex(index);
   dispatch({
   dispatch({
     type:CURRENT_TEXT_LABEL,
     type:CURRENT_TEXT_LABEL,
-    data:{changeVal:params.changeVal,ikey:ikey}
+    // data:{changeVal:params.changeVal,ikey:ikey}
+    data:Object.assign({},params,{ikey})
   })
   })
 }
 }
 
 
@@ -100,7 +112,8 @@ function otherHisLabelEdit(dispatch,params){
   let ikey = getLabelIndex(index);
   let ikey = getLabelIndex(index);
   dispatch({
   dispatch({
     type:CHANGEOTHERTEXTLABEL,
     type:CHANGEOTHERTEXTLABEL,
-    data:{changeVal:changeVal,ikey:ikey,totalVal}
+    // data:{changeVal:changeVal,ikey:ikey,totalVal}
+    data:Object.assign({},params,{ikey})
   })
   })
 }
 }
 
 
@@ -111,7 +124,8 @@ function checkBodyLabelEdit(dispatch,params){
   const {changeVal,totalVal} = params;
   const {changeVal,totalVal} = params;
   dispatch({
   dispatch({
     type:CHANGECHECKTEXTLABEL,
     type:CHANGECHECKTEXTLABEL,
-    data:{changeVal:changeVal,ikey:ikey,totalVal}
+    // data:{changeVal:changeVal,ikey:ikey,totalVal}
+    data:Object.assign({},params,{ikey})
   })
   })
 }
 }
 function mapDispatchToProps(dispatch,store){
 function mapDispatchToProps(dispatch,store){
@@ -131,7 +145,9 @@ function mapDispatchToProps(dispatch,store){
           type:ISREAD
           type:ISREAD
         })
         })
       }
       }
-      
+      dispatch({
+        type: ISREAD
+      });
     },
     },
     handleDbclick(obj){
     handleDbclick(obj){
       dispatch({
       dispatch({

+ 14 - 8
src/containers/SpreadDrop.js

@@ -136,7 +136,7 @@ function currentIll(dispatch,store,params){
   let existsId = exists && exists.length>0?getIds(exists):[];
   let existsId = exists && exists.length>0?getIds(exists):[];
   let withsId = withs && withs.length>0?getIds(withs):[];
   let withsId = withs && withs.length>0?getIds(withs):[];
   // const ids = existsId.join(",")+withsId.join(",");
   // const ids = existsId.join(",")+withsId.join(",");
-  const ids = (existsId.concat(withsId)).join(",");console.log("点击的下标是:",index,"选中的id是:",ids)
+  const ids = (existsId.concat(withsId)).join(",");
   let has = [],wes=[];
   let has = [],wes=[];
   //获取选中项目模板
   //获取选中项目模板
   fetchModules(ids).then((res)=>{
   fetchModules(ids).then((res)=>{
@@ -292,8 +292,10 @@ function handleModuleDiff(dispatch,store,params){
 
 
 //主诉普通多选确定
 //主诉普通多选确定
 function mainSuitCheck(dispatch,store,params){
 function mainSuitCheck(dispatch,store,params){
-  const {nones,exists,withs,order,mainSaveText,value} = params;
+  const {nones,exists,withs,order,mainSaveText,value,ikey} = params;
   let existsName = getNames(exists,order);
   let existsName = getNames(exists,order);
+  let withsName = getNames(withs);
+  let labelInx = getLabelIndex(ikey);
   let text = filterDataArr(mainSaveText);
   let text = filterDataArr(mainSaveText);
   /*if(text.length >= config.limited){
   /*if(text.length >= config.limited){
     Notify.info(config.limitText);
     Notify.info(config.limitText);
@@ -305,11 +307,12 @@ function mainSuitCheck(dispatch,store,params){
     Notify.info(config.limitText);
     Notify.info(config.limitText);
     return
     return
   }
   }
-  const index = params.ikey;
-  let ikey = getLabelIndex(index);
+  // const index = params.ikey;
+  // let ikey = getLabelIndex(index);
   dispatch({
   dispatch({
     type: COMM_CONFIRM,
     type: COMM_CONFIRM,
-    data: {exists:exists,existsName:existsName,ikey}
+    // data: {exists:exists,existsName:existsName,ikey}
+    data:Object.assign({},params,{existsName,withsName,labelInx})
   });
   });
   dispatch({//隐藏下拉
   dispatch({//隐藏下拉
     type:HIDEDROP
     type:HIDEDROP
@@ -324,7 +327,8 @@ function currentCheck(dispatch,store,params){
   let labelInx = getLabelIndex(ikey);
   let labelInx = getLabelIndex(ikey);
   dispatch({
   dispatch({
     type:SETMAINCHECKBOX,
     type:SETMAINCHECKBOX,
-    data:{labelInx,ikey,exclusion,excluName,nones,exists,existsName,noneIds,noneOn,nowOn,withOn,withs,withsName}
+    // data:{labelInx,ikey,exclusion,excluName,nones,exists,existsName,noneIds,noneOn,nowOn,withOn,withs,withsName}
+    data:Object.assign({},params,{existsName,withsName,labelInx})
   })
   })
 }
 }
 
 
@@ -337,7 +341,8 @@ function checkBodyCheck(dispatch,store,params){
   let labelInx = getLabelIndex(ikey);
   let labelInx = getLabelIndex(ikey);
   dispatch({
   dispatch({
     type:SETCHECKBOX,
     type:SETCHECKBOX,
-    data:{labelInx,ikey,exclusion,excluName,nones,exists,existsName,noneIds,noneOn,nowOn,withOn,withs,withsName}
+    // data:{labelInx,ikey,exclusion,excluName,nones,exists,existsName,noneIds,noneOn,nowOn,withOn,withs,withsName}
+    data:Object.assign({},params,{existsName,withsName,labelInx})
   })
   })
 }
 }
 //其他史普通多选确定
 //其他史普通多选确定
@@ -348,7 +353,8 @@ function otherHisCheck(dispatch,store,params){
   let labelInx = getLabelIndex(ikey);
   let labelInx = getLabelIndex(ikey);
   dispatch({
   dispatch({
     type:SETOTHERCHECKBOX,
     type:SETOTHERCHECKBOX,
-    data:{labelInx,ikey,exclusion,excluName,nones,exists,existsName,noneIds,noneOn,nowOn,withOn,withs,withsName}
+    // data:{labelInx,ikey,exclusion,excluName,nones,exists,existsName,noneIds,noneOn,nowOn,withOn,withs,withsName}
+    data:Object.assign({},params,{existsName,withsName,labelInx})
   })
   })
 }
 }
 
 

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

@@ -235,8 +235,8 @@ export function setCheckText(state,action) {
 //多选文字,如杂音
 //多选文字,如杂音
 export function setCheckBoxValue(state,action) {
 export function setCheckBoxValue(state,action) {
   let res = Object.assign({},state);
   let res = Object.assign({},state);
-  const {labelInx,excluName,existsName,nones,withsName} = action.data;
-  let showText = (excluName||'')+(existsName||'')+(nones||'')+(withsName||'');
+  const {labelInx,excluName,existsName,nones,withsName,ban} = action.data;
+  let showText = (excluName||'')+(existsName||'')+(ban.name||'')+(withsName||'')+(nones&&nones.replace('、','')||'');
   // 若每个选项都有符号,去掉最后一个,因与标签间的符号有冲突
   // 若每个选项都有符号,去掉最后一个,因与标签间的符号有冲突
   let pattern = new RegExp(/\,+$|\,+$|\.+$|\。+$|\、+$/);//+ 一次或多次
   let pattern = new RegExp(/\,+$|\,+$|\.+$|\。+$|\、+$/);//+ 一次或多次
   if(pattern.test(showText)){
   if(pattern.test(showText)){

+ 49 - 30
src/store/actions/currentIll.js

@@ -1,5 +1,6 @@
 import {getLabelIndex,fullfillText,getIds} from '@common/js/func.js';
 import {getLabelIndex,fullfillText,getIds} from '@common/js/func.js';
 import config from '@config/index.js';
 import config from '@config/index.js';
+import {getInitModules} from '@store/async-actions/homePage.js';
 
 
 //插入病程变化模板
 //插入病程变化模板
 function insertPro(data,processModule){
 function insertPro(data,processModule){
@@ -38,12 +39,23 @@ export const setModule = (state,action)=>{
 //插入病程变化
 //插入病程变化
 export const insertProcess = (state,action)=>{
 export const insertProcess = (state,action)=>{
   const res = Object.assign({},state);
   const res = Object.assign({},state);
-  const processModule = JSON.parse(JSON.stringify(res.processModule));
+  const sonId = action.id;//子模板id
+  // const processModule = JSON.parse(JSON.stringify(res.processModule));
+  let addSmoduleData;
+  // let allModules = JSON.parse(localStorage.getItem('modules'));
+  let allModules = action.allModules;
+  for(let k=0; k<allModules.length; k++){
+    if(allModules[k].id==sonId){
+      addSmoduleData = JSON.parse(JSON.stringify(allModules[k].moduleDetailDTOList));
+    }
+  }
   let data = res.data;
   let data = res.data;
-  res.data = insertPro(data,processModule);
+  let newData = insertPro(data,addSmoduleData);
+  res.data = fullfillText(newData).newArr;
   res.saveText = fullfillText(res.data).saveText;
   res.saveText = fullfillText(res.data).saveText;
   res.update=Math.random();
   res.update=Math.random();
   return res;
   return res;
+
 }
 }
 
 
 
 
@@ -63,12 +75,10 @@ export const setData = (state,action) =>{
   res.symptomIds = JSON.parse(JSON.stringify(mainIds));
   res.symptomIds = JSON.parse(JSON.stringify(mainIds));
   const num = action.info.num;//点击了几次添加病情变化
   const num = action.info.num;//点击了几次添加病情变化
   const symptomFeature = action.info.symptomFeature;//分词
   const symptomFeature = action.info.symptomFeature;//分词
-  // const useEmpty = action.info.useEmpty;
   let useEmpty,mainData;
   let useEmpty,mainData;
-  // let mainData = JSON.parse(JSON.stringify(action.info.mainData));//主诉模板数据
   let mainModleData = JSON.parse(JSON.stringify(action.info.mainData));//主诉模板数据
   let mainModleData = JSON.parse(JSON.stringify(action.info.mainData));//主诉模板数据
   let moduleData = JSON.parse(JSON.stringify(res.moduleData));//现病史模板
   let moduleData = JSON.parse(JSON.stringify(res.moduleData));//现病史模板
-  let addModule = JSON.parse(JSON.stringify(res.addModule));//拷贝的模板
+  // let addModule = JSON.parse(JSON.stringify(res.addModule));//拷贝的模板
   let current = JSON.parse(JSON.stringify(moduleData));
   let current = JSON.parse(JSON.stringify(moduleData));
   let newMain = [];
   let newMain = [];
   let mainLabelModule = res.mainLabelModule;//主诉选中的症状id获取到的模板
   let mainLabelModule = res.mainLabelModule;//主诉选中的症状id获取到的模板
@@ -102,7 +112,7 @@ export const setData = (state,action) =>{
     })
     })
     useEmpty = existData&&existData.length>0?false:true;
     useEmpty = existData&&existData.length>0?false:true;
   }
   }
-  // console.log(888,useEmpty);
+  
   if (useEmpty) {
   if (useEmpty) {
     // res.data = res.emptyData;
     // res.data = res.emptyData;
     res.data = JSON.parse(JSON.stringify(res.emptyData));
     res.data = JSON.parse(JSON.stringify(res.emptyData));
@@ -137,12 +147,8 @@ export const setData = (state,action) =>{
       // 主症状添加tongYong标签选中文字
       // 主症状添加tongYong标签选中文字
       let tongYText = tongYong?{name:tongYong,value:tongYong,tagType:config.tagType}:'';
       let tongYText = tongYong?{name:tongYong,value:tongYong,tagType:config.tagType}:'';
       let mainCopy = JSON.parse(JSON.stringify(main));
       let mainCopy = JSON.parse(JSON.stringify(main));
-      /*if(tongYText){
-        for(let j=0; j<mainCopy.length; j++){
-          mainCopy[j].name = tongYong + (mainCopy[j].name).replace('、',"");
-          mainCopy[j].value = tongYong + (mainCopy[j].value).replace('、',"");
-        }
-      }*/
+      let manInput = [];
+      // 去掉主诉添加的顿号 
       for(let j=0; j<mainCopy.length; j++){
       for(let j=0; j<mainCopy.length; j++){
         if(tongYText){
         if(tongYText){
           mainCopy[j].name = tongYong + (mainCopy[j].name).replace('、',"");
           mainCopy[j].name = tongYong + (mainCopy[j].name).replace('、',"");
@@ -150,11 +156,18 @@ export const setData = (state,action) =>{
         }else{
         }else{
           mainCopy[j].name = (mainCopy[j].name).replace('、',"");
           mainCopy[j].name = (mainCopy[j].name).replace('、',"");
           mainCopy[j].value = (mainCopy[j].value).replace('、',"");
           mainCopy[j].value = (mainCopy[j].value).replace('、',"");
+        }  
+        //查询是否有手动输入--输入的内容放到最后(3-27)
+        if(mainCopy[j].name != mainCopy[j].value){
+          const inputText = mainCopy[j].value.replace(mainCopy[j].name,"");
+          const textObj = Object.assign({},JSON.parse(config.textLabel),{name:inputText});
+          if(config.textReg.test(inputText)){//包含中英文或数字->即不全是标点符号才插入
+             manInput.push(textObj);
+          }
+          mainCopy[j].value = mainCopy[j].name;
         }
         }
-        
       }
       }
 
 
-
        // 将ids接口获取到的模板匹配到对应主症状后面
        // 将ids接口获取到的模板匹配到对应主症状后面
       // 主症状
       // 主症状
       let newMainCopy = JSON.parse(JSON.stringify(mainCopy));
       let newMainCopy = JSON.parse(JSON.stringify(mainCopy));
@@ -174,7 +187,8 @@ export const setData = (state,action) =>{
               if(items.length==0){//没有尾巴时给症状后加逗号(3.5)
               if(items.length==0){//没有尾巴时给症状后加逗号(3.5)
                 for(let j=0; j<newMainCopy.length; j++){
                 for(let j=0; j<newMainCopy.length; j++){
                   if(newMainCopy[j].id==mainCopy[k].id){
                   if(newMainCopy[j].id==mainCopy[k].id){
-                    newMainCopy[j].value = newMainCopy[j].name = mainCopy[k].value+',';
+                    // newMainCopy[j].value = newMainCopy[j].name = mainCopy[k].value+',';
+                    newMainCopy[j].value = newMainCopy[j].name = mainCopy[k].value||mainCopy[k].name+',';
                   }
                   }
                 }
                 }
               }       
               }       
@@ -192,15 +206,20 @@ 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));
       let newWiths = [];
       let newWiths = [];
+      let manWithInput = [];
       if(withs.length>0){
       if(withs.length>0){
         for(let b=0; b<withs.length; b++){
         for(let b=0; b<withs.length; b++){
           withs[b].name = withs[b].name.replace('、',"");
           withs[b].name = withs[b].name.replace('、',"");
           withs[b].value = withs[b].value.replace('、',"");
           withs[b].value = withs[b].value.replace('、',"");
+          if(withs[b].name != withs[b].value){
+            const inputText = withs[b].value.replace(withs[b].name,"");
+            const textObj = Object.assign({},JSON.parse(config.textLabel),{name:inputText});
+            if(config.textReg.test(inputText)){//包含中英文或数字->即不全是标点符号才插入
+              manWithInput.push(textObj);
+            }           
+            withs[b].value = withs[b].name;  
+          }
         }
         }
         newWiths = JSON.parse(JSON.stringify(withs));
         newWiths = JSON.parse(JSON.stringify(withs));
         let withInd = 0;
         let withInd = 0;
@@ -221,8 +240,9 @@ export const setData = (state,action) =>{
               withLengArr[d] = items.length;
               withLengArr[d] = items.length;
               if(items.length==0){//没有尾巴时给症状后加逗号(3.5)
               if(items.length==0){//没有尾巴时给症状后加逗号(3.5)
                 for(let j=0; j<newWiths.length; j++){
                 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(newWiths[j].id==withs[d].id){
+                    // newWiths[j].value = newWiths[j].name = withs[d].value+',';
+                    newWiths[j].value = newWiths[j].name = withs[d].value||withs[d].name+',';
                   }
                   }
                 }
                 }
               }
               }
@@ -235,7 +255,7 @@ export const setData = (state,action) =>{
         }
         }
       }
       }
       
       
-      let symptomArr = newMainCopy.concat(newWiths);
+      let symptomArr = newMainCopy.concat(manInput,newWiths,manWithInput);
       let newSymptomArr = JSON.parse(JSON.stringify(symptomArr));  
       let newSymptomArr = JSON.parse(JSON.stringify(symptomArr));  
       //组装好的主症状和伴随症状插入现病史模板(flag=4前)
       //组装好的主症状和伴随症状插入现病史模板(flag=4前)
       let insertIdx = null;
       let insertIdx = null;
@@ -269,7 +289,7 @@ export const setData = (state,action) =>{
               if(items.length==0){//没有尾巴时给症状后加逗号(3.5)
               if(items.length==0){//没有尾巴时给症状后加逗号(3.5)
                 for(let j=0; j<featureData.length; j++){
                 for(let j=0; j<featureData.length; j++){
                   if(featureData[j].id==symptomFeature[k].id){
                   if(featureData[j].id==symptomFeature[k].id){
-                    featureData[j].value = featureData[j].name = symptomFeature[k].value+',';
+                    featureData[j].value = featureData[j].name = symptomFeature[k].value||symptomFeature[k].name+',';
                   }
                   }
                 }
                 }
               }
               }
@@ -361,16 +381,15 @@ export const confirm = (state,action) =>{
 //普通多选确定事件-主诉通用特征、初为后为等
 //普通多选确定事件-主诉通用特征、初为后为等
 export const setCheckBox = (state,action)=>{
 export const setCheckBox = (state,action)=>{
   const res = Object.assign({},state);
   const res = Object.assign({},state);
-  const {exists,labelInx,existsName} = action.data;
+  const {labelInx,excluName,existsName,nones,withsName,ban} = action.data;
   // 若每个选项都有符号,去掉最后一个,因与标签间的符号有冲突
   // 若每个选项都有符号,去掉最后一个,因与标签间的符号有冲突
-  let names=existsName;
+  let showText = (excluName||'')+(existsName||'')+(ban.name||'')+(withsName||'')+(nones&&nones.replace('、','')||'');
   let pattern = new RegExp(/\,+$|\,+$|\.+$|\。+$|\、+$/);//+ 一次或多次
   let pattern = new RegExp(/\,+$|\,+$|\.+$|\。+$|\、+$/);//+ 一次或多次
-  if(pattern.test(existsName)){
-    names = existsName.substr(0,existsName.length-1);
+  if(pattern.test(showText)){
+    showText = showText.substr(0,showText.length-1);
   }
   }
-  let arr = res.data;
-  arr[labelInx].value = names;
-  res.saveText[labelInx] = names;
+  res.data[labelInx].value = showText;
+  res.saveText[labelInx] = showText;
   res.selecteds[labelInx] = action.data;
   res.selecteds[labelInx] = action.data;
   res.update=Math.random();
   res.update=Math.random();
   return res;
   return res;

+ 2 - 0
src/store/actions/diagnosticList.js

@@ -67,11 +67,13 @@ export const setDiagToMainSuit = (state, action) => {
     res.mainSuitStr = action.data;
     res.mainSuitStr = action.data;
     return res;
     return res;
 }
 }
+
 export const clearAllDiag = (state, action) => {
 export const clearAllDiag = (state, action) => {
     const res = Object.assign({}, state);
     const res = Object.assign({}, state);
     res.diagnosticList = action.data
     res.diagnosticList = action.data
     res.diagnosticStr = action.saveText
     res.diagnosticStr = action.saveText
     res.mainSuitStr = action.mainSuitStr
     res.mainSuitStr = action.mainSuitStr
+    res.diagnosticStrNoType = action.saveText
     return res;
     return res;
 }
 }
 
 

+ 35 - 25
src/store/actions/mainSuit.js

@@ -69,22 +69,33 @@ export const getBigSymptom = (state,action) => {
 //点击插入新模板--添加病程变化
 //点击插入新模板--添加病程变化
 export const handleTailClick = (state,action)=>{
 export const handleTailClick = (state,action)=>{
   const res = Object.assign({},state);
   const res = Object.assign({},state);
-  res.showDrop = !res.showDrop;
+  const sonId = action.id;//子模板id
   let num = res.moduleNum.num;
   let num = res.moduleNum.num;
   num++;
   num++;
-  const addSmoduleData = JSON.parse(JSON.stringify(res.addSmoduleData));
+  // const addSmoduleData = JSON.parse(JSON.stringify(res.addSmoduleData));
   // const addDatas = JSON.parse(JSON.stringify(fullfillText(action.info).newArr));
   // const addDatas = JSON.parse(JSON.stringify(fullfillText(action.info).newArr));
+  let addSmoduleData;
+  // const allModules = JSON.parse(localStorage.getItem('modules'));
+  let allModules = action.allModules;
+  for(let k=0; k<allModules.length; k++){
+    if(allModules[k].id==sonId){
+      addSmoduleData = JSON.parse(JSON.stringify(allModules[k].moduleDetailDTOList));
+    }
+  }
   let datas = JSON.parse(JSON.stringify(res.data));
   let datas = JSON.parse(JSON.stringify(res.data));
   let leng = datas.length;
   let leng = datas.length;
+  
   for(let i=0; i<addSmoduleData.length; i++){
   for(let i=0; i<addSmoduleData.length; i++){
     addSmoduleData[i].pos = num;
     addSmoduleData[i].pos = num;
     // let pos = leng-1+i;
     // let pos = leng-1+i;
    /* let pos = leng-2+i;
    /* let pos = leng-2+i;
     datas.splice(pos,0,addDatas[i]);*/
     datas.splice(pos,0,addDatas[i]);*/
   }
   }
-  res.data = insertPro(datas,addSmoduleData);
+  let newData = insertPro(datas,addSmoduleData);
+  res.data = fullfillText(newData).newArr;
   res.saveText = fullfillText(res.data).saveText;
   res.saveText = fullfillText(res.data).saveText;
   res.moduleNum.num = num;
   res.moduleNum.num = num;
+  res.showDrop = !res.showDrop;
   return res;
   return res;
 }
 }
 
 
@@ -264,17 +275,16 @@ export const confirm = (state,action) =>{
 // 普通多选确定事件
 // 普通多选确定事件
 export const commConfirm=(state,action)=>{
 export const commConfirm=(state,action)=>{
   const res = Object.assign({},state);
   const res = Object.assign({},state);
-  const {exists,ikey,existsName} = action.data;
+  const {labelInx,excluName,existsName,nones,withsName,ban} = action.data;
   // 若每个选项都有符号,去掉最后一个,因与标签间的符号有冲突
   // 若每个选项都有符号,去掉最后一个,因与标签间的符号有冲突
-  let names=existsName;
+  let showText = (excluName||'')+(existsName||'')+(ban.name||'')+(withsName||'')+(nones&&nones.replace('、','')||'');
   let pattern = new RegExp(/\,+$|\,+$|\.+$|\。+$|\、+$/);//+ 一次或多次
   let pattern = new RegExp(/\,+$|\,+$|\.+$|\。+$|\、+$/);//+ 一次或多次
-  if(pattern.test(existsName)){
-    names = existsName.substr(0,existsName.length-1);
+  if(pattern.test(showText)){
+    showText = showText.substr(0,showText.length-1);
   }
   }
-  let arr = res.data;
-  arr[ikey].value = names;
-  res.saveText[ikey] = names;
-  res.selecteds[ikey] = action.data;
+  res.data[labelInx].value = showText;
+  res.saveText[labelInx] = showText;
+  res.selecteds[labelInx] = action.data;
   res.update=Math.random();
   res.update=Math.random();
   return res;
   return res;
 }
 }
@@ -521,29 +531,29 @@ export const setRadioInputValue = (state,action)=>{
 //双击标签输入改变值
 //双击标签输入改变值
 export const changeLabelVal = (state,action)=>{
 export const changeLabelVal = (state,action)=>{
   const res = Object.assign({},state);
   const res = Object.assign({},state);
-  const index = parseInt(action.data.ikey);
-  const newVal = action.data.changeVal;
-  let data = res.data;
-  let item = data[index];
+  const {changeVal,totalVal,ikey,prefix,suffix} = action.data;
+  const index = ikey;
+  const newVal = changeVal;
+  let item = res.data[index];
   const next = res.data[+index+1];
   const next = res.data[+index+1];
   const nextVal = next.value||next.name;
   const nextVal = next.value||next.name;
   //标签后是不是标点符号标签,是的话删除本标签时一起删除
   //标签后是不是标点符号标签,是的话删除本标签时一起删除
   let nextIsDot = +next.tagType===8&&!nextVal.match(config.punctuationReg);
   let nextIsDot = +next.tagType===8&&!nextVal.match(config.punctuationReg);
-  // if(newVal&&newVal.trim()){//时间单位传空--键盘输入
-  if(newVal){
+  let labText = totalVal?totalVal:newVal;
+  if(labText.trim()){
     if(item){
     if(item){
       item.value = newVal;
       item.value = newVal;
-      res.saveText[index] = newVal;
+      item.labelPrefix = prefix||'';
+      item.labelSuffix = suffix||'';
+      res.saveText[index] = labText;
     }
     }
   }else{//删除完标签内容则删除该标签
   }else{//删除完标签内容则删除该标签
     const num = nextIsDot?2:1;
     const num = nextIsDot?2:1;
-    data.splice(index,num);
-    // data[index].value = "";
-    // res.data.splice(index,1);
-    res.saveText.splice(index,1);
-    // res.saveText[index] = "";
-  } 
-  res.update = Math.random();
+    res.data.splice(index,num);
+    res.selecteds.splice(index,num);//杂音类样式选中状态对应
+    res.saveText = fullfillText(res.data).saveText;
+  }
+  res.update = Math.random();//console.log(222,res);
   return res;
   return res;
 }
 }
 
 

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

@@ -201,10 +201,10 @@ export function setOtherInput(state,action){
 
 
 //多选文字,如杂音
 //多选文字,如杂音
 export function setCheckBoxValue(state,action) {
 export function setCheckBoxValue(state,action) {
-  let res = Object.assign({},state);
-  const {labelInx,excluName,existsName,nones,withsName} = action.data;
-  let showText = (excluName||'')+(existsName||'')+(nones||'')+(withsName||'');
+  const res = Object.assign({},state);
+  const {labelInx,excluName,existsName,nones,withsName,ban} = action.data;
   // 若每个选项都有符号,去掉最后一个,因与标签间的符号有冲突
   // 若每个选项都有符号,去掉最后一个,因与标签间的符号有冲突
+  let showText = (excluName||'')+(existsName||'')+(ban.name||'')+(withsName||'')+(nones&&nones.replace('、','')||'');
   let pattern = new RegExp(/\,+$|\,+$|\.+$|\。+$|\、+$/);//+ 一次或多次
   let pattern = new RegExp(/\,+$|\,+$|\.+$|\。+$|\、+$/);//+ 一次或多次
   if(pattern.test(showText)){
   if(pattern.test(showText)){
     showText = showText.substr(0,showText.length-1);
     showText = showText.substr(0,showText.length-1);
@@ -212,7 +212,7 @@ export function setCheckBoxValue(state,action) {
   res.data[labelInx].value = showText;
   res.data[labelInx].value = showText;
   res.saveText[labelInx] = showText;
   res.saveText[labelInx] = showText;
   res.selecteds[labelInx] = action.data;
   res.selecteds[labelInx] = action.data;
-  res.update = Math.random();
+  res.update=Math.random();
   return res;
   return res;
 }
 }
 //搜索结果
 //搜索结果
@@ -324,7 +324,7 @@ export function changeTextLabel(state,action) {
     res.selecteds.splice(index,num);//杂音类样式选中状态对应
     res.selecteds.splice(index,num);//杂音类样式选中状态对应
     res.saveText = fullfillText(res.data).saveText;
     res.saveText = fullfillText(res.data).saveText;
   }
   }
-  res.update = Math.random();
+  res.update = Math.random();//console.log(888,res,action);
   return res;
   return res;
 }
 }
 
 

+ 6 - 0
src/store/actions/treat.js

@@ -105,3 +105,9 @@ export const isFirstMainDiag = (state, action) => {
     res.isFirstMainDiag = false;
     res.isFirstMainDiag = false;
     return res;
     return res;
 }
 }
+//回读清除是否第一次主诊断
+export const clearFirstMainDiag = (state, action) => {
+    const res = Object.assign({}, state);
+    res.isFirstMainDiag = action.flag;
+    return res;
+}

+ 15 - 2
src/store/async-actions/homePage.js

@@ -1,5 +1,5 @@
 import {post,json} from '@utils/ajax.js';
 import {post,json} from '@utils/ajax.js';
-import {SETINITDATA,MODI_LOADING} from '@store/types/homePage.js';
+import {SETINITDATA,MODI_LOADING,SETALLMODULES} from '@store/types/homePage.js';
 import {SET_CURRENT} from '@store/types/currentIll';
 import {SET_CURRENT} from '@store/types/currentIll';
 import {SET_MAINSUIT} from '@store/types/mainSuit';
 import {SET_MAINSUIT} from '@store/types/mainSuit';
 import config from '@config/index.js';
 import config from '@config/index.js';
@@ -28,13 +28,26 @@ function modulesParseJson(data){
 export const getInitModules= (dispatch,getStore)=>{
 export const getInitModules= (dispatch,getStore)=>{
   const state = getStore();
   const state = getStore();
   const {message} = state.patInfo;
   const {message} = state.patInfo;
-  return json(api.getModules,{age:message.patientAge,sexType:message.sex}).then((res) => {
+  const param = {
+    age:message.patientAge,
+    sexType:message.sex,
+    mouduleType:1,//慢病2  科室1 其他0
+    relationId:message.hospitalDeptId, //慢病id  科室id  其他0
+  }
+  // return json(api.getModules,{age:message.patientAge,sexType:message.sex}).then((res) => {
+  return json(api.getModules,param).then((res) => {
       dispatch(initHistoryDetails(message));      //历史病历回读
       dispatch(initHistoryDetails(message));      //历史病历回读
       if (res.data.code == '0') {
       if (res.data.code == '0') {
         const newObj = modulesParseJson(res.data.data);
         const newObj = modulesParseJson(res.data.data);
         const initData = newObj.json;
         const initData = newObj.json;
         const initSaveText = newObj.saveTextJson;
         const initSaveText = newObj.saveTextJson;
         const initModuleName = newObj.moduleName;
         const initModuleName = newObj.moduleName;
+        // 将所有模板缓存,方便根据id取子模板
+        // localStorage.setItem('modules',JSON.stringify(res.data.data));
+        dispatch({
+          type: SETALLMODULES,
+          data: res.data.data
+        });
         dispatch({
         dispatch({
           type: SETINITDATA,
           type: SETINITDATA,
           data: initData
           data: initData

+ 2 - 1
src/store/async-actions/mainSuit.js

@@ -18,7 +18,8 @@ export const getCommSymptoms = ()=>{//获取常见症状
     const params = {
     const params = {
       'deptId':deptCode,
       'deptId':deptCode,
       'age':message.patientAge,
       'age':message.patientAge,
-      'sexType':message.sex
+      'sexType':message.sex,
+      'type':1
     };
     };
     json(api.getCommSymptoms,params).then((res)=>{
     json(api.getCommSymptoms,params).then((res)=>{
         let result = res.data;
         let result = res.data;

+ 1 - 1
src/store/async-actions/treat.js

@@ -293,7 +293,7 @@ export const  getInstroduceMore = (drugIdList) =>{
 export const commonTreatAddToAdvice = () => {
 export const commonTreatAddToAdvice = () => {
     return (dispatch, getState) => {
     return (dispatch, getState) => {
         const state = getState();
         const state = getState();
-        if(state.treat.treatItem.treatIndex === 0 && state.treat.isFirstMainDiag) {
+        if(state.treat.treatItem.id === state.diagnosticList.diagnosticList[0].id && state.treat.isFirstMainDiag) {
             dispatch({
             dispatch({
                 type: IS_FIRST_MAIN_DIAG
                 type: IS_FIRST_MAIN_DIAG
             })
             })

+ 2 - 1
src/store/reducers/diagnosticList.js

@@ -30,7 +30,8 @@ const initState = {
         //     type: 1
         //     type: 1
         // }
         // }
     ],
     ],
-    mainSuitStr:''
+    mainSuitStr:'',
+    diagnosticStrNoType:'',
 
 
 }
 }
 
 

+ 6 - 2
src/store/reducers/homePage.js

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

+ 76 - 8
src/store/reducers/inspect.js

@@ -23,6 +23,7 @@ const initSearchList = {
 
 
     getExcelDataList: [], //导入的数据
     getExcelDataList: [], //导入的数据
     pushItem:[],    //推送的数据
     pushItem:[],    //推送的数据
+    pushItems:[],    //右侧模板预览的数据
 }
 }
 
 
 export default (state = initSearchList, action) => {
 export default (state = initSearchList, action) => {
@@ -41,6 +42,11 @@ export default (state = initSearchList, action) => {
                 newState.labelList = [...tempArrs]
                 newState.labelList = [...tempArrs]
             }
             }
         }
         }
+        
+        let tmpArr = newState.getExcelDataList;
+        let tmpArr2 = newState.labelList;
+        newState.pushItems = getPushLists(tmpArr,tmpArr2);
+        newState.inspectStrPlus = getStringPlus(newState.pushItems)
         return newState;
         return newState;
     }
     }
     if (action.type == RESET_LABEL) {             //选中的结果重组
     if (action.type == RESET_LABEL) {             //选中的结果重组
@@ -56,6 +62,11 @@ export default (state = initSearchList, action) => {
           tempArr.push(action.lis[i]);
           tempArr.push(action.lis[i]);
         }
         }
         newState.labelList = [...tempArr]
         newState.labelList = [...tempArr]
+        
+        let tmpArr = newState.getExcelDataList;
+        let tmpArr2 = newState.labelList;
+        newState.pushItems = getPushLists(tmpArr,tmpArr2);
+        newState.inspectStrPlus = getStringPlus(newState.pushItems);
         return newState;
         return newState;
     }
     }
     if (action.type == FILL_ACTIVE) {                        //点击标签放到暂存里
     if (action.type == FILL_ACTIVE) {                        //点击标签放到暂存里
@@ -79,7 +90,8 @@ export default (state = initSearchList, action) => {
         }
         }
         tempArrs.show = false;
         tempArrs.show = false;
         newState.pushItem = getPushList(tmpArr,tmpArr2);
         newState.pushItem = getPushList(tmpArr,tmpArr2);
-        newState.inspectStrPlus = getStringPlus(newState.pushItem)
+        newState.pushItems = getPushLists(tmpArr,tmpArr2);
+        newState.inspectStrPlus = getStringPlus(newState.pushItems)
         return newState;
         return newState;
     }
     }
     if (action.type == GET_EXCEL) {              //导入数据
     if (action.type == GET_EXCEL) {              //导入数据
@@ -120,7 +132,8 @@ export default (state = initSearchList, action) => {
         newState.getExcelDataList = [...tmpArr];
         newState.getExcelDataList = [...tmpArr];
         let tempArr1 = newState.getExcelDataList;
         let tempArr1 = newState.getExcelDataList;
         newState.pushItem = getPushList(tempArr1,tempArr2);
         newState.pushItem = getPushList(tempArr1,tempArr2);
-        newState.inspectStrPlus = getStringPlus(newState.pushItem)
+        newState.pushItems = getPushLists(tempArr1,tempArr2);
+        newState.inspectStrPlus = getStringPlus(newState.pushItems)
         return newState;
         return newState;
     }
     }
     if (action.type == CHECK_VALUE_IS_CHANGE) {     //数据添加后显示与否
     if (action.type == CHECK_VALUE_IS_CHANGE) {     //数据添加后显示与否
@@ -135,7 +148,8 @@ export default (state = initSearchList, action) => {
         newState.labelList = tempArrs;
         newState.labelList = tempArrs;
         // tempArrAct.show = true;
         // tempArrAct.show = true;
         newState.pushItem = getPushList(tmpArr,tempArrs);
         newState.pushItem = getPushList(tmpArr,tempArrs);
-        newState.inspectStrPlus = getStringPlus(newState.pushItem)
+        newState.pushItems = getPushLists(tmpArr,tempArrs);
+        newState.inspectStrPlus = getStringPlus(newState.pushItems)
         return newState;
         return newState;
     }
     }
     if (action.type == CLEAR_ALL_LABEL) {     //清空所有数据
     if (action.type == CLEAR_ALL_LABEL) {     //清空所有数据
@@ -155,7 +169,8 @@ export default (state = initSearchList, action) => {
         newState.labelList = [...tempArr];
         newState.labelList = [...tempArr];
         let tmpArr = newState.getExcelDataList;
         let tmpArr = newState.getExcelDataList;
         newState.pushItem = getPushList(tmpArr,tempArr);
         newState.pushItem = getPushList(tmpArr,tempArr);
-        newState.inspectStrPlus = getStringPlus(newState.pushItem)
+        newState.pushItems = getPushLists(tmpArr,tempArr);
+        newState.inspectStrPlus = getStringPlus(newState.pushItems)
         return newState;
         return newState;
     }
     }
     return state;
     return state;
@@ -186,7 +201,8 @@ function getExcelString(action,newState,tmpArr,tmpArr2) {
         })
         })
     })
     })
     newState.pushItem = getPushList(tmpArr,tmpArr2);
     newState.pushItem = getPushList(tmpArr,tmpArr2);
-    newState.inspectStrPlus = getStringPlus(newState.pushItem)
+    newState.pushItems = getPushLists(tmpArr,tmpArr2);
+    newState.inspectStrPlus = getStringPlus(newState.pushItems)
   }else{
   }else{
     newState.inspectStrPlus = '';
     newState.inspectStrPlus = '';
     newState.pushItem = []
     newState.pushItem = []
@@ -224,8 +240,13 @@ function getString(lists) {
 function getStringPlus(dataList){
 function getStringPlus(dataList){
   let strPlus = '';
   let strPlus = '';
   dataList && dataList.map((item)=>{
   dataList && dataList.map((item)=>{
-    let strTmp = item.name + ',' + item.detailName + ',' + (item.otherValue ? item.otherValue : (item.value + item.units)) +';'
-    strPlus += strTmp;
+    if(item.detailName){
+      let strTmp = item.name + ',' + item.detailName + ',' + (item.otherValue ? item.otherValue : (item.value + item.units)) +';'
+      strPlus += strTmp;
+    }else{
+      let strTmp = item.name+';'
+      strPlus += strTmp;
+    }
   })
   })
   return strPlus;
   return strPlus;
 }
 }
@@ -256,7 +277,49 @@ function getPushList(data1,data2){     //推送数据
         })
         })
     })
     })
     data2.length>0 && data2.map((item)=>{        //填写单数据拼接
     data2.length>0 && data2.map((item)=>{        //填写单数据拼接
-        item.details.map((val)=>{
+      item.details && item.details.map((val)=>{
+            if(val.value != undefined && val.value != ''){
+                let tmpObj = {};
+                tmpObj.name = item.name || '';
+                tmpObj.detailName = val.name || '';
+                tmpObj.uniqueName = val.uniqueName || '';//公表名称
+                tmpObj.source = '0';     //数据来源
+                tmpObj.maxValue = val.maxValue ? val.maxValue : '';
+                tmpObj.minValue = val.minValue ? val.minValue : '';
+                tmpObj.units = val.labelSuffix || '';
+                tmpObj.value = (val.value-0) === (val.value-0) ? val.value:'';
+                tmpObj.otherValue = (val.value-0) === (val.value-0) ?'':val.value;
+                tmpArr2.push(tmpObj);
+            }
+        })
+    })
+    totalTmpArr = tmpArr1.concat(tmpArr2);
+    return totalTmpArr;
+}
+function getPushLists(data1,data2){     //推送数据
+    let tmpArr1 = [];
+    let tmpArr2 = [];
+    let totalTmpArr = [];
+    data1.length>0 && data1.map((items)=>{    //excel导入的数据拼接
+        items.lisExcelRes.map((item)=>{
+            item.lisExcelItem.map((part)=>{
+                let tmpObj = {};
+                tmpObj.name = part.mealName || '';//套餐名
+                tmpObj.detailName = part.itemName || '';//化验项名
+                tmpObj.uniqueName = part.uniqueName || '';//公表名称
+                tmpObj.source = '1';//数据来源
+                tmpObj.maxValue = part.max || ''; 
+                tmpObj.minValue = part.min || '';
+                tmpObj.units = part.unit || '';//单位
+                tmpObj.value = (part.value-0) === (part.value-0) ? part.value:'';//值
+                tmpObj.otherValue = (part.value-0) === (part.value-0) ?'':part.value; //阴性阳性
+                tmpArr1.push(tmpObj);
+            })
+        })
+    })
+    data2.length>0 && data2.map((item)=>{        //填写单数据拼接
+      if(item.show){
+          item.details.map((val)=>{
             if(val.value != undefined && val.value != ''){
             if(val.value != undefined && val.value != ''){
                 let tmpObj = {};
                 let tmpObj = {};
                 tmpObj.name = item.name || '';
                 tmpObj.name = item.name || '';
@@ -271,6 +334,11 @@ function getPushList(data1,data2){     //推送数据
                 tmpArr2.push(tmpObj);
                 tmpArr2.push(tmpObj);
             }
             }
         })
         })
+      }else{
+        let tmpObj = {};
+        tmpObj.name = item.name;
+        tmpArr2.push(tmpObj);
+      }
     })
     })
     totalTmpArr = tmpArr1.concat(tmpArr2);
     totalTmpArr = tmpArr1.concat(tmpArr2);
     return totalTmpArr;
     return totalTmpArr;

+ 4 - 2
src/store/reducers/treat.js

@@ -1,5 +1,5 @@
-import { SELECT_DRUG, SET_TREAT_INFO, SET_OTHER_DRUG, SET_DRUG_INFO, CLEAR_DRUG_INFO,SHOW_TREAT, HIDE_TREAT, CLEAR_TREAT, SHOW_DRUG_INFO, HIDE_DRUG_INFO, SET_GENERAL_TREAT, SET_TREATMENT, SET_SURGERY_TREAT, SET_RECOMMEND_BASIC, SET_DRUG_INFO_LIST,IS_FIRST_MAIN_DIAG } from '../types/treat'
-import { selectDrug, setTreatInfo, setOtherDrug, setDrugInfo, clearDrugInfo, showTreat, hideTreat, clearTreat, showDrugInfo, hideDrugInfo, setTreatment, setGeneralTreat, setSurgeryTreat, setRecommendBasic, setDrugInfoList, isFirstMainDiag } from '../actions/treat'
+import { SELECT_DRUG, SET_TREAT_INFO, SET_OTHER_DRUG, SET_DRUG_INFO, CLEAR_DRUG_INFO,SHOW_TREAT, HIDE_TREAT, CLEAR_TREAT, SHOW_DRUG_INFO, HIDE_DRUG_INFO, SET_GENERAL_TREAT, SET_TREATMENT, SET_SURGERY_TREAT, SET_RECOMMEND_BASIC, SET_DRUG_INFO_LIST,IS_FIRST_MAIN_DIAG,CLEAR_FIRST_MAIN_DIAG } from '../types/treat'
+import { selectDrug, setTreatInfo, setOtherDrug, setDrugInfo, clearDrugInfo, showTreat, hideTreat, clearTreat, showDrugInfo, hideDrugInfo, setTreatment, setGeneralTreat, setSurgeryTreat, setRecommendBasic, setDrugInfoList, isFirstMainDiag,clearFirstMainDiag } from '../actions/treat'
 const initState = {
 const initState = {
     show: false, //治疗方案显示隐藏
     show: false, //治疗方案显示隐藏
     showDrugInfo: false, //药品信息显示隐藏
     showDrugInfo: false, //药品信息显示隐藏
@@ -200,6 +200,8 @@ export default function(state=initState, action){
             return setDrugInfoList(state, action);
             return setDrugInfoList(state, action);
         case IS_FIRST_MAIN_DIAG: 
         case IS_FIRST_MAIN_DIAG: 
             return isFirstMainDiag(state, action)
             return isFirstMainDiag(state, action)
+        case CLEAR_FIRST_MAIN_DIAG: 
+            return clearFirstMainDiag(state, action)
         default:
         default:
             return state
             return state
     }
     }

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

@@ -12,4 +12,5 @@ export const ISREAD = 'is_history_or_template';     //是否回读或模板数
 export const SETOTHERHISTORY = 'set_otherHis_history';    //其他史历史数据暂存
 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 MODI_LOADING = 'MODI_LOADING';    //1024标识
-export const SEARCH_DROP_LOCATION = 'SEARCH_DROP_LOCATION';    //1024标识
+export const SEARCH_DROP_LOCATION = 'SEARCH_DROP_LOCATION';    //1024标识
+export const SETALLMODULES = 'SETALLMODULES';    //储存所有模板数据

+ 1 - 0
src/store/types/treat.js

@@ -14,4 +14,5 @@ export const SET_RECOMMEND_BASIC = 'SET_RECOMMEND_BASIC'//设置其他推荐推
 export const SET_TREAT_INFO = 'SET_TREAT_INFO' //设置治疗方案信息(name,id等)
 export const SET_TREAT_INFO = 'SET_TREAT_INFO' //设置治疗方案信息(name,id等)
 export const SET_DRUG_INFO_LIST = 'SET_DRUG_INFO_LIST' //查询多个药品说明书(添加数据时查看药品说明用)
 export const SET_DRUG_INFO_LIST = 'SET_DRUG_INFO_LIST' //查询多个药品说明书(添加数据时查看药品说明用)
 export const IS_FIRST_MAIN_DIAG = 'IS_FIRST_MAIN_DIAG' //是否为主诊断第一次开单
 export const IS_FIRST_MAIN_DIAG = 'IS_FIRST_MAIN_DIAG' //是否为主诊断第一次开单
+export const CLEAR_FIRST_MAIN_DIAG = 'CLEAR_FIRST_MAIN_DIAG' //回读清空是否为主诊断第一次开单
 
 

+ 2 - 2
src/utils/config.js

@@ -1,11 +1,11 @@
 // const host='http://192.168.3.100:5050';//王峰
 // const host='http://192.168.3.100:5050';//王峰
 // const host='http://192.168.3.101:5050';//任国宾
 // const host='http://192.168.3.101:5050';//任国宾
-// const host='http://192.168.2.241:5050';//后端接口访问地址
 const host='http://192.168.2.241:5050';//后端接口访问地址
 const host='http://192.168.2.241:5050';//后端接口访问地址
+// const host='http://192.168.2.236:5050';//后端接口访问地址
 //const host='http://192.168.2.164:8080';
 //const host='http://192.168.2.164:8080';
 // const host='http://192.168.3.117:8080'; //周铁刚
 // const host='http://192.168.3.117:8080'; //周铁刚
 // const newIcssVisitUrl = '223.93.170.82:13000';    //icss服务访问地址(跳转目的地),不能加http://
 // const newIcssVisitUrl = '223.93.170.82:13000';    //icss服务访问地址(跳转目的地),不能加http://
 module.exports={
 module.exports={
     host,
     host,
-    prefix:'/api/icssyz'            //带权限验证的api
+    prefix:'/api/icss'            //带权限验证的api
 };
 };

+ 110 - 3
src/utils/tools.js

@@ -8,6 +8,7 @@ import {clearAllLabel} from '@store/actions/inspect';
 import {CLEAR_ALL_DIAG} from '@store/types/diagnosticList';
 import {CLEAR_ALL_DIAG} from '@store/types/diagnosticList';
 import {CLEAR_ALL_PUSH_MESSAGE, SET_TIPS} from '@store/types/pushMessage';
 import {CLEAR_ALL_PUSH_MESSAGE, SET_TIPS} from '@store/types/pushMessage';
 import {ISREAD, SETREADDITEMS} from "../store/types/homePage";
 import {ISREAD, SETREADDITEMS} from "../store/types/homePage";
+import {CLEAR_FIRST_MAIN_DIAG} from "../store/types/treat";
 import {tabChange} from '@store/actions/tabTemplate';
 import {tabChange} from '@store/actions/tabTemplate';
 import config from '@config/index.js';
 import config from '@config/index.js';
 
 
@@ -141,7 +142,7 @@ const deepClone = (data)=>{
 };
 };
 
 
 const getUrlArgObject = (parm) => {  
 const getUrlArgObject = (parm) => {  
-    /*let args=new Object();
+    /*let args=new Object();  
     let query=window.location.href;//获取查询串  
     let query=window.location.href;//获取查询串  
     let pairs,arr;
     let pairs,arr;
     if(query.indexOf("?") != -1){
     if(query.indexOf("?") != -1){
@@ -187,7 +188,8 @@ const getAllDataList =(baseList) =>{           //获取所有模块结构化的
     jsonData.addItems = baseList.homePage.addItems||{};
     jsonData.addItems = baseList.homePage.addItems||{};
     jsonData.mainsuitIds = baseList.mainSuit.mainIds;      //主诉去重
     jsonData.mainsuitIds = baseList.mainSuit.mainIds;      //主诉去重
     jsonData.currentIds = baseList.currentIll.symptomIds;      //现病史去重
     jsonData.currentIds = baseList.currentIll.symptomIds;      //现病史去重
-    //console.log(jsonData,'结构化数据获取')
+    jsonData.isFirstMainDiag = baseList.treat.isFirstMainDiag;      //治疗方案
+    // console.log(jsonData,'结构化数据获取')
     return jsonData;
     return jsonData;
 }
 }
 const getAllDataStringList =(baseList) =>{           //获取所有模块文本的数据
 const getAllDataStringList =(baseList) =>{           //获取所有模块文本的数据
@@ -260,6 +262,10 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
             data:{},
             data:{},
             saveText:'',
             saveText:'',
         });
         });
+        store.dispatch({
+          type:CLEAR_FIRST_MAIN_DIAG,
+          flag:true
+        });
         storageLocal.remove('emrParam');
         storageLocal.remove('emrParam');
        // Notify.success('页面已清空')
        // Notify.success('页面已清空')
     }else{
     }else{
@@ -325,6 +331,10 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
                   type:SETREADDITEMS,
                   type:SETREADDITEMS,
                   data:dataJson.addItems
                   data:dataJson.addItems
                 });
                 });
+                store.dispatch({
+                  type:CLEAR_FIRST_MAIN_DIAG,
+                  flag:dataJson.isFirstMainDiag
+                });
               //tab跳回辅助信息
               //tab跳回辅助信息
               store.dispatch(tabChange('0'));
               store.dispatch(tabChange('0'));
             }else{    //结构化历史病历回读
             }else{    //结构化历史病历回读
@@ -389,6 +399,10 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
                 type:SETREADDITEMS,
                 type:SETREADDITEMS,
                 data:dataJson.addItems
                 data:dataJson.addItems
               });
               });
+              store.dispatch({
+                type:CLEAR_FIRST_MAIN_DIAG,
+                flag:dataJson.isFirstMainDiag
+              });
             }
             }
         } else {
         } else {
             if(type == 'template'){     //纯文本模板回读
             if(type == 'template'){     //纯文本模板回读
@@ -438,6 +452,10 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
                 type:SETREADDITEMS,
                 type:SETREADDITEMS,
                 data:dataJson.addItems
                 data:dataJson.addItems
               });
               });
+              store.dispatch({
+                type:CLEAR_FIRST_MAIN_DIAG,
+                flag:dataJson.isFirstMainDiag
+              });
               //tab跳回辅助信息
               //tab跳回辅助信息
               store.dispatch(tabChange('0'));
               store.dispatch(tabChange('0'));
             }else{  //纯文本历史病历回读
             }else{  //纯文本历史病历回读
@@ -493,6 +511,10 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
                 type:SETREADDITEMS,
                 type:SETREADDITEMS,
                 data:dataJson.addItems
                 data:dataJson.addItems
               });
               });
+              store.dispatch({
+                type:CLEAR_FIRST_MAIN_DIAG,
+                flag:dataJson.isFirstMainDiag
+              });
             }
             }
         }
         }
     }
     }
@@ -559,7 +581,7 @@ function filterOtherDataArr(arrTmp,jsonArr){
 function trimDots(str){
 function trimDots(str){
   return str.replace(config.punReg,function(word){
   return str.replace(config.punReg,function(word){
     return word.substr(0,1);
     return word.substr(0,1);
-  }).replace(/^[,,.。::"“??”;;、!!]+/,'');
+  }).replace(/^[,,.。::"“??”;;、!!\s]+/,'');
 }
 }
 
 
 //标签间连续标点只保留一个,保留前面一个
 //标签间连续标点只保留一个,保留前面一个
@@ -705,6 +727,89 @@ function timestampToTime(timestamp) {     //excel导入2019年5月1日会转换
   var s = date.getSeconds();
   var s = date.getSeconds();
   return Y+M+D+h+m+s;
   return Y+M+D+h+m+s;
 }
 }
+function getPageLength(event) {     //兼容ie8获取页面距离左和上的距离,包括滚动距离
+  let e = event || window.event;
+  let scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;
+  let scrollY = document.documentElement.scrollTop || document.body.scrollTop;
+  let x = e.pageX || e.clientX + scrollX;
+  let y = e.pageY || e.clientY + scrollY;
+  let page = {
+    pageX:x,
+    pageY:y
+  }
+  return page;
+}
+function dragBox(domWrap,domDrag){
+  let drag = document.getElementById(domDrag);//拖拽区域
+  let wrap = document.getElementById(domWrap);//被拖拽的元素
+  let width = window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;//屏幕宽度
+  let height = window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;//屏幕高度
+  let mouseX = 0,mouseY = 0,dragX = 0,dragY = 0,isDrag = false,isMove = false;
+  windowEventHandler('mousedown',(event)=>{    //鼠标位置获取,计算点击位置到拖拽元素左边的距离
+    let wrap = document.getElementById(domWrap);
+    let page = getPageLength(event);
+    drag = document.getElementById(domDrag);
+    mouseX = page.pageX - wrap.offsetLeft      //鼠标到拖拽元素的左边界的距离
+    mouseY = page.pageY - wrap.offsetTop       //鼠标到拖拽元素的上边界的距离
+    isDrag = true
+    isMove = false
+  },drag)
+  // windowEventHandler('mousemove',handleMove,document)
+  windowEventHandler('mousemove',(event)=>{      //移动的
+    let dragDes = document.getElementById('treatDescBox');//展開区域
+    let page = getPageLength(event);
+    let maxDragX = 0,dragDesWidth = 0;
+    let maxDragY = height - wrap.offsetHeight;//最大可拖拽y方向距离
+
+    if(domDrag == 'dragTreatTitle'){//最大可推拽x方向距离
+      if(dragDes != null){
+        dragDesWidth = dragDes.offsetWidth
+      }else{
+        dragDesWidth = 0
+      }
+      maxDragX = width - wrap.offsetWidth - dragDesWidth
+    }else{
+      maxDragX = width - wrap.offsetWidth
+    }
+    if(isDrag){
+      dragX = page.pageX - mouseX          //鼠标可拖拽到左边的最大距离
+      dragY = page.pageY - mouseY          //鼠标可拖拽到上边的最大距离
+      if(dragX < 0){      //不能超出左边界
+        dragX = 0
+      }
+      if(dragY < 0){      //不能超出上边界
+        dragY = 0
+      }
+      if(domDrag == 'dragTreatTitle'){
+        if(width-dragX-dragDesWidth < wrap.offsetWidth){    //不能超出右边界
+          dragX = maxDragX
+        }
+      }else{
+        if(width-dragX < wrap.offsetWidth){    //不能超出右边界
+          dragX = maxDragX
+        }
+      }
+      if(height-dragY < wrap.offsetHeight){     //不能超出下边界
+        dragY = maxDragY
+      }
+      isMove = true
+      wrap.style.left = dragX + 'px'
+      wrap.style.marginLeft = 0 + 'px'
+      wrap.style.top = dragY + 'px'
+    }
+  },document)
+  windowEventHandler('mouseup',()=>{
+    if(isMove){ //有move就设置位置没有移动就不处理
+      wrap.style.left = dragX + 'px'
+      wrap.style.top = dragY + 'px'
+    }
+    isDrag = false
+    return false
+  },document)
+}
+// function handleMove(event,mouseX){
+//     console.log(event)
+// }
 module.exports = {
 module.exports = {
     checkType: Type.checkType,
     checkType: Type.checkType,
     regexp,
     regexp,
@@ -733,5 +838,7 @@ module.exports = {
     getPageCoordinate,
     getPageCoordinate,
     windowRemoveEventHandler,
     windowRemoveEventHandler,
     timestampToTime,
     timestampToTime,
+    getPageLength,
+    dragBox,
     formatContinueDots
     formatContinueDots
 };
 };