Просмотр исходного кода

Merge branch 'dev/new1' into dev/byll

Luolei 6 лет назад
Родитель
Сommit
d771a09a5f
51 измененных файлов с 539 добавлено и 168 удалено
  1. 0 1
      src/common/components/ConfirmModal/NewPortal/index.jsx
  2. 12 24
      src/common/components/EditableSpan/index.jsx
  3. 1 1
      src/common/components/ItemBox/index.jsx
  4. 24 9
      src/common/js/func.js
  5. 5 1
      src/common/less/variables.less
  6. 1 1
      src/components/AddAssistCheck/index.jsx
  7. 1 1
      src/components/AddInspect/index.jsx
  8. 1 1
      src/components/CheckBody/index.jsx
  9. 2 1
      src/components/CurrentIll/index.jsx
  10. 1 0
      src/components/DiagResultSearch/index.less
  11. 7 3
      src/components/HistoryCaseContainer/index.jsx
  12. 14 10
      src/components/MainSuit/index.jsx
  13. 8 2
      src/components/NumberUnitDrop/index.jsx
  14. 7 6
      src/components/PushContainer/index.jsx
  15. 29 0
      src/components/PushItems/DetailsModal/NewPortal/index.jsx
  16. 41 0
      src/components/PushItems/DetailsModal/index.jsx
  17. 72 0
      src/components/PushItems/DetailsModal/index.less
  18. 15 4
      src/components/PushItems/index.jsx
  19. 15 10
      src/components/RadioDrop/index.jsx
  20. 12 4
      src/components/SpreadDrop/index.jsx
  21. 0 3
      src/components/SpreadDrop/index.less
  22. 2 2
      src/components/Treat/DrugTreat/index.jsx
  23. 1 1
      src/components/TreatDesc/DrugInfo/index.less
  24. 13 10
      src/components/TreatDesc/index.jsx
  25. 14 2
      src/components/TreatDesc/index.less
  26. 1 1
      src/config/index.js
  27. 1 1
      src/containers/AssistCheck.js
  28. 1 1
      src/containers/CheckBody.js
  29. 2 2
      src/containers/CurrentIll.js
  30. 1 1
      src/containers/DiagnosticList.js
  31. 1 1
      src/containers/EditableSpan.js
  32. 1 1
      src/containers/Inspect.js
  33. 6 6
      src/containers/MainSuit.js
  34. 1 1
      src/containers/NumberDrop.js
  35. 1 1
      src/containers/NumberUnitDrop.js
  36. 5 4
      src/containers/OtherHistory.js
  37. 12 2
      src/containers/PushItemsContainer.js
  38. 2 2
      src/containers/RadioDrop.js
  39. 2 2
      src/containers/SpreadDrop.js
  40. 10 2
      src/containers/TypeConfigContainer.js
  41. 1 2
      src/store/actions/checkBody.js
  42. 25 4
      src/store/actions/currentIll.js
  43. 0 1
      src/store/actions/diagnosticList.js
  44. 82 10
      src/store/actions/mainSuit.js
  45. 30 3
      src/store/actions/pushMessage.js
  46. 1 1
      src/store/async-actions/homePage.js
  47. 27 4
      src/store/async-actions/pushMessage.js
  48. 1 1
      src/store/reducers/homePage.js
  49. 8 2
      src/store/reducers/pushMessage.js
  50. 4 1
      src/store/types/pushMessage.js
  51. 15 14
      src/utils/tools.js

+ 0 - 1
src/common/components/ConfirmModal/NewPortal/index.jsx

@@ -9,7 +9,6 @@ class NewPortal extends Component {
         this.node = document.createElement('div');
         document.body.appendChild(this.node);
     }
-
     render() {
         const { visible,children } = this.props;
         

+ 12 - 24
src/common/components/EditableSpan/index.jsx

@@ -113,23 +113,17 @@ class EditableSpan extends Component{
   }
 
   moveEnd(obj) {
-    obj.focus();
-    if($.support.msie)
-    {
-        var range = document.selection.createRange();
-        this.last = range;
-        range.moveToElementText(obj);
-        range.select();
-        document.selection.empty(); //取消选中
+    if(window.getSelection){//ie11 10 9 ff safari
+      obj.focus(); //解决ff不获取焦点无法定位问题
+      var range = window.getSelection();//创建range
+      range.selectAllChildren(obj);//range 选择obj下所有子内容
+      range.collapseToEnd();//光标移至最后
     }
-    else
-    {
-        var range = document.createRange();
-        range.selectNodeContents(obj);
-        range.collapse(false);
-        var sel = window.getSelection();
-        sel.removeAllRanges();
-        sel.addRange(range);
+    else if (document.selection) {//ie10 9 8 7 6 5
+      var range = document.selection.createRange();//创建选择对象
+      range.moveToElementText(obj);//range定位到obj
+      range.collapse(false);//光标移至最后
+      range.select();
     }
   }
 
@@ -159,16 +153,10 @@ class EditableSpan extends Component{
     let innerVal = target.innerText;
     if(ev.keyCode==8){
       // 主诉现病史去重:删除最后一个字的时候移除该数据(将name、id和value替换成空)并移除id
-      let pattern1 = new RegExp(/^\,|^\,|^\.|^\。|^\、|^\;|^\;|^\:|^\:/);
-      if(pattern1.test(preVal)){//以标点开头的情况-现病史
-        if(preVal.trim().length==2){
+      if(preVal.trim().length==1){
           removeId && removeId({boxMark,i:index,text:""});
+          // this.moveEnd(obj[0]);
         }
-      }else{
-        if(preVal.trim().length==1){
-          removeId && removeId({boxMark,i:index,text:""});
-        }
-      }
       
       if(innerVal !==preVal){return false}
       let data = innerVal.trim();

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

@@ -33,7 +33,7 @@ class ItemBox extends Component {
   }
   handleInput(e){
     const {onchange,data} = this.props;
-    if((data&&data.length==0)||!data){//避免结构化下触发onchange,导致下拉要点两下
+    if(!data || (data.length==0)){//避免结构化下触发onchange,导致下拉要点两下
       onchange&&onchange(e)
     }
   }

+ 24 - 9
src/common/js/func.js

@@ -65,9 +65,12 @@ export const strTrim = (str) =>{
   return str.replace(/&nbsp;|<div>|<\/div>|<br>|\s/g,'');
 };
 
-//获取已填文字填入saveText
-function getSaveText(arr){
-
+//获取组合组件已填文字填入saveText
+function getSaveText(data){console.log(data)
+  const arr = data.questionMapping.map((it)=>{
+    return it.value?(it.labelPrefix||'')+(it.value||'')+(it.labelSuffix||''):'';
+  });
+  return arr.join('');
 }
 
 //添加自由文本标签
@@ -102,8 +105,12 @@ export const fullfillText = (arr,noPre=false,noEnd=false,ifEmpty=true)=>{
         saveText.push('');
       }
       newArr.push(it);
-      tempText = value?it.labelPrefix+value+it.labelSuffix:'';
-      tempText = notText?tempText:it.value||it.name;
+      if(it.tagType != 3){
+        tempText = value?it.labelPrefix+value+it.labelSuffix:'';
+        tempText = notText?tempText:it.value||it.name;
+      }else{
+        tempText = getSaveText(it);
+      }
       saveText.push(tempText);
     }else{
       pre = arr[i-1];
@@ -111,7 +118,11 @@ export const fullfillText = (arr,noPre=false,noEnd=false,ifEmpty=true)=>{
       if(notTextLabel(pre)&&notText){
           // newArr.push(textLabel,it);
           ifEmpty?newArr.push(textLabel,it):newArr.push(_textLabel,it);
-          tempText = value?it.labelPrefix+value+it.labelSuffix:'';
+          if(it.tagType != 3) {
+            tempText = value ? it.labelPrefix + value + it.labelSuffix : '';
+          }else{
+            tempText = getSaveText(it);
+          }
           saveText.push("",tempText); 
         //最后一个非文本标签,后面添加一个文本标签
         /*if(!noEnd&&i===arr.length-1){
@@ -120,9 +131,13 @@ export const fullfillText = (arr,noPre=false,noEnd=false,ifEmpty=true)=>{
         }*/
       }else{    //本身是或者前面是文本标签时,前面不添加文本标签
         newArr.push(it);
-        tempText = value?it.labelPrefix+value+it.labelSuffix:'';
-        // tempText = notText?tempText:it.value||it.name;
-        tempText = notText?tempText:(it.value||it.value==""?it.value:it.name);
+        if(it.tagType != 3) {
+          tempText = value ? it.labelPrefix + value + it.labelSuffix : '';
+          // tempText = notText?tempText:it.value||it.name;
+          tempText = notText ? tempText : (it.value || it.value == "" ? it.value : it.name);
+        }else{
+          tempText = getSaveText(it);
+        }
         saveText.push(tempText);
       }
       if(notText&&!noEnd&&i===arr.length-1){//最后一个非文本标签,后面添加一个文本标签

+ 5 - 1
src/common/less/variables.less

@@ -161,4 +161,8 @@
   box-shadow: 0 10px 20px 0 #989DA3;
   // filter:progid:DXImageTransform.Microsoft.Shadow(color='#989DA3',Direction=125,Strength=6);
   border: 1px solid #dedede;
-}
+}
+
+.borderd{
+   border:1px #3B9ED0 solid;
+ }

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

@@ -140,7 +140,7 @@ class AddAssistCheck extends React.Component {
                 </div>
                 <ConfirmModal 
                     visible={visible}
-                    confirm={()=>{this.delConfirm()}}
+                    confirm={this.delConfirm}
                     close={this.handleCancel}
                     cancel={this.handleCancel}
                     okText="删除"

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

@@ -369,7 +369,7 @@ class Inspect extends React.Component {
                 </div>
                 <ConfirmModal 
                     visible={visible}
-                    confirm={()=>{this.delConfirm()}}
+                    confirm={this.delConfirm}
                     close={this.handleCancel}
                     cancel={this.handleCancel}
                     okText="删除"

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

@@ -63,7 +63,7 @@ class CheckBody extends Component{
       return ;
     }
     //有主诉时且本身无数据,第一次点击获取数据,(不论获取成功与否)再点击不获取(直到刷新成空白页或清空)
-    if(hasMain&&isEmpty){
+    if(hasMain&&isEmpty!=false){
       this.props.getInit();
     }
   }

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

@@ -72,7 +72,8 @@ class CurrentIll extends Component{
   }
 
   onchange(e){//监听输入事件,主诉无数据不能输入
-    e.target.innerText = "";
+    const ev = e || window.event;
+    ev.target.innerText = "";
   }
 
   handleClick(e){//让搜索框跟随鼠标点击移动

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

@@ -20,6 +20,7 @@
 .search-input {
     width: 300px;
     height: 34px;
+    line-height: 34px;
     position: relative;
     padding: 0  30px;
 }

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

@@ -12,6 +12,7 @@ import { CONFIRM_TYPE } from "@store/types/typeConfig";
 class HistoryCaseContainer extends React.Component {
     constructor(props){
         super(props);
+        this.close = this.close.bind(this);
     }
     componentDidMount(){
         // store.dispatch(initItemList());
@@ -24,6 +25,9 @@ class HistoryCaseContainer extends React.Component {
         store.dispatch({type: CONFIRM_TYPE, confirmType: baseObj.sign});
         pushAllDataList(baseObj.sign,'push',baseObj,'history')       //引用
     }
+    close(){
+      store.dispatch(visibleHistory(false));
+    }
     render(){
         const { visible,showHistoryCases,showHistoryBox,items,handleCaseClick,handleQuoteClick,handleSortClick,activeHistory,preInfo } = this.props;
         const domNode = document.getElementById('root');
@@ -41,9 +45,9 @@ class HistoryCaseContainer extends React.Component {
                 ></HistoryList>
                 <ConfirmModal
                     visible={visible}
-                    confirm={()=>{this.makeSure()}}
-                    close={()=>{store.dispatch(visibleHistory(false))}}
-                    cancel={()=>{store.dispatch(visibleHistory(false))}}
+                    confirm={this.makeSure}
+                    close={this.close}
+                    cancel={this.close}
                     okText={"引用"}
                     okBorderColor={'#3B9ED0'}
                     okColor={'#fff'}

+ 14 - 10
src/components/MainSuit/index.jsx

@@ -143,20 +143,21 @@ class MainSuit extends Component{
   }
 
   handleChange(e){
-    const data = e.target.innerText;
+    const ev = e || window.event;
+    const data = ev.target.innerText;
     const {getSearchData,searchData,datas,pushMessage,reTotalHide} = this.props;
     const {overFlag,inpText} = this.state;
     reTotalHide && reTotalHide();//重置homePage中的控制项
     const that = this;
-    if(data.length > config.limited){
+    if(data&&data.length > config.limited){
       Notify.info(config.limitText);
       if(overFlag){
-        e.target.innerText = inpText;
-        e.target.blur();
+        ev.target.innerText = inpText;
+        ev.target.blur();
         return
       }
-      e.target.innerText = data.substr(0,config.limited);  //输入法内输入多个字再按enter的情况
-      e.target.blur();
+      ev.target.innerText = data.substr(0,config.limited);  //输入法内输入多个字再按enter的情况
+      ev.target.blur();
       this.setState({
         inpText:data.substr(0,config.limited),
         overFlag:true
@@ -167,11 +168,11 @@ class MainSuit extends Component{
       inpText:data,
       overFlag:false
     })
-    if(datas.length > 0){//使用模板
+    if(datas && datas.length > 0){//使用模板
       return false;
     }
     // 有输入内容或搜索结果时关闭,否则显示
-    if(data.trim()||searchData.length>0){
+    if(data && data.trim()||searchData.length>0){
       this.setState({
         symptom:false
       })
@@ -180,9 +181,9 @@ class MainSuit extends Component{
         symptom:true
       })
     }
-
     clearTimeout(this.state.timer);
     const timer = setTimeout(function(){
+      pushMessage && pushMessage(data);
       //调搜索接口 使用模板走EditableSpan里的搜索方法
       getSearchData && getSearchData({inpStr:data,boxMark:1});
     },config.delayTime);
@@ -211,7 +212,10 @@ class MainSuit extends Component{
       });
     }else{
       if(datas.length==0){
-        freeText && freeText(data.trim());
+        const ev = e || window.event;
+        const data = ev.target.innerText;
+        // freeText && freeText(data.trim());
+        freeText && freeText(data);
       }
     }
     

+ 8 - 2
src/components/NumberUnitDrop/index.jsx

@@ -29,6 +29,7 @@ class NumberUnitDrop extends Component{
       labelVal:''
     };
     this.$span = React.createRef();
+    this.$cont = React.createRef();
     this.select = this.select.bind(this);
     this.numInpBlur = this.numInpBlur.bind(this);
     this.handleSpanInp = this.handleSpanInp.bind(this);
@@ -114,10 +115,15 @@ class NumberUnitDrop extends Component{
     }
   }
   getClasses(){         //整个标签是否有值的状态
-    const {value,hideTag} = this.props;
+    const {value,hideTag,show} = this.props;
     const inpValue = this.state.value;
     const isSelected = value||inpValue?style['selected']:style['container'];
     const noTag = hideTag?style['no-tag']:'';
+    if(show){
+      $(this.$cont.current).addClass(style['borderd']);
+    }else{
+      $(this.$cont.current).removeClass(style['borderd']);
+    }
     return className(isSelected,noTag);
   }
   changeToEdit(e){        //整个标签双击编辑状态
@@ -146,7 +152,7 @@ class NumberUnitDrop extends Component{
   render(){
     const {placeholder,prefix,suffix,show,value,handleHide} = this.props;
     const {numEditable,editable,hasSelect,placeholderFlag} = this.state;
-    return <div className={this.getClasses()}>
+    return <div className={this.getClasses()} ref={this.$cont}>
       <span>{prefix}</span>
       <span onClick={this.handleNumClick}
             contentEditable={editable}

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

@@ -36,8 +36,6 @@ class PushContainer extends Component {
             oKBg:'',
             okColor:'red',
             num:0,          //计数
-            text:'',
-            currId:''
         }
         this.$cont = React.createRef();
         this.itemList = null;
@@ -49,6 +47,7 @@ class PushContainer extends Component {
         this.handleMangerTemplate=this.handleMangerTemplate.bind(this)
         this.handleDelList=this.handleDelList.bind(this)
         this.makeSure=this.makeSure.bind(this)
+        this.handleClose = this.handleClose.bind(this);
     }
     componentDidMount(){
         // const height = getWindowInnerHeight()-160;
@@ -183,7 +182,6 @@ class PushContainer extends Component {
         store.dispatch(allChecked(false))
         store.dispatch(allCheckedShow(!tmpFlg))
     }
-    
     handleDelList(){          //批量删除
         this.setState({
             type:2,
@@ -225,6 +223,9 @@ class PushContainer extends Component {
             store.dispatch(changeVisible(false))
         }
     }
+    handleClose(){
+      store.dispatch(changeVisible(false));
+    }
     render() {
         const {activeId,checkItems,visible,showMsg,items,allCheckShow} = this.props;
         return <div className={style["container"]} ref={this.$cont} >
@@ -249,9 +250,9 @@ class PushContainer extends Component {
             </Tab>
             <ConfirmModal 
                 visible={visible}
-                confirm={()=>{this.makeSure()}}
-                close={()=>{store.dispatch(changeVisible(false))}}
-                cancel={()=>{store.dispatch(changeVisible(false))}}
+                confirm={this.makeSure}
+                close={this.handleClose}
+                cancel={this.handleClose}
                 okText={this.state.okText}
                 okBorderColor={this.state.okBorderColor}
                 okColor={this.state.okColor}

+ 29 - 0
src/components/PushItems/DetailsModal/NewPortal/index.jsx

@@ -0,0 +1,29 @@
+import React, { Component } from 'react';
+import ReactDOM from 'react-dom';
+
+//传送门,将dom渲染到body节点
+class NewPortal extends Component {
+    constructor(props) {
+        super(props)
+        // 初始化创建渲染的父元素并添加到body下
+        this.node = document.createElement('div');
+    }
+
+    componentDidMount() {
+        document.body.appendChild(this.node);
+    }
+
+    componentWillUnmount() {
+        document.body.removeChild(this.node);
+    }
+    render() {
+        const { visible,children } = this.props;
+        
+        return visible && ReactDOM.createPortal(
+            children,
+            this.node
+        )
+    }
+}
+
+export default NewPortal;

+ 41 - 0
src/components/PushItems/DetailsModal/index.jsx

@@ -0,0 +1,41 @@
+import React, { Component } from "react";
+import styles from "./index.less";
+import NewPortal from './NewPortal'
+import close from "./../img/close.png";
+class DetailsModal extends Component {
+    constructor(props) {
+        super(props);
+        this.hideTips = this.hideTips.bind(this)
+    }
+    hideTips() {
+        const { hideTips } = this.props;
+        hideTips && hideTips();
+    }
+
+    render() {
+        const {showTipsDetails, tipsDetails} = this.props;
+        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']}>
+                    {tipsDetails && tipsDetails.introduceDetailList && tipsDetails.introduceDetailList.map((item, index) => {
+                        return (<div>
+                            <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>
+           <div className={styles['details-mask']}>
+           </div>
+        </div>
+    </NewPortal>)
+    }
+}
+
+export default DetailsModal;

+ 72 - 0
src/components/PushItems/DetailsModal/index.less

@@ -0,0 +1,72 @@
+.details-wrapper {
+    position: fixed;
+    width: 100%;
+    height: 100%;
+    left: 0;
+    top: 0;
+    z-index: 205;
+}
+
+.details-content-wrapper {
+    position: fixed;
+    padding: 50px 0;
+    width: 80%;
+    height: 80%;
+    left: 10%;
+    top: 10%;
+    background: #fff;
+    z-index: 10;
+}
+
+.details-content-name {
+    position: absolute;
+    top: 0;
+    width: 100%;
+    padding: 0 40px;
+    height: 50px;
+    line-height: 50px;
+    font-size: 24px;
+}
+
+.details-content-title-box {
+    position: relative;
+    height: 40px;
+    line-height: 40px;
+    font-size: 20px;
+}
+
+.details-content-title-name {
+    position: absolute;
+    background: #fff;
+    padding-right: 5px;
+    font-size: 20px;
+    z-index: 10;
+}
+
+.details-content-title-line {
+    position: absolute;
+    width: 100%;
+    height: 20px;
+    top: 0;
+    border-bottom: 1px dashed #ccc;
+}
+.details-close {
+    position: absolute;
+    right: 0;
+}
+.details-content {
+    height: 100%;
+    padding: 0 40px;
+    overflow-y: auto;
+}
+.details-mask {
+    position: fixed;
+    width: 100%;
+    height: 100%;
+    left: 0;
+    top: 0;
+    background: #000;
+    opacity: .6;
+    filter:alpha(opacity=60);
+    -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(opacity=60);";
+}

+ 15 - 4
src/components/PushItems/index.jsx

@@ -7,7 +7,7 @@ import tipsImg from "../../common/images/tips.png";
 import vigilantImg from "../../common/images/vigilant.png";
 import showImg from "../../common/images/show.png";
 import hideImg from "../../common/images/close.png";
-
+import DetailsModal from './DetailsModal';
 import PushDiag from "./PushDiag";
 import DiagnosticItem from "@containers/DiagnosticItem";
 import $ from "jquery";
@@ -29,6 +29,7 @@ class PushItems extends Component {
     this.changeAssay = this.changeAssay.bind(this);
     this.changeCheck = this.changeCheck.bind(this);
     this.showTips = this.showTips.bind(this);
+    this.hideTips = this.hideTips.bind(this)
     this.$cont = React.createRef();
   }
 
@@ -61,8 +62,13 @@ class PushItems extends Component {
   }
 
   showTips(tips) {
-    const { getTipsDetails } = this.props;
+    const { getTipsDetails, showTipsDetailsModal } = this.props;
     getTipsDetails && getTipsDetails();
+    showTipsDetailsModal && showTipsDetailsModal()
+  }
+  hideTips() {
+    const { hideTipsDetailsModal } = this.props;
+    hideTipsDetailsModal && hideTipsDetailsModal()
   }
   componentDidMount() {
     const height = getWindowInnerHeight() - 200;
@@ -82,7 +88,9 @@ class PushItems extends Component {
       possible,
       assay,
       check,
-      tips
+      tips,
+      showTipsDetails,
+      tipsDetails
     } = this.props.pushMessage;
     const { tipsDiscalimer } = this.props;
     const { moreAssay, moreCheck } = this.state;
@@ -355,7 +363,10 @@ class PushItems extends Component {
           </div>
         </div>
         {tipsDiscalimer.data && <div className={style['disTips']} dangerouslySetInnerHTML={{__html: tipsDiscalimer.data.data[1].description}}></div>}
-        
+        {showTipsDetails && <DetailsModal  
+            showTipsDetails = {showTipsDetails}
+            hideTips = {this.hideTips}
+            tipsDetails = {tipsDetails}/>}
         
       </div>
     );

+ 15 - 10
src/components/RadioDrop/index.jsx

@@ -2,6 +2,7 @@ import React,{Component} from 'react';
 import {handleEnter} from '@utils/tools.js';
 import {DropList} from '@commonComp';
 import style from "./index.less";
+import $ from "jquery";
 
 /****
  * 单选下拉
@@ -23,17 +24,23 @@ class RadioDrop extends Component{
       editable:false,
       timer:null
     };
+    this.$cont = React.createRef();
     this.handleSelect = this.handleSelect.bind(this);
     this.handleShow = this.handleShow.bind(this);
     this.handledbClick = this.handledbClick.bind(this);
     this.handleEditLabel = this.handleEditLabel.bind(this);
   }
   getClass(){
-    const {value,hideTag,placeholder} = this.props;
+    const {value,hideTag,placeholder,show} = this.props;
+    if(show){
+      $(this.$cont.current).addClass(style['borderd']);
+    }else{
+      $(this.$cont.current).removeClass(style['borderd']);
+    }
     if(hideTag){
       return style['no-tag'];
     }
-    if(value&&value!=placeholder){
+    if(value){
       return style['selected-tag'];
     }
     return style['tag'];
@@ -87,18 +94,16 @@ class RadioDrop extends Component{
   }
   handleEditLabel(e){
     e.stopPropagation();
+    if(!this.state.editable){     //ie8点开下拉未选值存值bug修改
+      return;
+    }
     const {ikey,boxMark,handleLabelEdit} = this.props;
-    /*const {editable} = this.state;
-    if(editable){
-      // 更改标签的value值
-      let changeVal = e.target.innerText;
-      handleLabelEdit && handleLabelEdit({ikey,changeVal,type:boxMark});
-    }*/
     this.setState({
       editable:false
     });  
    // 更改标签的value值
-    let changeVal = e.target.innerText;
+    const ev = e || window.event;
+    let changeVal = ev.target.innerText;
     handleLabelEdit && handleLabelEdit({ikey,changeVal,type:boxMark});
   }
   handledbClick(e){
@@ -114,7 +119,7 @@ class RadioDrop extends Component{
   }
   render(){
     const {data,prefix,suffix,placeholder,show,value} = this.props;
-    return <div className={style['container']}>
+    return <div className={style['container']} ref = {this.$cont}>
       {prefix}
       <div className={this.getClass()}
            onBlur={this.handleEditLabel}

+ 12 - 4
src/components/SpreadDrop/index.jsx

@@ -56,7 +56,7 @@ class SpreadDrop extends Component{
     let boxLeft = e.pageX -175 + 'px';
     let offsetTop = e.target.offsetTop;
     const ht = e.target.offsetHeight;   //如杂音选中文字有多行时,写死会遮挡
-    let boxTop = offsetTop + ht + 'px';
+    let boxTop = offsetTop + ht +2 + 'px';
     this.setState({
       boxLeft:boxLeft,
       boxTop:boxTop
@@ -122,10 +122,13 @@ class SpreadDrop extends Component{
     e.stopPropagation();
     const {ikey,type,handleLabelChange} = this.props;
     const {editable} = this.state;
+    const ev = e || window.event;
     if(editable){
       // 更改标签的value值
-      let changeVal = e.target.innerText;
-      e.target.innerText = '';      //避免出现重复输入值
+      let changeVal = ev.target.innerText;
+      if(!isIE()){
+        e.target.innerText = '';      //避免出现重复输入值
+      }
       handleLabelChange && handleLabelChange({ikey,changeVal,type});
     }
     this.setState({
@@ -175,7 +178,7 @@ class SpreadDrop extends Component{
     const {handleConfirm,ikey,type,tagType,order,mainSaveText,copyType} = this.props;
     const params = Object.assign({},this.state,{ikey,type,tagType,order,mainSaveText,copyType});
     handleConfirm&&handleConfirm(params);
-	  this.btnClickFlag = true;
+	this.btnClickFlag = true;
     //点确定后隐藏弹窗
     this.props.handleHide();
   }
@@ -282,6 +285,11 @@ class SpreadDrop extends Component{
     });
   }
   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'];
     }

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

@@ -40,9 +40,6 @@
   cursor: pointer;
   line-height: 20px;
 }
-.tag{
-  .tag;
-}
 
 .selected-tag{
   padding: 0;

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

@@ -49,11 +49,11 @@ class DrugTreat extends Component {
                                 return ((it.isShow == 1 || it.selected) && <span style={it.forbidden === '2' ? {opacity: '0.3', filter:'alpha(opacity=30)'} : ''}>
                                         {ii === 0 ? '' : ', '}
                                         <span className={style['drug-name']}  
-                                            onDoubleClick={() =>{this.setDrugInfo(it);showDrugInfo();}} 
+                                            // onDoubleClick={() =>{this.setDrugInfo(it);showDrugInfo();}}  //药品说明双击显示(现在为点击图标显示)
                                             onClick={()=>{it.forbidden === '2' ? '' : this.handleSelect(index,ii)}} style={it.selected ? {color: '#3B9ED0', borderBottom: '1px solid #3B9ED0'}:''}>
                                             {it.medicitionName}
                                         </span>
-                                        {/* {it.showInfo && it.showInfo==='1'&& <img className={style['info-img']} src={info} onClick={() =>{this.setDrugInfo(it);showDrugInfo();}}/>} */}
+                                        {<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}
                                         
                                     </span>)

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

@@ -27,7 +27,7 @@
 .close-drug-desc {
     position: absolute;
     right: 0;
-    width: 30px;
+    width: 40px;
 }
 .drug-desc-item {
     padding: 5px 0;

+ 13 - 10
src/components/TreatDesc/index.jsx

@@ -37,17 +37,20 @@ class TreatDesc extends Component {
                     
                 </div> } */}
                 { otherDrugIndex > -1 && <div  className={style['similar-drug']}>
-                    <h3 className={style['drug-desc-title']}>同类药物  <img src={close} onClick={this.hideTreatDesc} className={style['close-drug-desc']} /></h3>
+                    <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)'} : ''}>
-                        {index === 0 ? '' : ', '}                   
-                        <span className={style['drug-name']} 
-                              onDoubleClick={() =>{setDrugInfo(item);showDrugInfo();}} 
-                              onClick={()=>{item.forbidden === '2' ? '' : this.handleSelect(otherDrugIndex,index)}} 
-                              style={item.selected ? {color: '#3B9ED0'}:''}>
-                            {item.medicitionName}
-                        </span>
-                        {/* {item.showInfo && item.showInfo==='1'&& <img className={style['info-img']} src={info} />} */}
+                        return (<span   style={item.forbidden === '2' ? {opacity: '0.3', filter:'alpha(opacity=30)'} : ''}>
+                        {index === 0 ? '' : ', '}     
+                        <span className={style['drug-name-box']}>
+                            <span className={style['drug-name']} 
+                                onDoubleClick={() =>{setDrugInfo(item);showDrugInfo();}} 
+                                onClick={()=>{item.forbidden === '2' ? '' : this.handleSelect(otherDrugIndex,index)}} 
+                                style={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}
                         
                     </span>)

+ 14 - 2
src/components/TreatDesc/index.less

@@ -46,11 +46,16 @@
     background: #fff;
     padding: 60px 20px 80px;
 }
-
-.drug-name {
+.drug-name-box {
     display: inline-block;
     height: 30px;
 }
+.drug-name {
+    border-bottom: 1px solid #666;
+    display: inline-block;
+    cursor: pointer;
+    
+}
 .info-img {
     width: 12px;
     margin: 0 3px -1px;
@@ -63,3 +68,10 @@
     border-radius: 4px;
     text-align: center;
 }
+.drug-desc-class-title {
+    display: inline-block;
+    width: 210px;
+    overflow: hidden;
+    text-overflow: ellipsis;
+    white-space: nowrap;
+}

+ 1 - 1
src/config/index.js

@@ -12,7 +12,7 @@ export default {
       '1':'mainSuit',         //主诉
       '2':'current',          //现病史
       '3':'process',          //病程变化
-      '4':'otherHis',         //其他史
+      '4':'otherHisModel',         //其他史
       // '5':'checkbody'        //查体
       '5':'currentEmpty',        //现病史空模板
       '6':'addSymptom'        //添加病情变化--主诉

+ 1 - 1
src/containers/AssistCheck.js

@@ -36,7 +36,7 @@ function mapDispatchToProps(dispatch, store) {
         //右侧推送
         fetchPushInfos(){
           //调右侧推送
-          dispatch(billing);
+          dispatch(billing());
         }
     }
 }

+ 1 - 1
src/containers/CheckBody.js

@@ -51,7 +51,7 @@ function mapDispatchToProps(dispatch,state){
     //右侧推送
     fetchPushInfos(){
       //调右侧推送
-      dispatch(billing);
+      dispatch(billing());
     },
   }
 }

+ 2 - 2
src/containers/CurrentIll.js

@@ -78,7 +78,7 @@ function mapDispatchToProps(dispatch) {
          //右侧推送
          setTimeout(function(){      //延迟待确定后的数据更新后推送,避免获取的参数还是旧的
            if(didPushParamChange()){     //操作后内容有变化才推送
-             dispatch(billing);
+             dispatch(billing());
            }
          },500);
        },
@@ -91,7 +91,7 @@ function mapDispatchToProps(dispatch) {
         //文本模式下推送
         fetchPushInfos(){
           //调右侧推送
-          dispatch(billing);
+          dispatch(billing());
         },
       handleInput(obj){    //文本模式值保存
         dispatch({

+ 1 - 1
src/containers/DiagnosticList.js

@@ -64,7 +64,7 @@ function mapDispatchToProps(dispatch) {
             dispatch(getTips(diagItem))
         },
         getBilling: () => {
-            dispatch(billing)
+            dispatch(billing())
         }
     }
 }

+ 1 - 1
src/containers/EditableSpan.js

@@ -172,7 +172,7 @@ function mapDispatchToProps(dispatch,state) {
       clearTimeout(timer);
       let timer = setTimeout(function(){      //延迟待确定后的数据更新后推送,避免获取的参数还是旧的
         if(didPushParamChange()){     //操作后内容有变化才推送
-          dispatch(billing);
+          dispatch(billing());
           clearTimeout(timer);
         }
       },config.delayPushTime);

+ 1 - 1
src/containers/Inspect.js

@@ -48,7 +48,7 @@ function mapDispatchToProps(dispatch, store) {
         //右侧推送
         fetchPushInfos(){
           //调右侧推送
-          dispatch(billing);
+          dispatch(billing());
         }
     }
 }

+ 6 - 6
src/containers/MainSuit.js

@@ -79,7 +79,7 @@ function mapDispatchToProps(dispatch) {
           //右侧推送
           setTimeout(function(){      //延迟待确定后的数据更新后推送,避免获取的参数还是旧的
             if(didPushParamChange()){     //操作后内容有变化才推送
-              dispatch(billing);
+              dispatch(billing());
             }
           },500);
         },
@@ -91,9 +91,9 @@ function mapDispatchToProps(dispatch) {
       setMainSuit: (value) => {
         dispatch({type: SET_MAIN_SUIT, value})
       },
-      pushMessage() {//结构模式右侧推送
-        console.log("右侧推送接口");
-        dispatch(billing);
+      pushMessage(data) {//结构模式右侧推送
+        // console.log("右侧推送接口");
+        dispatch(billing(data));
       },
       getSearchData:(item)=>{
         getSearch(item).then((res)=>{
@@ -132,14 +132,14 @@ function mapDispatchToProps(dispatch) {
         //右侧推送
           setTimeout(function(){ 
             if(didPushParamChange()){
-              dispatch(billing);
+              dispatch(billing());
             }
           },500);
       },
       fetchPushInfos(){//文本模式下推送
         //调右侧推送
         console.log('右侧推送内容');
-        dispatch(billing);
+        dispatch(billing());
       },
       handleInput(obj){   //文本模式值保存
           dispatch({

+ 1 - 1
src/containers/NumberDrop.js

@@ -125,7 +125,7 @@ function mapDispatchToProps(dispatch,store){
       clearTimeout(timer);
       let timer = setTimeout(function(){      //延迟待确定后的数据更新后推送,避免获取的参数还是旧的
         if(didPushParamChange()){     //操作后内容有变化才推送
-          dispatch(billing);
+          dispatch(billing());
           clearTimeout(timer);
         }
       },config.delayPushTime);

+ 1 - 1
src/containers/NumberUnitDrop.js

@@ -120,7 +120,7 @@ function mapDispatchToProps(dispatch,store){
       clearTimeout(timer);
       let timer = setTimeout(function(){      //延迟待确定后的数据更新后推送,避免获取的参数还是旧的
         if(didPushParamChange()){     //操作后内容有变化才推送
-          dispatch(billing);
+          dispatch(billing());
           clearTimeout(timer);
         }
       },config.delayPushTime);

+ 5 - 4
src/containers/OtherHistory.js

@@ -36,10 +36,11 @@ function mapDispatchToProps(dispatch,store){
       //先获取最近记录,没有的话显示模板
       dispatch((dispatch,getStore)=>{
         const initData = getStore().homePage.initData;
-        const arr = JSON.parse(JSON.stringify(initData.otherHis));
+        const model = JSON.parse(JSON.stringify(initData.otherHisModel));
+        const arr = JSON.parse(JSON.stringify(initData.otherHis||null));
         const arrSave = JSON.parse(JSON.stringify(initData.otherHisSave||null));
         const isHis = initData.otherIsHis;
-        const listObj = isHis?{newArr:arr,saveText:arrSave||[]}:fullfillText(arr);
+        const listObj = isHis?{newArr:arr,saveText:arrSave||[]}:fullfillText(model);
         dispatch({
           type:SETDATA,
           data:listObj.newArr,
@@ -52,7 +53,7 @@ function mapDispatchToProps(dispatch,store){
       //右侧推送
       setTimeout(function(){      //延迟待确定后的数据更新后推送,避免获取的参数还是旧的
         if(didPushParamChange()){     //操作后内容有变化才推送
-          dispatch(billing);
+          dispatch(billing());
         }
       },500);
     },
@@ -78,7 +79,7 @@ function mapDispatchToProps(dispatch,store){
     //右侧推送
     fetchPushInfos(){
       //调右侧推送
-      dispatch(billing);
+      dispatch(billing());
     },
     handleInput(obj){    //文本模式值保存
       dispatch({

+ 12 - 2
src/containers/PushItemsContainer.js

@@ -1,7 +1,7 @@
 import React from 'react';
 import {connect} from 'react-redux';
 import PushItems from '../components/PushItems'
-import {CHANGE_ASSAY, CHANGE_CHECK, ADD_BILLING} from '@store/types/pushMessage';
+import {CHANGE_ASSAY, CHANGE_CHECK, ADD_BILLING, SHOW_TIPS_DETAILS, HIDE_TIPS_DETAILS} from '@store/types/pushMessage';
 import { ADD_DIAGNOSTIC, GET_DIAGNOSTIC_STR } from '@store/types/diagnosticList';
 import {billing, getTips, getTipsDetails} from '../store/async-actions/pushMessage';
 import { isAddMainSuit } from '@store/async-actions/diagnosticList';
@@ -30,7 +30,7 @@ function mapDispatchToProps(dispatch) {
                 type: GET_DIAGNOSTIC_STR
             });
             dispatch(isAddMainSuit())
-            dispatch(billing);
+            dispatch(billing());
         },
         billing: (checkedAssay, checkedCheck) => {
             // dispatch(billing)
@@ -45,6 +45,16 @@ function mapDispatchToProps(dispatch) {
         },
         getTipsDetails: () => {
             dispatch(getTipsDetails())
+        },
+        showTipsDetailsModal: () => {
+            dispatch({
+                type: SHOW_TIPS_DETAILS
+            })
+        },
+        hideTipsDetailsModal: () => {
+            dispatch({
+                type: HIDE_TIPS_DETAILS
+            })
         }
     }
 }

+ 2 - 2
src/containers/RadioDrop.js

@@ -107,7 +107,7 @@ function mapDispatchToProps(dispatch,store){
       //右侧推送
       setTimeout(function(){      //延迟待确定后的数据更新后推送,避免获取的参数还是旧的
         if(didPushParamChange()){     //操作后内容有变化才推送
-          dispatch(billing);
+          dispatch(billing());
         }
       },500);
     },
@@ -127,7 +127,7 @@ function mapDispatchToProps(dispatch,store){
         type:dbEditActions[+type],
         data:{changeVal:params.changeVal,ikey:ikey}
       });
-      dispatch(billing);
+      dispatch(billing());
       dispatch({
         type:ISREAD
       })

+ 2 - 2
src/containers/SpreadDrop.js

@@ -332,7 +332,7 @@ function handleLabel(dispatch,params){
       break;
     default:
   }
-  dispatch(billing);
+  dispatch(billing());
   dispatch({
     type:ISREAD
   })
@@ -349,7 +349,7 @@ function mapDispatchToProps(dispatch,store){
       //右侧推送
       setTimeout(function(){      //延迟待确定后的数据更新后推送,避免获取的参数还是旧的
         if(didPushParamChange()){     //操作后内容有变化才推送
-          dispatch(billing);
+          dispatch(billing());
         }
       },500);
     },

+ 10 - 2
src/containers/TypeConfigContainer.js

@@ -8,6 +8,7 @@ import config from "@config/index";
 import { initItemList } from '@store/async-actions/tabTemplate';
 import { allCheckedShow } from '@store/actions/tabTemplate';
 import {Notify} from '@commonComp';
+import {SETOTHERHISTORY} from "../store/types/homePage";
 
 function mapStateToProps(state) {
   return {
@@ -34,10 +35,17 @@ function mapDispatchToProps(dispatch) {
       //保存模式切换结果
       dispatch(saveMode(confirmType)).then((res)=>{
         if(res.data.code=='0'&&res.data.data){
+          //清空所有数据
           pushAllDataList('','clear');
           dispatch({type: CONFIRM_TYPE, confirmType});
-          //清空所有数据
-          dispatch(getOtherHisRecord());          //获取其他史最近记录
+          //切换模式是要重新获取其他史数据
+          dispatch({
+            type:SETOTHERHISTORY,
+            data:[],
+            save:[],
+            otherIsHis:false
+          });
+          dispatch(getOtherHisRecord());        //获取其他史最近记录
           Notify.success("模式切换成功");
           dispatch(initItemList(confirmType));
           dispatch(allCheckedShow(false))    //全选反选显示重置

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

@@ -119,7 +119,6 @@ export function setCheckBoxValue(state,action) {
     showText = showText.substr(0,showText.length-1);
   }
   res.data[labelInx].value = showText;
-  res.saveText[labelInx] = showText;
   res.selecteds[labelInx] = action.data;
   res.saveText = fullfillText(res.data).saveText;
   res.update = Math.random();
@@ -241,7 +240,7 @@ export function setInputLabel(state,action){
   if(+item.tagType===3){      //multSpred标签
     item.questionMapping[subIndex].value = text;
     let texts = item.questionMapping.map((it)=>{
-      return it.value?(it.labelPrefix||'')+(it.value||'')+(it.labelSuffix||''):'';
+      return (it.labelPrefix||'')+(it.value||'')+(it.labelSuffix||'');
     });
     res.saveText[i] = texts.join('');
     res.update = Math.random();

+ 25 - 4
src/store/actions/currentIll.js

@@ -59,10 +59,13 @@ function addPos(data,num){
 export const setData = (state,action) =>{
   let res = Object.assign({},state);
   res.editClear = false;
-  res.symptomIds = JSON.parse(JSON.stringify(action.info.mainIds));
-  const useEmpty = action.info.useEmpty;
+  const mainIds = action.info.mainIds;
+  res.symptomIds = JSON.parse(JSON.stringify(mainIds));
   const num = action.info.num;//点击了几次添加病情变化
-  let mainData = JSON.parse(JSON.stringify(action.info.mainData));//主诉模板数据
+  // const useEmpty = action.info.useEmpty;
+  let useEmpty,mainData;
+  // let mainData = JSON.parse(JSON.stringify(action.info.mainData));//主诉模板数据
+  let mainModleData = JSON.parse(JSON.stringify(action.info.mainData));//主诉模板数据
   let moduleData = JSON.parse(JSON.stringify(res.moduleData));//现病史模板
   let addModule = JSON.parse(JSON.stringify(res.addModule));//拷贝的模板
   let current = JSON.parse(JSON.stringify(moduleData));
@@ -81,6 +84,24 @@ export const setData = (state,action) =>{
   /*let mainLabelModuleArr = objToArr.filter((item)=>{
     return item.questionMapping.length>0;
   })*/
+
+  // 是否使用空模板:num=0时判断mainIds,num>=1,截取第一病程遍历是否有症状exist
+  if(num==0){
+    useEmpty = mainIds.length>0?false:true;
+    mainData = mainModleData;
+  }else{
+    let sliceIdx;
+    for(let j=0; j<mainModleData.length; j++){
+      if(mainModleData[j].id==config.tongYId && mainModleData[j].pos==1){
+        sliceIdx = j;
+      }
+    }
+    mainData = mainModleData.slice(0,sliceIdx);
+    let existData = mainData.filter((item)=>{
+      return item.exist;
+    })
+    useEmpty = existData&&existData.length>0?false:true;
+  }
   
   if (useEmpty) {
     res.data = res.emptyData;
@@ -211,7 +232,7 @@ function getLabel(lid,lname){
 // 多选展开确定事件--主、伴、无
 export const confirm = (state,action) =>{
   let res = Object.assign({},state);
-  let length1 = res.data.length;console.log(123,action);
+  let length1 = res.data.length;
   let arr = JSON.parse(JSON.stringify(res.data));
   const {nones,exists,withs,ikey,exclusion,excluName,ban,noneIds} = action.data;
   let existsId = exists && exists.length>0?getIds(exists):[];

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

@@ -7,7 +7,6 @@ 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);
-    console.log('del',state,action.id)
     return res;
 }
 

+ 82 - 10
src/store/actions/mainSuit.js

@@ -128,10 +128,7 @@ export const confirm = (state,action) =>{
   let arr = res.data;
   let saveText = JSON.parse(JSON.stringify(res.saveText));
   const {exists,withs,ikey,withsName,existsName,ban} = action.data;
-  // let existsId = getIds(exists);
-  // let withsId = getIds(withs);
   let banText = JSON.stringify(ban) == "{}" ? '':{id:ban.id,name:ban.name,value:ban.name,tagType:config.tagType};
-  // res.mainIds = res.mainIds?res.mainIds.concat(existsId,withsId):[];
   let length = exists.length;
   let labelIndx = parseInt(ikey);//当前点击标签的index
   // 取第一个添加症状的主症状和伴随
@@ -142,8 +139,18 @@ export const confirm = (state,action) =>{
     res.mainSymptIds = res.mainSymptIds.concat(existsId,withsId);
   }
 
-  let text = saveText.slice(0,labelIndx);
-  let index = text.indexOf('伴');
+  // 第二病程-伴位置处理
+  let forwardId;
+  let text;
+  for(let n=labelIndx-1; n>0; n--){
+    if(arr[n].id==8){
+      forwardId = n;
+      continue;
+    }
+  }
+  if(forwardId){
+    text = saveText.slice(forwardId,labelIndx);
+    let index = text.indexOf('伴');
     if(index==-1){//没有伴,直接插入ikey前
       if(exists.length > 0){
         for(let i=0; i<exists.length; i++){
@@ -181,6 +188,48 @@ export const confirm = (state,action) =>{
         }
       }
     }
+  }else{
+    let text = saveText.slice(0,labelIndx);
+    let index = text.indexOf('伴');
+    if(index==-1){//没有伴,直接插入ikey前
+      if(exists.length > 0){
+        for(let i=0; i<exists.length; i++){
+          let pos = labelIndx + i;
+          arr.splice(pos,0,getTextLabel(exists[i].id,exists[i].name,1));
+          res.saveText[pos] = exists[i].name;
+        }
+      }
+      if(withs.length > 0){
+        let newWiths = JSON.parse(JSON.stringify(withs));
+        if(banText){
+         newWiths.unshift(banText);
+       }
+       for(let j=0; j<newWiths.length; j++){
+        let withsPos = labelIndx +length + j;
+        arr.splice(withsPos,0,getTextLabel(newWiths[j].id,newWiths[j].name,2));
+        res.saveText[withsPos] = newWiths[j].name;
+      }
+    }
+    }else{//有伴
+      if(exists.length > 0){
+        for(let i=0; i<exists.length; i++){
+          let pos = index + i;
+          arr.splice(pos,0,getTextLabel(exists[i].id,exists[i].name,1));
+          res.saveText[pos] = exists[i].name;
+        }
+      }
+      
+      if(withs.length>0){//有伴插到ikey前既可     
+        for(let j=0; j<withs.length; j++){
+          // let withsPos = labelIndx + j;
+          let withsPos = labelIndx +length + j;
+          arr.splice(withsPos,0,getTextLabel(withs[j].id,withs[j].name,2));
+          res.saveText[withsPos] = withs[j].name;
+        }
+      }
+    }
+  }
+
     
     res.data = arr;
     res.saveText = fullfillText(arr).saveText;
@@ -249,6 +298,7 @@ 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{
     // 替换
@@ -272,18 +322,39 @@ export const insertSearch = (state,action)=>{
     res.data[focusIndex].value = value;
     res.saveText[focusIndex] = value;*/
 
+    /*******************第一病程搜索结果也移植到现病史修改(2-18)********************/
+    // 位置判断-第一病程-主症状还是伴随 前一个标签存在 并且没有pos;
+    // 判断在伴的前面还是后面:前exist=1(主),后exist=2(伴)
+    let nText = {};
+    if(focusIndex==0){
+      nText = Object.assign({},text,{exist:1});
+    }else{
+      if(!data[focusIndex-1].pos){//第一病程
+        const preText = res.saveText.slice(0,focusIndex);
+        const ind = preText.indexOf("伴");
+        if(ind != -1){
+          nText = Object.assign({},text,{exist:2});
+        }else{
+          nText = Object.assign({},text,{exist:1});
+        }
+      }else{//第二及以上病程
+        nText = Object.assign({},text);
+      }
+    }
+    
+
     // 从新插入一个span标签
     const searchStr = res.searchStr;
     let innerText = span.current.innerText;
     const value = innerText.replace(searchStr,"");
     let index = innerText.indexOf(searchStr);
     if(index < 1){//前
-      res.data.splice(focusIndex,0,text);
+      res.data.splice(focusIndex,0,nText);
       res.saveText.splice(focusIndex,0,searchData);
       res.data[focusIndex+1].value = value;
       res.saveText[focusIndex+1] = value;
     }else{
-      res.data.splice(focusIndex+1,0,text);
+      res.data.splice(focusIndex+1,0,nText);
       res.saveText.splice(focusIndex+1,0,searchData);
       res.data[focusIndex].value = value;
     }
@@ -381,11 +452,11 @@ export function setRadioValue(state,action){
 //双击标签输入改变值
 export const changeLabelVal = (state,action)=>{
   const res = Object.assign({},state);
-  const index = action.data.ikey;
+  const index = parseInt(action.data.ikey);
   const newVal = action.data.changeVal;
   let data = res.data;
   let item = data[index];
-  if(newVal.trim()){
+  if(newVal&&newVal.trim()){
     if(item){
       item.value = newVal;
       res.saveText[index] = newVal;
@@ -393,9 +464,10 @@ export const changeLabelVal = (state,action)=>{
   }else{//删除完标签内容则删除该标签
     
     data.splice(index,1);
+    // data[index].value = "";
     // res.data.splice(index,1);
-    // res.saveText = fullfillText(res.data).saveText;
     res.saveText.splice(index,1);
+    // res.saveText[index] = "";
   } 
   res.update = Math.random();
   return res;

+ 30 - 3
src/store/actions/pushMessage.js

@@ -129,12 +129,20 @@ export const addScheme = (state, action) => {
   return res;
 }
 
+//设置提示信息
 export const setTips = (state, action) => {
   const res = Object.assign({}, state)
   res.tips = action.tips;
   return res;
 }
 
+//设置提示信息详情页
+export const setTipsDetails = (state, action) => {
+  const res = Object.assign({}, state)
+  res.tipsDetails = action.tipsDetails;
+  return res;
+}
+
 export const setChangeAdviceTreatment = (state, action) => {
 	const res = JSON.parse(JSON.stringify(state))
 	const index = action.index; //诊断的下标
@@ -198,8 +206,27 @@ export const addBilling = (state, action) => {
 	return res;
 }
 export const clearAllPushMessage = (state, action) => {
-    const res = JSON.parse(JSON.stringify(state));
-	res.advice = action.data
-	res.AdviceStr = action.saveText
+	const res = JSON.parse(JSON.stringify(state));
+	res.advice = action.data;
+	res.AdviceStr = action.saveText;
+	res.tips = {};
+	res.vigilant = [];
+	res.doubt = [];
+	res.possible = [];
+	res.determine = [];
+	res.assay = [];
+	res.check = [];
+	return res;
+}
+
+export const showTipsDetails = (state, action) => {
+	const res = Object.assign({}, state);
+	res.showTipsDetails = true;
+	return res;
+}
+
+export const hideTipsDetails = (state, action) => {
+	const res = Object.assign({}, state);
+	res.showTipsDetails = false;
 	return res;
 }

+ 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());          //获取其他史最近记录
+        dispatch(getOtherHisRecord());  console.log(111)        //获取其他史最近记录
         initHis(dispatch)
       }else{
         initHis(dispatch)

+ 27 - 4
src/store/async-actions/pushMessage.js

@@ -1,5 +1,5 @@
 import { get, post, json } from "@utils/ajax";
-import { BILLING_ADVICE, SET_TIPS } from '../types/pushMessage';
+import { BILLING_ADVICE, SET_TIPS, SET_TIPS_DETAILS } from '../types/pushMessage';
 import { SET_CLICK_DIAG } from '../types/diagnosticList';
 import {storageLocal,getEMRParams} from '@utils/tools';
 
@@ -9,7 +9,8 @@ const api={
 }
 
 //获取右侧推送信息
-export const billing = (dispatch, getState) => {
+export const billing = (mdata) => {
+ return (dispatch, getState) =>{
   const state = getState();
   let url = api.push;
   if(+state.typeConfig.typeConfig===1){
@@ -25,7 +26,7 @@ export const billing = (dispatch, getState) => {
     pacs: emrData.pacs,
     sex: emrData.sex,
     vital:emrData.vital,
-    symptom: emrData.current + emrData.main
+    symptom: mdata?(emrData.current + mdata):(emrData.current + emrData.main)
   };
   storageLocal.set('emrParam',params);      //推送数据存储,用作推送前对比是否有变,有变才推送
     json(url, params).then((data) => {
@@ -63,8 +64,10 @@ export const billing = (dispatch, getState) => {
   }).catch((e) =>{
       console.log(e)
   }) 
+ }
 };
 
+
 export const getTips = (diagItem) =>{
     return (dispatch, getState) =>{
         dispatch({
@@ -93,6 +96,26 @@ export const getTips = (diagItem) =>{
 export const getTipsDetails = () => {
     return(dispatch, getState) => {
         const state = getState();
-        window.open(`/static/pages/information.html?type=7&&questionId=${state.diagnosticList.clickDiag.id}`);
+        // 诊断指南新窗口展示
+        // window.open(`/static/pages/information.html?type=7&&questionId=${state.diagnosticList.clickDiag.id}`);
+
+        //弹窗显示
+        const url ='/api/icss/introduceInfo/getByQuestionId'
+        const imageUrlPrefix = 'http://192.168.2.241:82'
+        
+        const params = {
+            type: 7,
+            questionId: state.diagnosticList.clickDiag.id,
+            position:2
+        }
+        json(url, params)
+        .then((data)=>{
+                dispatch({
+                    type: SET_TIPS_DETAILS,
+                    tipsDetails: data.data.data
+                })
+        }).catch((e) => {
+            console.log(e)
+        })
     }
 }

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

@@ -44,7 +44,7 @@ export default function (state=initState,action) {
     case SETOTHERHISTORY:
       res.initData.otherHis = action.data;
       res.initData.otherHisSave = action.save;
-      res.initData.otherIsHis = true;
+      res.initData.otherIsHis = action.otherIsHis!=undefined?action.otherIsHis:true;
       return res;
     /*case SETTEXTFOCUS:
       res.focusTextIndex = action.index;

+ 8 - 2
src/store/reducers/pushMessage.js

@@ -1,5 +1,5 @@
-import {CHANGE_ASSAY, CHANGE_CHECK, BILLING_ADVICE, ADD_SCHEME, SET_TIPS, SET_CHANGE_ADVICE_TREATMENT, SET_CHANGE_ADVICE_ASSAY, SET_CHANGE_ADVICE_CHECK, ADD_BILLING,CLEAR_ALL_PUSH_MESSAGE } from '../types/pushMessage';
-import {changeAssay, changeCheck, setAdvice, addScheme, setTips, setChangeAdviceTreatment, setChangeAdviceAssay, setChangeAdviceCheck, addBilling,clearAllPushMessage } from '../actions/pushMessage';
+import {CHANGE_ASSAY, CHANGE_CHECK, BILLING_ADVICE, ADD_SCHEME, SET_TIPS,  SET_TIPS_DETAILS, SET_CHANGE_ADVICE_TREATMENT, SET_CHANGE_ADVICE_ASSAY, SET_CHANGE_ADVICE_CHECK, ADD_BILLING,CLEAR_ALL_PUSH_MESSAGE,SHOW_TIPS_DETAILS, HIDE_TIPS_DETAILS } from '../types/pushMessage';
+import {changeAssay, changeCheck, setAdvice, addScheme, setTips, setTipsDetails, setChangeAdviceTreatment, setChangeAdviceAssay, setChangeAdviceCheck, addBilling, clearAllPushMessage, showTipsDetails, hideTipsDetails } from '../actions/pushMessage';
 
 const initState = {
   vigilant: [],
@@ -32,6 +32,8 @@ export default function(state = initState, action) {
       return addScheme(state, action);
     case SET_TIPS: 
       return setTips(state, action);
+    case SET_TIPS_DETAILS:
+      return setTipsDetails(state,action)
     case SET_CHANGE_ADVICE_TREATMENT:
       return setChangeAdviceTreatment(state, action);
     case SET_CHANGE_ADVICE_ASSAY: 
@@ -42,6 +44,10 @@ export default function(state = initState, action) {
       return addBilling(state, action);
     case CLEAR_ALL_PUSH_MESSAGE: 
       return clearAllPushMessage(state, action);
+    case SHOW_TIPS_DETAILS: 
+      return showTipsDetails(state, action);
+    case HIDE_TIPS_DETAILS:
+      return hideTipsDetails(state, action);
     default:
       return state;
   }

+ 4 - 1
src/store/types/pushMessage.js

@@ -5,10 +5,13 @@ export const ADD_ASSAY = 'ADD_ASSAY'; //添加化验;
 export const ADD_CHECK = 'ADD_CHECK'; //添加辅检;
 export const ADD_SCHEME = 'ADD_SCHEME'; //添加治疗方案;
 export const SET_TIPS = 'SET_TIPS'; //设置提示信息;
+export const SET_TIPS_DETAILS = 'SET_TIPS_DETAILS'; //设置提示信息详情页内容;
 export const SET_CHANGE_ADVICE_TREATMENT = 'SET_CHANGE_ADVICE_TREATMENT'//改变医嘱的文字内容;
 export const ADD_BILLING = 'ADD_BILLIND'; //添加开单项
 export const SET_CHANGE_ADVICE_ASSAY = 'SET_CHANGE_ADVICE_ASSAY';   //改变医嘱部分辅检的文字内容
 export const SET_CHANGE_ADVICE_CHECK = 'SET_CHANGE_ADVICE_CHECK';   //改变医嘱部分化验的文字内容
-export const CLEAR_ALL_PUSH_MESSAGE = 'CLEAR_ALL_PUSH_MESSAGE';   //改变医嘱部分化验的文字内容
+export const CLEAR_ALL_PUSH_MESSAGE = 'CLEAR_ALL_PUSH_MESSAGE';   //清除所有推送信息
+export const SHOW_TIPS_DETAILS = 'SHOW_TIPS_DETAILS'; //显示提示详情页
+export const HIDE_TIPS_DETAILS = 'HIDE_TIPS_DETAILS'; //显示提示详情页
 
 

+ 15 - 14
src/utils/tools.js

@@ -218,7 +218,7 @@ const getAllDataStringList =(baseList) =>{           //获取所有模块文本
       'diag' : baseList.diagnosticList.diagnosticStr,
       'advice' : baseList.pushMessage.AdviceStr
     }
-    // console.log(jsonDataString,'文本模式数据获取')
+    //console.log(jsonDataString,'文本模式数据获取')
     return jsonDataString;
 }
 /**
@@ -229,9 +229,6 @@ const getAllDataStringList =(baseList) =>{           //获取所有模块文本
  * @param {引用的话是保存时候的文本类型,编辑的时候是当前页面设置的文本类型} whichSign 
  */
 const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清空所有的数据
-      store.dispatch({
-        type:ISREAD
-      });
     if(action == 'clear'){     //清空
         store.dispatch({type: CLEAR_MAIN_SUIT,data:[],saveText:[],selecteds:[],editClear:true,mainIds:[],mainSymptIds:[]});
         store.dispatch({type: CLEAR_CURRENT_ILL,data:[],saveText:[],selecteds:[],editClear:true,symptomIds:[]});
@@ -253,6 +250,7 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
             type: CLEAR_ALL_PUSH_MESSAGE,
             data:{}
         });
+        storageLocal.remove('emrParam');
        // Notify.success('页面已清空')
     }else{
         if (whichSign == 0) {
@@ -466,7 +464,10 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
               });
             }
         }
-    }  
+    }
+  store.dispatch({
+    type:ISREAD
+  });
 }
 
 function filterArr(arr){
@@ -573,7 +574,7 @@ function didPushParamChange(){
   return true;
 }
 //判断页面所有数据是否为空
-function isAllClear(jsonData,jsonStr){    
+function isAllClear(jsonData,jsonStr){
   if (      //结构化和文本数据都为空
     JSON.stringify(jsonData.advice) == '{}' &&
     jsonData.chief.length < 1 &&
@@ -584,14 +585,14 @@ function isAllClear(jsonData,jsonStr){
     jsonData.pacs.length < 1 &&
     jsonData.lis.labelList.length < 1 &&
     jsonData.lis.getExcelDataList.length < 1 &&
-    JSON.stringify(jsonData.advice) == '{}' && 
-    filterArr(JSON.parse(jsonStr.chief)) == '' && 
-    filterArr(JSON.parse(jsonStr.present)) == '' && 
-    filterArr(JSON.parse(jsonStr.other)) == '' && 
-    filterArr(JSON.parse(jsonStr.vital)) == '' && 
-    jsonData.diag.length < 1 && 
-    jsonData.pacs.length < 1 && 
-    jsonData.lis.labelList.length < 1 && 
+    JSON.stringify(jsonData.advice) == '{}' &&
+    filterArr(JSON.parse(jsonStr.chief)) == '' &&
+    filterArr(JSON.parse(jsonStr.present)) == '' &&
+    filterArr(JSON.parse(jsonStr.other)) == '' &&
+    filterArr(JSON.parse(jsonStr.vital)) == '' &&
+    jsonData.diag.length < 1 &&
+    jsonData.pacs.length < 1 &&
+    jsonData.lis.labelList.length < 1 &&
     jsonData.lis.getExcelDataList.length < 1
   ) {
     return false;