Browse Source

Merge branch 'dev/new1' into dev/byll

Luolei 6 years ago
parent
commit
7ad8183615
90 changed files with 1577 additions and 402 deletions
  1. 1 1
      index.html
  2. 40 21
      src/common/components/EditableSpan/index.jsx
  3. 6 1
      src/common/components/EditableSpan/index.less
  4. 1 1
      src/common/js/func.js
  5. 1 1
      src/common/less/reset.css
  6. 8 2
      src/common/less/variables.less
  7. 4 8
      src/components/CheckBody/index.jsx
  8. 1 1
      src/components/CommonSymptom/index.jsx
  9. 4 0
      src/components/CommonSymptom/index.less
  10. 1 1
      src/components/CopyRight/index.jsx
  11. 3 1
      src/components/CopyRight/index.less
  12. 4 4
      src/components/CurrentIll/index.jsx
  13. 15 6
      src/components/DiagResultSearch/index.jsx
  14. 14 3
      src/components/DiagnosticItem/index.jsx
  15. 4 0
      src/components/DiagnosticItem/index.less
  16. 6 6
      src/components/DiagnosticList/index.jsx
  17. 1 0
      src/components/EMRContainer/index.less
  18. 22 4
      src/components/InfoTitle/index.jsx
  19. 4 0
      src/components/InfoTitle/index.less
  20. 9 9
      src/components/MainSuit/index.jsx
  21. 7 1
      src/components/MultSpread/index.jsx
  22. 3 0
      src/components/MultSpread/index.less
  23. 226 0
      src/components/Multiple/index.jsx
  24. 48 0
      src/components/Multiple/index.less
  25. 44 52
      src/components/NumberDrop/index.jsx
  26. 4 4
      src/components/NumberUnitDrop/index.jsx
  27. 25 6
      src/components/Operation/index.jsx
  28. 7 0
      src/components/Operation/index.less
  29. 10 46
      src/components/OtherHistory/index.jsx
  30. 2 1
      src/components/PatInfo/index.jsx
  31. 5 0
      src/components/PatInfo/index.less
  32. 52 3
      src/components/PushItems/DetailsModal/index.jsx
  33. 34 1
      src/components/PushItems/DetailsModal/index.less
  34. 9 5
      src/components/PushItems/index.jsx
  35. 4 2
      src/components/PushItems/index.less
  36. 6 1
      src/components/RadioDrop/index.jsx
  37. 1 0
      src/components/SearchDrop/index.less
  38. 13 11
      src/components/SpreadDrop/index.jsx
  39. 44 5
      src/components/Treat/DrugTreat/index.jsx
  40. 1 0
      src/components/Treat/DrugTreat/index.less
  41. BIN
      src/components/Treat/img/info1.png
  42. 10 3
      src/components/Treat/index.jsx
  43. 37 13
      src/components/TreatDesc/DrugInfo/index.jsx
  44. 15 1
      src/components/TreatDesc/DrugInfo/index.less
  45. BIN
      src/components/TreatDesc/img/info1.png
  46. 27 5
      src/components/TreatDesc/index.jsx
  47. 1 0
      src/components/TreatDesc/index.less
  48. 1 0
      src/config/index.js
  49. 2 1
      src/containers/CheckBody.js
  50. 1 2
      src/containers/CurrentIll.js
  51. 1 1
      src/containers/DiagnosticItem.js
  52. 2 2
      src/containers/DiagnosticList.js
  53. 7 1
      src/containers/EditableSpan.js
  54. 2 2
      src/containers/MainSuit.js
  55. 182 0
      src/containers/Multiple.js
  56. 2 2
      src/containers/NumberDrop.js
  57. 2 2
      src/containers/NumberUnitDrop.js
  58. 5 2
      src/containers/OperationContainer.js
  59. 5 3
      src/containers/OtherHistory.js
  60. 2 2
      src/containers/RadioDrop.js
  61. 65 12
      src/containers/SpreadDrop.js
  62. 11 1
      src/containers/Treat.js
  63. 25 4
      src/containers/eleType.js
  64. 24 6
      src/modules/HomePage/index.jsx
  65. 89 9
      src/store/actions/checkBody.js
  66. 103 27
      src/store/actions/currentIll.js
  67. 1 1
      src/store/actions/diagnosticList.js
  68. 2 0
      src/store/actions/diagnosticSearch.js
  69. 1 1
      src/store/actions/homePage.js
  70. 34 14
      src/store/actions/mainSuit.js
  71. 80 38
      src/store/actions/otherHistory.js
  72. 2 2
      src/store/actions/pushMessage.js
  73. 8 0
      src/store/actions/treat.js
  74. 20 6
      src/store/async-actions/diagnosticSearch.js
  75. 2 1
      src/store/async-actions/fetchModules.js
  76. 1 1
      src/store/async-actions/homePage.js
  77. 41 1
      src/store/async-actions/treat.js
  78. 11 4
      src/store/reducers/checkBody.js
  79. 4 2
      src/store/reducers/currentIll.js
  80. 5 1
      src/store/reducers/homePage.js
  81. 4 3
      src/store/reducers/mainSuit.js
  82. 10 3
      src/store/reducers/otherHistory.js
  83. 4 2
      src/store/reducers/treat.js
  84. 3 1
      src/store/types/checkBody.js
  85. 1 0
      src/store/types/currentIll.js
  86. 2 1
      src/store/types/homePage.js
  87. 1 0
      src/store/types/mainSuit.js
  88. 3 1
      src/store/types/otherHistory.js
  89. 1 0
      src/store/types/treat.js
  90. 21 10
      src/utils/tools.js

+ 1 - 1
index.html

@@ -8,6 +8,6 @@
     <title>ICSS</title>
 </head>
 <body>
-<div id="root"></div>
+<div id="root" style="min-width: 1024px;overflow-y: hidden;"></div>
 </body>
 </html>

+ 40 - 21
src/common/components/EditableSpan/index.jsx

@@ -1,8 +1,9 @@
 import React,{Component} from 'react';
 import style from './index.less';
 import config from "@config/index";
-import {filterArr,isIE,getPageCoordinate} from '@utils/tools.js';
+import {filterArr,isIE,getPageCoordinate,filterDataArr} from '@utils/tools.js';
 import Notify from '../Notify/index.js';
+import classNames from 'classnames';
 
 import $ from 'jquery';
 /*****
@@ -39,7 +40,15 @@ class EditableSpan extends Component{
   }
   handleFocus(e){
     e.stopPropagation();
-    const {setFocusIndex,i,boxMark}= this.props;
+    const {mainSaveText,full,setFocusIndex,i,boxMark,value}= this.props;
+    let mainText = filterDataArr(mainSaveText);//主诉字数
+    if(+boxMark==3||+boxMark==4){         //主诉为空,且第一次聚焦其他史查体时提示且不可输入
+      if(!mainText&&full&&(value===''||value===undefined)){
+        Notify.error("无法操作,请先输入主诉");
+        e.target.blur();
+        return ;
+      }
+    }
     let text = e.target.innerText;
     setFocusIndex&&setFocusIndex({i,boxMark,dom:this.$span});
     this.setState({
@@ -50,10 +59,10 @@ class EditableSpan extends Component{
   }
   onChange(e){
     e.stopPropagation();
-    const {handleChange,boxMark,i,handleSearch,value,mainSaveText,mainIds} = this.props;
+    const {handleChange,boxMark,i,handleSearch,value,mainSaveText,mainIds,handleClear} = this.props;
     const {labelVal,searchPre} = this.state;
     const text1 =e.target.innerText;
-    let mainText = filterArr(mainSaveText);//主诉字数
+    let mainText = filterDataArr(mainSaveText);//主诉字数
     if(+boxMark==1){
       if(mainText.length >= config.limited){
         if(text1.length > labelVal.length){
@@ -88,11 +97,15 @@ class EditableSpan extends Component{
       isEnd = !(newText.indexOf(searchPre)>0);
       search = temp.replace(/[(^\s*)|(\s*$)|(^\,*)|(\,*$)]/g,'');
       //console.log(labelVal,'旧:',searchPre,'新:',newText,'搜索:',search);
-      handleSearch&&handleSearch({text:search,isEnd,boxMark,mainIds});
+      if(config.punctuationReg.test(search)){     //只有标点符号时不搜索
+        handleSearch&&handleSearch({text:search,isEnd,boxMark,mainIds});
+      }else{//只有标点符号时要清空搜索结果
+        handleClear && handleClear({boxMark})
+      }
       //搜索后保持现在的值,继续输入时要用于对比
-      that.setState({
+      /*that.setState({
         searchPre:newText
-      });
+      });*/
     },config.delayTime);
     this.setState({
       timer
@@ -131,9 +144,6 @@ class EditableSpan extends Component{
     const ev = e||window.event;
     const target = ev.target||ev.srcElement;
     let innerVal = target.innerText;
-    /*if(this.props.full){
-      return false;
-    }*/
     //禁止回车事件
     if(ev.keyCode==13){return false;}
     //backspace事件
@@ -146,16 +156,21 @@ class EditableSpan extends Component{
 
   }
   handleKeyup(e){
-    const {boxMark,handleKeydown,i,value,removeId} = this.props;
+    const {boxMark,handleKeydown,i,value,removeId,handleClear} = this.props;
     const {preVal,index} = this.state;
     const ev = e||window.event;
     const target = ev.target||ev.srcElement;
     let innerVal = target.innerText;
     if(ev.keyCode==8){
       // 主诉现病史去重:删除最后一个字的时候移除该数据(将name、id和value替换成空)并移除id
-      if(preVal.trim().length==1){
+      // 前面是标签,内容为空时再删一次才移除标签;前面是文本,则直接移除;
+      let preObj = $(this.$span.current).prev();
+      if(index!==0&&preVal.trim().length==1){
           removeId && removeId({boxMark,i:index,text:""});
-          // this.moveEnd(obj[0]);
+          handleClear && handleClear({boxMark});//删除最后一个字时清空搜索结果,避免现病史搜索框不立即消失的情况
+          if(preObj[0].nodeName !=="DIV"){
+            this.moveEnd(preObj[0]);
+          }
         }
       
       if(innerVal !==preVal){return false}
@@ -163,7 +178,7 @@ class EditableSpan extends Component{
       //判断是否为空、中英文:, 。、;,且不是第一位
       let pattern = new RegExp(/^\,?$|^\,?$|^\.?$|^\。?$|^\、?$|^\;?$|^\;?$|^\:?$|^\:?$\s/);
       if(index!==0 && pattern.test(data)){
-        let preObj = $(this.$span.current).prev();
+        // let preObj = $(this.$span.current).prev();
         let obj = preObj[0].nodeName=="DIV"?preObj.prev():preObj;
         handleKeydown&&handleKeydown({boxMark,i:index,text:data});
         this.moveEnd(obj[0]);  
@@ -173,12 +188,6 @@ class EditableSpan extends Component{
       }
     }
   }
-  /*shouldComponentUpdate(next){
-    if(JSON.stringify(next) == JSON.stringify(this.props)){
-      return false;
-    }
-    return true;
-  }*/
   componentWillReceiveProps(next){
     const isRead = this.props.isRead;
     if(next.isRead != isRead){
@@ -196,8 +205,18 @@ class EditableSpan extends Component{
       },this);
     }
   }
+
+  getClass(){
+    const {full,value,saveText,i} = this.props;
+    const preSelected = saveText[i-1];
+    const isFull = full?' '+style['full']:'';       //是否宽度设为整行宽度
+    //有标点符号之外的字符或者前一个标签有选中值时,显示为黑色,否则灰显
+    const unselect = value.match(config.punctuationReg)||preSelected?'':style['unselect'];
+    return classNames(style['editable-span'],isFull,unselect);
+  }
+
   render() {
-    return <span className={style['editable-span']+(this.props.full?' '+style['full']:'')}
+    return <span className={this.getClass()}
                       contentEditable='true'
                       ref={this.$span}
                       onInput={this.onChange}

+ 6 - 1
src/common/components/EditableSpan/index.less

@@ -1,14 +1,19 @@
+@import "~@less/variables.less";
 .editable-span{
   display: inline-block;
   outline: none;
   word-break: break-word;
   min-width: 10px;
   // line-height: 2;
-  /*height: 20px;*/
+  height: 16px;
   line-height: 16px;
   /*vertical-align: middle;*/
   text-align: left;
 }
 .full{
   width: 100%;
+  line-height: 100%;
+}
+.unselect{
+  color: @placeholder-color;
 }

+ 1 - 1
src/common/js/func.js

@@ -66,7 +66,7 @@ export const strTrim = (str) =>{
 };
 
 //获取组合组件已填文字填入saveText
-function getSaveText(data){console.log(data)
+function getSaveText(data){//console.log(data)
   const arr = data.questionMapping.map((it)=>{
     return it.value?(it.labelPrefix||'')+(it.value||'')+(it.labelSuffix||''):'';
   });

+ 1 - 1
src/common/less/reset.css

@@ -23,7 +23,7 @@ html, body {
     height: 100%;
 	/*overflow-x: hidden;*/
   font-family: 'Microsoft YaHei', arial, tahoma, sans-serif;
-  overflow: hidden;    /* 弹窗出现有可能出现滚动条*/
+	/*overflow-y: hidden;     弹窗出现有可能出现滚动条*/
 }
 
 body {

+ 8 - 2
src/common/less/variables.less

@@ -164,5 +164,11 @@
 }
 
 .borderd{
-   border:1px #3B9ED0 solid;
- }
+   border:1px #000 solid;
+ }
+
+.blue-border{
+  border:2px @blue solid;
+  border-radius: 2px;
+  /*box-shadow: 0px 0px 2px @blue;*/
+}

+ 4 - 8
src/components/CheckBody/index.jsx

@@ -34,7 +34,7 @@ class CheckBody extends Component{
     return arr;
   }
   handleClick(e){//让搜索框跟随鼠标点击移动
-    e.stopPropagation();
+    // e.stopPropagation();
     const {fetchPushInfos,totalHide} = this.props;
     //fetchPushInfos&&fetchPushInfos();
     this.getData();
@@ -75,15 +75,11 @@ class CheckBody extends Component{
   }
   getData(){
     //第一次聚焦查体时,主诉有数据则调接口,主诉无数据则显示提示;其他时间查体模板数据不调接口
-    const {hasMain,saveText,data,isEmpty} = this.props;
-    const hasData = saveText.join("")||data.length>0;
+    const {hasMain,isEmpty} = this.props;
 
-    if(!hasMain&&isEmpty){          //无主诉且本身无数据时,点击提示(空白页、清空)
-      Notify.error("无法操作,请先输入主诉");
-      return ;
-    }
+    //无主诉提示在EditableSpan里
     //有主诉时且本身无数据,第一次点击获取数据,(不论获取成功与否)再点击不获取(直到刷新成空白页或清空)
-    if(hasMain&&isEmpty){
+    if(hasMain&&isEmpty!=false){
       this.props.getInit();
     }
   }

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

@@ -44,7 +44,7 @@ class CommonSymptom extends Component{
   render(){  
     const {data} = this.props;
     return <div className={this.getClass()} contenteditable="false">
-      <ul>
+      <ul className={style["listBox"]}>
         {data&&data.map((it)=>{
           return <li onClick={(e)=>this.handleSelect(e,it)}>{it.name}</li>
         })}

+ 4 - 0
src/components/CommonSymptom/index.less

@@ -3,6 +3,10 @@
   .pop;
   left: 85px;
   padding: 0 0 10px;
+  .listBox{
+    max-height: 370px;
+    overflow-y: auto;
+  }
   li{
     width: 200px;
     line-height: 35px;

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

@@ -81,7 +81,7 @@ class CopyRight extends Component {
       <div className={style["container"]}>
         <div className={style["copy"]}>
           版本信息:{" "}
-          <a href="javascript:;" onClick={showCopyModal}>
+          <a lassName={style["copy-number"]} href="javascript:;" onClick={showCopyModal}>
             {number}
           </a>{" "}
           {hasNewVersion && <span>new</span>} &copy;<b>朗通医疗</b>

+ 3 - 1
src/components/CopyRight/index.less

@@ -21,6 +21,8 @@
       }
       a{
         text-decoration: none;
+        font-size: 12px;
+        color: #3B9ED0;
       }
       b{
         font-size: 12px;
@@ -30,7 +32,7 @@
     
     .disclaimer{
       font-size: 12px;
-      color: #00e;
+      color: #3B9ED0;
       float: right;
       cursor: pointer;
     }

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

@@ -37,7 +37,7 @@ class CurrentIll extends Component{
 
   handleFocus(e){
     // 判断主诉是否为空
-    const {mainData,mainText,setData,moduleNum,mainIds,data,changeEditIll,editClear,mainSymptIds} = this.props;
+    const {mainData,mainText,setData,moduleNum,mainIds,data,changeEditIll,editClear} = this.props;
     const that = this;
     let mainFinallyText = filterDataArr(mainText);
     // if(mainData.length == 0 && !mainText[0]){
@@ -49,11 +49,11 @@ class CurrentIll extends Component{
       })
     }else {
       // let useEmpty = mainData.length>0?false:true;
-      let useEmpty = mainSymptIds.length>0?false:true;
       let num = moduleNum.num;//主诉使用了几个模板
       // if(editClear && data.length==0){//第一次聚焦去设置现病史的data
       if(data.length==0){//第一次聚焦去设置现病史的data
-        setData && setData({useEmpty,num,mainData,mainIds});//是否使用空模板 及数据处理
+        // setData && setData({useEmpty,num,mainData,mainIds});//是否使用空模板 及数据处理
+        setData && setData({num,mainData,mainIds});//是否使用空模板 及数据处理
       }
       this.setState({
           showMoudle:true,
@@ -144,7 +144,7 @@ class CurrentIll extends Component{
       <ItemBox title='现病史' editable={editClear||data.length==0?true:false} handleFocus={this.handleFocus} onchange={forbidInput?(e)=>{this.onchange(e)}:''} handleClick={this.handleClick}>
         {data.length>0?this.getInlineTag():''}
       </ItemBox>
-      {searchFlag ? <SearchDrop data={searchData} show={!totalHide&&show} onSelect={this.handleSearchSelect} left={boxLeft} top={boxTop} />:""}
+      {searchFlag ? <SearchDrop data={searchData} show={!totalHide} onSelect={this.handleSearchSelect} left={boxLeft} top={boxTop} />:""}
     </div>
   }
 }

+ 15 - 6
src/components/DiagResultSearch/index.jsx

@@ -3,13 +3,15 @@ import style from './index.less';
 import close from './img/close.png'
 import search from './img/search.png'
 import DiagnosticItem from '@containers/DiagnosticItem'
+import config from '@config/index';
 import $ from 'jquery';
 class DiagResultSearch extends Component {
     constructor(props) {
         super(props);
         this.state = {
             showClose: false,
-            focus: true
+            focus: true,
+            timer:null
         };
         this.searchInput = React.createRef();
         this.handleInput = this.handleInput.bind(this);
@@ -54,10 +56,17 @@ class DiagResultSearch extends Component {
     handleInput(value) {
         const {  setSearchValue, getSearchResult } = this.props;
         value.length > 0 ? this.setState({showClose: true}) : this.setState({showClose: false});
-        if(value.trim() == ''){
-          return  getSearchResult('');
-        }
-        getSearchResult(value.trim());
+        clearTimeout(this.state.timer);
+        let timer = setTimeout(()=>{
+            clearTimeout(this.state.timer);
+          if(value.trim() == ''){
+            return  getSearchResult('');
+          }
+          getSearchResult(value.trim());
+        },config.delayTime);
+        this.setState({
+          timer
+        });
     }
     clearInput() {
         const {  setSearchValue, getSearchResult } = this.props;
@@ -95,7 +104,7 @@ class DiagResultSearch extends Component {
                 <div className={style['search-result']}>
                     {
                         searchResult && searchResult.map((item) => {
-                            return(<div  key={item.id} className={style['search-result-item']}><DiagnosticItem item={item} clearInput={this.clearInput}/></div>)
+                            return(<div  key={item.id} className={style['search-result-item']}><DiagnosticItem title={true} item={item} clearInput={this.clearInput}/></div>)
                         })
                     }
                 </div>

+ 14 - 3
src/components/DiagnosticItem/index.jsx

@@ -1,6 +1,7 @@
 import React, { Component } from 'react';
 import style from './index.less';
 import {ConfirmModal} from '@commonComp';
+import Notify from '@commonComp/Notify';
 
 class DiagnosticItem extends Component{
     constructor(props){
@@ -45,7 +46,13 @@ class DiagnosticItem extends Component{
         //     this.setState({
         //         visible: false,
         //     },()=>{
-                const { 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
+                    }
+                }
                 addDiagnostic&&addDiagnostic(item);
                 clearInput&&clearInput();
                 hideSearch&&hideSearch()
@@ -55,9 +62,13 @@ class DiagnosticItem extends Component{
 
     render(){
         const { visible } = this.state
-        const { item } = this.props
+        const { item, title } = this.props
         return (<span className={style['diag-item']} >
-                    <span className={style['diag-name']} onClick={() =>{this.chooseDiagodal(item)}}>{item.name} </span>
+                    <span className={style['diag-name']} 
+                          title = {title && item.name + (item.showType === 2 || item.showType === 3 ? '('+ item.retrievalName+')': '')}
+                          onClick={() =>{this.chooseDiagodal(item)}}>
+                        {item.name} {item.showType === 2 || item.showType === 3 ? '('+ item.retrievalName+')': ''}
+                    </span>
                     <ConfirmModal visible={visible} okText='初诊' cancelText='复诊' confirm={this.confirm}  cancel={this.cancel} close={this.close}>
                         <div className={style['confirm-info']}>确定选择“{item.name}”为</div> 
                     </ConfirmModal>

+ 4 - 0
src/components/DiagnosticItem/index.less

@@ -12,4 +12,8 @@
 .diag-name {
     display: inline-block;
     width: 100%;
+    height: 100%;
+    overflow: hidden;
+    text-overflow: ellipsis;
+    white-space: nowrap;
 }

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

@@ -12,7 +12,7 @@ class DiagnosticList extends Component {
         super(props);
         this.state = {
             visible: false,
-            delId: '',
+            delItem: {},
             treatTitle: ''
         }
         this.deleteItem = this.deleteItem.bind(this);
@@ -38,9 +38,9 @@ class DiagnosticList extends Component {
         downDiagnostic && downDiagnostic(index)
     }
     deleteItem() {
-        const { delId } = this.state;
+        const { delItem } = this.state;
         const { delDiagnostic } = this.props;
-        delDiagnostic && delDiagnostic(delId);
+        delDiagnostic && delDiagnostic(delItem);
         this.setState({
             visible: false,
         })
@@ -56,10 +56,10 @@ class DiagnosticList extends Component {
             visible: false
         })
     }
-    handleDeleteItem(id) {
+    handleDeleteItem(item) {
         this.setState({
             visible: true,
-            delId: id,
+            delItem: item,
         })
     }
     showTreat(item) {
@@ -95,7 +95,7 @@ class DiagnosticList extends Component {
                                           onClick={() =>{hasTreat && this.showTreat(item)}}>
                                           治疗方案
                                     </span>
-                                    <img className={style['diag-del']} src={del_icon} onClick={()=>{this.handleDeleteItem(item.id)}}/>
+                                    <img className={style['diag-del']} src={del_icon} onClick={()=>{this.handleDeleteItem(item)}}/>
                         </div>)
                     })}
                      {treatment&&<Treat title={treatTitle}></Treat>}

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

@@ -7,6 +7,7 @@
   box-sizing: border-box;
   position: absolute;
   // min-width: 700px;
+  min-width: 548px;
   float: left;
   overflow-y:auto;
   overflow-x: hidden;

+ 22 - 4
src/components/InfoTitle/index.jsx

@@ -8,20 +8,37 @@ import store from '@store';
 import { showHistory } from '@store/actions/historyTemplates';
 import { initItemList } from '@store/async-actions/historyTemplates';
 import HistoryCases from '@containers/HistoryCases';
+import $ from 'jquery';
 
 class InfoTitle extends Component {
     constructor(props){
         super(props);
+        this.state={
+            le:''
+        }
         this.showHistoryBox = this.showHistoryBox.bind(this)
     }
     showHistoryBox(){
         store.dispatch(initItemList());
         store.dispatch(showHistory(true))
     }
+    componentWillReceiveProps(next){
+        const that = this;
+        if(next.winWidth <= 1024){
+          $(window).scroll(function(){
+            let scrollLeft = document.body.scrollLeft || document.documentElement.scrollLeft;
+            let left = -(scrollLeft - 10) +'px';
+            that.setState({
+              le:left
+            })
+          })
+        }
+    }
     render() {
-        const {disVisible,copyVisible} = this.props;
-        return <div className={style['title-wrapper']} style={{zIndex:disVisible||copyVisible?40:204}}>
-            <PatInfoContainer />
+        const {disVisible,copyVisible,winWidth} = this.props;
+        const {le} = this.state;
+        return <div className={style['title-wrapper']} style={{zIndex:disVisible||copyVisible?40:204,left:le}}>
+            <PatInfoContainer sizeFlag={winWidth <= 1035?true:false}/>
             <div className={style["operations"]} onClick={this.showHistoryBox}>
                 <span><img src={historyCase} />&nbsp;历史病历</span>
             </div>
@@ -35,7 +52,8 @@ class InfoTitle extends Component {
 function mapStateToProps(state) {
   return {
     disVisible: state.copyRight.disVisible,
-    copyVisible:state.copyRight.copyVisible
+    copyVisible:state.copyRight.copyVisible,
+    winWidth:state.homePage.windowWidth
   }
 }
 

+ 4 - 0
src/components/InfoTitle/index.less

@@ -10,6 +10,7 @@
   top: 50px;
   right: 470px;
   z-index: 204;
+  min-width: 548px;
 }
 .operations, .health{
   float: left;
@@ -39,5 +40,8 @@
     filter:alpha(opacity=30);
     -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(opacity=30);";
 }
+.font{
+  font-size: 13px;
+}
 
 

+ 9 - 9
src/components/MainSuit/index.jsx

@@ -216,7 +216,15 @@ class MainSuit extends Component{
     if(!isIE()){
       e.target.innerText="";
       freeText && freeText(data.trim());
-      // 延时关闭常见症状下拉,不延时会影响选中
+    }else{
+      if(datas.length==0){
+        const ev = e || window.event;
+        const data = ev.target.innerText;
+        // freeText && freeText(data.trim());
+        freeText && freeText(data);
+      }
+    }
+    // 延时关闭常见症状下拉,不延时会影响选中
       clearTimeout(this.state.clearTimer);
       const clearTimer = setTimeout(function(){
         that.setState({
@@ -226,14 +234,6 @@ class MainSuit extends Component{
       this.setState({
         clearTimer
       });
-    }else{
-      if(datas.length==0){
-        const ev = e || window.event;
-        const data = ev.target.innerText;
-        // freeText && freeText(data.trim());
-        freeText && freeText(data);
-      }
-    }
     
   }
 

+ 7 - 1
src/components/MultSpread/index.jsx

@@ -125,9 +125,15 @@ class MultSpread extends Component{
       saveAddItem&&saveAddItem(copyId,data);
     }
   }
+  getContClass(){
+    const {editable} = this.state;
+    const edit = editable?style['blue-border']:'';
+    return classNames(edit);
+  }
   render(){
     const {showAdd,addLabelItem,ikey,copyId,textPrefix,textSuffix} = this.props;
-    return (<div style={{display:'inline-block'}}
+    return (<div className={this.getContClass()}
+                 style={{display:'inline-block'}}
                  onDoubleClick={this.changeToEdit}
                  contentEditable={this.state.editable}
                  onBlur={this.handleEdit}

+ 3 - 0
src/components/MultSpread/index.less

@@ -7,6 +7,9 @@
 }
 .selected{
   .selected-tag;
+  span{           //ie8子标签灰显bug
+    color: @text-color;
+  }
   position: relative;
   padding: 0;
   &:before{

+ 226 - 0
src/components/Multiple/index.jsx

@@ -0,0 +1,226 @@
+import react from "react";
+import style from "./index.less";
+import $ from 'jquery';
+import classNames from 'classnames';
+import {handleEnter,isIE,filterArr,deepClone,filterDataArr} from '@utils/tools.js';
+import {Notify} from '@commonComp';
+import config from '@config/index.js';
+/**
+  单列多选组件(tagtype=1,controlType=2)
+  2019-2-20 By_liucf
+  参数:
+  placeholder:标签名
+  value:标签选中的值
+  show:是否展示下拉
+  data:下拉数据
+  type:标识哪一项数据(1-主诉,2-现病史,3-其他史,4-查体)
+**/
+
+class Multiple extends react.Component{
+  constructor(props){
+    super(props);
+    const {seleData,seleId} = deepClone(props.selecteds||[]);
+    this.state={
+      editable:false,
+      timer:null,
+      labelVal:"",
+      seleData:seleData||"",
+      seleId:seleId||[],
+      boxLeft:null,
+      boxTop:null
+    }
+    this.$div = React.createRef();
+    this.handleShow = this.handleShow.bind(this);
+    this.changeToEdit = this.changeToEdit.bind(this);
+    this.handleSelect = this.handleSelect.bind(this);
+    this.onChange = this.onChange.bind(this);
+    this.handleBlur = this.handleBlur.bind(this);
+    this.handleClear = this.handleClear.bind(this);
+    this.handleComfirn = this.handleComfirn.bind(this);
+  }
+
+  getClass(){
+    if(this.props.show){
+      $(this.$div.current).addClass(style['borderd']);
+    }else{
+      $(this.$div.current).removeClass(style['borderd']);
+    }
+    if(this.props.value){
+      return style['selected-tag'];
+    }
+    return style['tag'];
+  }
+
+  getListClass(){
+    let name = style['text-list'];
+    let isHide = this.props.show?'':style['hide'];
+    return classNames(style['list'],name,isHide);
+  }
+
+  getSeleStyle(id){
+    const {seleId} = this.state;
+    if(seleId.includes(id)){
+      return style['selected'];
+    }
+    return '';
+  }
+
+  handleShow(e){//单击
+    e&&e.stopPropagation();
+    let boxLeft = e.pageX -133 + 'px';
+    let offsetTop = e.target.offsetTop;
+    const ht = e.target.offsetHeight;   //如杂音选中文字有多行时,写死会遮挡
+    let boxTop = offsetTop + ht +2 + 'px';
+    this.setState({
+      boxLeft:boxLeft,
+      boxTop:boxTop
+    })
+     this.setStateInit();
+    const {ikey,handleShow,placeholder,flag,id,value,tagType,type} = this.props;
+    const that = this;
+    clearTimeout(this.state.timer);
+    this.state.timer = setTimeout(function(){
+      if (that.state.editable) {//如果处于编辑状态点击不显示下拉框
+        return
+      }else{
+        handleShow&&handleShow({ikey,placeholder,flag,id,value,tagType,type});
+      }
+    },300)
+
+  }
+
+  setStateInit(){//恢复初始选中状态
+    const {seleData,seleId} = deepClone(this.props.selecteds||[]);
+    this.setState({
+      seleData:seleData||"",
+      seleId:seleId||[],
+    })
+  }
+
+  changeToEdit(e){//双击
+    const {value,id,placeholder,handleDbclick,handleHide} = this.props;
+    let text = e.target.innerText;
+    handleHide&&handleHide();       //展开情况下双击收起
+    // clearTimeout(this.state.timer);//取消延时的单击事件
+    e.stopPropagation();
+    if(value&&value.trim()){//有选中值的标签才能双击编辑
+      this.setState({
+        labelVal:text,
+        editable:true
+      });
+      e.target.focus();
+      handleDbclick && handleDbclick({value,id,placeholder});
+    }
+  }
+
+  handleSelect(e,item){
+    e&&e.stopPropagation();
+    let {seleData,seleId} = this.state;
+    const {name,id} = item;
+    if(seleId.includes(id)){
+      seleId.splice(seleId.indexOf(id),1);
+      seleData = seleData.replace(name,'');
+    }else{
+      seleId.push(id);
+      seleData += name;
+    }
+    this.setState({
+      seleData,
+      seleId
+    })
+  }
+
+  onChange(e){
+    const {mainSaveText,ikey,type,handleLabelChange} = this.props;
+    const {labelVal,editable} = this.state;
+    let mainText = filterDataArr(mainSaveText);//主诉字数
+    if(editable){//避免IE中点击标签也会触发
+      let val = e.target.innerText;
+      if(+type==1){// 主诉字数达到上限时不允许输入
+        if(mainText.length >= config.limited){
+          if(val.length > labelVal.length){
+            e.target.innerText = labelVal;
+            Notify.info(config.limitText);
+            return
+          }else if(val.length == labelVal.length){
+            this.setState({
+              labelVal:val
+            });
+          }else{
+            handleLabelChange && handleLabelChange({ikey,changeVal:val,type});
+          }
+        }
+      }
+    }
+  }
+
+  handleBlur(e){//修改存值
+    e.stopPropagation();
+    const {ikey,type,handleLabelChange} = this.props;
+    const {editable} = this.state;
+    const ev = e || window.event;
+    if(editable){
+      // 更改标签的value值
+      let changeVal = ev.target.innerText;
+      if(!isIE()){
+        e.target.innerText = '';      //避免出现重复输入值
+      }
+      handleLabelChange && handleLabelChange({ikey,changeVal,type});
+    }
+    this.setState({
+      editable:false
+    });
+  }
+
+  handleClear(e){
+    e&&e.stopPropagation();
+    this.setState({
+      seleData:"",
+      seleId:[]
+    })
+  }
+
+  handleComfirn(e){
+    e&&e.stopPropagation();
+    const {handleConfirm,ikey,order,mainSaveText,value,handleHide,type} = this.props;
+    const params = Object.assign({},this.state,{ikey,order,mainSaveText,value,type});
+    handleConfirm&&handleConfirm(params);
+    handleHide&&handleHide();
+  }
+
+  componentDidMount(){
+    if(isIE()){
+      $(this.$div.current).onIe8Input(function(e){
+        this.onChange(e)
+      },this);
+    }
+  }
+
+  render(){
+    const {placeholder,value,show,data} = this.props;
+    const {editable,boxTop,boxLeft} = this.state;
+    return <div className={style["container"]}>
+      <div className={this.getClass()}
+      ref={this.$div}
+      onClick={this.handleShow}
+      onDoubleClick={this.changeToEdit}
+      onBlur={this.handleBlur}
+      onInput={this.onChange}
+      onkeydown={handleEnter}
+      contentEditable={editable}>{value||placeholder}</div>
+      <div className={this.getListClass()} style={{top:boxTop,left:boxLeft}} contentEditable="false">
+        <ul>
+          {data&&data.map((it)=>{
+          return <li onClick={(e)=>this.handleSelect(e,it)} className={this.getSeleStyle(it.id)} title={it.name.length>8?it.name:''}>{it.name&&it.name.length>8?it.name.slice(0,8)+'...':it.name}</li>
+        })}
+          <li onClick={this.handleClear} className={style['mClear']}>清空选项</li>
+          <li onClick={this.handleComfirn} className={style['mConfirm']}>确定</li>
+        </ul>
+        
+      </div>
+    </div>
+  }
+
+}
+
+export default Multiple;

+ 48 - 0
src/components/Multiple/index.less

@@ -0,0 +1,48 @@
+@import "~@less/mixin.less";
+.container{
+  display: inline-block;
+}
+.selected{
+    .select-li;
+  }
+.tag,.selected-tag{
+  cursor: pointer;
+  line-height: 20px;
+}
+
+.selected-tag{
+  padding: 0;
+  color: @text-color;
+  border-bottom: 1px @border-color solid;
+  line-height: 22px;
+}
+.list{
+  .pop;
+  padding: 0 0 10px;
+  color: @text-color;
+  li{
+    height: 32px;
+    line-height: 32px;
+    border:1px #fff solid;
+    padding: 0 20px;
+    white-space: nowrap;
+    cursor: pointer;
+  }
+  // li:hover,.selected{
+  li:hover{
+    border-color:#3B9ED0;
+  }
+}
+.hide{
+  display: none;
+}
+
+.mClear{
+  color:red;
+}
+.mConfirm{
+  color: #3B9ED0;
+  text-align: center;
+  border: 1px solid #3B9ED0;
+
+}

+ 44 - 52
src/components/NumberDrop/index.jsx

@@ -18,10 +18,8 @@ class NumberDrop extends Component{
     super(props);
     this.state={
       editable:false,      //标签是否可输入
-      numEditable:true,      //数字框是否可输入
       timer:null,
       hasSelect:false,       //是否点过下拉键盘
-      isClosed:false,
       boxLeft:0,
       boxTop:0,
       tmpTop:0,
@@ -30,6 +28,7 @@ class NumberDrop extends Component{
     this.$span = React.createRef();
     this.$pre = React.createRef();
     this.$suf = React.createRef();
+    this.$cont = React.createRef();
     this.select = this.select.bind(this);
     this.numInpBlur = this.numInpBlur.bind(this);
     this.handleSpanInp = this.handleSpanInp.bind(this);
@@ -38,7 +37,7 @@ class NumberDrop extends Component{
     this.handleBlur = this.handleBlur.bind(this);
     this.changeToEdit = this.changeToEdit.bind(this);
   }
-  select(text){         //选中键盘上数字事件
+  select(text){        //选中键盘上数字事件
     const {handleSelect,ikey,suffix,prefix,mainSaveText} = this.props;
     this.setState({
       hasSelect:true
@@ -47,57 +46,42 @@ class NumberDrop extends Component{
   }
   handleNumFocus(e){       //数字框可编辑状态下聚集事件,处理是否显示下拉等
     e.stopPropagation();
-    const {show,handleShow,ikey,id,patId,handleHide,value} = this.props;
-    const that = this;
-
-    //双击时不显示下拉
-    const timer = setTimeout(function(){
-      const {hasSelect,editable,isClosed} = that.state;
-      if(editable||isClosed){
-        return;
-      }
-      handleShow&&handleShow({ikey,id:patId||id});
-      that.setState({
-        numEditable:false
-      });
-    },300);
-    this.setState({
-      timer
-    });
   }
   handleNumClick(e){      //数字框不可编辑的状态时点击事件,点击将数字框变为可输入且下拉不再显示直到失焦后再次聚集
-    this.setState({
-      boxLeft:getPageCoordinate(e).boxLeft,
-      boxTop:getPageCoordinate(e).boxTop,
-      tmpScroll: $("#addScrollEvent")[0].scrollTop,
-      tmpTop:getPageCoordinate(e).boxTop
-    });
-    $("#addScrollEvent").scroll(()=>{
-      let scrollYs = $("#addScrollEvent")[0].scrollTop;
-      this.setState({
-        boxTop:this.state.tmpTop - scrollYs + this.state.tmpScroll
-      })
-    })
-    e.stopPropagation();
     const {show,handleShow,ikey,id,patId,handleHide,value} = this.props;
-    const {hasSelect} = this.state;
-
-    if(show&&!hasSelect){
+    if(show) {
+      handleHide && handleHide();
+      return;
+    }else{
+      const {editable} = this.state;
+      if(editable){
+        return;
+      }
+      const that = this;
+      //双击时不显示下拉
+      clearTimeout(that.state.timer);
+      const timer = setTimeout(function(){
+        handleShow&&handleShow({ikey,id:patId||id});
+      },300);
       this.setState({
-        numEditable:true,
-        isClosed:true
-      });
-      handleHide&&handleHide();
-      setTimeout(function(){
-        e.target.focus();
+        timer,
+        boxLeft:getPageCoordinate(e).boxLeft,
+        boxTop:getPageCoordinate(e).boxTop,
+        tmpScroll: $("#addScrollEvent")[0].scrollTop,
+        tmpTop:getPageCoordinate(e).boxTop
       });
+      $("#addScrollEvent").scroll(()=>{
+        let scrollYs = $("#addScrollEvent")[0].scrollTop;
+        this.setState({
+          boxTop:this.state.tmpTop - scrollYs + this.state.tmpScroll
+        })
+      })
     }
+    e.stopPropagation();
   }
   numInpBlur(e){        //数字框失焦,保存值到store中
     e.stopPropagation();
     this.setState({
-      isClosed:false,
-      numEditable:true,
       hasSelect:false
     });
     const val = e.target.innerText.replace(/^\s*/,'');
@@ -106,25 +90,32 @@ class NumberDrop extends Component{
     e.target.innerText = '';      //避免出现重复输入值
     handleSelect&&handleSelect({ikey,text,suffix,prefix,mainSaveText});
   }
-  handleSpanInp(e){    //数字框输入事件
+  handleSpanInp(e){   //数字框输入事件
     e.stopPropagation();
-    //const {value} = this.props;
+    const {handleHide} = this.props;
+    handleHide&&handleHide();
   }
   getClasses(){         //整个标签是否有值的状态
     const {value,hideTag,placeholder} = this.props;
+    const blueBorder = this.state.editable?style['blue-border']:'';
     const isSelected = value&&value!=placeholder?style['selected']:style['container'];
     const noTag = hideTag?style['no-tag']:'';
-    return className(isSelected,noTag);
+    return className(isSelected,noTag,blueBorder);
   }
   changeToEdit(e){        //整个标签双击编辑状态
-    const {value,id,handleDbclick,patId} = this.props;
+    const {value,id,handleDbclick,patId,handleHide,show} = this.props;
     clearTimeout(this.state.timer);//取消延时的单击事件
     e.preventDefault();
+    if(show){
+      handleHide&&handleHide();
+    }
     if(value&&value.trim()) {//有选中值的标签才能双击编辑
       this.setState({
         editable: true
       });
-      //e.target.focus();
+      setTimeout(()=>{
+        this.$cont.current.focus();
+      })
       //双击埋点记录
       handleDbclick && handleDbclick({id:patId||id});
     }
@@ -143,14 +134,15 @@ class NumberDrop extends Component{
     handleLabelChange && handleLabelChange({ikey,changeVal,type:boxMark,totalVal,prefix,suffix});
   }
   getSpanClass(){       //将被替换的文字选中状态显示
-    const {hasSelect} = this.state;
-    const cls = !hasSelect&&this.props.show?style['blued']:'';
+    //const {hasSelect} = this.state;
+    const cls = this.props.show?style['blued']:'';
     return cls;
   }
   render(){
     const {placeholder,prefix,suffix,show,value,handleHide} = this.props;
     const {numEditable,editable,hasSelect,boxTop,boxLeft} = this.state;
     return <div className={this.getClasses()}
+                ref={this.$cont}
                 onDoubleClick={this.changeToEdit}
                 contentEditable={editable}
                 onBlur={this.handleBlur}
@@ -158,7 +150,7 @@ class NumberDrop extends Component{
       <span ref = {this.$pre}>&nbsp;{prefix}</span>
       <span onFocus={this.handleNumFocus}
             onClick={this.handleNumClick}
-            contentEditable={numEditable}
+            contentEditable={true}
             style={{minWidth:'10px',display:'inline-block'}}
             ref = {this.$span}
             onBlur={this.numInpBlur}

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

@@ -3,7 +3,7 @@ import className from 'classnames';
 import {NumberUnitPan} from '@commonComp';
 import style from './index.less';
 import config from '@config/index.js';
-import {filterArr,handleEnter,isIE,getPageCoordinate} from '@utils/tools.js';
+import {filterArr,handleEnter,isIE,getPageCoordinate,filterDataArr} from '@utils/tools.js';
 import {Notify} from '@commonComp';
 import $ from 'jquery';
 /***
@@ -67,7 +67,6 @@ class NumberUnitDrop extends Component{
       }
       handleShow&&handleShow({ikey,id:patId||id});
     },300);
-    
     this.setState({
       timer,
       boxLeft:getPageCoordinate(e).boxLeft,
@@ -109,7 +108,7 @@ class NumberUnitDrop extends Component{
     // 主诉字数达到上限时不允许输入
     const {mainSaveText,ikey,type,handleSelect,suffix,prefix,boxMark} = this.props;
     const {labelVal,editable} = this.state;
-    let mainText = filterArr(mainSaveText);//主诉字数
+    let mainText = filterDataArr(mainSaveText);//主诉字数
     if(editable){//避免IE中点击标签也会触发
       let val = e.target.innerText;
       if(+boxMark==1){
@@ -132,6 +131,7 @@ class NumberUnitDrop extends Component{
   getClasses(){         //整个标签是否有值的状态
     const {value,hideTag,show} = this.props;
     const inpValue = this.state.value;
+    const blueBorder = this.state.editable?style['blue-border']:'';
     const isSelected = value||inpValue?style['selected']:style['container'];
     const noTag = hideTag?style['no-tag']:'';
     if(show){
@@ -139,7 +139,7 @@ class NumberUnitDrop extends Component{
     }else{
       $(this.$cont.current).removeClass(style['borderd']);
     }
-    return className(isSelected,noTag);
+    return className(isSelected,noTag,blueBorder);
   }
   changeToEdit(e){        //整个标签双击编辑状态
     e.stopPropagation();

+ 25 - 6
src/components/Operation/index.jsx

@@ -12,7 +12,6 @@ import {getAllDataList,getAllDataStringList,isAllClear,filterDataArr} from '@uti
 import store from '@store';
 import $ from 'jquery';
 
-
 class Operation extends Component {
   constructor(props) {
     super(props)
@@ -26,6 +25,7 @@ class Operation extends Component {
       type: '',
       zIndex:40,
       sex:'3',
+      le:'',
     }
     this.showPrint = this.showPrint.bind(this);
     this.closePrint = this.closePrint.bind(this);
@@ -167,7 +167,6 @@ class Operation extends Component {
   saveHis(type) {
     const { diagShowTmp } = this.props;
     let flg = this.getAllData();
-    console.log(flg)
     if(flg){
       this.setState({
         title: '',
@@ -309,16 +308,36 @@ class Operation extends Component {
       this.setState({ title: '' }) 
     }
   }
+  componentWillReceiveProps(next){//监听滚动事件
+    const that = this;
+    if(next.winWidth <= 1024){
+      /*$(document).on('scroll',function(){
+        let left = -($(document).scrollLeft() - 10) + 'px';
+        that.setState({
+          le:left
+        })
+      })*/
+      $(window).scroll(function(){
+        let scrollLeft = document.body.scrollLeft || document.documentElement.scrollLeft;
+        let left = -(scrollLeft - 10) +'px';
+        that.setState({
+          le:left
+        })
+      })
+    }
+  }
+
   render() {
     const { showPrint, closePrint, showPreview, closePreview } = this;
     const { visible, preVisible,diagShow } = this.props.print;
-    const {zIndex,type} = this.state;
-    return <div className={style['container']} style={{zIndex:zIndex}}>
+    const {winWidth} = this.props;
+    const {zIndex,type,le} = this.state;
+    return <div className={style['container']} style={{zIndex:zIndex,left:le}}>
       <span className={style['button']} onClick={showPrint}><img src={printImg} /> 打印病历</span>
       <span className={style['preButton']} onClick={showPreview}><img src={preview} /> 预览</span>
       <span className={style['preButton']} onClick={() => { this.saveHis(3) }}><img src={saveHistory} /> 保存病历模板</span>
-      <span className={style['saveButton']} onClick={() => { this.saveAll(1) }}>保存</span>
-      <span className={`${style['clearButton']} ${style['saveButton']}`} onClick={() => { this.clearAll(2) }}>清除</span>
+      <span className={winWidth<=1082?`${style['saveButton']} ${style['b1024']}`: style['saveButton']} onClick={() => { this.saveAll(1) }}>保存</span>
+      <span className={winWidth<=1082?`${style['clearButton']} ${style['saveButton']} ${style['b1024']}`:`${style['clearButton']} ${style['saveButton']}`} onClick={() => { this.clearAll(2) }}>清除</span>
       <PrintPreviewContainer visible={visible} onClose={closePrint} />
       <PreviewContainer visible={preVisible} onClose={closePreview} />
       <ConfirmModal

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

@@ -7,6 +7,7 @@
     left: 10px;
     right: 470px;
     // min-width: 720px;
+    min-width: 548px;
     background-color: #fff;
     // z-index: 240;
     padding-bottom: 10px;
@@ -66,6 +67,12 @@
         background-color: #fff;
         color: #000;
     }
+    .b1024{
+        width: 60px;
+        margin-left: 15px;
+        margin-right: 10px;
+        font-size: 13px;
+    }
     .modal{
         position: fixed;
         left: 50%;

+ 10 - 46
src/components/OtherHistory/index.jsx

@@ -4,7 +4,6 @@ import chooseType from '@containers/eleType.js';
 import SearchDrop from '@components/SearchDrop';
 import {filterDataArr,getPageCoordinate,windowEventHandler,isIE} from '@utils/tools'
 import $ from 'jquery';
-import style from './index.less';
 
 class OtherHistory extends Component{
   constructor(props){
@@ -20,12 +19,6 @@ class OtherHistory extends Component{
     this.handleClick = this.handleClick.bind(this);
     this.handleSearchSelect = this.handleSearchSelect.bind(this);
     this.getData = this.getData.bind(this);
-    this.handleInput = this.handleInput.bind(this);
-  }
-  toggleEditable(){
-    this.setState({
-      boxEditable:!this.state.boxEditable
-    })
   }
   handleSearchSelect(obj){
     const {questionId,name} = obj;
@@ -40,40 +33,23 @@ class OtherHistory extends Component{
     });
     return list;
   }
-  handleInput(e){     //主诉未填无法输入
-    const {type,hasMain} = this.props;
-    if(+type===0&&!hasMain){
-      e.target.innerText='';
-    }
-  }
   getData(){
     //第一次聚焦其他史时,主诉有数据则获取最近一次其他史记录(没有的话显示初始模板),主诉无数据则显示提示;其他时间其他史模板数据不调接口
-    const {hasMain,type,setInitData,data,saveText,changeEditClear} = this.props;
-    const hasData = saveText.join("")||data.length>0;
-    if(hasData){      //其他史已有数据不获取
-      return;
-    }
-    if(+type===0&&!hasMain){
-      document.activeElement.blur();        //修改第一次提示后不再提示bug
-      Notify.error("无法操作,请先输入主诉");
-      return;
-    }
+    const {hasMain,type,setInitData,isEmpty} = this.props;
+    console.log(isEmpty)
+    //无主诉提示在EditableSpan里
     //智能模式有主诉或者文本模式获取最近历史
-    setInitData();
+    if((+type===0&&hasMain&&isEmpty!=false)||(+type===1&&isEmpty!=false)){
+      setInitData();
+    }
 
-    //回读后容器框要不可编辑,否则自由文本标签onInput,onFocus事件失效(原因未知)
-    /*if(data.length>0){
-       this.setState({
-         editable:false
-       });
-      changeEditClear(false)
-    }*/
   }
   handleClick(e){//让搜索框跟随鼠标点击移动
     //e.stopPropagation();
     const {fetchPushInfos} = this.props;
     //fetchPushInfos&&fetchPushInfos();
     //若使用e.target,因为是onClick事件中,值可能是itembox的而不是span因此会有bug
+    this.getData();
     let leftL=0;      //用焦点元素的左边距替换鼠标点击的左边距,高度还是鼠标点击的位置
     if(isIE()){
       leftL = getPageCoordinate(e).boxLeft
@@ -98,21 +74,9 @@ class OtherHistory extends Component{
       })
     },$("#addScrollEvent")[0])
   }
-  /*componentWillReceiveProps(next){
-    const isRead = this.props;
-    this.setState({
-      isRead:next.isRead !== isRead
-    });
-  }
-  componentDidMount(){
-    const {setInitData} = this.props;
-    setInitData&&setInitData();
-  }*/
   render(){
-    const {data,hasMain,searchData,totalHide,showArr,focusTextIndex,isRead,type,fetchPushInfos,handleInput,saveText,editClear} = this.props;
-    const {boxTop,boxLeft,boxMark} = this.state;
-    const hasData = saveText.join("")||data.length>0;
-    const show = showArr&&showArr[boxMark+focusTextIndex+'0'];
+    const {hasMain,searchData,totalHide,isRead,type,fetchPushInfos,handleInput,saveText} = this.props;
+    const {boxTop,boxLeft} = this.state;
     if(+type===1){      //文本模式
       return <Textarea title='其他史' boxMark='3'
                        isRead={isRead}
@@ -123,7 +87,7 @@ class OtherHistory extends Component{
                        hasMain={hasMain}/>;
     }
     return  <div>
-      <ItemBox title='其他史' editable={hasData?false:true} isRead={isRead} handleClick={this.handleClick} handleFocus={this.getData} onchange={this.handleInput}>
+      <ItemBox title='其他史' isRead={isRead} handleClick={this.handleClick}>
         {this.getLabels()}
         {searchData && searchData.length>0?<SearchDrop data={searchData} show={!totalHide} left={boxLeft} top={boxTop} onSelect={this.handleSearchSelect}></SearchDrop>:''}
       </ItemBox>

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

@@ -12,7 +12,8 @@ class PatInfo extends Component {
 
   render(){
     const {message} = this.props.patInfo;
-     return <table className={style["table"]}>
+    const {sizeFlag} = this.props;
+     return <table className={sizeFlag?`${style["table"]} ${style["newSize"]}`:style["table"]}>
       <tr>
         <td key='1' className={`${style.tdBorderB} ${style.tdBorderR}`}>卡号:{message.patientIdNo && message.patientIdNo}</td>
         <td key='2' className={`${style.tdBorderB} ${style.tdBorderR}`}>姓名:{message.patientName && message.patientName}</td>

+ 5 - 0
src/components/PatInfo/index.less

@@ -17,3 +17,8 @@
     border-right: 1px solid @person-table-color;
   }
 }
+.newSize{
+  td{
+  font-size: 13px;
+  }
+}

+ 52 - 3
src/components/PushItems/DetailsModal/index.jsx

@@ -2,33 +2,82 @@ import React, { Component } from "react";
 import styles from "./index.less";
 import NewPortal from './NewPortal'
 import close from "./../img/close.png";
+import $ from "jquery";
 class DetailsModal extends Component {
     constructor(props) {
         super(props);
+        this.state = {
+            currentIndex: 0
+        }
         this.hideTips = this.hideTips.bind(this)
     }
     hideTips() {
         const { hideTips } = this.props;
         hideTips && hideTips();
     }
+    handleClickMenu(index, item, tipsDetails) {
+        const that = this
+        setTimeout(function(){
+            that.setState({
+                currentIndex: index
+            })
+        },0)
+        
+        let scrollTop = 0
+        tipsDetails.introduceDetailList.map((it, ii) => {
+            if( ii < index) {
+                scrollTop = scrollTop + parseInt($('#' + it.title).css('height'))
+            }
+        })
+        $('#detailsContent').scrollTop(scrollTop)
+    }
+    handleScrollModal(tipsDetails) {
+        const scrollTop = $('#detailsContent').scrollTop()
+        let divHeight = 0;
+        for (let i = 0; i < tipsDetails.introduceDetailList.length; i++) {
+            divHeight = divHeight + parseInt($('#' + tipsDetails.introduceDetailList[i].title).css('height'))
+            if(divHeight > scrollTop) {
+                this.setState({
+                    currentIndex: i
+                })
+                return
+            }
+        }
+    }
+    
+    
 
     render() {
         const {showTipsDetails, tipsDetails} = this.props;
+        const { currentIndex } = this.state
         const imageUrlPrefix = 'http://192.168.2.241:82'; //图片服务器地址
         return (<NewPortal visible={showTipsDetails}>
         <div className={styles['details-wrapper']}>
            <div className={styles['details-content-wrapper']}>
                 <h1 className={styles['details-content-name']} >{tipsDetails && tipsDetails.name} <img className={styles['details-close']} onClick={this.hideTips} src={close} /></h1>
-                <div className={styles['details-content']}>
+                <div className={styles['details-content']} id= 'detailsContent' onScroll={this.handleScrollModal.bind(this, tipsDetails)}>
                     {tipsDetails && tipsDetails.introduceDetailList && tipsDetails.introduceDetailList.map((item, index) => {
-                        return (<div>
-                            <div className={styles['details-content-title-box']}>
+                        return (<div id={item.title}>
+                            <div className={styles['details-content-title-box']} >
                                 <span className={styles['details-content-title-name']}>{item.title}</span>
                                 <div className={styles['details-content-title-line']}></div>
                             </div>
                             <div dangerouslySetInnerHTML ={{__html: item.content.replace(/{imageUrlPrefix}/g, imageUrlPrefix)}}></div>
                         </div>)
                     })}
+                    
+                </div>
+                <div className={styles['content-menu']}>
+                    {tipsDetails && tipsDetails.introduceDetailList && tipsDetails.introduceDetailList.map((item, index) => {
+                            return (<div>
+                                <div className={styles['details-menu-title-box']}>
+                                    {index === 0 ? '' : <div className={styles['details-content-menu-line']}></div>}
+                                    <span onClick={this.handleClickMenu.bind(this, index, item, tipsDetails)} className={styles['details-content-menu-name']} style = {index === currentIndex ? {color:'#0089be'} : ''}>
+                                        <span className={styles['details-content-menu-circle']} style = {index === currentIndex ? {background:'#0089be'} : ''}></span>{item.title}
+                                    </span>
+                                </div>
+                            </div>)
+                        })}
                 </div>
            </div>
            <div className={styles['details-mask']}>

+ 34 - 1
src/components/PushItems/DetailsModal/index.less

@@ -15,6 +15,7 @@
     left: 10%;
     top: 10%;
     background: #fff;
+    overflow: hidden;
     z-index: 10;
 }
 
@@ -55,10 +56,42 @@
     right: 0;
 }
 .details-content {
+    position: relative;
     height: 100%;
-    padding: 0 40px;
+    padding: 0 180px 0 40px;
     overflow-y: auto;
 }
+.content-menu {
+    position: absolute;
+    top: 50px;
+    right: 20px;
+    background: #eee;
+    border: 1px solid #eee;
+    width: 160px;
+    padding: 15px 18px;
+}
+.details-content-menu-line {
+    height: 15px;
+    width: 0;
+    border: 1px solid #ccc;
+    background-color: #ccc;
+    margin-left: 4px
+}
+.details-content-menu-name {
+    color: #33475f;
+    font-size: 13px;
+    cursor: pointer;
+}
+.details-content-menu-circle {
+    display: inline-block;
+    width: 8px;
+    height: 8px;
+    border-radius: 5px;
+    border: 1px solid #ccc;
+    margin-top: 5px;
+    background-color: #eee;
+    margin-right: 10px;
+}
 .details-mask {
     position: fixed;
     width: 100%;

+ 9 - 5
src/components/PushItems/index.jsx

@@ -46,11 +46,15 @@ class PushItems extends Component {
     const checkedAssay = assay.filter(item => item.checked);
     const checkedCheck = check.filter(item => item.checked);
     this.props.billing(checkedAssay, checkedCheck);
-    const Height = $(".src-components-BodyContainer-2SgEx").height();
-    const adviceHeight = $(".src-common-components-ItemBox-1Bpz3").height();
-    const winHeight = window.innerHeight;
-    const scrollTop = Height;
-    document.documentElement.scrollTop = 10000;
+    if(checkedAssay.length > 0 || checkedCheck.length > 0) {
+      console.log('checkedCheck',checkedAssay, checkedCheck)
+      const Height = $(".src-components-BodyContainer-2SgEx").height();
+      const adviceHeight = $(".src-common-components-ItemBox-1Bpz3").height();
+      const winHeight = window.innerHeight;
+      const scrollTop = Height;
+      document.documentElement.scrollTop = 10000;
+    }
+    
   }
 
   changeAssay(item) {

+ 4 - 2
src/components/PushItems/index.less

@@ -108,15 +108,16 @@
       div{
         float: right;
         width: 50px;
-        height: 26px;
         border: 1px solid #3B9ED0;
         text-align: center;
-        line-height: 26px;
         padding:0px;
         border-radius: 4px;
         margin-top: -3px;
         cursor: pointer;
         font-weight: normal;
+        height: 28px;
+        line-height: 28px;
+        font-size: 12px;
       }
     }
     div{
@@ -339,6 +340,7 @@
 }
 .billing {
   color: #3B9ED0;
+  
 }
 .disTips {
   padding: 10px 20px 0;

+ 6 - 1
src/components/RadioDrop/index.jsx

@@ -29,6 +29,7 @@ class RadioDrop extends Component{
       tmpTop:0,
     };
     this.$cont = React.createRef();
+    this.isIE = navigator.appName=="Microsoft Internet Explorer" && navigator.appVersion.split(";")[1].replace(/[ ]/g,"")=="MSIE8.0";
     this.handleSelect = this.handleSelect.bind(this);
     this.handleShow = this.handleShow.bind(this);
     this.handledbClick = this.handledbClick.bind(this);
@@ -36,6 +37,7 @@ class RadioDrop extends Component{
   }
   getClass(){
     const {value,hideTag,placeholder,show} = this.props;
+    const blueBorder = this.state.editable?style['blue-border']:'';
     if(show){
       $(this.$cont.current).addClass(style['borderd']);
     }else{
@@ -45,7 +47,7 @@ class RadioDrop extends Component{
       return style['no-tag'];
     }
     if(value){
-      return style['selected-tag'];
+      return blueBorder?style['selected-tag']+' '+blueBorder:style['selected-tag'];
     }
     return style['tag'];
   }
@@ -119,6 +121,9 @@ class RadioDrop extends Component{
    // 更改标签的value值
     const ev = e || window.event;
     let changeVal = ev.target.innerText;
+    if(!this.isIE){
+      ev.target.innerText = '';
+    }
     handleLabelEdit && handleLabelEdit({ikey,changeVal,type:boxMark});
   }
   handledbClick(e){

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

@@ -2,6 +2,7 @@
 .list{
   max-height:300px;
   overflow-y: auto;
+  overflow-x: hidden;
   .pop;
   left: 85px;
   padding: 0 0 10px;

+ 13 - 11
src/components/SpreadDrop/index.jsx

@@ -2,7 +2,7 @@ import React,{Component} from 'react';
 import classNames from 'classnames';
 import config from '@config/index.js';
 import style from './index.less';
-import {deepClone,filterArr,handleEnter,isIE,getPageCoordinate,windowEventHandler} from '@utils/tools.js';
+import {deepClone,filterArr,handleEnter,isIE,getPageCoordinate,windowEventHandler,filterDataArr} from '@utils/tools.js';
 import {Notify} from '@commonComp';
 import ReactDom from "react-dom";
 import {getIds} from '@common/js/func.js';
@@ -112,7 +112,7 @@ class SpreadDrop extends Component{
   onChange(e){
     const {mainSaveText,ikey,type,handleLabelChange} = this.props;
     const {labelVal,editable} = this.state;
-    let mainText = filterArr(mainSaveText);//主诉字数
+    let mainText = filterDataArr(mainSaveText);//主诉字数
     if(editable){//避免IE中点击标签也会触发
       let val = e.target.innerText;
       if(+type==1){// 主诉字数达到上限时不允许输入
@@ -190,8 +190,8 @@ class SpreadDrop extends Component{
   }
   handleConfirm(e){
     e.stopPropagation();
-    const {handleConfirm,ikey,type,tagType,order,mainSaveText,copyType} = this.props;
-    const params = Object.assign({},this.state,{ikey,type,tagType,order,mainSaveText,copyType});
+    const {handleConfirm,ikey,type,tagType,order,mainSaveText,copyType,value} = this.props;
+    const params = Object.assign({},this.state,{ikey,type,tagType,order,mainSaveText,copyType,value});
     handleConfirm&&handleConfirm(params);
 	this.btnClickFlag = true;
     //点确定后隐藏弹窗
@@ -300,17 +300,18 @@ class SpreadDrop extends Component{
     });
   }
   getClass(){
+    const blueBorder = this.state.editable?style['blue-border']:'';
     if(this.props.show){
       $(this.$div.current).addClass(style['borderd']);
     }else{
       $(this.$div.current).removeClass(style['borderd']);
     }
     if(this.props.value){
-      return style['selected-tag'];
+      return classNames(style['selected-tag'],blueBorder);
     }
     return style['tag'];
   }
-  
+
   componentDidMount(){
     if(isIE()){
       $(this.$div.current).onIe8Input(function(e){
@@ -336,7 +337,7 @@ class SpreadDrop extends Component{
         onInput={this.onChange}
         onkeydown={handleEnter}
         >{value||placeholder}</div>
-          <ListItems data={data} left={boxLeft} 
+          <ListItems data={data} left={boxLeft}
             top={boxTop} show={show} handleSelect={this.handleSelect} handleConfirm={this.handleConfirm} handleClear={this.handleClear} {...this.state}></ListItems>
       </div>
   }
@@ -380,7 +381,7 @@ class ListItems extends Component{
       display:show?'block':'none'
     }
   }
-  render (){   
+  render (){
     const {handleClear,handleConfirm} = this.props;
     const domNode = document.getElementById('root');
     return ReactDom.createPortal(
@@ -394,6 +395,7 @@ class ListItems extends Component{
     ,domNode)
   }
 }
+
 class ListItem extends Component{
   constructor(props){
     super(props);
@@ -402,7 +404,6 @@ class ListItem extends Component{
     e.stopPropagation();
     // window.event? window.event.cancelBubble = true : e.stopPropagation();
     const {handleClick,isExclu,isRadio,data,exists,noneIds,withs,joint,listIndex} = this.props;
-
     const index=listIndex+''+i;
     //列单选处理
     if(isRadio){
@@ -448,8 +449,9 @@ class ListItem extends Component{
     const pos = isSpecialPos?style['independent']:'';
     return <ul className={classNames(style['row'],pos)} onBlur={(e)=>e.stopPropagation()}>
       {datas&&datas.map((it,i)=>{
-        return <li onClick={(e)=>this.handleClick(e,it,i)}
-                   className={this.getClass(it.id)}>{it.labelPrefix}{it.name}{it.labelSuffix}</li>
+        /*return <li onClick={(e)=>this.handleClick(e,it,i)}
+                   className={this.getClass(it.id)}>{it.labelPrefix}{it.name}{it.labelSuffix}</li>*/
+          return <li onClick={(e)=>this.handleClick(e,it,i)} className={this.getClass(it.id)} title={it.name.length>8?it.name:''}>{it.name&&it.name.length>8?it.name.slice(0,8)+'...':it.name}</li>
       })}
     </ul>;
   }

+ 44 - 5
src/components/Treat/DrugTreat/index.jsx

@@ -1,6 +1,7 @@
 import React, { Component } from 'react';
 import style from './index.less';
 import info from './../img/info.png';
+import info1 from './../img/info1.png';
 import drugIcon from './../img/drug.png';
 import more from '@common/images/addItem1.png';
 import $ from "jquery";
@@ -8,16 +9,31 @@ import $ from "jquery";
 class DrugTreat extends Component {
     constructor(props) {
         super(props);
+        this.state = {
+            currentImg: -1,
+        }
         this.handleSelect = this.handleSelect.bind(this);
         this.setOtherRecommend = this.setOtherRecommend.bind(this);
         this.setDrugInfo = this.setDrugInfo.bind(this);
         this.showTreatDesc = this.showTreatDesc.bind(this);
+        this.handleMouseLeaveImg = this.handleMouseLeaveImg.bind(this)
     }
 
     handleSelect(index,ii) {
         const { selectDrug } = this.props;
         selectDrug && selectDrug(index,ii);
     }
+    handleMouseEnterImg(ii, index) {
+        this.setState({
+            currentIndex: index,
+            currentImg: ii
+        })
+    }
+    handleMouseLeaveImg() {
+        this.setState({
+            currentIndex: -1,
+        })
+    }
     setOtherRecommend(item, index) {
         this.showTreatDesc();
         const { setOtherRecommend } = this.props;
@@ -27,6 +43,20 @@ class DrugTreat extends Component {
         const { setDrugInfo } = this.props;
         setDrugInfo && setDrugInfo(item);
     }
+    //搜索药品说明书(查看数据用)
+    handleInputDrug(e) {
+        this.setState({
+            drugIdList: e.target.value
+         })
+    }
+    //搜索药品说明书(查看数据用)
+    searchDrug() {
+        const { showDrugInfo, setDrugInfoMore } = this.props
+        const drugIdList = this.state.drugIdList.split(' ')
+        setDrugInfoMore({drugIdList: drugIdList})
+        showDrugInfo && showDrugInfo();
+
+    }
     showTreatDesc() {
         $('#treatDescBox').css({'display': 'block'});
         $('#treatWrapper').animate({'margin-left': '-470px'}, 300);
@@ -38,23 +68,32 @@ class DrugTreat extends Component {
 
     render(){
         const { treatment,showDrugInfo } = this.props
+        const { currentImg, currentIndex } = this.state
         return(
             treatment && treatment.length > 0 && <div className={style['drug-box']}>
                 <h3 className={style['drug-title']}><img className={style['drug-icon']} src={drugIcon}/> 常用药物治疗</h3>
+                {/* 查看药物说明书 */}
+                <div> <input onInput={this.handleInputDrug.bind(this)} style={{border:'1px solid #000'}} type="text"/><button onClick = {this.searchDrug.bind(this)}>搜索药品说明</button></div>
                 {treatment.map((item, index) => {
                     return(<div className={style['drug-content']}>
                         <div  className={style['drug-name-box']}>
-                            {index + 1 + '. ' }{item.drugsName}:&nbsp;
+                            <span>{index + 1 + '. ' }{item.bigdrugsName}<span>({item.subdrugsName})</span>:&nbsp;</span>
                             {item.medicitionsList.map((it, ii) => {
-                                return ((it.isShow == 1 || it.selected) && <span style={it.forbidden === '2' ? {opacity: '0.3', filter:'alpha(opacity=30)'} : ''}>
+                                return ((it.isShow == 1 || it.selected) && <span >
                                         {ii === 0 ? '' : ', '}
                                         <span className={style['drug-name']}  
                                             // onDoubleClick={() =>{this.setDrugInfo(it);showDrugInfo();}}  //药品说明双击显示(现在为点击图标显示)
-                                            onClick={()=>{it.forbidden === '2' ? '' : this.handleSelect(index,ii)}} style={it.selected ? {color: '#3B9ED0', borderBottom: '1px solid #3B9ED0'}:''}>
+                                            onClick={()=>{it.forbidden === '2' ? '' : this.handleSelect(index,ii)}} 
+                                            style={it.forbidden === '2' ? {opacity: '0.3', filter:'alpha(opacity=30)',filter:'progid:DXImageTransform.Microsoft.Alpha(opacity=30)'} : it.selected ? {color: '#3B9ED0', borderBottom: '1px solid #3B9ED0'}:''}
+                                            >
                                             {it.medicitionName}
                                         </span>
-                                        {<img className={style['info-img']} src={info} onClick={() =>{this.setDrugInfo(it);showDrugInfo();}}/>}
-                                        {it.forbidden === '1' ? <span className={style['info-flag']} style={{border: '1px solid #F4C051', background: '#F4C051',marginLeft: '5px'}}>慎用</span>: it.forbidden === '2' ? <span className={style['info-flag']} style={{border: '1px solid #000',marginLeft: '5px'}}>禁用</span> : ''}, 使用率{it.rate}
+                                        {<img className={style['info-img']}    
+                                              src={currentIndex === index ? (ii === currentImg ? info1 : info) : info} 
+                                              onMouseEnter={this.handleMouseEnterImg.bind(this, ii, index)}
+                                              onMouseLeave = {this.handleMouseLeaveImg}
+                                              onClick={() =>{this.setDrugInfo(it);showDrugInfo();}}/>}
+                                        {it.forbidden === '1' ? <span className={style['info-flag']} style={{opacity: '0.3',border: '1px solid #F4C051', background: '#F4C051',marginLeft: '5px'}}>慎用</span>: it.forbidden === '2' ? <span className={style['info-flag']} style={{opacity: '0.3',filter:'alpha(opacity=30)',filter:'progid:DXImageTransform.Microsoft.Alpha(opacity=30)',border: '1px solid #000',marginLeft: '5px'}}>禁用</span> : ''}, 使用率{it.rate}
                                         
                                     </span>)
                             })}

+ 1 - 0
src/components/Treat/DrugTreat/index.less

@@ -23,6 +23,7 @@
 .info-img {
     width: 12px;
     margin: 0 3px -1px;
+    cursor: pointer;
 }
 .info-flag {
     display: inline-block;

BIN
src/components/Treat/img/info1.png


+ 10 - 3
src/components/Treat/index.jsx

@@ -38,7 +38,10 @@ class Treat extends Component {
     }
 
     render(){
-        const { generalTreat, treatment, treatItem, surgeryTreat, selectDrug, drugInfo, treatDesc, setOtherRecommend, setDrugInfo, showDrug, showDrugInfo,hideDrugInfo, title} = this.props;
+    
+    
+        const { generalTreat, treatment, treatItem, surgeryTreat, selectDrug, drugInfo, treatDesc, setOtherRecommend, setDrugInfo, showDrug, showDrugInfo,hideDrugInfo, title, drugInfoList, hideDrugInfoMore} = this.props;
+        const { setDrugInfoMore } = this.props
         return(
             <div   className={style['treat-wrapper']}>
                 <div className={style['treat-mask']}>
@@ -52,7 +55,9 @@ class Treat extends Component {
                                 selectDrug={selectDrug} 
                                 setOtherRecommend={ setOtherRecommend } 
                                 showDrugInfo = {showDrugInfo}
-                                setDrugInfo={ setDrugInfo }>
+                                setDrugInfo={ setDrugInfo }
+                                setDrugInfoMore = {setDrugInfoMore} //查询多条药品说明数据
+                            >
                         </DrugTreat> 
                         <GeneralTreat icon={surgicalIcon} title='手术治疗' titleStyle={{background:'#FAEAEA',opacity:'1', filter:'alpha(opacity=100);',filter:'progid:DXImageTransform.Microsoft.Alpha(opacity=100);'}} titleBg='#FAEAEA' generalTreat={surgeryTreat}></GeneralTreat>
                     </div>
@@ -71,7 +76,9 @@ class Treat extends Component {
                 </div>
                 
                 
-                {showDrug && drugInfo && <DrugInfo drugInfo = {drugInfo} hideDrugInfo = {hideDrugInfo}></DrugInfo>}
+                {/* {showDrug && drugInfo && <DrugInfo drugInfo = {drugInfo} hideDrugInfo = {hideDrugInfo}></DrugInfo>} */}
+                {/* 查询多个药品说明书 (添加数据查看药品说明书用)*/}
+                {showDrug && <DrugInfo drugInfoList = {drugInfoList} hideDrugInfoMore = {hideDrugInfoMore}></DrugInfo>}
             </div>
                 
             

+ 37 - 13
src/components/TreatDesc/DrugInfo/index.jsx

@@ -8,23 +8,47 @@ class DrugInfo extends Component {
     }
 
     render() {
-        const { drugInfo, hideDrugInfo } = this.props
-        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>
-                { drugInfo && drugInfo.drugDesc.length > 0 && <div className={style['drug-desc-wrapper']}>
-                    <div className={style['drug-title1']}>{drugInfo.title}说明书</div>
-                    {drugInfo.drugDesc.map((item, index) =>{
-                        return <div className={style['drug-desc-item']}><span className={style['drug-desc-title']}>{item.title}</span> <span className={style['drug-desc-content']} dangerouslySetInnerHTML ={{__html: item.content}}></span> </div>
-                    })}
-                </div> }
-                { !drugInfo || (drugInfo && drugInfo.drugDesc.length === 0) && <div className={style['drug-desc-wrapper']}>
-                    <div>
-                        该药品暂无说明
-                    </div>
+        const { drugInfo, hideDrugInfo, drugInfoList,hideDrugInfoMore } = this.props
+        // 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>
+        //         { drugInfo && drugInfo.drugDesc.length > 0 && <div className={style['drug-desc-wrapper']}>
+        //             <div className={style['drug-title1']}>{drugInfo.title}说明书</div>
+        //             {drugInfo.drugDesc.map((item, index) =>{
+        //                 return <div className={style['drug-desc-item']}><span className={style['drug-desc-title']}>{item.title.trim()}</span> <div className={style['drug-desc-content']} dangerouslySetInnerHTML ={{__html: item.content}}></div> </div>
+        //             })}
+        //         </div> }
+        //         { !drugInfo || (drugInfo && drugInfo.drugDesc.length === 0) && <div className={style['drug-desc-wrapper']}>
+        //             <div>
+        //                 该药品暂无说明
+        //             </div>
                     
+        //         </div> }
+
+        // </div>)
+
+         return (<div className={style['drug-info-wrapper']}>
+                <h3 className={style['drug-title']}>说明书  <img src={close} onClick={hideDrugInfoMore} className={style['close-drug-desc']}/> </h3>
+                { drugInfoList && drugInfoList.length > 0 && <div className={style['drug-desc-wrapper']}>
+                    {drugInfoList.map((item,index) => {
+                        return <div>
+                            <h3 style={{height:' 50px', fontSize:'40px', fontWeight: '800'}}>{'【'+item.id+'】'}{item.name}说明书  </h3>
+                            {item.introduceDetailList&&item.introduceDetailList.length>0&&item.introduceDetailList.map((it, index) =>{
+                                return <div className={style['drug-desc-item']}><span className={style['drug-desc-title']}>{it.title.trim()}</span> <div className={style['drug-desc-content']} dangerouslySetInnerHTML ={{__html: it.content}}></div> </div>
+                            })}
+                             <br/>
+                            <br/> <br/> <br/> <br/>
+                        </div>
+                        
+                       
+
+                    })}
+                   
                 </div> }
+               
 
         </div>)
+
+
     }
 }
 

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

@@ -30,7 +30,15 @@
     width: 40px;
 }
 .drug-desc-item {
+    zoom: 1;
     padding: 5px 0;
+    &:after{
+        content: "";
+        display: block;
+        height: 0;
+        clear: both;
+        visibility: hidden;
+    }
 }
 .drug-desc-title {
     display: inline-block;
@@ -38,6 +46,9 @@
     font-size: 14px;
     height: 100%;
     float: left;
+    width: 190px;
+    text-align-last:justify;    /*chrome*/
+    text-justify: distribute;   /*ff*/
 }
 .drug-desc-title::before {
     content: '【'
@@ -52,4 +63,7 @@
     color: #000000;
     text-align: center;
 }
-.drug-desc-content {}
+.drug-desc-content {
+    /*width: 100%;*/
+    margin-left: 210px;
+}

BIN
src/components/TreatDesc/img/info1.png


+ 27 - 5
src/components/TreatDesc/index.jsx

@@ -3,15 +3,30 @@ import style from './index.less';
 import $ from "jquery";
 import close from './img/close.png';
 import info from './img/info.png';
+import info1 from './img/info1.png';
 
 
 class TreatDesc extends Component {
     constructor(props){
         super(props);
+        this.state = {
+            currentIndex: -1
+        }
         this.hideTreatDesc = this.hideTreatDesc.bind(this);
         this.handleSelect= this.handleSelect.bind(this);
+        this.handleMouseLeaveImg = this.handleMouseLeaveImg.bind(this)
     }
 
+    handleMouseEnterImg(index) {
+        this.setState({
+            currentIndex: index,
+        })
+    }
+    handleMouseLeaveImg() {
+        this.setState({
+            currentIndex: -1,
+        })
+    }
     handleSelect(index,ii) {
         const { selectDrug } = this.props;
         selectDrug && selectDrug(index,ii);
@@ -25,6 +40,7 @@ class TreatDesc extends Component {
     render(){
         const  { treatment, treatDesc, setDrugInfo, showDrugInfo} = this.props
         const { title, basic, otherDrugIndex, drugDesc} = treatDesc
+        const { currentIndex } = this.state
         return (treatment && treatment.length >0 && <div  className={style['treat-desc-box']}>
             
             {title && title === '药品推荐' ? <div className={style['similar-drug-box']} id='treatDescBox'>
@@ -39,19 +55,25 @@ class TreatDesc extends Component {
                 { otherDrugIndex > -1 && <div  className={style['similar-drug']}>
                     <h3 className={style['drug-desc-title']}><span className={style['drug-desc-class-title']} title={'同类药物(' + treatment[otherDrugIndex].drugsName + ')'}>同类药物({treatment[otherDrugIndex].drugsName})</span>  <img src={close} onClick={this.hideTreatDesc} className={style['close-drug-desc']} /></h3>
                     {treatment[otherDrugIndex].medicitionsList.map((item, index) =>{
-                        return (<span   style={item.forbidden === '2' ? {opacity: '0.3', filter:'alpha(opacity=30)'} : ''}>
+                        return (<span >
                         {index === 0 ? '' : ', '}     
                         <span className={style['drug-name-box']}>
                             <span className={style['drug-name']} 
-                                onDoubleClick={() =>{setDrugInfo(item);showDrugInfo();}} 
+                                // onDoubleClick={() =>{setDrugInfo(item);showDrugInfo();}} 
                                 onClick={()=>{item.forbidden === '2' ? '' : this.handleSelect(otherDrugIndex,index)}} 
-                                style={item.selected ? {color: '#3B9ED0'}:''}>
+                                style={item.forbidden === '2' ? {opacity: '0.3', filter:'alpha(opacity=30)',filter:'progid:DXImageTransform.Microsoft.Alpha(opacity=30)'} : item.selected ? {color: '#3B9ED0'}:''}
+                              
+                                >
                                 {item.medicitionName}
                             </span>
                         </span>              
                         
-                        {<img  onClick={() =>{setDrugInfo(item);showDrugInfo();}}  className={style['info-img']} src={info} />}
-                        {item.forbidden === '1' ? <span className={style['info-flag']} style={{border: '1px solid #F4C051', background: '#F4C051',marginLeft: '5px'}}>慎用</span>: item.forbidden === '2' ? <span className={style['info-flag']} style={{border: '1px solid #000',marginLeft: '5px'}}>禁用</span> : ''}, 使用率{item.rate}
+                        {<img className={style['info-img']}    
+                            src={currentIndex === index ? info1 : info} 
+                            onMouseEnter={this.handleMouseEnterImg.bind(this, index)}
+                            onMouseLeave = {this.handleMouseLeaveImg}
+                            onClick={() =>{setDrugInfo(item);showDrugInfo();}}/>}
+                        {item.forbidden === '1' ? <span className={style['info-flag']} style={{border: '1px solid #F4C051', background: '#F4C051',marginLeft: '5px'}}>慎用</span>: item.forbidden === '2' ? <span className={style['info-flag']} style={{opacity: '0.3', filter:'alpha(opacity=30)',filter:'progid:DXImageTransform.Microsoft.Alpha(opacity=30)',border: '1px solid #000',marginLeft: '5px'}}>禁用</span> : ''}, 使用率{item.rate}
                         
                     </span>)
                     })}

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

@@ -59,6 +59,7 @@
 .info-img {
     width: 12px;
     margin: 0 3px -1px;
+    cursor: pointer;
 }
 .info-flag {
     display: inline-block;

+ 1 - 0
src/config/index.js

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

+ 2 - 1
src/containers/CheckBody.js

@@ -4,10 +4,11 @@ import {getModule,getInitData} from '@store/async-actions/fetchModules.js';
 import {HIDE,RESET,SETDROPSHOW,ISREAD} from '@store/types/homePage.js';
 import {SELECTSEARCHDATA} from "@store/types/checkBody";
 import {billing} from '@store/async-actions/pushMessage';
+import {filterDataArr} from '@utils/tools.js';
 
 function mapStateToProps(state){ 
   const {homePage,mainSuit,checkBody} = state;
-  const hasMain = mainSuit.saveText.join('');//||mainSuit.data.length;
+  const hasMain = filterDataArr(mainSuit.saveText);//||mainSuit.data.length;
   return {
     data:checkBody.data,
     isEmpty:checkBody.isEmpty,

+ 1 - 2
src/containers/CurrentIll.js

@@ -12,7 +12,7 @@ import {getModule} from '@store/async-actions/fetchModules.js';
 import {didPushParamChange} from '@utils/tools.js';
 
 
-function mapStateToProps(state) {
+function mapStateToProps(state) { //console.log(111,state);
   const {homePage} = state;
     return {
         data:state.currentIll.data,//主诉模板
@@ -29,7 +29,6 @@ function mapStateToProps(state) {
         moduleNum:state.mainSuit.moduleNum,//主诉使用的模板
         type: state.typeConfig.typeConfig,
         mainIds:state.mainSuit.mainIds,//主诉症状选中的id(去重用)
-        mainSymptIds:state.mainSuit.mainSymptIds,//主诉症状选中的id(移植用)
         fillInfo: state.fillInfo,
         showArr:homePage.showDrop,
         totalHide: homePage.totalHide,

+ 1 - 1
src/containers/DiagnosticItem.js

@@ -10,7 +10,7 @@ import {billing, getTips} from '../store/async-actions/pushMessage';
 
 function mapStateToProps(state) {
     return {
-
+        diagnosticList: state.diagnosticList.diagnosticList
     }
 }
 

+ 2 - 2
src/containers/DiagnosticList.js

@@ -20,10 +20,10 @@ function mapStateToProps(state) {
 
 function mapDispatchToProps(dispatch) {
     return {
-        delDiagnostic: (id) => {
+        delDiagnostic: (item) => {
             dispatch({
                 type: DEL_DIAGNOSTIC,
-                id: id
+                item: item
             });
             dispatch(getSearchResult)
             

+ 7 - 1
src/containers/EditableSpan.js

@@ -2,7 +2,7 @@ import {connect} from 'react-redux';
 import {EditableSpan} from '@commonComp';
 import {SETCHECKTEXT,SETSEARCHDATA,CHECK_FOCUS_INDEX,CHECKBODY_CLEAR,DEL_CHECKBODY} from '@types/checkBody';
 import {SET_SEARCH,MAIN_FOCUS_INDEX,CLEAR_SEARCH,SETMAINTEXT,DEL_MAIN,REMOVE_MAIN_ID} from '@types/mainSuit';
-import {SETOTHERTEXT,SETOTHERSEARCHDATA,OTHER_FOCUS_INDEX,OTHERHIS_CLEAR,DEL_OTHERHIS} from '@types/otherHistory';
+import {SETOTHERTEXT,SETOTHERSEARCHDATA,OTHER_FOCUS_INDEX,OTHERHIS_CLEAR,DEL_OTHERHIS,REMOVE_OTHER_ID} from '@types/otherHistory';
 import {SET_CURRENT_SEARCH,CURRENT_CLEAR,SETCURRENTTEXT,CURRENT_FOCUS_INDEX,DEL_CURRENT,REMOVE_CURR_ID} from '@types/currentIll';
 import {getSearch} from '@store/async-actions/fetchModules.js';
 import {billing} from '@store/async-actions/pushMessage';
@@ -244,9 +244,15 @@ function mapDispatchToProps(dispatch,state) {
         case 2:
           dispatch({type:REMOVE_CURR_ID,index:obj.i,text:obj.text});
           break;
+        case 3:
+          dispatch({type:REMOVE_OTHER_ID,index:obj.i});//移除多余空标签
+          break;
         default:
           break;
       }
+    dispatch({
+      type:ISREAD
+    })
     }
   }
 }

+ 2 - 2
src/containers/MainSuit.js

@@ -7,7 +7,7 @@ import {getCommSymptoms,getCommSymptomPush} from '@store/async-actions/mainSuit.
 import {SET_MAIN_SUIT} from '@store/types/fillInfo';
 import {getSearch} from '@store/async-actions/fetchModules';
 import {billing} from '@store/async-actions/pushMessage';
-import {filterArr,didPushParamChange} from '@utils/tools.js';
+import {filterArr,didPushParamChange,filterDataArr} from '@utils/tools.js';
 import config from '@config/index.js';
 import {Notify} from '@commonComp';
 
@@ -51,7 +51,7 @@ function mapDispatchToProps(dispatch) {
           })
         },
         handleTailClick:(obj,saveText)=>{//点击带尾巴的标签,如添加病程变化
-          let text = filterArr(saveText);
+          let text = filterDataArr(saveText);
           if(text.length >= config.limited){
             Notify.info(config.limitText);
             return

+ 182 - 0
src/containers/Multiple.js

@@ -0,0 +1,182 @@
+// import React from "react";
+import {connect} from "react-redux";
+import Multiple from "@components/Multiple";
+import {RESET,SETDROPSHOW,HIDEDROP,CLICKCOUNT,ISREAD} from '@store/types/homePage.js';
+import {CURRENT_MUL,CURRENT_TEXT_LABEL} from '@types/currentIll';
+import {MAINSUIT_MUL,CHANGE_LABELVAL} from '@types/mainSuit';
+import {OTHERHIS_MUL,CHANGEOTHERTEXTLABEL} from '@types/otherHistory';
+import {CHECKBODY_MUL,CHANGECHECKTEXTLABEL} from '@types/checkBody';
+import {getLabelIndex,fullfillText,getIds} from '@common/js/func.js';
+import {filterArr,filterDataArr} from '@utils/tools.js';
+import config from '@config/index.js';
+import {Notify} from '@commonComp';
+
+function handleMainSuit(dispatch,params){
+  const {ikey,seleData,seleId,value,mainSaveText} = params;
+  //字数限制
+  let mainText = filterDataArr(mainSaveText);
+  let lengths = value?mainText.length - value.length + seleData.length:mainText.length + seleData.length;
+  if(lengths > config.limited){
+    Notify.info(config.limitText);
+    return
+  }
+  const index = getLabelIndex(ikey);
+  dispatch({
+    type:MAINSUIT_MUL,
+    data:{seleData,seleId,ikey:index}
+  })
+}
+
+function handleCurrent(dispatch,params){
+  const {ikey,seleData,seleId} = params;
+  const index = getLabelIndex(ikey);
+  dispatch({
+    type:CURRENT_MUL,
+    data:{seleData,seleId,ikey:index}
+  })
+}
+
+function handleOtherHis(dispatch,params){
+  const {ikey,seleData,seleId} = params;
+  const index = getLabelIndex(ikey);
+  dispatch({
+    type:OTHERHIS_MUL,
+    data:{seleData,seleId,ikey:index}
+  })
+}
+
+function handleCheckBody(dispatch,params){
+  const {ikey,seleData,seleId} = params;
+  const index = getLabelIndex(ikey);
+  dispatch({
+    type:CHECKBODY_MUL,
+    data:{seleData,seleId,ikey:index}
+  })
+}
+
+function handleDiff(dispatch,params){
+  const {type} = params;
+  switch(+type){
+    case 1:
+      handleMainSuit(dispatch,params);
+      break;
+    case 2:
+      handleCurrent(dispatch,params);
+      break;
+    case 3:
+      handleOtherHis(dispatch,params);
+      break;
+    case 4:
+      handleCheckBody(dispatch,params);
+      break;
+    default:
+
+  }
+}
+
+/*****************双击标签改变值**********************/
+function changeMainSuit(dispatch,obj){
+  const {ikey,changeVal} = obj;
+  const index = getLabelIndex(ikey);
+  dispatch({
+    type:CHANGE_LABELVAL,
+    data:{changeVal,ikey:index}
+  })
+}
+
+function changeCurrent(dispatch,obj){
+  const {ikey,changeVal} = obj;
+  const index = getLabelIndex(ikey);
+  dispatch({
+    type:CURRENT_TEXT_LABEL,
+    data:{changeVal,ikey:index}
+  })
+}
+
+//其他史
+function changeOtherHis(dispatch,obj){
+  const {ikey,changeVal} = obj;
+  const index = getLabelIndex(ikey);
+  dispatch({
+    type:CHANGEOTHERTEXTLABEL,
+    data:{changeVal,ikey:index}
+  })
+}
+
+//查体
+function changeCheckBody(dispatch,obj){
+  const {ikey,changeVal} = obj;
+  const index = getLabelIndex(ikey);
+  dispatch({
+    type:CHANGECHECKTEXTLABEL,
+    data:{changeVal,ikey:index}
+  })
+}
+
+function handleLabel(dispatch,obj){
+  const {type} = obj;
+  switch (+type) {
+    case 1:
+      changeMainSuit(dispatch,obj);
+      break;
+    case 2:
+      changeCurrent(dispatch,obj);
+      break;
+    case 3:
+      changeOtherHis(dispatch,obj);
+      break;
+    case 4:
+      changeCheckBody(dispatch,obj);
+      break;
+    default:
+
+  }
+}
+
+function mapStateToProps(state){
+  return{
+    mainSaveText:state.mainSuit.saveText,
+  }
+}
+
+function mapDispatchToProps(dispatch){
+  return{
+    handleShow(obj){
+      dispatch({
+        type:CLICKCOUNT,
+        data:obj,
+        clickType:'单击',
+        num:1
+      });
+      dispatch({
+        type:SETDROPSHOW,
+        data:obj
+      });
+      dispatch({
+        type: RESET
+      });
+    },
+    handleHide(){
+      dispatch({
+        type:HIDEDROP
+      })
+    },
+    handleDbclick(obj){//双击统计
+      dispatch({
+        type:CLICKCOUNT,
+        data:obj,
+        clickType:'双击',
+        num:1
+      });
+    },
+    handleLabelChange(obj){//标签内输入
+      handleLabel(dispatch,obj);
+    },
+    handleConfirm(params){
+      handleDiff(dispatch,params);
+    }
+  }
+}
+
+const MultipleContainer = connect(mapStateToProps,mapDispatchToProps)(Multiple);
+export default MultipleContainer;

+ 2 - 2
src/containers/NumberDrop.js

@@ -9,7 +9,7 @@ import {getLabelIndex} from '@common/js/func.js';
 import {CURRENT_NUMBER,CURRENT_TEXT_LABEL,CURRENT_TEXT_LABEL_NUMBER} from '@store/types/currentIll.js';
 import {billing} from '@store/async-actions/pushMessage';
 import {Notify} from '@commonComp';
-import {filterArr,didPushParamChange} from '@utils/tools.js';
+import {filterArr,didPushParamChange,filterDataArr} from '@utils/tools.js';
 import config from '@config/index.js';
 
 function mapStateToProps(state){
@@ -51,7 +51,7 @@ function handleModuleDiff(dispatch,params){
   const type = params.ikey.substr(0,1);    //当前所在的项目
   switch (+type){
     case 1:
-      let text = filterArr(mainSaveText);
+      let text = filterDataArr(mainSaveText);
       if(text.length >= config.limited){
         Notify.info(config.limitText);
         return

+ 2 - 2
src/containers/NumberUnitDrop.js

@@ -8,7 +8,7 @@ import {NUMBER_SELECT,CHANGE_LABELVAL} from '@store/types/mainSuit.js';
 import {getLabelIndex} from '@common/js/func.js';
 import {CURRENT_NUMBER,CURRENT_TEXT_LABEL} from '@store/types/currentIll.js';
 import {Notify} from '@commonComp';
-import {filterArr,didPushParamChange} from '@utils/tools.js';
+import {filterArr,didPushParamChange,filterDataArr} from '@utils/tools.js';
 import {billing} from '@store/async-actions/pushMessage';
 import config from '@config/index.js';
 
@@ -51,7 +51,7 @@ function handleModuleDiff(dispatch,params){
   const type = params.ikey.substr(0,1);    //当前所在的项目
   switch (+type){
     case 1:
-      let text = filterArr(mainSaveText);
+      let text = filterDataArr(mainSaveText);
       if(text.length >= config.limited){
         Notify.info(config.limitText);
         return

+ 5 - 2
src/containers/OperationContainer.js

@@ -12,9 +12,12 @@ import {saveMessage,clearMessages} from "../store/async-actions/print";
 import {saveTemplateDetail} from '@store/async-actions/tabTemplate';
 import {saveClickNum} from '@store/async-actions/homePage';
 
-function mapStateToProps({print}) {
+// function mapStateToProps({print}) {
+function mapStateToProps(state) {
+    const {print,homePage} = state;
     return ({
-        print
+        print,
+        winWidth:homePage.windowWidth
     });
 }
 

+ 5 - 3
src/containers/OtherHistory.js

@@ -6,13 +6,14 @@ import {HIDE,RESET,ISREAD} from '@store/types/homePage.js';
 import {getModule} from '@store/async-actions/fetchModules.js';
 import {billing} from '@store/async-actions/pushMessage';
 import {fullfillText} from '@common/js/func';
-import {didPushParamChange} from '@utils/tools.js';
+import {didPushParamChange,filterDataArr} from '@utils/tools.js';
 
 function mapStateToProps(state){
   const {otherHistory,homePage,typeConfig,mainSuit} = state;
-  const hasMain = mainSuit.saveText.join('');//||mainSuit.data.length;
+  const hasMain = filterDataArr(mainSuit.saveText);//||mainSuit.data.length;
   return {
     data: otherHistory.data,
+    isEmpty:otherHistory.isEmpty,
     //initData:state.homePage.initData.otherHis,
     update:otherHistory.update,   //用于触发更新
     showArr:homePage.showDrop,
@@ -44,7 +45,8 @@ function mapDispatchToProps(dispatch,store){
         dispatch({
           type:SETDATA,
           data:listObj.newArr,
-          save:listObj.saveText
+          save:listObj.saveText,
+          isEmpty:false
         });
         dispatch({
           type:ISREAD

+ 2 - 2
src/containers/RadioDrop.js

@@ -7,7 +7,7 @@ import {SETDROPSHOW,HIDE,RESET,HIDEDROP,CLICKCOUNT,ISREAD} from '@types/homePage
 import {RADIO_SELECT,CHANGE_LABELVAL} from '@store/types/mainSuit.js';
 import {CURRENT_RADIO,CURRENT_TEXT_LABEL} from '@store/types/currentIll.js';
 import {Notify} from '@commonComp';
-import {filterArr,didPushParamChange} from '@utils/tools.js';
+import {filterArr,didPushParamChange,filterDataArr} from '@utils/tools.js';
 import {billing} from '@store/async-actions/pushMessage';
 import {getLabelIndex,fullfillText} from '@common/js/func.js';
 import config from '@config/index.js';
@@ -68,7 +68,7 @@ function handleModuleDiff(dispatch,store,params){
   const type = params.ikey.substr(0,1);    //当前所在的项目
   switch (+type){
     case 1:
-      let text = filterArr(mainSaveText);
+      let text = filterDataArr(mainSaveText);
       if(text.length >= config.limited){
         Notify.info(config.limitText);
         return

+ 65 - 12
src/containers/SpreadDrop.js

@@ -7,12 +7,12 @@ import {RESET,SETDROPSHOW,HIDEDROP,CLICKCOUNT,ISREAD} from '@store/types/homePag
 import {getModules as fetchModules} from '@store/async-actions/fetchModules.js';
 import {getCommSymptomPush} from '@store/async-actions/mainSuit.js'
 import {GET_BIGDATAPUSH,MIX_CONFIRM,COMM_CONFIRM,CHANGE_LABELVAL} from '@store/types/mainSuit';
-import {SETCHECKBOX,CHANGECHECKTEXTLABEL} from '@types/checkBody';
+import {SETCHECKBOX,CHANGECHECKTEXTLABEL,CHECKCONFIRMSELECTED} from '@types/checkBody';
 import {CURRENT_CONFIRM,SETMAINCHECKBOX,CURRENT_TEXT_LABEL,CURRENT_GET_BIGDATAPUSH} from '@types/currentIll';
 import {getLabelIndex,fullfillText,getIds} from '@common/js/func.js';
 import {billing} from '@store/async-actions/pushMessage';
 import {Notify} from '@commonComp';
-import {filterArr,didPushParamChange} from '@utils/tools.js';
+import {filterArr,didPushParamChange,filterDataArr} from '@utils/tools.js';
 import config from '@config/index.js';
 
 function mapStateToProps(state) {
@@ -44,7 +44,11 @@ function mainSuitModule(dispatch,store,params){
   let existsName = getNames(exists);
   let withsName = getNames(withs);
   let banName = ban.name;
-  let text = filterArr(mainSaveText);
+  let text = filterDataArr(mainSaveText);
+  if(text.length >= config.limited){
+    Notify.info(config.limitText);
+    return
+  }
   let names;
   if(banName){
     names = existsName + banName + withsName;
@@ -126,7 +130,7 @@ function otherHisConfirm(dispatch,store,params){
   }
   let existsId = getIds(exists);
   let withsId = getIds(withs);
-  const ids = existsId.join(",")+withsId.join(",");
+  const ids = existsId.length>0?existsId.join(",")+','+withsId.join(","):withsId.join(",");
   if(!ids&&nones){      //只有无的项目
     dispatch({
       type: CONFIRMSELECTED,
@@ -161,7 +165,51 @@ function otherHisConfirm(dispatch,store,params){
 }
 
 function checkBodyConfirm(dispatch,store,params){
-  console.log(params)
+  const {nones,exists,withs,exclusion,excluName,copyType} = params;
+  // const ikey = params.ikey.substr(1,1);
+  const index = params.ikey;
+  let ikey = getLabelIndex(index);
+  if(params.exclusion){
+    dispatch({
+      type: CHECKCONFIRMSELECTED,
+      data:{exclusion,excluName,ikey,copyType}
+    });
+    return ;
+  }
+  let existsId = getIds(exists);
+  let withsId = getIds(withs);
+  const ids = existsId.join(",")+','+withsId.join(",");
+  if(!ids&&nones){      //只有无的项目
+    dispatch({
+      type: CHECKCONFIRMSELECTED,
+      data: {exists:[],withs:[],nones:nones,ikey,copyType}
+    });
+    dispatch({
+      type:ISREAD
+    });
+    return;
+  }
+  // const ids = exists.join(",")+withs.join(",");
+  let has = [],wes=[];
+  //获取选中项目模板
+  fetchModules(ids).then((res)=>{
+    if(+res.data.code===0){
+      const list = res.data.data;
+      existsId.map((i)=>{
+        has.push(...list[i].questionMapping);
+      });
+      withsId.map((i)=>{
+        wes.push(...list[i].questionMapping);
+      });
+      dispatch({
+        type: CHECKCONFIRMSELECTED,
+        data: {exists:fullfillText(has,false,false).newArr,withs:fullfillText(wes,false,false).newArr,nones:nones,ikey,copyType}
+      });
+      dispatch({
+        type:ISREAD
+      });
+    }
+  });
 }
 
 //在不同模块(主诉、现病史等)下拉选中调用不同事件
@@ -169,11 +217,11 @@ function handleModuleDiff(dispatch,store,params){
   const {type,mainSaveText} = params;
   switch (+type){
     case 1:
-      let text = filterArr(mainSaveText);
+      /*let text = filterDataArr(mainSaveText);
       if(text.length >= config.limited){
         Notify.info(config.limitText);
         return
-      }
+      }*/
       mainSuitModule(dispatch,store,params);
       break;
     case 2:
@@ -194,10 +242,15 @@ function handleModuleDiff(dispatch,store,params){
 
 //主诉普通多选确定
 function mainSuitCheck(dispatch,store,params){
-  const {nones,exists,withs,order,mainSaveText} = params;
+  const {nones,exists,withs,order,mainSaveText,value} = params;
   let existsName = getNames(exists,order);
-  let text = filterArr(mainSaveText);
-  let lengths = text.length + existsName.length;
+  let text = filterDataArr(mainSaveText);
+  if(text.length >= config.limited){
+    Notify.info(config.limitText);
+    return
+  }
+  // let lengths = text.length + existsName.length;
+  let lengths = value?(text.length - value.length + existsName.length):(text.length + existsName.length);
   if(lengths > config.limited){
     Notify.info(config.limitText);
     return
@@ -253,11 +306,11 @@ function handleCheckBox(dispatch,store,params){
   const {type,mainSaveText} = params;
   switch (+type){
     case 1:
-      let text = filterArr(mainSaveText);
+      /*let text = filterDataArr(mainSaveText);
       if(text.length >= config.limited){
         Notify.info(config.limitText);
         return
-      }
+      }*/
       mainSuitCheck(dispatch,store,params);
       break;
     case 2:

+ 11 - 1
src/containers/Treat.js

@@ -2,7 +2,7 @@ import React from 'react';
 import { connect } from 'react-redux';
 import Treat from '@components/Treat';
 import { SELECT_DRUG, SET_OTHER_DRUG, SET_DRUG_INFO, CLEAR_DRUG_INFO,HIDE_TREAT, CLEAR_TREAT, SHOW_DRUG_INFO, HIDE_DRUG_INFO } from '@store/types/treat.js';
-import { getInstroduce, getRecommendBasic } from '@store/async-actions/treat';
+import { getInstroduce, getRecommendBasic, getInstroduceMore } from '@store/async-actions/treat';
 import { ADD_SCHEME } from '@store/types/pushMessage.js'
 import { showDrugInfo } from '../store/actions/treat';
 
@@ -17,6 +17,7 @@ function mapStateToProps(state){
         drugInfo: treat.drugInfo,
         showDrug: treat.showDrugInfo,
         treatItem: treat.treatItem,
+        drugInfoList: treat.drugInfoList,   //药品说明书列表(查询多个药品说明书)
     }
 }
  
@@ -70,6 +71,15 @@ function mapDispatchToProps(dispatch) {
                 title: title,
                 treatment: treatment
             })
+        },
+        //查询多条药品说明数据(添加数据用)
+        setDrugInfoMore:(drugIdList) => {
+            dispatch(getInstroduceMore(drugIdList));
+        },
+        hideDrugInfoMore: () =>{
+            dispatch({
+                type: HIDE_DRUG_INFO
+            })
         }
     }
 }

+ 25 - 4
src/containers/eleType.js

@@ -6,6 +6,7 @@ import SpreadDrop from "@containers/SpreadDrop";
 import EditableSpan from '@containers/EditableSpan';
 import InlineTag from '@containers/InlineTag';
 import NumberUnitDrop from '@containers/NumberUnitDrop';
+import Multiple from '@containers/Multiple';
 
 /******
  * 下拉类型分发
@@ -17,8 +18,8 @@ import NumberUnitDrop from '@containers/NumberUnitDrop';
  * *******/
 //单选类型
 export function singleRadio(params){
-  const data = params.item;
-  const {i,hideTag,boxMark,showArr,boxTop,boxLeft} = params;
+  const data = params.item;//console.log(111,data);
+  const {i,hideTag,boxMark,showArr,selecteds,boxTop,boxLeft} = params;
   const showInx = boxMark+i+'0';    //单括号多标签的情况下需要识别同一个标签内多个下拉组件的显示状态
   switch (+data.controlType){
     case 0:
@@ -36,6 +37,20 @@ export function singleRadio(params){
                         boxTop={boxTop}
                         boxLeft={boxLeft}
                         hideTag={hideTag}></RadioDrop>;
+    case 2:
+      const dataList = data.questionDetailList&&data.questionDetailList.length>0?data.questionDetailList:data.questionMapping;
+      return <Multiple data={dataList}
+                     ikey={showInx}
+                     placeholder={data.name}
+                     value={data.value}
+                     copyType={data.copyType}
+                     selecteds={selecteds ?selecteds[i]:[]}
+                     show={showArr&&showArr[showInx]}
+                     order={data.textGenerate}
+                     type={boxMark}
+                     textPrefix={data.labelPrefix}
+                     textSuffix={data.labelSuffix}
+                     id={data.id}></Multiple>
     case 3:
       return <EditableSpan {...params} value={data.value||data.value==''?data.value:data.name} update={Math.random()}/>;
     case 5://带单位数字键盘
@@ -124,9 +139,15 @@ export default function(params){
     case 6:
       return multCheckLabels(params,data.tagType);
     case 8:
-      // return <EditableSpan {...params} value={data.value||data.name} update={Math.random()}/>;
+      let isLast = false;
+      if(+params.boxMark===3||+params.boxMark === 4){
+        //其他史查体删到只剩最后一个自由文本标签时,该标签宽度100%,解决落关标文本
+        if(params.saveText.length==1&&+data.tagType===8){
+          isLast = true;
+        }
+      }
       // 删除后value为空,应展示空而不是name
-      return <EditableSpan {...params} value={data.value||data.value==''?data.value:data.name} full={data.full} update={Math.random()}/>;
+      return <EditableSpan {...params} value={data.value||data.value==''?data.value:data.name} full={data.full||isLast}/>;
     case 11://推送类型
       return multCheckLabels(params,data.tagType);
     default:

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

@@ -4,11 +4,11 @@ import BannerContainer from '@containers/TypeConfigContainer';
 //  引入组件
 import BodyContainer from "@components/BodyContainer";
 
-import {HIDEDROP} from '@store/types/homePage.js';
+import {HIDEDROP,SETMINSCREEN} from '@store/types/homePage.js';
 import style from './index.less';
 /*import {getInitModules} from '@store/async-actions/homePage.js';*/
 import { getUrlArgObject } from "@utils/tools";
-
+import $ from 'jquery';
 class HomePage extends Component {
     constructor() {
         super();
@@ -17,16 +17,28 @@ class HomePage extends Component {
         }
     }
     
-    /*componentDidMount(){
-        clearTimeout(this.state.timer);
+    componentDidMount(){
+        const {setWindow} = this.props;
+       /* clearTimeout(this.state.timer);
         const that = this;
         const timer = setTimeout(function(){//解决患者信息在获取模板之后的问题
             that.props.getInit();
         },200)
         this.setState({
             timer
-        })      
-    }*/
+        }) */ 
+        // 获取并监听窗口宽度,用于有横向滚动条时患者信息和打印预览跟随滚动
+        let width = $(window).width();
+        let height = $(window).height();
+        setWindow && setWindow({width,height});
+        
+        $(window).resize(function(){
+            let reWidth = $(window).width(); 
+            let reHeight = $(window).height();  
+            setWindow && setWindow({width:reWidth,height:reHeight});
+        })    
+
+    }
     render() {
         return <div className={style['home-page']} onClick={this.props.hideAllDrop}>
             <BannerContainer />
@@ -51,6 +63,12 @@ const mapDispatchToProps = function (dispatch) {
         /*getInit(){
             dispatch(getInitModules);
         }*/
+        setWindow(obj){
+            dispatch({
+                type:SETMINSCREEN,
+                obj:obj
+            })
+        }
     }
 };
 

+ 89 - 9
src/store/actions/checkBody.js

@@ -7,9 +7,61 @@ export function set(state,action){
   res.data = [...data];
   res.saveText = fullfillText(res.data).saveText;//存逗号
   res.update = Math.random();
-  res.isEmpty = false;
+  res.isEmpty = action.isEmpty;
   return res;
 }
+//多选标签选中确定处理
+export const confirm = (state,action) =>{
+  let res = Object.assign({},state);
+  let arr = res.data;
+  const {nones,exists,withs,ikey,exclusion,excluName,copyType} = action.data;
+  const items = [...exists||[],...withs||[]];
+  if((!exists||!withs||items.length==0)&&!nones&&!exclusion){       //取消无殊的选中,空白提交
+    arr[ikey].value = '';
+    res.saveText[ikey] = '';
+    res.selecteds.splice(ikey,1);
+    res.update=Math.random();
+    return res;
+  }
+  //选中互斥项
+  if(exclusion){
+    arr[ikey].value = excluName;
+    res.saveText[ikey] = excluName;
+    res.selecteds[ikey] = action.data;
+    res.update=Math.random();
+    return res;
+  }
+  //只有无的项目选中
+  if(+copyType===0) {      //原标签保留
+    arr.splice(ikey,1);
+  }
+  if(arr[ikey].value)  arr[ikey].value= '';
+  let preText = arr[ikey-1].value!==undefined?arr[ikey-1].value:arr[ikey-1].name||'';
+  let newPreText =preText +nones;//console.log(arr[ikey-1],newPreText)
+  if(items.length==0&&nones){
+    arr[ikey-1].value = newPreText;
+    res.saveText[ikey-1] = newPreText;
+    res.selecteds[ikey] = null;       //无殊选中状态遗留bug修改
+    res.update=Math.random();
+    return res;
+  }
+  //有,伴,无随配
+  //arr.splice(ikey-1,1);
+  let flabel = items[items.length-1];         //要插入的最后一个标签
+  let labelText = flabel.value!==undefined?flabel.value:flabel.name;
+  let text = labelText;
+  //要插入的最后一个标签为自由文本,则和后面的文本标签文字合并
+  if(flabel.tagType==8){
+    flabel.value = labelText+nones;
+    text = flabel.value;
+  }
+  arr.splice(ikey,0,...exists,...withs);
+  //arr[ikey-1].value = text;
+  //res.saveText[ikey+items.length] = text;
+  res.saveText = fullfillText(arr).saveText;
+  res.update=Math.random();         //用于触发组件更新(data变化了因在对象中无法被组件检测到)
+  return res;
+};
 //查体中数字键盘选中事件
 export function setNumberValue(state,action){
   let res = Object.assign({},state);
@@ -28,7 +80,7 @@ export function setNumberValue(state,action){
       if(it.value){     //至少有一个子值才黑显
         hasValue = true;
       }
-        return (it.labelPrefix||'')+(it.value||'')+(it.labelSuffix||'');
+      return (it.labelPrefix||'')+(it.value||'')+(it.labelSuffix||'');
     });
     res.saveText[labelInx] = hasValue?sub.join(''):'';
   }
@@ -183,6 +235,10 @@ export const changeLabelVal = (state,action)=>{//双击标签输入改变值
   const newVal = changeVal;     //下拉修改的内容
   let labText = totalVal?totalVal:newVal;   //如单选没有前后缀
   let item = res.data[index];
+  const next = res.data[+index+1];
+  const nextVal = next.value||next.name;
+  //标签后是不是标点符号标签,是的话删除本标签时一起删除
+  let nextIsDot = +next.tagType===8&&!nextVal.match(config.punctuationReg);
   // if(newVal && newVal.trim()){
   if(labText && labText.trim()){
     if(item){
@@ -193,7 +249,8 @@ export const changeLabelVal = (state,action)=>{//双击标签输入改变值
       res.saveText[index] = labText;
     }
   }else{//删除完标签内容则删除该标签
-    res.data.splice(index,1);
+    const num = nextIsDot?2:1;
+    res.data.splice(index,num);
     res.saveText = fullfillText(res.data).saveText;
   }
   res.update = Math.random();
@@ -207,6 +264,10 @@ export const changeNumLabelVal = (state,action)=>{
   const index = ikey;
   const newVal = changeVal;
   let item = res.data[index];
+  const next = res.data[+index+1];
+  const nextVal = next.value||next.name;
+  //标签后是不是标点符号标签,是的话删除本标签时一起删除
+  let nextIsDot = +next.tagType===8&&!nextVal.match(config.punctuationReg);
   if(totalVal.trim()){
     if(item){
       item.value = newVal;
@@ -215,10 +276,11 @@ export const changeNumLabelVal = (state,action)=>{
     }
     res.saveText[index] = totalVal;
   }else{//删除完标签内容则删除该标签
-    res.data.splice(index,1);
+    const num = nextIsDot?2:1;
+    res.data.splice(index,num);
     res.saveText = fullfillText(res.data).saveText;
-  } 
-  
+  }
+
   res.update = Math.random();
   return res;
 }
@@ -260,12 +322,30 @@ export function backspaceText(state,action){
   let res = Object.assign({},state);
   const {delIndex} = action;
   const data = res.data;
-  if(data[delIndex-1].tagType==8 ||data[delIndex-1].flag&&data[delIndex-1].flag==3){
+  if(data[delIndex-1].flag&&data[delIndex-1].flag==3){
+    // if(data[delIndex-1].tagType==8 ||data[delIndex-1].flag&&data[delIndex-1].flag==3){
     // 前一个是文本标签或者子模板 不做处理
-  }else{
+  }else if(data[delIndex-1].tagType==8){
+    data.splice(delIndex,1);
+    res.saveText.splice(delIndex,1);
+  }
+  else{
     data.splice(delIndex-1,2);
+    res.saveText.splice(delIndex-1,2);
   }
-  res.saveText = fullfillText(data).saveText;
+  // res.saveText = fullfillText(data).saveText;
+  res.update = Math.random();
+  return res;
+}
+
+// 单列多选
+export function multipleComfirn(state,action){
+  let res = Object.assign({},state);
+  const {ikey,seleData} = action.data;
+  let data = res.data;
+  data[ikey].value = seleData;
+  res.saveText[ikey] = seleData;
+  res.selecteds[ikey] = action.data;
   res.update = Math.random();
   return res;
 }

+ 103 - 27
src/store/actions/currentIll.js

@@ -255,8 +255,8 @@ export const confirm = (state,action) =>{
   if(withs && withs.length>0){
     // for(let i in withs){
     for(let i=0;i<withs.length; i++){
-      // withsArr.splice(parseInt(ikey)+length,0,banText,getLabel(withs[i].id,withs[i].name),...(withs[i].questionMapping.filter((item)=>{return item.symptomType==0||item.symptomType==2;})));
-      withsArr.splice(parseInt(ikey)+length,0,getLabel(withs[i].id,withs[i].questionMapping && withs[i].questionMapping.length==0?(ban.name+withs[i].name+','):(ban.name+withs[i].name)),...(withs[i].questionMapping && withs[i].questionMapping.filter((item)=>{return item.symptomType==0||item.symptomType==2;})));
+      withsArr.splice(parseInt(ikey)+length,0,banText,getLabel(withs[i].id,withs[i].questionMapping && withs[i].questionMapping.length==0?(withs[i].name+','):(withs[i].name)),...(withs[i].questionMapping.filter((item)=>{return item.symptomType==0||item.symptomType==2;})));
+      /*withsArr.splice(parseInt(ikey)+length,0,getLabel(withs[i].id,withs[i].questionMapping && withs[i].questionMapping.length==0?(ban.name+withs[i].name+','):(ban.name+withs[i].name)),...(withs[i].questionMapping && withs[i].questionMapping.filter((item)=>{return item.symptomType==0||item.symptomType==2;})));*/
     }
   }
 
@@ -390,6 +390,10 @@ export const changeLabelVal = (state,action)=>{
   const newVal = changeVal;
   let labText = totalVal?totalVal:newVal;
   let item = res.data[index];
+  const next = res.data[+index+1];
+  const nextVal = next.value||next.name;
+  //标签后是不是标点符号标签,是的话删除本标签时一起删除
+  let nextIsDot = +next.tagType===8&&!nextVal.match(config.punctuationReg);
   if(labText.trim()){
     if(item){
       item.value = newVal;
@@ -398,7 +402,8 @@ export const changeLabelVal = (state,action)=>{
       res.saveText[index] = labText;
     }
   }else{//删除完标签内容则删除该标签
-    res.data.splice(index,1);
+    const num = nextIsDot?2:1;
+    res.data.splice(index,num);
     res.saveText = fullfillText(res.data).saveText;
   } 
   res.update = Math.random();
@@ -412,6 +417,10 @@ export const changeNumLabelVal = (state,action)=>{
   const index = ikey;
   const newVal = changeVal;
   let item = res.data[index];
+  const next = res.data[+index+1];
+  const nextVal = next.value||next.name;
+  //标签后是不是标点符号标签,是的话删除本标签时一起删除
+  let nextIsDot = +next.tagType===8&&!nextVal.match(config.punctuationReg);
   let labText = totalVal?totalVal:newVal;   //如单选没有前后缀
   if(labText.trim()){
     if(item){
@@ -421,7 +430,8 @@ export const changeNumLabelVal = (state,action)=>{
     }
     res.saveText[index] = labText;
   }else{//删除完标签内容则删除该标签
-    res.data.splice(index,1);
+    const num = nextIsDot?2:1;
+    res.data.splice(index,num);
     res.saveText = fullfillText(res.data).saveText;
   }
   res.update = Math.random();
@@ -498,6 +508,8 @@ export function insertLabelData(state,action){
   res.symptomIds.push(id);
   const text = Object.assign(JSON.parse(config.textLabel),{name:searchData},{id:id});
   let focusIndex = res.focusIndex;
+  let saveText = res.saveText;
+  let banIdx = saveText.indexOf("伴");
   
   if(isReplace){
     span.current.innerText = '';
@@ -516,26 +528,70 @@ export function insertLabelData(state,action){
     let innerText = span.current.innerText;
     let strIndex = innerText.indexOf(searchStr);
     const value = innerText.replace(searchStr,"");
-    // let value;
-    // if(strIndex <= 1){//前
-    if(strIndex < 1){//前
-      res.data.splice(focusIndex,0,text);
-      res.saveText.splice(focusIndex,0,searchData);
-      res.data[focusIndex+1].value = value;
-      res.saveText[focusIndex+1] = value;
-      resData = JSON.parse(JSON.stringify(res.data));
-      resData.splice(focusIndex+1,0,...(data.questionMapping.filter((item)=>{
-                              return item.symptomType==0||item.symptomType==2;
-                            })));
+    // 没有伴展开主诉symptomType=0/1的尾巴,有伴一>第一个点选上去的伴为依据,伴前展开主诉,伴后展开伴随;多余的伴以及手动输入的伴不做处理(2-25)
+    if(banIdx==-1){
+      // if(strIndex <= 1){//前
+      if(strIndex < 1){//前
+        res.data.splice(focusIndex,0,text);
+        res.saveText.splice(focusIndex,0,searchData);
+        res.data[focusIndex+1].value = value;
+        res.saveText[focusIndex+1] = value;
+        resData = JSON.parse(JSON.stringify(res.data));
+        resData.splice(focusIndex+1,0,...(data.questionMapping.filter((item)=>{
+                                return item.symptomType==0||item.symptomType==1;
+                              })));
+      }else{
+        res.data.splice(focusIndex+1,0,text);
+        res.saveText.splice(focusIndex+1,0,searchData);
+        res.data[focusIndex].value = value;
+        resData = JSON.parse(JSON.stringify(res.data));
+        // +2是因为插入一个文本标签  
+        resData.splice(focusIndex+2,0,...(data.questionMapping.filter((item)=>{
+                                return item.symptomType==0||item.symptomType==1;
+                              })));
+      }
     }else{
-      res.data.splice(focusIndex+1,0,text);
-      res.saveText.splice(focusIndex+1,0,searchData);
-      res.data[focusIndex].value = value;
-      resData = JSON.parse(JSON.stringify(res.data));
-      // +3是因为插入一个文本标签加一个符号标签  
-      resData.splice(focusIndex+3,0,...(data.questionMapping.filter((item)=>{
-                              return item.symptomType==0||item.symptomType==2;
-                            })));
+      if(focusIndex > banIdx){//伴后
+        if(strIndex < 1){//前
+          res.data.splice(focusIndex,0,text);
+          res.saveText.splice(focusIndex,0,searchData);
+          res.data[focusIndex+1].value = value;
+          res.saveText[focusIndex+1] = value;
+          resData = JSON.parse(JSON.stringify(res.data));
+          resData.splice(focusIndex+1,0,...(data.questionMapping.filter((item)=>{
+                                  return item.symptomType==0||item.symptomType==2;
+                                })));
+        }else{
+          res.data.splice(focusIndex+1,0,text);
+          res.saveText.splice(focusIndex+1,0,searchData);
+          res.data[focusIndex].value = value;
+          resData = JSON.parse(JSON.stringify(res.data));
+          // +2是因为插入一个文本标签  
+          resData.splice(focusIndex+2,0,...(data.questionMapping.filter((item)=>{
+                                  return item.symptomType==0||item.symptomType==2;
+                                })));
+        }
+      }else{//伴前
+        if(strIndex < 1){//前
+          res.data.splice(focusIndex,0,text);
+          res.saveText.splice(focusIndex,0,searchData);
+          res.data[focusIndex+1].value = value;
+          res.saveText[focusIndex+1] = value;
+          resData = JSON.parse(JSON.stringify(res.data));
+          resData.splice(focusIndex+1,0,...(data.questionMapping.filter((item)=>{
+                                  return item.symptomType==0||item.symptomType==1;
+                                })));
+        }else{
+          res.data.splice(focusIndex+1,0,text);
+          res.saveText.splice(focusIndex+1,0,searchData);
+          res.data[focusIndex].value = value;
+          resData = JSON.parse(JSON.stringify(res.data));
+          // +2是因为插入一个文本标签  
+          resData.splice(focusIndex+2,0,...(data.questionMapping.filter((item)=>{
+                                  return item.symptomType==0||item.symptomType==1;
+                                })));
+        }
+      }
     }
     span.current.innerText = value;
     res.data = fullfillText(resData).newArr;
@@ -597,11 +653,13 @@ export function backspaceText(state,action){
     // data[delIndex].value = text;
   }else if(data[delIndex-1].tagType==8){
     data.splice(delIndex,1);
+    res.saveText.splice(delIndex,1);
   }
   else{
     data.splice(delIndex-1,2);
+    res.saveText.splice(delIndex-1,2);
   }
-  res.saveText = fullfillText(data).saveText;
+  // res.saveText = fullfillText(data).saveText;
   res.update = Math.random();
   return res;
 }
@@ -616,9 +674,27 @@ export function removeId(state,action){
   if(ids.includes(id)){
     ids.splice(ids.indexOf(id),1);
   }
-  data[index].id = "";
-  data[index].name = text;
-  data[index].value = text;
+  if(!data[index].value && data[index-1].tagType==8){
+    data.splice(index,1);
+    res.saveText.splice(index,1);
+  }else{
+    data[index].id = "";
+    data[index].name = text;
+    data[index].value = text;
+  }
+  //console.log(345,action,res);
+  res.update = Math.random();
+  return res;
+}
+
+// 单列多选
+export function multipleComfirn(state,action){
+  let res = Object.assign({},state);
+  const {ikey,seleData} = action.data;
+  let data = res.data;
+  data[ikey].value = seleData;
+  res.saveText[ikey] = seleData;
+  res.selecteds[ikey] = action.data;
   res.update = Math.random();
   return res;
 }

+ 1 - 1
src/store/actions/diagnosticList.js

@@ -6,7 +6,7 @@ export const addDiagnostic = (state, action) => {
 
 export const delDiagnostic = (state, action) => {
     const res = JSON.parse(JSON.stringify(state));
-    res.diagnosticList = res.diagnosticList.filter(item => item.id !== action.id);
+    res.diagnosticList = res.diagnosticList.filter(item => (item.id !== action.item.id && item.name !== action.item.name));
     return res;
 }
 

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

@@ -23,6 +23,8 @@ export const getSearchResult= (state, action) => {
         let searchResultItem = {}
         searchResultItem.id = item.questionId
         searchResultItem.name = item.name
+        searchResultItem.showType = item.showType
+        searchResultItem.retrievalName = item.retrievalName
         searchResult.push(searchResultItem)
     }) 
     res.searchResult = searchResult;

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

@@ -32,7 +32,7 @@ export const confirmHide=(state,action)=>{
   let res = Object.assign({},state);
   let obj = res.showDrop||{};
   let temp = Object.assign({},obj);
-  let keyArr = Object.keys(obj); 
+  let keyArr = Object.keys(obj);
   for(let i=0; i<keyArr.length; i++){
     temp[JSON.parse(keyArr[i])] = false;
   }

+ 34 - 14
src/store/actions/mainSuit.js

@@ -110,7 +110,6 @@ export const insertMain = (state,action) => {
   // res.saveText[inserIndx] = text.name;
   res.saveText = fullfillText(res.data).saveText;
   res.mainIds.push(id);
-  res.mainSymptIds.push(id);
   res.editClear = false;//主诉框编辑状态
   res.update=Math.random();
   return res;
@@ -136,7 +135,6 @@ export const confirm = (state,action) =>{
     let existsId = getIds(exists);
     let withsId = getIds(withs);
     res.mainIds = res.mainIds?res.mainIds.concat(existsId,withsId):[];
-    res.mainSymptIds = res.mainSymptIds.concat(existsId,withsId);
   }
 
   // 第二病程-伴位置处理
@@ -298,7 +296,6 @@ export const insertSearch = (state,action)=>{
     // res.saveText[inserIndx] = searchData;
     res.saveText = fullfillText(res.data).saveText;
     res.mainIds.push(id);
-    res.mainSymptIds.push(id);
     res.editClear = false;//主诉框编辑状态
   }else{
     // 替换
@@ -456,14 +453,18 @@ export const changeLabelVal = (state,action)=>{
   const newVal = action.data.changeVal;
   let data = res.data;
   let item = data[index];
+  const next = res.data[+index+1];
+  const nextVal = next.value||next.name;
+  //标签后是不是标点符号标签,是的话删除本标签时一起删除
+  let nextIsDot = +next.tagType===8&&!nextVal.match(config.punctuationReg);
   if(newVal&&newVal.trim()){
     if(item){
       item.value = newVal;
       res.saveText[index] = newVal;
     }
   }else{//删除完标签内容则删除该标签
-    
-    data.splice(index,1);
+    const num = nextIsDot?2:1;
+    data.splice(index,num);
     // data[index].value = "";
     // res.data.splice(index,1);
     res.saveText.splice(index,1);
@@ -481,6 +482,10 @@ export const changeNumLabelVal = (state,action)=>{
   const newVal = changeVal;
   let labText = totalVal?totalVal:newVal;   //如单选没有前后缀
   let item = res.data[index];
+  const next = res.data[+index+1];
+  const nextVal = next.value||next.name;
+  //标签后是不是标点符号标签,是的话删除本标签时一起删除
+  let nextIsDot = +next.tagType===8&&!nextVal.match(config.punctuationReg);
   if(labText.trim()){
     if(item){
       item.value = newVal;
@@ -489,7 +494,8 @@ export const changeNumLabelVal = (state,action)=>{
       res.saveText[index] = labText;
     }
   }else{//删除完标签内容则删除该标签
-    res.data.splice(index,1);
+    const num = nextIsDot?2:1;
+    res.data.splice(index,num);
     res.saveText = fullfillText(res.data).saveText;
   }
   res.update = Math.random();//console.log(44,action,res);
@@ -518,7 +524,6 @@ export const clearMainSuit = (state,action)=>{//回读和清除
   // res.saveText = fullfillText(action.data).saveText;//解决删除data里的值保存,回读后页面上有内容saveText里没有的情况
   res.selecteds = action.selecteds?action.selecteds:[];
   res.mainIds = action.mainIds;
-  res.mainSymptIds = action.mainSymptIds;
   if(action.editClear){
     res.editClear = action.editClear;
   }
@@ -595,11 +600,13 @@ export function backspaceText(state,action){
     // 前一个是文本标签或者子模板 不做处理
   }else if(data[delIndex-1].tagType==8){
     data.splice(delIndex,1);
+    res.saveText.splice(delIndex,1);
   }
   else{
     data.splice(delIndex-1,2);
+    res.saveText.splice(delIndex-1,2);
   }
-  res.saveText = fullfillText(data).saveText;
+  // res.saveText = fullfillText(data).saveText;
   res.update = Math.random();
   return res;
 }
@@ -611,16 +618,29 @@ export function removeId(state,action){
   const data = res.data;
   const id = data[index].id;
   let ids = res.mainIds;
-  let mainIds = res.mainSymptIds;
   if(ids.includes(id)){
     ids.splice(ids.indexOf(id),1);
   }
-  if(mainIds.includes(id)){
-    mainIds.splice(mainIds.indexOf(id),1);
+  if(!data[index].value && data[index-1].tagType==8){
+    data.splice(index,1);
+    res.saveText.splice(index,1);
+  }else{
+    data[index].id = "";
+    data[index].name = text;
+    data[index].value = text;
   }
-  data[index].id = "";
-  data[index].name = text;
-  data[index].value = text;
   res.update = Math.random();
   return res;
 }
+
+// 单列多选
+export function multipleComfirn(state,action){
+  let res = Object.assign({},state);
+  const {ikey,seleData} = action.data;
+  let data = res.data;
+  data[ikey].value = seleData;
+  res.saveText[ikey] = seleData;
+  res.selecteds[ikey] = action.data;
+  res.update = Math.random();console.log(123,action,res);
+  return res;
+}

+ 80 - 38
src/store/actions/otherHistory.js

@@ -37,21 +37,21 @@ export const confirm = (state,action) =>{
     return res;
   }
   //有,伴,无随配
-    //arr.splice(ikey-1,1);
-    let flabel = items[items.length-1];         //要插入的最后一个标签
-    let labelText = flabel.value!==undefined?flabel.value:flabel.name;
-    let text = labelText;
-    //要插入的最后一个标签为自由文本,则和后面的文本标签文字合并
-    if(flabel.tagType==8){
-      flabel.value = labelText+nones;
-      text = flabel.value;
-    }
-    arr.splice(ikey,0,...exists,...withs);
-    //arr[ikey-1].value = text;
-    //res.saveText[ikey+items.length] = text;
-    res.saveText = fullfillText(arr).saveText;
-    res.update=Math.random();         //用于触发组件更新(data变化了因在对象中无法被组件检测到)
-    return res;
+  //arr.splice(ikey-1,1);
+  let flabel = items[items.length-1];         //要插入的最后一个标签
+  let labelText = flabel.value!==undefined?flabel.value:flabel.name;
+  let text = labelText;
+  //要插入的最后一个标签为自由文本,则和后面的文本标签文字合并
+  if(flabel.tagType==8){
+    flabel.value = labelText+nones;
+    text = flabel.value;
+  }
+  arr.splice(ikey,0,...exists,...withs);
+  //arr[ikey-1].value = text;
+  //res.saveText[ikey+items.length] = text;
+  res.saveText = fullfillText(arr).saveText;
+  res.update=Math.random();         //用于触发组件更新(data变化了因在对象中无法被组件检测到)
+  return res;
 };
 
 //单选下拉选中
@@ -219,6 +219,10 @@ export function changeTextLabel(state,action) {
   const index = ikey;
   const newVal = changeVal;
   let item = res.data[index];
+  const next = res.data[+index+1];
+  const nextVal = next.value||next.name;
+  //标签后是不是标点符号标签,是的话删除本标签时一起删除
+  let nextIsDot = +next.tagType===8&&!nextVal.match(config.punctuationReg);
   let labText = totalVal?totalVal:newVal;
   if(labText.trim()){
     if(item){
@@ -228,7 +232,8 @@ export function changeTextLabel(state,action) {
       res.saveText[index] = labText;
     }
   }else{//删除完标签内容则删除该标签
-    res.data.splice(index,1);
+    const num = nextIsDot?2:1;
+    res.data.splice(index,num);
     res.saveText = fullfillText(res.data).saveText;
   }
   res.update = Math.random();
@@ -242,6 +247,10 @@ export const changeNumLabelVal = (state,action)=>{
   const index = ikey;
   const newVal = changeVal;
   let item = res.data[index];
+  const next = res.data[+index+1];
+  const nextVal = next.value||next.name;
+  //标签后是不是标点符号标签,是的话删除本标签时一起删除
+  let nextIsDot = +next.tagType===8&&!nextVal.match(config.punctuationReg);
   let labText = totalVal?totalVal:newVal;   //如单选没有前后缀
   if(labText.trim()){
     if(item){
@@ -251,7 +260,8 @@ export const changeNumLabelVal = (state,action)=>{
     }
     res.saveText[index] = labText;
   }else{//删除完标签内容则删除该标签
-    res.data.splice(index,1);
+    const num = nextIsDot?2:1;
+    res.data.splice(index,num);
     res.saveText = fullfillText(res.data).saveText;
   };
   res.update = Math.random();
@@ -259,13 +269,14 @@ export const changeNumLabelVal = (state,action)=>{
 }
 
 export function clearOtherHistory(state,action){       //清空数据
-    let res = Object.assign({},state);
-    res.data = action.data;
-    res.saveText = action.saveText;
-    res.selecteds = action.selecteds;
-    res.editClear = action.editClear;
-    return res;
-  }
+  let res = Object.assign({},state);
+  res.data = action.data;
+  res.saveText = action.saveText;
+  res.selecteds = action.selecteds;
+  res.editClear = action.editClear;
+  res.isEmpty = action.isEmpty;
+  return res;
+}
 //文本模式下值保存
 export const setTextModeValue = (state,action)=>{
   const res = Object.assign({},state);
@@ -275,19 +286,19 @@ export const setTextModeValue = (state,action)=>{
 
 //复制标签(如血压)事件
 export function addLabelItem(state,action){
-    let res = Object.assign({},state);
-    const {data,i} = action;
-    const textLabel = JSON.parse(config.textLabel);
-    //使用Object.assign({},data)拷贝操作时复制项和原项会同步修改
-    if(!data) return res;
-    res.data.splice(i+1,0,JSON.parse(data),textLabel);
-    res.update = Math.random();
-    return res;
+  let res = Object.assign({},state);
+  const {data,i} = action;
+  const textLabel = JSON.parse(config.textLabel);
+  //使用Object.assign({},data)拷贝操作时复制项和原项会同步修改
+  if(!data) return res;
+  res.data.splice(i+1,0,JSON.parse(data),textLabel);
+  res.update = Math.random();
+  return res;
 }
 export const otherEditClear = (state,action)=>{
-    const res = Object.assign({},state);
-    res.editClear = action.bool;
-    return res;
+  const res = Object.assign({},state);
+  res.editClear = action.bool;
+  return res;
 };
 
 // backspace删除
@@ -295,12 +306,43 @@ export function backspaceText(state,action){
   let res = Object.assign({},state);
   const {delIndex} = action;
   const data = res.data;
-  if(data[delIndex-1].tagType==8 ||data[delIndex-1].flag&&data[delIndex-1].flag==3){
+  if(data[delIndex-1].flag&&data[delIndex-1].flag==3){
+    // if(data[delIndex-1].tagType==8 ||data[delIndex-1].flag&&data[delIndex-1].flag==3){
     // 前一个是文本标签或者子模板 不做处理
-  }else{
+  }else if(data[delIndex-1].tagType==8){
+    data.splice(delIndex,1);
+    res.saveText.splice(delIndex,1);
+  }
+  else{
     data.splice(delIndex-1,2);
+    res.saveText.splice(delIndex-1,2);
   }
-  res.saveText = fullfillText(data).saveText;
+  // res.saveText = fullfillText(data).saveText;
+  res.update = Math.random();
+  return res;
+}
+
+//删除后移除空标签
+export function removeId(state,action){
+  let res = Object.assign({},state);
+  const {index} = action;
+  const data = res.data;
+  if(!data[index].value && data[index-1].tagType==8){
+    data.splice(index,1);
+    res.saveText.splice(index,1);
+  }
+  res.update = Math.random();
+  return res;
+}
+
+// 单列多选
+export function multipleComfirn(state,action){
+  let res = Object.assign({},state);
+  const {ikey,seleData} = action.data;
+  let data = res.data;
+  data[ikey].value = seleData;
+  res.saveText[ikey] = seleData;
+  res.selecteds[ikey] = action.data;
   res.update = Math.random();
   return res;
 }

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

@@ -89,10 +89,10 @@ export const addScheme = (state, action) => {
     }
   })
   if (isRepeat) {
-   //将同类药添加到一起
+	 //将同类药添加到一起
 	for (let i = 0; i < scheme[RepeatIndex].treatment.length; i++) {
 		for (let j = 0; j < treatment.length; j++) {
-			if (scheme[RepeatIndex].treatment[i].id === treatment[j].id) {
+			if (scheme[RepeatIndex].treatment[i].id === treatment[j].id && scheme[RepeatIndex].treatment[i].bigdrugsName === treatment[j].bigdrugsName) {
 				for(let z = 0; z < treatment[j].medicitionsList.length; z++) {
 					if(treatment[j].medicitionsList[z].selected) {
 						if(scheme[RepeatIndex].treatment[i].treatmentStr !== '') {

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

@@ -91,3 +91,11 @@ export const setTreatInfo = (state, action) => {
     return res;
 }
 
+//设置多个药品说明书(添加数据时查看数据用)
+export const setDrugInfoList = (state, action) => {
+    const res = JSON.parse(JSON.stringify(state));
+    const drugInfoList = action.drugInfoList;
+    res.drugInfoList = drugInfoList
+    return res
+}
+

+ 20 - 6
src/store/async-actions/diagnosticSearch.js

@@ -8,9 +8,9 @@ export const getSearchResult = (value) =>{
         const url = '/api/icss/retrieval/getTagInfos'
         const param={
             type: 7,
-            age: 44,
+            age: state.patInfo.message.patientAge,
             inputStr: value,
-            sexType: 1
+            sexType: state.patInfo.message.sex
         }
         if(value === state.diagnosticSearch.searchValue) {
             return
@@ -19,6 +19,14 @@ export const getSearchResult = (value) =>{
                 type: SET_SEARCH_VALUE,
                 searchValue: value
             })
+            //如果搜索值为空,则直接将搜索结果设为空
+            if(value === '') {
+                dispatch({
+                    type: GET_SEARCH_RESULT,
+                    searchResult: []
+                })
+                return
+            }
             json(url, param).then((data)=>{
                 const searchRes = data.data.data;
                 const diagList = state.diagnosticList.diagnosticList;
@@ -35,11 +43,17 @@ export const getSearchResult = (value) =>{
                             searchResult.push(searchRes[i])
                         }
                     }
+                    dispatch({
+                        type: GET_SEARCH_RESULT,
+                        searchResult: searchResult
+                    })
+                } else {
+                    dispatch({
+                        type: GET_SEARCH_RESULT,
+                        searchResult: []
+                    })
                 }
-                dispatch({
-                    type: GET_SEARCH_RESULT,
-                    searchResult: searchResult
-                })
+               
             }).catch((e)=>{
                 console.log(e)
             })

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

@@ -71,6 +71,7 @@ export const getOtherHisRecord = ()=>{
         const objStr = JSON.parse(data.otherStr||'[]');
         let arr = [];
         if((!obj||!obj.other||obj.other.length==0)&&!objStr[0]){        //无其他史历史记录用默认模板
+          //console.log('其他史最近数据无')
           //arr = state.homePage.initData.otherHis;
         }else{
           arr = obj.other;
@@ -115,7 +116,7 @@ export function getInitData(){
         dispatch({
           type:SET,
           data:[block],
-          isEmpty:false
+          isEmpty:true
         });
         Notify.error(res.data.msg);
       }

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

@@ -56,7 +56,7 @@ export const getInitModules= (dispatch,getStore)=>{
           emptyData:initData.currentEmpty,//现病史空模板
           saveEmpty:initSaveText.currentEmpty,
         });
-        dispatch(getOtherHisRecord());  console.log(111)        //获取其他史最近记录
+        dispatch(getOtherHisRecord());          //获取其他史最近记录
         initHis(dispatch)
       }else{
         initHis(dispatch)

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

@@ -1,7 +1,7 @@
 import { json } from "@utils/ajax";
 import { SET_TREAT } from '@store/types/diagnosticList';
 import { ADD_DIAGNOSTIC, GET_DIAGNOSTIC_STR} from '@store/types/diagnosticList';
-import { SET_DRUG_INFO, SET_TREATMENT, SET_TREAT_INFO, SET_RECOMMEND_BASIC } from '@store/types/treat';
+import { SET_DRUG_INFO, SET_TREATMENT, SET_TREAT_INFO, SET_RECOMMEND_BASIC, SET_DRUG_INFO_LIST } from '@store/types/treat';
 import {storageLocal,getEMRParams} from '@utils/tools';
 import { isAddMainSuit } from '@store/async-actions/diagnosticList';
 
@@ -248,6 +248,46 @@ export const getInstroduce = (item)=>{
 
 }
 
+export const  getInstroduceMore = (drugIdList) =>{
+    return (dispatch, getState) =>{
+        let drugInfoList = [];
+        for (let i = 0; i < drugIdList.drugIdList.length; i++ ) {
+            const url = '/api/icss/introduceInfo/getByQuestionId';
+            const params = {
+                questionId: drugIdList.drugIdList[i],
+                type: 8,
+                position: 5
+            }
+            json(url, params)
+            .then((data)=>{
+                    if(data.data.data) {
+                        drugInfoList.push(data.data.data)
+                        dispatch({
+                            type: SET_DRUG_INFO_LIST,
+                            drugInfoList: drugInfoList,
+                        })
+                        console.log('drugInfoList', drugInfoList)
+                    } else {
+                        drugInfoList.push([])
+                        dispatch({
+                            type: SET_DRUG_INFO_LIST,
+                            drugInfoList: drugInfoList,
+                        })
+                    }
+                    
+            }).catch((e) => {
+                console.log(e)
+            })
+
+
+
+
+        }
+        
+
+    }
+}
+
 //其他推荐推荐依据不用展示
 // export const getRecommendBasic = (item)=>{
     

+ 11 - 4
src/store/reducers/checkBody.js

@@ -1,11 +1,14 @@
 import {SET,SETNUMBER4,SETSELECTED4,SETCHECKBOX,ADDLABELITEM,SETCHECKTEXT,SETSEARCHDATA,
-  SELECTSEARCHDATA,CHANGECHECKTEXTLABEL,CLEARCHECKBODY,CHECK_FOCUS_INDEX,CHECKBODY_CLEAR,SETCHECKINPUT,DEL_CHECKBODY,CHANGECHECKTEXTLABEL_NUMBER} from '../types/checkBody.js';
-import {set,setNumberValue,setRadioValue,setCheckBoxValue,addLabelItem,setCheckText,setSearchData,insertLabelData,changeLabelVal,clearCheckBody,setInputLabel,backspaceText,changeNumLabelVal} from '../actions/checkBody.js';
+  SELECTSEARCHDATA,CHANGECHECKTEXTLABEL,CLEARCHECKBODY,CHECK_FOCUS_INDEX,CHECKBODY_CLEAR,
+  SETCHECKINPUT,DEL_CHECKBODY,CHANGECHECKTEXTLABEL_NUMBER,CHECKCONFIRMSELECTED,CHECKBODY_MUL} from '../types/checkBody.js';
+import {set,setNumberValue,setRadioValue,setCheckBoxValue,addLabelItem,setCheckText,
+  setSearchData,insertLabelData,changeLabelVal,clearCheckBody,setInputLabel,backspaceText,
+  changeNumLabelVal,confirm,multipleComfirn} from '../actions/checkBody.js';
 import config from '@config/index.js';
 
-//const block = Object.assign(JSON.parse(config.textLabel),{full:false});//空白时保留一个自由文本标签
+const block = Object.assign(JSON.parse(config.textLabel),{full:true});//空白时保留一个自由文本标签
 const initState = {
-                data:[],
+                data:[block],
                 saveText:[],    //saveText为生成的纯文本
                 searchData:[],
                 selecteds:[],
@@ -36,6 +39,8 @@ export default function(state=initState,action){
       return clearCheckBody(state,action);
     case CHANGECHECKTEXTLABEL://改变标签值
       return changeLabelVal(state,action);
+    case CHECKCONFIRMSELECTED:
+      return confirm(state,action);
     case CHANGECHECKTEXTLABEL_NUMBER://数字键盘
       return changeNumLabelVal(state,action);
     case CHECK_FOCUS_INDEX:
@@ -48,6 +53,8 @@ export default function(state=initState,action){
       return setInputLabel(state,action);
   case DEL_CHECKBODY:
       return backspaceText(state,action);
+    case CHECKBODY_MUL:
+      return multipleComfirn(state,action);
     default:
       return res;
   }

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

@@ -1,9 +1,9 @@
 // 现病史
 import {SET_CURRENT,CURRENT_CONFIRM,INSERT_PROCESS,SET_CURRENT_DATA,SET_LABEL_MODULE,SETMAINCHECKBOX,
   CURRENT_RADIO,CURRENT_NUMBER,CURRENT_TEXT_LABEL,CLEAR_CURRENT_ILL,SETTEXTMODEVALUE,CURRENT_GET_BIGDATAPUSH,CURRENT_CLEAR,
-  SET_CURRENT_SEARCH,SETCURRENTTEXT,CURRENT_FOCUS_INDEX,SELECT_SEARCHDATA,CLEAR_CURRENT_EDIT,CURRENTADDLABELITEM,SETCURRENTINPUT,DEL_CURRENT,CURRENT_TEXT_LABEL_NUMBER,REMOVE_CURR_ID} from '../types/currentIll';
+  SET_CURRENT_SEARCH,SETCURRENTTEXT,CURRENT_FOCUS_INDEX,SELECT_SEARCHDATA,CLEAR_CURRENT_EDIT,CURRENTADDLABELITEM,SETCURRENTINPUT,DEL_CURRENT,CURRENT_TEXT_LABEL_NUMBER,REMOVE_CURR_ID,CURRENT_MUL} from '../types/currentIll';
 import {confirm,insertProcess,setData,setCheckBox,setRadioValue,setNumberValue,changeLabelVal,clearCurrentIll,
-  setTextModeValue,setModule,bigDataSymptom,setCheckText,insertLabelData,clearCurrentEdit,addLabelItem,setInputLabel,backspaceText,changeNumLabelVal,removeId} from '../actions/currentIll';
+  setTextModeValue,setModule,bigDataSymptom,setCheckText,insertLabelData,clearCurrentEdit,addLabelItem,setInputLabel,backspaceText,changeNumLabelVal,removeId,multipleComfirn} from '../actions/currentIll';
 
 const initState = {
   moduleData:[],
@@ -71,6 +71,8 @@ export default function(state=initState,action){
       return backspaceText(state,action);
     case REMOVE_CURR_ID:
       return removeId(state,action);
+    case CURRENT_MUL://单列多选
+      return multipleComfirn(state,action);
     default:
       return state;
   }

+ 5 - 1
src/store/reducers/homePage.js

@@ -1,5 +1,5 @@
 import {HIDE,RESET,SETINITDATA,SETDROPSHOW,SETADDITEMINIT,SETT0EDIT,SETREADDITEMS,
-  HIDEDROP,CLICKCOUNT,ISREAD,SETOTHERHISTORY} from '../types/homePage.js';
+  HIDEDROP,CLICKCOUNT,ISREAD,SETOTHERHISTORY,SETMINSCREEN} from '../types/homePage.js';
 import {showDrop,setAddItemInit,setLabelToEdit,confirmHide,clickNum} from '../actions/homePage.js';
 
 const initState = {
@@ -50,6 +50,10 @@ export default function (state=initState,action) {
       res.focusTextIndex = action.index;
       res.span=action.$span;
       return res;*/
+    case SETMINSCREEN:
+      res.windowWidth = action.obj.width;
+      res.windowHeight = action.obj.height;
+      return res;
     default:
       return res;
   }

+ 4 - 3
src/store/reducers/mainSuit.js

@@ -1,9 +1,9 @@
 import {COMM_SYMPTOMS,CLEAR_COMSYMPTOMS,SHOW_TAIL,INSERT_MAIN,
   SET_SEARCH,CLEAR_SEARCH,GET_BIGDATAPUSH,SET_MAINSUIT,MIX_CONFIRM,NUMBER_SELECT,
   RADIO_SELECT,COMM_CONFIRM,CHANGE_LABELVAL,SAVE_FREE,CLEAR_MAIN_SUIT,SET_DATA,
-  INSERT_SEARCH,MAIN_FOCUS_INDEX,SETTEXTMODEVALUE,SETMAINTEXT,MAINADDLABELITEM,SETMAININPUT,DEL_MAIN,CHANGE_LABELVAL_NUMBER,REMOVE_MAIN_ID} from '../types/mainSuit'
+  INSERT_SEARCH,MAIN_FOCUS_INDEX,SETTEXTMODEVALUE,SETMAINTEXT,MAINADDLABELITEM,SETMAININPUT,DEL_MAIN,CHANGE_LABELVAL_NUMBER,REMOVE_MAIN_ID,MAINSUIT_MUL} from '../types/mainSuit'
 import {getCommSymptoms,handleTailClick,insertMain,setSearch,getBigSymptom,setMainMoudle,confirm,
-  setNumberValue,setRadioValue,commConfirm,changeLabelVal,saveFreeVal,clearMainSuit,insertSearch,setTextModeValue,setCheckText,changeEditClear,addLabelItem,setInputLabel,backspaceText,changeNumLabelVal,removeId} from '../actions/mainSuit'
+  setNumberValue,setRadioValue,commConfirm,changeLabelVal,saveFreeVal,clearMainSuit,insertSearch,setTextModeValue,setCheckText,changeEditClear,addLabelItem,setInputLabel,backspaceText,changeNumLabelVal,removeId,multipleComfirn} from '../actions/mainSuit'
 
 
 const initState = {
@@ -20,7 +20,6 @@ const initState = {
   focusIndex:'',
   mainIds:[], //选中的主症状和伴随的id(搜索去重)
   editClear:true,
-  mainSymptIds:[]//选中的主症状和伴随的id(移植到现病史)
 }
 
 export default function(state=initState,action){
@@ -85,6 +84,8 @@ export default function(state=initState,action){
       return backspaceText(state,action);
     case REMOVE_MAIN_ID:
       return removeId(state,action);
+    case MAINSUIT_MUL://单列多选
+      return multipleComfirn(state,action);
     default:
       return state;
   }

+ 10 - 3
src/store/reducers/otherHistory.js

@@ -1,8 +1,10 @@
 import {SETDATA,CONFIRMSELECTED,SETRADIO,SETNUMBER,SETOTHERCHECKBOX,SETOTHERTEXT,SETOTHERSEARCHDATA,
-  SELECTOTHERSEARCHDATA,CLEAROTHERHISTORY,CHANGEOTHERTEXTLABEL,SETOTHERINPUT,SETTEXTMODEVALUE,OTHER_FOCUS_INDEX,OTHERHIS_CLEAR,OTHERADDLABELITEM,OTHEREDICLEAR,DEL_OTHERHIS,CHANGEOTHERTEXTLABEL_NUMBER} from '../types/otherHistory';
-import {confirm,setRadioValue,setNumberValue,setCheckBoxValue,setCheckText,setSearchData,insertLabelData,clearOtherHistory,changeTextLabel,setOtherInput,setTextModeValue,addLabelItem,otherEditClear,backspaceText,changeNumLabelVal} from '../actions/otherHistory';
+  SELECTOTHERSEARCHDATA,CLEAROTHERHISTORY,CHANGEOTHERTEXTLABEL,SETOTHERINPUT,SETTEXTMODEVALUE,OTHER_FOCUS_INDEX,OTHERHIS_CLEAR,OTHERADDLABELITEM,OTHEREDICLEAR,DEL_OTHERHIS,CHANGEOTHERTEXTLABEL_NUMBER,OTHERHIS_MUL,REMOVE_OTHER_ID} from '../types/otherHistory';
+import {confirm,setRadioValue,setNumberValue,setCheckBoxValue,setCheckText,setSearchData,insertLabelData,clearOtherHistory,changeTextLabel,setOtherInput,setTextModeValue,addLabelItem,otherEditClear,backspaceText,changeNumLabelVal,multipleComfirn,removeId} from '../actions/otherHistory';
+import config from '@config/index.js';
 
-const initState = {data:[],saveText:[],selecteds:[],focusIndex:'',editClear:true};/*mockData.OtherHis.moduleDetailDTOList;[
+const block = Object.assign(JSON.parse(config.textLabel),{full:true});//空白时保留一个自由文本标签
+const initState = {data:[block],isEmpty:true,saveText:[],selecteds:[],focusIndex:'',editClear:true};/*mockData.OtherHis.moduleDetailDTOList;[
     mockData.radioData,
     mockData.inputData,
     mockData.spreadData,
@@ -16,6 +18,7 @@ export default function(state=initState,action){//console.log(state)
     case SETDATA:
       res.data = action.data;
       res.saveText = action.save||[];
+      res.isEmpty = action.isEmpty;
       return res;
     case SETRADIO:
       return setRadioValue(state,action);
@@ -53,6 +56,10 @@ export default function(state=initState,action){//console.log(state)
         return otherEditClear(state,action);
     case DEL_OTHERHIS:
         return backspaceText(state,action);
+    case OTHERHIS_MUL:
+        return multipleComfirn(state,action);
+    case REMOVE_OTHER_ID:
+        return removeId(state,action);
     default:
       return res;
   }

+ 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 } from '../types/treat'
-import { selectDrug, setTreatInfo, setOtherDrug, setDrugInfo, clearDrugInfo, showTreat, hideTreat, clearTreat, showDrugInfo, hideDrugInfo, setTreatment, setGeneralTreat, setSurgeryTreat, setRecommendBasic } 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 } from '../types/treat'
+import { selectDrug, setTreatInfo, setOtherDrug, setDrugInfo, clearDrugInfo, showTreat, hideTreat, clearTreat, showDrugInfo, hideDrugInfo, setTreatment, setGeneralTreat, setSurgeryTreat, setRecommendBasic, setDrugInfoList } from '../actions/treat'
 const initState = {
     show: false, //治疗方案显示隐藏
     showDrugInfo: false, //药品信息显示隐藏
@@ -195,6 +195,8 @@ export default function(state=initState, action){
             return setTreatInfo(state, action);
         case CLEAR_DRUG_INFO:
             return clearDrugInfo(state, action);
+        case SET_DRUG_INFO_LIST:
+        return setDrugInfoList(state, action);
         default:
             return state
     }

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

@@ -13,4 +13,6 @@ export const CHECK_FOCUS_INDEX = 'check_focus_text_index';
 export const CHECKBODY_CLEAR = 'clear_search_check_body';
 export const SETCHECKINPUT = 'set_check_body_input_label';
 export const DEL_CHECKBODY = 'DEL_CHECKBODY';//backspace
-export const CHANGECHECKTEXTLABEL_NUMBER = 'CHANGECHECKTEXTLABEL_NUMBER';//数字键盘
+export const CHANGECHECKTEXTLABEL_NUMBER = 'CHANGECHECKTEXTLABEL_NUMBER';//数字键盘
+export const CHECKCONFIRMSELECTED = 'spread_check_body_labels';
+export const CHECKBODY_MUL = 'CHECKBODY_MUL';//单列多选

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

@@ -23,4 +23,5 @@ export const SETCURRENTINPUT = 'SET_CURRENT_ILL_INPUT_LABEL';     //文本输入
 export const DEL_CURRENT = 'DEL_CURRENT';     //backspace删除
 export const CURRENT_TEXT_LABEL_NUMBER = 'CURRENT_TEXT_LABEL_NUMBER';     //数字键盘输入
 export const REMOVE_CURR_ID = 'REMOVE_CURR_ID';     //删除后移除id
+export const CURRENT_MUL = 'CURRENT_MUL';     //单列多选
 

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

@@ -9,4 +9,5 @@ export const SETTEXTFOCUS = 'set_focus_text_index';
 export const HIDEDROP = 'set_box_drop_hide';//点击确定隐藏
 export const CLICKCOUNT = 'click_count';//埋点
 export const ISREAD = 'is_history_or_template';     //是否回读或模板数据
-export const SETOTHERHISTORY = 'set_otherHis_history';    //其他史历史数据暂存
+export const SETOTHERHISTORY = 'set_otherHis_history';    //其他史历史数据暂存
+export const SETMINSCREEN = 'SETMINSCREEN';    //1024标识

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

@@ -24,3 +24,4 @@ export const SETMAININPUT = 'SET_MAIN_INPUT_LABEL';     //文本输入标签存
 export const DEL_MAIN = 'DEL_MAIN';     //删除标签
 export const CHANGE_LABELVAL_NUMBER = 'CHANGE_LABELVAL_NUMBER';     //数字键盘输入存值
 export const REMOVE_MAIN_ID = 'REMOVE_MAIN_ID';     //移除id
+export const MAINSUIT_MUL = 'MAINSUIT_MUL';     //单列多选

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

@@ -17,4 +17,6 @@ export const OTHERHIS_CLEAR = 'OTHERHIS_CLEAR';  //清空搜索值
 export const OTHERADDLABELITEM = 'other_add_label_item';    //带加号的标签复制
 export const OTHEREDICLEAR = 'OTHEREDICLEAR';    //文本框是否可以编辑
 export const DEL_OTHERHIS = 'DEL_OTHERHIS';    //backspace
-export const CHANGEOTHERTEXTLABEL_NUMBER = 'CHANGEOTHERTEXTLABEL_NUMBER';    //数字键盘
+export const CHANGEOTHERTEXTLABEL_NUMBER = 'CHANGEOTHERTEXTLABEL_NUMBER';    //数字键盘
+export const OTHERHIS_MUL = 'OTHERHIS_MUL';    //单列多选
+export const REMOVE_OTHER_ID = 'REMOVE_OTHER_ID';    

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

@@ -12,3 +12,4 @@ export const SET_SURGERY_TREAT = 'SET_SURGERY_TREAT'; //设置手术治疗
 export const SET_TREATMENT = 'SET_TREATMENT' //设置治疗方案
 export const SET_RECOMMEND_BASIC = 'SET_RECOMMEND_BASIC'//设置其他推荐推荐依据
 export const SET_TREAT_INFO = 'SET_TREAT_INFO' //设置治疗方案信息(name,id等)
+export const SET_DRUG_INFO_LIST = 'SET_DRUG_INFO_LIST' //查询多个药品说明书(添加数据时查看药品说明用)

+ 21 - 10
src/utils/tools.js

@@ -165,7 +165,9 @@ const getAllDataList =(baseList) =>{           //获取所有模块结构化的
     jsonData.chief = baseList.mainSuit.data;      //主诉
     jsonData.present = baseList.currentIll.data;    //现病史
     jsonData.other = baseList.otherHistory.data;      //其他史
+    jsonData.otherHistoryIsEmpty = baseList.otherHistory.isEmpty;
     jsonData.vital = baseList.checkBody.data;    //查体
+    jsonData.checkBodyIsEmpty = baseList.checkBody.isEmpty;
     jsonData.lis.labelList = baseList.inspect.labelList;      //化验
     jsonData.lis.getExcelDataList =  baseList.inspect.getExcelDataList;      //化验导入
     jsonData.pacs = baseList.assistCheck.assistLabel;     //辅检
@@ -177,9 +179,8 @@ const getAllDataList =(baseList) =>{           //获取所有模块结构化的
     jsonData.checkBodySelecteds = baseList.checkBody.selecteds;      //主诉选中状态保存
     jsonData.addItems = baseList.homePage.addItems||{};
     jsonData.mainsuitIds = baseList.mainSuit.mainIds;      //主诉去重
-    jsonData.mainSymptIds = baseList.mainSuit.mainSymptIds;      //主诉去重
     jsonData.currentIds = baseList.currentIll.symptomIds;      //现病史去重
-    // console.log(jsonData,'结构化数据获取')
+    //console.log(jsonData,'结构化数据获取')
     return jsonData;
 }
 const getAllDataStringList =(baseList) =>{           //获取所有模块文本的数据
@@ -230,10 +231,11 @@ const getAllDataStringList =(baseList) =>{           //获取所有模块文本
  */
 const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清空所有的数据
     if(action == 'clear'){     //清空
-        store.dispatch({type: CLEAR_MAIN_SUIT,data:[],saveText:[],selecteds:[],editClear:true,mainIds:[],mainSymptIds:[]});
+      const block = Object.assign(JSON.parse(config.textLabel),{full:true});//空白时保留一个自由文本标签
+      store.dispatch({type: CLEAR_MAIN_SUIT,data:[],saveText:[],selecteds:[],editClear:true,mainIds:[]});
         store.dispatch({type: CLEAR_CURRENT_ILL,data:[],saveText:[],selecteds:[],editClear:true,symptomIds:[]});
-        store.dispatch({type: CLEAROTHERHISTORY,data:[],saveText:[],selecteds:[],editClear:true});
-        store.dispatch({type: CLEARCHECKBODY,data:[],isEmpty:true,saveText:[],selecteds:[]});
+        store.dispatch({type: CLEAROTHERHISTORY,data:[block],isEmpty:true,saveText:[],selecteds:[],editClear:true});
+        store.dispatch({type: CLEARCHECKBODY,data:[block],isEmpty:true,saveText:[],selecteds:[]});
         store.dispatch(clearAssistData([],''));
         store.dispatch(clearAllLabel([],[],''));
         store.dispatch({
@@ -265,7 +267,6 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
                     selecteds:dataJson.mainSuitSelecteds?dataJson.mainSuitSelecteds:[],
                     saveText:JSON.parse(dataJsonStr.chief),
                     mainIds:dataJson.mainsuitIds?dataJson.mainsuitIds:[],
-                    mainSymptIds:dataJson.mainSymptIds?dataJson.mainSymptIds:[],
                 });
                 store.dispatch({
                     type: CLEAR_CURRENT_ILL,
@@ -278,6 +279,7 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
                     type: CLEAROTHERHISTORY,
                     data:dataJson.other,
                     selecteds:dataJson.otherHistorySelecteds?dataJson.otherHistorySelecteds:[],
+                    isEmpty:dataJson.otherHistoryIsEmpty,
                     saveText:JSON.parse(dataJsonStr.other),
                     editClear:dataJson.other.length>0?false:true
                 });
@@ -285,6 +287,7 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
                     type: CLEARCHECKBODY,
                     data:dataJson.vital,
                     selecteds:dataJson.checkBodySelecteds?dataJson.checkBodySelecteds:[],
+                    isEmpty:dataJson.checkBodyIsEmpty,
                     saveText:JSON.parse(dataJsonStr.vital)
                 });
                 store.dispatch(clearAllLabel(
@@ -319,7 +322,6 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
                     selecteds:dataJson.mainSuitSelecteds?dataJson.mainSuitSelecteds:[],
                     saveText:dataJsonStr[0].content ? JSON.parse(dataJsonStr[0].content) :[],
                     mainIds:dataJson.mainsuitIds?dataJson.mainsuitIds:[],
-                    mainSymptIds:dataJson.mainSymptIds?dataJson.mainSymptIds:[],
                 });
                 store.dispatch({
                     type: CLEAR_CURRENT_ILL,
@@ -333,12 +335,14 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
                     data:dataJson.other,
                     selecteds:dataJson.otherHistorySelecteds?dataJson.otherHistorySelecteds:[],
                     saveText:dataJsonStr[2].content ? JSON.parse(dataJsonStr[2].content):[],
+                    isEmpty:dataJson.otherHistoryIsEmpty,
                     editClear:dataJson.other.length>0?false:true
                 });
                 store.dispatch({
                     type: CLEARCHECKBODY,
                     data:dataJson.vital,
                     selecteds:dataJson.checkBodySelecteds?dataJson.checkBodySelecteds:[],
+                    isEmpty:dataJson.checkBodyIsEmpty,
                     saveText:dataJsonStr[3].content ? JSON.parse(dataJsonStr[3].content):[]
                 });
                 store.dispatch(clearAllLabel(
@@ -384,11 +388,13 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
                 store.dispatch({
                     type: CLEAROTHERHISTORY,
                     data:[],
+                    isEmpty:dataJson.otherHistoryIsEmpty,
                     saveText:JSON.parse(dataJsonStr.other)
                 });
                 store.dispatch({
                     type: CLEARCHECKBODY,
                     data:dataJson.vital,
+                    isEmpty:dataJson.checkBodyIsEmpty,
                     saveText:JSON.parse(dataJsonStr.vital)
                 });
                 store.dispatch(clearAllLabel(
@@ -432,11 +438,13 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
                 store.dispatch({
                     type: CLEAROTHERHISTORY,
                     data:[],
+                    isEmpty:dataJson.otherHistoryIsEmpty,
                     saveText:dataJsonStr[2].content ? JSON.parse(dataJsonStr[2].content) :[]
                 });
                 store.dispatch({
                     type: CLEARCHECKBODY,
                     data:dataJson.vital,
+                    isEmpty:dataJson.checkBodyIsEmpty,
                     saveText:dataJsonStr[3].content ? JSON.parse(dataJsonStr[3].content):[]
                 });
                 store.dispatch(clearAllLabel(
@@ -484,6 +492,9 @@ function filterDataArr(arrTmp){   //数据处理
     let tmpArr = [];
     let arr = arrTmp.join('').split('');
     for(let i = 0;i < arr.length;i++){
+        if(!(arr[i].match(config.punctuationReg)||arr[i-1])){        //只有标点符号或者前一个标签无值是(说明本标点灰显,不显示在预览中)
+            arr.splice(i,1,'');
+        }
         if(arr[i] && arr[i].indexOf('undefined') == -1){
             if(tmpArr[tmpArr.length-1] != ',' && tmpArr[tmpArr.length-1] != ',' ){
                 tmpArr.push(arr[i])
@@ -590,9 +601,9 @@ function isAllClear(jsonData,jsonStr,baseList){
     jsonData.chief.length < 1 &&
     jsonData.present.length < 1 &&
     // jsonData.other.length < 1 && 
-    (jsonData.other.length > 0 ? baseList.checkBody.isEmpty : true) &&
-    // jsonData.vital.length < 1 &&
-    (jsonData.vital.length > 0 ? baseList.otherHistory.isEmpty : true) &&
+    (jsonData.other.length > 0 ? baseList.otherHistory.isEmpty : true) &&
+    //jsonData.vital.length < 1 &&
+    (jsonData.vital.length > 0 ? baseList.checkBody.isEmpty : true) &&
     jsonData.diag.length < 1 &&
     jsonData.pacs.length < 1 &&
     jsonData.lis.labelList.length < 1 &&