Преглед изворни кода

Merge branch 'dev/new1' into ChronicMag

# Conflicts:
#	src/components/AddAssistCheck/index.jsx
#	src/components/AddInspect/index.jsx
#	src/components/DiagnosticList/index.less
#	src/containers/CurrentIll.js
#	src/containers/eleType.js
#	src/store/async-actions/homePage.js
#	src/store/async-actions/pushMessage.js
#	src/store/reducers/homePage.js
#	src/store/types/homePage.js
zhouna пре 6 година
родитељ
комит
3c3f3c40f2
66 измењених фајлова са 704 додато и 316 уклоњено
  1. 3 2
      src/common/components/EditableSpan/index.jsx
  2. 2 1
      src/common/components/ItemBox/index.less
  3. 1 1
      src/common/components/Notify/index.less
  4. 4 3
      src/common/components/NumberPan/index.jsx
  5. 20 0
      src/common/components/NumberPan/index.less
  6. 2 2
      src/common/components/TailInlineTag/index.jsx
  7. 13 20
      src/common/components/Textarea/index.jsx
  8. 42 42
      src/components/AddAssistCheck/index.jsx
  9. 2 2
      src/components/AddInspect/index.jsx
  10. 10 9
      src/components/CheckBody/index.jsx
  11. 1 1
      src/components/CopyRight/index.jsx
  12. 3 3
      src/components/CurrentIll/index.jsx
  13. 3 2
      src/components/DiagnosticList/index.jsx
  14. 1 0
      src/components/DiagnosticList/index.less
  15. 12 6
      src/components/Inspect/index.jsx
  16. 1 0
      src/components/Inspect/index.less
  17. 3 2
      src/components/MainSuit/index.jsx
  18. 5 2
      src/components/MultSpread/index.jsx
  19. 53 26
      src/components/NumberDrop/index.jsx
  20. 2 2
      src/components/Operation/index.jsx
  21. 1 1
      src/components/PreviewBody/index.jsx
  22. 6 6
      src/components/PushItems/index.jsx
  23. 2 2
      src/components/RadioDrop/index.jsx
  24. 1 1
      src/components/Treat/DrugTreat/index.jsx
  25. 12 12
      src/components/Treat/index.jsx
  26. 7 0
      src/components/Treat/index.less
  27. 21 21
      src/components/TreatDesc/DrugInfo/index.jsx
  28. 17 10
      src/components/TreatDesc/DrugInfo/index.less
  29. 4 3
      src/components/TreatDesc/index.jsx
  30. 1 0
      src/components/TreatDesc/index.less
  31. 1 1
      src/containers/CheckBody.js
  32. 4 1
      src/containers/CurrentIll.js
  33. 1 1
      src/containers/Inspect.js
  34. 5 2
      src/containers/MainSuit.js
  35. 5 1
      src/containers/MultSpread.js
  36. 2 2
      src/containers/Multiple.js
  37. 4 1
      src/containers/NumberDrop.js
  38. 6 4
      src/containers/SpreadDrop.js
  39. 7 5
      src/containers/eleType.js
  40. 43 5
      src/store/actions/checkBody.js
  41. 67 6
      src/store/actions/currentIll.js
  42. 16 8
      src/store/actions/mainSuit.js
  43. 57 8
      src/store/actions/otherHistory.js
  44. 6 0
      src/store/actions/treat.js
  45. 1 1
      src/store/async-actions/assistCheck.js
  46. 2 2
      src/store/async-actions/copyRight.js
  47. 1 1
      src/store/async-actions/diagnosticSearch.js
  48. 10 10
      src/store/async-actions/fetchModules.js
  49. 1 1
      src/store/async-actions/getInfoByUuid.js
  50. 1 1
      src/store/async-actions/historyTemplates.js
  51. 14 8
      src/store/async-actions/homePage.js
  52. 2 2
      src/store/async-actions/inspect.js
  53. 2 2
      src/store/async-actions/mainSuit.js
  54. 4 4
      src/store/async-actions/patInfo.js
  55. 2 2
      src/store/async-actions/print.js
  56. 5 5
      src/store/async-actions/pushMessage.js
  57. 5 5
      src/store/async-actions/tabTemplate.js
  58. 5 5
      src/store/async-actions/treat.js
  59. 5 1
      src/store/reducers/homePage.js
  60. 77 9
      src/store/reducers/inspect.js
  61. 4 2
      src/store/reducers/treat.js
  62. 2 1
      src/store/types/homePage.js
  63. 1 1
      src/store/types/treat.js
  64. 16 8
      src/utils/ajax.js
  65. 2 1
      src/utils/config.js
  66. 63 17
      src/utils/tools.js

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

@@ -224,8 +224,9 @@ class EditableSpan extends Component{
         }*/
         let data = innerVal.trim();
         //判断是否为空、中英文:, 。、;,且不是第一位
-        let pattern = new RegExp(/^\,?$|^\,?$|^\.?$|^\。?$|^\、?$|^\;?$|^\;?$|^\:?$|^\:?$|\s/);
-        if(index!==0 && pattern.test(data)){
+        // let pattern = new RegExp(/^\,?$|^\,?$|^\.?$|^\。?$|^\、?$|^\;?$|^\;?$|^\:?$|^\:?$|\s/);
+        // if(index!==0 && pattern.test(data)){
+        if(index!==0 && !config.punctuationReg.test(data)){
           // let preObj = $(this.$span.current).prev();
           let obj = preObj[0].nodeName=="DIV"?preObj.prev():preObj;
           handleKeydown&&handleKeydown({boxMark,i:index,text:data});

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

@@ -24,10 +24,11 @@
     padding:5px;
     outline: none;
     border-bottom:1px @part-border-color dashed;
-    border-radius: 4px;
+    /*border-radius: 4px;*/
   }
   .border {
       border:1px @part-border-color dashed !important;
+      border-radius: 4px;
   }
   .noBorder{
     border: none;

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

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

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

@@ -1,6 +1,7 @@
 import React,{Component} from 'react';
 import style from './index.less';
 import ReactDom from "react-dom";
+import backspace from '../../images/backspace.png'
 
 class NumberPan extends Component{
   constructor(props){
@@ -74,19 +75,19 @@ class NumberPan extends Component{
           <td><button onClick={select}>4</button></td>
           <td><button onClick={select}>5</button></td>
           <td><button onClick={select}>6</button></td>
-          <td><button onClick={this.handleBack.bind(this)}>回退</button></td>
+          <td><button onClick={this.handleBack.bind(this)}><img src={backspace} onClick={this.handleBack.bind(this)} /></button></td>
         </tr>
         <tr>
           <td><button onClick={select}>7</button></td>
           <td><button onClick={select}>8</button></td>
           <td><button onClick={select}>9</button></td>
-          <td><button onClick={this.handleClear.bind(this)}>清空</button></td>
+          <td><button onClick={this.handleClear.bind(this)} className={style['clearN']}>清空</button></td>
         </tr>
         <tr>
           <td><button onClick={select}>.</button></td>
           <td><button onClick={select}>0</button></td>
           <td><button onClick={select}>~</button></td>
-          <td><button onClick={this.handleClose.bind(this)}>确定</button></td>
+          <td><button onClick={this.handleClose.bind(this)} className={style['confirm']}>确定</button></td>
         </tr>
       </table>
       </div>

+ 20 - 0
src/common/components/NumberPan/index.less

@@ -21,4 +21,24 @@
   button:hover{
     border-color: @blue;
   }
+  .confirm{
+    color: #3B9ED0;
+    font-weight: bold;
+    text-align: center;
+    padding-left: 14px;
+    font-size: 14px;
+    line-height: normal;
+  }
+  .imgN{
+    text-align: right;
+    vertical-align: middle;
+    padding-right: 8px;
+    cursor: pointer;
+  }
+  .clearN{
+    color:#F6514A;
+    text-align: center;
+    padding-left: 8px;
+    font-weight: bold;
+  }
 }

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

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

+ 13 - 20
src/common/components/Textarea/index.jsx

@@ -17,7 +17,7 @@ class Textarea extends Component {
     this.$dom = React.createRef();
     this.handleInput = this.handleInput.bind(this);
     this.handleFocus = this.handleFocus.bind(this);
-    this.handleBlur = this.handleBlur.bind(this);
+    //this.handleBlur = this.handleBlur.bind(this);
     this.handleKeydown = this.handleKeydown.bind(this);
   }
   handleFocus(){            //初始显示props中的值,focus已经显示输入的值,避免值更新闪烁
@@ -36,7 +36,7 @@ class Textarea extends Component {
     const text = e.target.innerText || e.target.innerHTML;
     const stimer = this.state.timer;
     if(boxMark=='1'&&text.length>config.limited){           //主诉字符数限制
-      e.target.innerText?(e.target.innerText = text.substr(0,config.limited)):(e.target.innerHTML = text.substr(0,config.limited)); 
+      e.target.innerText?(e.target.innerText = text.substr(0,config.limited)):(e.target.innerHTML = text.substr(0,config.limited));
       e.target.blur();
       Notify.error(config.limitText);
       if(overFlag){
@@ -59,7 +59,7 @@ class Textarea extends Component {
     })
 
     //存值到store
-    // handleInput&&handleInput({text});
+    handleInput&&handleInput({text});
     //右侧推送--延时推送
     clearTimeout(stimer);
     let timer = setTimeout(function(){
@@ -70,6 +70,14 @@ class Textarea extends Component {
       timer
     });
   }
+  handleKeydown(e){
+    const {boxMark} = this.props;
+    const ev = e||window.event;
+    if(+boxMark==1){
+      //禁止回车事件
+      if(ev.keyCode==13){return false;}
+    }
+  }
   shouldComponentUpdate(next){
     if(JSON.stringify(next) == JSON.stringify(this.props)){
       return false;
@@ -78,14 +86,14 @@ class Textarea extends Component {
   }
   componentWillReceiveProps(next){
     const isRead = this.props.isRead;
-    if(next.isRead != isRead||next.value!=this.props.value){      //value对比解决复诊不显示bug
+    if(next.isRead != isRead||(next.value!=this.props.value&&next.value&&next.value.indexOf("复诊")!=-1)){    //value对比解决复诊不显示bug,复诊对比解决关标跳到前面bug
       this.$dom.current.innerText?(this.$dom.current.innerText = next.value||''):(this.$dom.current.innerHTML = next.value||'');
     }
   }
   componentDidMount(){
     const {value} = this.props;
     if(value){
-      this.$dom.current.innerText?(this.$dom.current.innerText = value||''):(this.$dom.current.innerHTML=value||'');
+      this.$dom.current.innerText?(this.$dom.current.innerText = value||''):(this.$dom.current.innerText=value||'');
     }
     if(isIE()){
       $(this.$dom.current).onIe8Input(function(e){
@@ -93,20 +101,6 @@ class Textarea extends Component {
       },this);
     }
   }
-  handleBlur(){
-    const {handleInput} = this.props;
-    const text = this.$dom.current.innerText||this.$dom.current.innerHTML;
-    //存值到store
-    handleInput&&handleInput({text});
-  }
-  handleKeydown(e){
-    const {boxMark} = this.props;
-    const ev = e||window.event;
-    if(+boxMark==1){
-      //禁止回车事件
-      if(ev.keyCode==13){return false;}
-    }
-  }
   render() {
     const { title } = this.props;
     return (
@@ -118,7 +112,6 @@ class Textarea extends Component {
              ref={this.$dom}
              contentEditable={true}
              onInput={this.handleInput}
-             onBlur={this.handleBlur}
              onkeydown={this.handleKeydown}>
         </div>
       </div>

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

@@ -1,55 +1,55 @@
 import React from 'react';
-import { SearchOption, Calendar, ConfirmModal, Notify, Add } from '@commonComp';
+import { SearchOption, Calendar ,ConfirmModal,Notify,Add} from '@commonComp';
 import styles from './index.less';
 import $ from 'jquery';
 import Textarea from './Textarea';
 import close from './img/close.png';
 
 class AddAssistCheck extends React.Component {
-  constructor(props) {
-    super(props);
-    this.state = {
-      show: false,
-      date: false,
-      dateTime: "",
-      active: '',
-      visible: false,
-      id: null
+    constructor(props) {
+        super(props);
+        this.state = {
+            show: false,
+            date: false,
+            dateTime:"",
+            active:'',
+            visible:false,
+            id:null
+        }
+        this.handleShowDate = this.handleShowDate.bind(this)
+        this.getCurrentDate = this.getCurrentDate.bind(this)
+        this.getSearchList = this.getSearchList.bind(this)
+        this.getAssistLabel = this.getAssistLabel.bind(this)
+        this.handleDelClick = this.handleDelClick.bind(this)
+        this.delConfirm = this.delConfirm.bind(this)
+        this.handleCancel = this.handleCancel.bind(this)
     }
-    this.handleShowDate = this.handleShowDate.bind(this)
-    this.getCurrentDate = this.getCurrentDate.bind(this)
-    this.getSearchList = this.getSearchList.bind(this)
-    this.getAssistLabel = this.getAssistLabel.bind(this)
-    this.handleDelClick = this.handleDelClick.bind(this)
-    this.delConfirm = this.delConfirm.bind(this)
-    this.handleCancel = this.handleCancel.bind(this)
-  }
 
-  handleDelClick(id) {
-    this.setState({
-      visible: true,
-      id: id
-    })
-  }
+    handleDelClick(id){
+        this.setState({
+            visible:true,
+            id:id
+        })
+    }
 
-  delConfirm() {
-    const { handleDelAssist, handlePush } = this.props;
-    const { id } = this.state;
-    handleDelAssist && handleDelAssist(id);
-    handlePush && handlePush();           //右侧推送
-    this.setState({
-      visible: false,
-      id: null
-    })
-    Notify.success("删除成功");
-  }
+    delConfirm(){
+        const {handleDelAssist,handlePush} = this.props;
+        const {id} = this.state;
+        handleDelAssist&&handleDelAssist(id);
+        handlePush&&handlePush();           //右侧推送
+        this.setState({
+            visible:false,
+            id:null
+        })
+        Notify.success("删除成功");
+    }
 
-  handleCancel() {
-    this.setState({
-      visible: false,
-      id: null
-    })
-  }
+    handleCancel(){
+        this.setState({
+            visible:false,
+            id:null
+        })
+    }
 
   componentDidMount() {
     $(document).click((event) => {
@@ -166,7 +166,7 @@ class AddAssistCheck extends React.Component {
                 {
                   this.getCommonList()
                 }
-              </div> 
+              </div>
             }
           </SearchOption> : ''}
         </div>

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

@@ -1,5 +1,5 @@
 import React from 'react';
-import { SearchOption, InspectCommon, Calendar, Notify, ConfirmModal, Add } from '@commonComp';
+import { SearchOption, InspectCommon, Calendar ,Notify,ConfirmModal,Add} from '@commonComp';
 import SlideExcel from './SlideExcel';
 import SlideSelect from './SlideSelect';
 import { deepClone } from '@utils/tools';
@@ -350,7 +350,7 @@ class Inspect extends React.Component {
                   {
                     this.getCommonList()
                   }
-                </div> 
+                </div>
             }
           </SearchOption> : ''}
         </div>

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

@@ -33,17 +33,22 @@ class CheckBody extends Component{
     const {data,showArr,saveText,selecteds,importLabel} = this.props;
     let arr = [],list=[];//console.log(data,saveText)
     const {boxMark,showAll} = this.state;
+    const moreNum =data.length-[...data].reverse().findIndex((it)=>it.showInCheck)-1;//被隐藏的位置
+    const moreText = filterDataArr([...saveText].splice(moreNum+1));      //被收起的标签中是否有有值得,有则不能再收起showMoreBtn?more:''
+    const more = showAll?<span className={style['more']} onClick={this.showHide}>收起<img src={hideImg} /></span>:<span className={style['more']} onClick={this.showHide}>展开<img src={showImg} /></span>;
+    const showMoreBtn = data.length>moreNum&&!moreText;
     let showArray = data.filter((it)=>{
       if(it.showInCheck)
         return it;
     });
-    const showData = this.props.showAll||showAll?[...data]:showArray;//[...data].splice(0,config.showCheckNum*2+1);
+    const showData = moreText||showAll?[...data]:showArray;//[...data].splice(0,config.showCheckNum*2+1);
     if(showData){
       list = showData;
       arr = list.map((it,i)=>{
         return chooseType({item:it,boxMark,i,showArr,saveText,selecteds,importLabel});
       });
     }
+    showMoreBtn&&arr.push(more);      //是否显示收起展开按钮
     return arr;
   }
   handleClick(e){//让搜索框跟随鼠标点击移动
@@ -109,23 +114,19 @@ class CheckBody extends Component{
     });
   }
   componentWillUpdate(next){
-    if(!this.props.isEmpty&&next.isEmpty){
+    if((this.props.defaultShowAll&&!next.defaultShowAll)||(!this.props.defaultShowAll&&next.defaultShowAll)||(!this.props.isEmpty&&next.isEmpty)){
       this.setState({
-        showAll:false
+        showAll:next.defaultShowAll
       })
     }
   }
   render(){
     const {searchData,totalHide,data,boxLeft,boxTop,saveText} = this.props;
-    const {showAll} = this.state;
-    const moreNum =config.showCheckNum*2+1;
-    const moreText = filterDataArr([...saveText].splice(moreNum));      //被收起的标签中是否有有值得,有则不能再收起
-    const more = this.props.showAll||showAll?<span className={style['more']} onClick={this.showHide}>收起<img src={hideImg} /></span>:<span className={style['more']} onClick={this.showHide}>展开<img src={showImg} /></span>;
-    const showMoreBtn = data.length>moreNum&&!moreText;
+
     return  <div className={style['container']}>
       <ItemBox title='查体' handleClick={this.handleClick}>
         {this.getLabels()}
-        {showMoreBtn?more:''}
+        {/*{showMoreBtn?more:''}*/}
         {searchData && searchData.length>0?<SearchDrop data={searchData} show={!totalHide} left={boxLeft} top={boxTop} onSelect={this.handleSearchSelect}></SearchDrop>:''}
       </ItemBox>
     </div>

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

@@ -59,7 +59,7 @@ class CopyRight extends Component {
   render() {
     const { number, date, content, copyVisible, disVisible, disContent, hasNewVersion } = this.props.copyRight;
     const { showCopyModal, closeCopyModal, showDisclatmerModal, closeDisclatmerModal } = this;
-    const copyContent = content.map(item => {
+    const copyContent = content&&content.map(item => {
       return (
         <div className={style['message']}>
           {item.title}

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

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

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

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

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

@@ -101,6 +101,7 @@
 .diag-up, .diag-down, .diag-del {
     width: 20px;
     margin-bottom: 4px;
+    cursor: pointer;
 }
 .confirm-info {
     height: 70px;

+ 12 - 6
src/components/Inspect/index.jsx

@@ -6,8 +6,8 @@ import { getExcelList } from '@store/actions/inspect';
 import Notify from '@commonComp/Notify';
 import store from '@store';
 import $ from 'jquery';
-import { host } from '@utils/config.js';
-import {isIE} from '@utils/tools.js';
+import { host,prefix } from '@utils/config.js';
+import {isIE,getUrlArgObject} from '@utils/tools.js';
 
 
 (function ($) {
@@ -27,9 +27,9 @@ import {isIE} from '@utils/tools.js';
 import "./dists/FileAPI.js";
 
 const isLocal = window.location.hostname.indexOf('localhost')!=-1;
-const qhost = isLocal?host:'';
+const qhost = isLocal?host+prefix:prefix;
 const api = {
-    upload: qhost+'/api/icss/lisExcelRes/lisExcelAnalysis'
+    upload: qhost+'/lisExcelRes/lisExcelAnalysis'
 };
 
 class Inspect extends React.Component {
@@ -78,13 +78,19 @@ class Inspect extends React.Component {
             },
             function (files, rejected){
                 if( files.length ){
-                    console.log(files[0])
+                    //console.log(files[0])
+                  const securityCode = getUrlArgObject("code");
+                  const appKeyId = getUrlArgObject("appI");
+                  const appKeySecret = getUrlArgObject("appS");
                     FileAPI.upload({
                         // url: '/api/icss/lisExcelRes/lisExcelAnalysis',
                         url: api.upload,
                         data:{ hospitalCode:baseData == '{}'? '' : baseData.hospitalCode },
                         files: { uploadfile: files[0] },
                         headers:{
+                          appKeyId:appKeyId,
+                          appKeySecret:appKeySecret,
+                          securityCode:securityCode
                             // 'Content-Type':'Content-Type: multipart/form-data'
                             // 'Content-Type':'application/json;charset=UTF-8'
                             // 'Content-type': "text/plain"
@@ -97,7 +103,7 @@ class Inspect extends React.Component {
                                 let message = res.data.messages;
                                 store.dispatch(getExcelList(res.data));
                                 fetchPushInfos&&fetchPushInfos();
-                                if (message.length != 0) {
+                                if (message&&message.length != 0) {
                                     that.setState({
                                         visible:true,
                                         dom:message,

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

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

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

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

+ 5 - 2
src/components/MultSpread/index.jsx

@@ -55,6 +55,7 @@ class MultSpread extends Component{
         case +it.controlType===1:
           const list = it.questionDetailList&&it.questionDetailList.length>0?it.questionDetailList:it.questionMapping;
           return <RadioDrop data={list}
+                            boxMark={boxMark}
                             prefix={it.labelPrefix}
                             suffix={it.labelSuffix}
                             placeholder={it.name}
@@ -98,11 +99,13 @@ class MultSpread extends Component{
                             id={it.id}
                             ikey={inx} hideTag={true}></InlineTag>;
         case +it.controlType===7:
+          const min = data.minValue!=null&&data.minValue!=undefined?data.minValue-1:undefined;
+          const max = data.maxValue!=null&&data.maxValue!=undefined?+data.maxValue+1:undefined;
           return <NumberDrop prefix={it.labelPrefix}
                              suffix={it.labelSuffix}
                              placeholder={it.name}
-                             min={it.minValue}
-                             max={it.maxValue}
+                             min={min}
+                             max={max}
                              show={show}
                              allClick={false}
                              ikey={inx}

+ 53 - 26
src/components/NumberDrop/index.jsx

@@ -39,7 +39,7 @@ class NumberDrop extends Component{
     this.handleNumFocus = this.handleNumFocus.bind(this);
     this.handleBlur = this.handleBlur.bind(this);
     this.changeToEdit = this.changeToEdit.bind(this);
-    this.handleKeyDowm = this.handleKeyDowm.bind(this);
+    //this.handleKeyDowm = this.handleKeyDowm.bind(this);
     this.beyondArea = this.beyondArea.bind(this);
   }
   select(text){        //选中键盘上数字事件
@@ -54,14 +54,17 @@ class NumberDrop extends Component{
     }else{
       //console.log(text,isNaN(+text),max<+text)
       if(needCompare){
-        if(!isNaN(+text)&&max<+text){     //数值过大
+        /*if(text!=''&&(isNaN(+text)||max<+text)){    //数值过大
           this.beyondArea();
           return;
-        }
+        }*/
         const that = this;
+        const isFine = this.validSymbols(text,min,max);      //有~或/时是否合理
+        const hasSymbol = /[\/|\~]/g.test(text);           //是否有~或/
+        const singleFine = !isNaN(+text)&&max!=undefined&&min<text&&text<max;   //无~或/时是否合理
         timer = setTimeout(function(){
           clearTimeout(that.state.sltTimer);
-          if(!that.props.show&&!isNaN(+text)&&min>+text){
+          if(text!=''&&(!hasSymbol&&!singleFine)||(hasSymbol&&!isFine)){
             that.beyondArea();
             return;
           }
@@ -77,7 +80,7 @@ class NumberDrop extends Component{
   }
   beyondArea(){
     const {handleSelect,ikey,suffix,prefix,mainSaveText} = this.props;
-    Notify.info("数值在正常值范围内,请重新输入");
+    Notify.info("输入数值不符合规范,请重新输入!");
     handleSelect&&handleSelect({ikey,text:'',suffix,prefix,mainSaveText});
     this.setState({
       placeholder:this.props.placeholder,
@@ -132,18 +135,48 @@ class NumberDrop extends Component{
     }
     e.stopPropagation();
   }
+  validSymbols(txt,min,max){
+    //输入只有一个~或/时判断两边是否为合理数字,有多个为不合理
+    const index1 = txt.indexOf('~');
+    const index2 = txt.indexOf('/');
+    let arr1=[],arr2=[];
+    if(index1!=-1&&index1==txt.lastIndexOf('~')&&index1!=txt.length-1){   //有且只有一个~,且不在最后
+      arr1 = txt.split('~');
+      //~的范围在合理范围内为合理值
+      if(!isNaN(+arr1[0])&&!isNaN(+arr1[1])&&+arr1[0]>min&&+arr1[1]<max){
+        return true
+      }
+      return false;
+    }
+    if(index2!=-1&&index2==txt.lastIndexOf('/')&&index2!=txt.length-1){   //有且只有一个~,且不在最后
+      arr2 = txt.split('/');
+      // /两边的数字分别在合理范围内为合理值
+      if(!isNaN(+arr2[0])&&!isNaN(+arr2[1])&&min<arr2[0]&&arr2[0]<max&&min<arr2[1]&&arr2[1]<max){
+        return true
+      }
+      return false;
+    }
+    return false;
+  }
   numInpBlur(e){        //数字框失焦,保存值到store中
     e.stopPropagation();
     const {handleSelect,ikey,suffix,prefix,mainSaveText,min,max,show} = this.props;
     if(show){      //修改清空后第一次点击键盘不触发click事件bug
       return;
     }
-    //输入超出合理范围提示且清空
-    const txt = e.target.innerText.replace(/^\s*/,'');
-    if(max!=undefined&&!isNaN(+txt)&&(min>+txt||max<+txt)){
-      this.beyondArea();
-      return;
+    //输入超出合理范围或输入不是数字提示且清空
+    const needCompare=min!=undefined&&max!=undefined;
+    if(needCompare){
+      const txt = e.target.innerText.trim();
+      const isFine = this.validSymbols(txt,min,max);      //有~或/时是否合理
+      const hasSymbol = /[\/|\~]/g.test(txt);           //是否有~或/
+      const singleFine = !isNaN(+txt)&&min<txt&&txt<max;   //无~或/时是否合理
+      if(txt!=''&&(!hasSymbol&&!singleFine)||(hasSymbol&&!isFine)){
+        this.beyondArea();
+        return;
+      }
     }
+
     //输入为空时显示placeholder
     if(!e.target.innerText.trim()){
       this.setState({
@@ -151,24 +184,18 @@ class NumberDrop extends Component{
       });
     }
 
-    /*this.setState({
-      hasSelect:false
-    });*/
-    const val = e.target.innerText.replace(/^\s*/,'');
+    const val = e.target.innerText.trim();
     const {placeholder} = this.state;
-    let text = val===placeholder?'':val.replace(/[\u4e00-\u9fa5]/g,'');
-    e.target.innerText = '';      //避免出现重复输入值
+    let text = val===placeholder?'':val;
+    //e.target.innerText = '';      //避免出现重复输入值
     handleSelect&&handleSelect({ikey,text,suffix,prefix,mainSaveText});
   }
   handleSpanInp(e){   //数字框输入事件
     e.stopPropagation();
     const {handleHide} = this.props;
-    /*this.setState({     //再键盘点击数字要清空
-      hasSelect:false
-    });*/
     handleHide&&handleHide();
   }
-  handleKeyDowm(e){
+  /*handleKeyDowm(e){
     handleEnter();
     //只能输入数字
     const key = e.key;
@@ -178,7 +205,7 @@ class NumberDrop extends Component{
       e.preventDefault();
       return false;
     }
-  }
+  }*/
   getClasses(){         //整个标签是否有值的状态
     const {hideTag,placeholder,value,isImports} = this.props;
     const $span = this.$span.current;
@@ -213,10 +240,10 @@ class NumberDrop extends Component{
     this.setState({
       editable: false
     });
-    let totalVal = e.target.innerText;
-    let changeVal = this.$span.current.innerText.replace(/^\s*/,'');//数字框值-修改后;去掉前空格避免多空格叠加
-    let prefix = this.$pre.current.innerText.replace(/^\s*/,''); //前缀值-修改后
-    let suffix = this.$suf.current.innerText.replace(/^\s*/,''); //后缀值-修改后
+    let totalVal = e.target.innerText.trim();
+    let changeVal = this.$span.current.innerText.trim();//数字框值-修改后;去掉前空格避免多空格叠加
+    let prefix = this.$pre.current.innerText.trim(); //前缀值-修改后
+    let suffix = this.$suf.current.innerText.trim(); //后缀值-修改后
     //console.log('数字框:'+changeVal,";全部:"+totalVal,";前缀:"+prefix+";后缀:"+suffix);
     handleLabelChange && handleLabelChange({ikey,changeVal,type:boxMark,totalVal,prefix,suffix});
   }
@@ -249,7 +276,7 @@ class NumberDrop extends Component{
             onBlur={this.numInpBlur}
             onInput={this.handleSpanInp}
             className={this.getSpanClass()}
-            onkeydown={this.handleKeyDowm}>&nbsp;{value||placeholder}</span>
+            >&nbsp;{value||placeholder}</span>
       <span ref = {this.$suf}>&nbsp;{suffix}</span>
       <NumberPan handleSelect={(text)=>this.select(text)}
                  onClose={handleHide}

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

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

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

@@ -241,7 +241,7 @@ class PreviewBody extends Component {
                     return <table style={{ margin: '8px 0', width: '100%' }}>
                       {
                         item.show?<tr style={{ fontSize: '14px', lineHeight: '1.5' }}><td><span style={{ borderBottom: '1px solid #666666' }}> {item.name} </span></td></tr>:
-                        <tr style={{ fontSize: '14px', lineHeight: '1.5' }}><td><span style={{ color: '#767676',position:'relative',left:'-10px' }}>「{item.name}」</span></td></tr>
+                        <tr style={{ fontSize: '14px', lineHeight: '1.5' }}><td><span style={{ position:'relative',left:'-10px' }}>「{item.name}」</span></td></tr>
                       }
                       {
                         item.details.map((val) => {

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

@@ -336,7 +336,7 @@ class PushItems extends Component {
       assayNum = assayNum + item.name.length + 2;
       if (assayNum > 28) {
         assayNum2 = assayNum2 + item.name.length + 2; 
-        if(assayNum2 > 23) {
+        if(assayNum2 > 21) {
           return;
         } else {
           return (
@@ -388,7 +388,7 @@ class PushItems extends Component {
       checkNum = checkNum + item.name.length + 2;
       if (checkNum > 28) {
         checkNum2 = checkNum2 + item.name.length + 2; 
-        if(checkNum2 > 23) {
+        if(checkNum2 > 21) {
           return;
         }else {
           return (
@@ -510,7 +510,7 @@ class PushItems extends Component {
                           : moreAssay
                           ? assays
                           : assayHide}
-                        {assayNum2 > 23 ? (
+                        {assayNum2 > 21 ? (
                           <span
                             style={
                               moreAssay
@@ -548,7 +548,7 @@ class PushItems extends Component {
                           : moreCheck
                           ? checks
                           : checkHide}
-                        {checkNum2 > 23 ? (
+                        {checkNum2 > 21 ? (
                           <span
                             style={
                               moreCheck
@@ -618,7 +618,7 @@ class PushItems extends Component {
                               />
                               {item.isReason === 1 && (
                                 <div className={style["warn"]}>
-                                  {tipsDiscalimer.data.data[0].description}
+                                  {tipsDiscalimer.data.data[0]&&tipsDiscalimer.data.data[0].description}
                                 </div>
                               )}
                             </div>
@@ -633,7 +633,7 @@ class PushItems extends Component {
             </div>
           </div>
         </div>
-        {tipsDiscalimer.data && <div className={style['disTips']} dangerouslySetInnerHTML={{__html: tipsDiscalimer.data.data[1].description}}></div>}
+        {tipsDiscalimer.data && <div className={style['disTips']} dangerouslySetInnerHTML={{__html: tipsDiscalimer.data.data[1]&&tipsDiscalimer.data.data[1].description}}></div>}
         {showTipsDetails && <DetailsModal  
             showTipsDetails = {showTipsDetails}
             hideTips = {this.hideTips}

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

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

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

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

+ 12 - 12
src/components/Treat/index.jsx

@@ -15,7 +15,7 @@ class Treat extends Component {
     constructor(props){
         super(props);
         this.state = {
-          zIndex:301
+          zIndex:301,
         }
         this.hideTreat = this.hideTreat.bind(this);
         this.handlePrescription = this.handlePrescription.bind(this);
@@ -27,9 +27,10 @@ class Treat extends Component {
     }
     
     hideTreat() {
-        const { hideTreat,clearTreat } = this.props;
+        const { hideTreat,clearTreat, hideDrugInfo } = this.props;
         clearTreat && clearTreat();
         hideTreat && hideTreat();
+        hideDrugInfo && hideDrugInfo();
         // windowRemoveEventHandler('mousemove',handleMove,document)
     }
     handlePrescription() {
@@ -45,21 +46,20 @@ class Treat extends Component {
         const {  showDrugInfo } = this.props;
         showDrugInfo && showDrugInfo();
     }
-    setTreatBox(idx){
-      this.setState({
-        zIndex:idx == 300?300 : 500
-      })
+    setTreatBox(){
+      $('#treatWrapper').css({'z-index': 302});
+      $('#drugWrapper').css({'z-index': 301});
     }
     render(){
-        const { generalTreat, treatment, treatItem, surgeryTreat, selectDrug, drugInfo, treatDesc, setOtherRecommend, setDrugInfo, showDrug, showDrugInfo,hideDrugInfo, title, drugInfoList, hideDrugInfoMore} = this.props;
-        const { setDrugInfoMore } = this.props
-        const { zIndex } = this.state
+        const {setDrugInfoMore,treatIndex,treatIndexSet, generalTreat, treatment, treatItem, surgeryTreat, selectDrug, drugInfo, treatDesc, setOtherRecommend, setDrugInfo, showDrug, showDrugInfo,hideDrugInfo, title, drugInfoList, hideDrugInfoMore} = this.props;
+        const { zIndex,show } = this.state
         return(
             <div   className={style['treat-wrapper']}>
                 <div className={style['treat-mask']} onClick={this.hideTreat}>
                 </div>
-                <div id="treatWrapper" className={style['treat-box']}  onselectstart="return false" style={{zIndex:zIndex}}>
-                    <div onMouseDown={this.setTreatBox} id="dragTreatTitle" className={style['treat-title']}>治疗方案 ({treatItem.name})<img onClick={this.hideTreat} src={close}/></div>
+                <div id="treatWrapper" className={style['treat-box']}  onselectstart="return false">
+                    <img className={style.close} onClick={this.hideTreat} src={close}/>
+                    <div onMouseDown={this.setTreatBox} id="dragTreatTitle" className={style['treat-title']}>治疗方案 ({treatItem.name})</div>
 
                     <div className={style['treat-inner-box']}>
                         <GeneralTreat icon={generalIcon} title='一般治疗'   generalTreat={generalTreat}></GeneralTreat>
@@ -87,7 +87,7 @@ class Treat extends Component {
                     </TreatDesc>}
                 </div>
                 
-                {showDrug && drugInfo && <DrugInfo setTreatBox={this.setTreatBox} drugInfo = {drugInfo} hideDrugInfo = {hideDrugInfo}></DrugInfo>}
+                {showDrug && drugInfo && <DrugInfo setTreatBox={this.setTreatBox} treatIndexSet={treatIndexSet} drugInfo = {drugInfo} hideDrugInfo = {hideDrugInfo}></DrugInfo>}
                 {/* 查询多个药品说明书 (添加数据查看药品说明书用)*/}
                 {/* {showDrug && <DrugInfo drugInfoList = {drugInfoList} hideDrugInfoMore = {hideDrugInfoMore}></DrugInfo>} */}
             </div>

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

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

+ 21 - 21
src/components/TreatDesc/DrugInfo/index.jsx

@@ -10,7 +10,7 @@ class DrugInfo extends Component {
         super(props);
         this.state = {
             currentIndex: 0,
-            zIndex:301
+            zIndex:302
         }
         this.setDragBox = this.setDragBox.bind(this)
     }
@@ -47,37 +47,37 @@ class DrugInfo extends Component {
         }
     }
     setDragBox(){
-      const {zIndex,setTreatBox} = this.props
-      setTreatBox(300)
-      this.setState({
-        zIndex:zIndex+10
-      })
+      $('#treatWrapper').css({'z-index': 301});
+      $('#drugWrapper').css({'z-index': 302});
     }
     render() {
         const { drugInfo, hideDrugInfo, drugInfoList,hideDrugInfoMore } = this.props
-        const { currentIndex,zIndex } = this.state
-        return (<div className={style['drug-info-wrapper']} id="drugWrapper" style={{zIndex:zIndex}}>
-                <h3 onMouseDown={this.setDragBox} id="drugTitle" className={style['drug-title']}>{drugInfo.title}说明书  <img src={close} onClick={hideDrugInfo} className={style['close-drug-desc']}/> </h3>
+        const { currentIndex } = this.state
+        return (<div className={style['drug-info-wrapper']} id="drugWrapper">
+                <img src={close} onClick={hideDrugInfo} className={style['close-drug-desc']}/>
+                <h3 onMouseDown={this.setDragBox} id="drugTitle" className={style['drug-title']}>{drugInfo.title}说明书  </h3>
                 { drugInfo && drugInfo.drugDesc.length > 0 && <div className={style['drug-desc-wrapper']} id='drugDesc' onScroll={this.handleScrollModal.bind(this,  drugInfo.drugDesc)}>
                     <div className={style['drug-title1']} >{drugInfo.title}说明书</div>
                     {drugInfo.drugDesc.map((item, index) =>{
                         return <div className={style['drug-desc-item']} id={item.title.trim()}>
-                            <span className={style['drug-desc-title']} >{item.title.trim()}</span> 
+                            <div className={style['drug-desc-title']} >{item.title.trim()}</div> 
                             <div className={style['drug-desc-content']} dangerouslySetInnerHTML ={{__html: item.content}}></div> 
                         </div>
                     })}
                     <div className={style['content-menu-box']}>
-                        <div className={style['content-menu']}>
-                            {drugInfo.drugDesc.map((item, index) => {
-                                return (<div >
-                                    <div className={style['details-menu-title-box']}>
-                                        {index === 0 ? '' : <div className={style['details-content-menu-line']}></div>}
-                                        <span onClick={this.handleClickMenu.bind(this, index, item, drugInfo.drugDesc)} className={style['details-content-menu-name']} style = {index === currentIndex ? {color:'#0089be'} : ''}>
-                                            <span className={style['details-content-menu-circle']} style = {index === currentIndex ? {background:'#0089be'} : ''}></span>{item.title}
-                                        </span>
-                                    </div>
-                                </div>)
-                            })}
+                        <div className={style['content-menu-wrapper']}>
+                            <div className={style['content-menu']}>
+                                {drugInfo.drugDesc.map((item, index) => {
+                                    return (<div >
+                                        <div className={style['details-menu-title-box']}>
+                                            {index === 0 ? '' : <div className={style['details-content-menu-line']}></div>}
+                                            <span onClick={this.handleClickMenu.bind(this, index, item, drugInfo.drugDesc)} className={style['details-content-menu-name']} style = {index === currentIndex ? {color:'#0089be'} : ''}>
+                                                <span className={style['details-content-menu-circle']} style = {index === currentIndex ? {background:'#0089be'} : ''}></span>{item.title}
+                                            </span>
+                                        </div>
+                                    </div>)
+                                })}
+                            </div>
                         </div>
                     </div>
                 </div> }

+ 17 - 10
src/components/TreatDesc/DrugInfo/index.less

@@ -9,7 +9,7 @@
     background: #fff;
     z-index: 303;
     padding: 40px 0 60px;
-    
+    box-shadow: 0px 0px 5px -2px #7d7c7c;
 }
 .drug-desc-wrapper {
     height: 100%;
@@ -36,6 +36,8 @@
 .close-drug-desc {
     position: absolute;
     right: 0;
+    top: 0;
+    z-index: 9999;
     width: 40px;
 }
 .drug-desc-item {
@@ -53,11 +55,11 @@
     display: inline-block;
     font-weight: bold;
     font-size: 14px;
-    height: 100%;
-    float: left;
-    width: 190px;
-    text-align-last:justify;    /*chrome*/
-    text-justify: distribute;   /*ff*/
+    // height: 100%;
+    // float: left;
+    // width: 190px;
+    // text-align-last:justify;    /*chrome*/
+    // text-justify: distribute;   /*ff*/
 }
 .drug-desc-title::before {
     content: '【'
@@ -74,16 +76,21 @@
 }
 .drug-desc-content {
     /*width: 100%;*/
-    margin-left: 210px;
-    margin-right: 160px;
+    margin: 0px 160px 0px 10px;
 }
 
 .content-menu-box {
     position: absolute;
     top: 50px;
-    right: -20px;
-    width: 200px;
+    right: 20px;
+    width: 160px;
     height: 80%;
+    overflow: hidden;
+    
+}
+.content-menu-wrapper {
+    width: 200px;
+    height: 100%;
     overflow-y: auto;
 }
 .content-menu {

+ 4 - 3
src/components/TreatDesc/index.jsx

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

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

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

+ 1 - 1
src/containers/CheckBody.js

@@ -11,7 +11,7 @@ function mapStateToProps(state){
   const hasMain = filterDataArr(mainSuit.saveText);//||mainSuit.data.length;
   return {
     data:checkBody.data,
-    showAll:checkBody.showAll,
+    defaultShowAll:checkBody.showAll,
     isEmpty:checkBody.isEmpty,
     update:checkBody.update,   //用于触发更新
     showArr:homePage.showDrop,

+ 4 - 1
src/containers/CurrentIll.js

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

+ 1 - 1
src/containers/Inspect.js

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

+ 5 - 2
src/containers/MainSuit.js

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

+ 5 - 1
src/containers/MultSpread.js

@@ -5,7 +5,7 @@ import {SETSELECTED,CLEARSELECTED,CONFIRMSELECTED,CHANGEOTHERTEXTLABEL,OTHERADDL
 import {CHANGECHECKTEXTLABEL,ADDLABELITEM} from '@types/checkBody.js';
 import {CHANGE_LABELVAL,MAINADDLABELITEM} from '@store/types/mainSuit.js';
 import {CURRENTADDLABELITEM} from '@store/types/currentIll.js';
-import {HIDE,RESET,CLICKCOUNT,SETADDITEMINIT} from '@store/types/homePage.js';
+import {HIDE,RESET,CLICKCOUNT,SETADDITEMINIT,ISREAD} from '@store/types/homePage.js';
 
 function mapStateToProps(state){
   return {}
@@ -27,6 +27,10 @@ const getCopyData = (copyId,inx,boxMark)=>{
       data:JSON.stringify(copy),
       i:inx
     });
+    //自由文本组件更新
+    dispatch({
+      type:ISREAD
+    })
   }
 };
 

+ 2 - 2
src/containers/Multiple.js

@@ -32,7 +32,7 @@ function handleCurrent(dispatch,params){
   const index = getLabelIndex(ikey);
   dispatch({
     type:CURRENT_MUL,
-    data:{seleData,seleId,ikey:index}
+    data:{seleData,seleId,ikey:index,fullIkey:ikey}
   })
 }
 
@@ -41,7 +41,7 @@ function handleOtherHis(dispatch,params){
   const index = getLabelIndex(ikey);
   dispatch({
     type:OTHERHIS_MUL,
-    data:{seleData,seleId,ikey:index}
+    data:{seleData,seleId,ikey:index,fullIkey:ikey}
   })
 }
 

+ 4 - 1
src/containers/NumberDrop.js

@@ -3,7 +3,7 @@ import {connect} from 'react-redux';
 import NumberDrop from "@components/NumberDrop";
 import {SETNUMBER,CHANGEOTHERTEXTLABEL,CHANGEOTHERTEXTLABEL_NUMBER} from '@types/otherHistory';
 import {SETNUMBER4,CHANGECHECKTEXTLABEL,CHANGECHECKTEXTLABEL_NUMBER} from '@types/checkBody.js';
-import {SETDROPSHOW,CLICKCOUNT,HIDE,RESET,HIDEDROP} from '@types/homePage.js';
+import {SETDROPSHOW,CLICKCOUNT,HIDE,RESET,HIDEDROP,ISREAD} from '@types/homePage.js';
 import {NUMBER_SELECT,CHANGE_LABELVAL,CHANGE_LABELVAL_NUMBER} from '@store/types/mainSuit.js';
 import {getLabelIndex} from '@common/js/func.js';
 import {CURRENT_NUMBER,CURRENT_TEXT_LABEL,CURRENT_TEXT_LABEL_NUMBER} from '@store/types/currentIll.js';
@@ -90,6 +90,9 @@ function currentLabel(dispatch,params){
     // type:CURRENT_TEXT_LABEL,
     type:CURRENT_TEXT_LABEL_NUMBER,
     data:Object.assign({},params,{ikey})
+  });
+  dispatch({
+    type:ISREAD
   })
 }
 

+ 6 - 4
src/containers/SpreadDrop.js

@@ -205,7 +205,7 @@ function otherHisConfirm(dispatch,store,params){
       });
       dispatch({
         type: CONFIRMSELECTED,
-        data: {exists:fullfillText(has,false,false).newArr,withs:fullfillText(wes,false,false).newArr,nones:nones,ikey,copyType}
+        data: {exists:fullfillText(has,false,true).newArr,withs:fullfillText(wes,false,true).newArr,nones:nones,ikey,copyType}
       });
       dispatch({
         type:ISREAD
@@ -292,8 +292,10 @@ function handleModuleDiff(dispatch,store,params){
 
 //主诉普通多选确定
 function mainSuitCheck(dispatch,store,params){
-  const {nones,exists,withs,order,mainSaveText,value} = params;
+  const {nones,exists,withs,order,mainSaveText,value,ikey} = params;
   let existsName = getNames(exists,order);
+  let withsName = getNames(withs);
+  let labelInx = getLabelIndex(ikey);
   let text = filterDataArr(mainSaveText);
   /*if(text.length >= config.limited){
     Notify.info(config.limitText);
@@ -305,8 +307,8 @@ function mainSuitCheck(dispatch,store,params){
     Notify.info(config.limitText);
     return
   }
-  const index = params.ikey;
-  let ikey = getLabelIndex(index);
+  // const index = params.ikey;
+  // let ikey = getLabelIndex(index);
   dispatch({
     type: COMM_CONFIRM,
     // data: {exists:exists,existsName:existsName,ikey}

+ 7 - 5
src/containers/eleType.js

@@ -19,15 +19,16 @@ import Multiple from '@containers/Multiple';
  * *******/
 //单选类型
 export function singleRadio(params){
-  const data = params.item;//console.log(111,data);
+  const data = params.item;
   const {i,hideTag,boxMark,showArr,selecteds,boxTop,boxLeft,importLabel} = params;
   let isHigh=importLabel&&importLabel.includes(data.id);
   const showInx = boxMark+i+'0';    //单括号多标签的情况下需要识别同一个标签内多个下拉组件的显示状态
   switch (+data.controlType){
     case 0:
     case 1:
+      const custom= JSON.parse(localStorage.getItem('radio'+data.id));
       const list = data.questionDetailList&&data.questionDetailList.length>0?data.questionDetailList:data.questionMapping;
-      return <RadioDrop data={list}
+      return <RadioDrop data={custom&&custom.length?[...custom,...list]:list}
                         prefix={data.labelPrefix}
                         suffix={data.labelSuffix}
                         placeholder={data.name}
@@ -76,11 +77,12 @@ export function singleRadio(params){
                         id={data.id}
                         ikey={showInx}></InlineTag>;
     case 7:
+      const min = data.minValue!=null&&data.minValue!=undefined?data.minValue-1:undefined;
+      const max = data.maxValue!=null&&data.maxValue!=undefined?+data.maxValue+1:undefined;
       return <NumberDrop prefix={data.labelPrefix}
                          suffix={data.labelSuffix}
-                         min={data.minValue}
-                         max={data.maxValue}
-                         isImports={isHigh}
+                         min={min}
+                         max={max}
                          placeholder={data.name}
                          boxMark={boxMark}
                          id={data.id}

+ 43 - 5
src/store/actions/checkBody.js

@@ -1,11 +1,12 @@
 import config from '@config/index.js';
 import {getLabelIndex,fullfillText} from '@common/js/func.js';
+import {formatContinueDots} from '@utils/tools.js';
 //设置查体数据
 export function set(state,action){
   let res = Object.assign({},state);
   const {data} = action;
   const obj = fullfillText(data,false,false,false);
-  res.data = [...data];
+  res.data = obj.newArr;
   res.saveText = obj.saveText;//存逗号
   res.showAll = obj.checkHiddenDefault;
   res.update = Math.random();
@@ -105,7 +106,11 @@ export function setRadioValue(state,action){
   }
   if(+item.tagType===1){      //独立单选组件
     item.value = text;
-    res.saveText[labelInx] = item.labelPrefix+text+item.labelSuffix;
+    const exist = JSON.parse(localStorage.getItem('radio'+item.id)||null);
+    if(exist){    //选中状态处理
+      exist[0].selected=exist[0].id==id;
+      localStorage.setItem('radio'+item.id,JSON.stringify(exist));
+    }
     item.questionDetailList.map((its)=>{
       if(its.id === id){
         its.selected = true;
@@ -113,6 +118,7 @@ export function setRadioValue(state,action){
         its.selected = false;
       }
     });
+    res.saveText[labelInx] = item.labelPrefix+text+item.labelSuffix;
   }else{      //组合组件中的单选组件
     item.questionMapping[subInx].value = text;
     let hasValue = false;
@@ -205,7 +211,7 @@ export const setRadioInputValue = (state,action)=>{
 export function addLabelItem(state,action){
   let res = Object.assign({},state);
   const {data,i} = action;
-  const textLabel = JSON.parse(config.textLabel);
+  const textLabel = Object.assign({},JSON.parse(config._textLabel),{showInCheck:JSON.parse(data).showInCheck});
   //使用Object.assign({},data)拷贝操作时复制项和原项会同步修改
   if(!data) return res;
   res.data.splice(+i+2,0,JSON.parse(data),textLabel);
@@ -231,7 +237,7 @@ export function setCheckText(state,action) {
 export function setCheckBoxValue(state,action) {
   let res = Object.assign({},state);
   const {labelInx,excluName,existsName,nones,withsName,ban} = action.data;
-  let showText = (excluName||'')+(existsName||'')+(ban.name||'')+(withsName||'')+(nones||'');
+  let showText = (excluName||'')+(existsName||'')+(ban.name||'')+(withsName||'')+(nones&&nones.replace('、','')||'');
   // 若每个选项都有符号,去掉最后一个,因与标签间的符号有冲突
   let pattern = new RegExp(/\,+$|\,+$|\.+$|\。+$|\、+$/);//+ 一次或多次
   if(pattern.test(showText)){
@@ -260,10 +266,11 @@ export function insertLabelData(state,action){
   const {index,data,isReplace,span,searchInEnd}=action;
   const showText = res.saveText[index];
   let tempLabels = data.tagType==4?fullfillText(data.questionMapping).newArr:[data];
+  tempLabels = formatContinueDots(tempLabels);
   //查体中,默认显示区域搜索出来的标签要默认显示,隐藏区域搜索出的默认隐藏
   let hideAreaIndex = [...res.data].reverse().findIndex((it)=>it.showInCheck);
   hideAreaIndex = res.data.length-hideAreaIndex-1;        //默认显示的最后一个标签的位置
-  const text = Object.assign({},JSON.parse(config.textLabel),{showInCheck:index>hideAreaIndex?false:true});
+  const text = Object.assign({},JSON.parse(config._textLabel),{showInCheck:index>hideAreaIndex?false:true});
   let spreadLabels =tempLabels.map((it)=>{
     return Object.assign({},it,{showInCheck:index>hideAreaIndex?false:true});
   });
@@ -316,6 +323,33 @@ export const changeLabelVal = (state,action)=>{//双击标签输入改变值
   if(labText && labText.trim()){
     if(item){
       item.value = newVal;
+      const canAdd=hasNoSame(item.questionDetailList,labText);
+      //单选双击编辑的内容自动加到下拉选项中,双击编辑但未修改不添加
+      if(canAdd&&+item.tagType===1&&(+item.controlType===1||+item.controlType===0)){
+        const li = {
+          id:-Math.floor(Math.random()*1000),
+          name:labText,
+          questionId:item.id,
+          orderNo:0,
+          code:0,
+          defaultSelect:"0",
+          remark:null,
+          abnormal:0,
+          selected:true
+        };
+
+        const exist = JSON.parse(localStorage.getItem('radio'+item.id)||null);
+        //console.log(exist)
+        if(exist&&typeof exist=='object'){     //已添加过编辑的数据
+          //exist.push(li);
+          exist[0]=li;        //暂限添1条
+          localStorage.setItem('radio'+item.id,JSON.stringify(exist));
+        }else{
+          localStorage.setItem('radio'+item.id,JSON.stringify([li]));
+        }
+        //取消原选中状态
+        item.questionDetailList.find((it)=>it.selected==true).selected=false;
+      }
       item.labelPrefix = prefix||'';
       item.labelSuffix = suffix||'';
       // res.saveText[index] = totalVal;
@@ -331,6 +365,10 @@ export const changeLabelVal = (state,action)=>{//双击标签输入改变值
   return res;
 }
 
+function hasNoSame(arr,text){
+  return arr.findIndex((it)=>text==it.name)==-1;
+}
+
 // 数字键盘较特殊,有直接输入
 export const changeNumLabelVal = (state,action)=>{
   const res = Object.assign({},state);

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

@@ -1,5 +1,6 @@
 import {getLabelIndex,fullfillText,getIds} from '@common/js/func.js';
 import config from '@config/index.js';
+import {getInitModules} from '@store/async-actions/homePage.js';
 
 //插入病程变化模板
 function insertPro(data,processModule){
@@ -38,12 +39,23 @@ export const setModule = (state,action)=>{
 //插入病程变化
 export const insertProcess = (state,action)=>{
   const res = Object.assign({},state);
-  const processModule = JSON.parse(JSON.stringify(res.processModule));
+  const sonId = action.id;//子模板id
+  // const processModule = JSON.parse(JSON.stringify(res.processModule));
+  let addSmoduleData;
+  // let allModules = JSON.parse(localStorage.getItem('modules'));
+  let allModules = action.allModules;
+  for(let k=0; k<allModules.length; k++){
+    if(allModules[k].id==sonId){
+      addSmoduleData = JSON.parse(JSON.stringify(allModules[k].moduleDetailDTOList));
+    }
+  }
   let data = res.data;
-  res.data = insertPro(data,processModule);
+  let newData = insertPro(data,addSmoduleData);
+  res.data = fullfillText(newData).newArr;
   res.saveText = fullfillText(res.data).saveText;
   res.update=Math.random();
   return res;
+
 }
 
 
@@ -371,7 +383,7 @@ export const setCheckBox = (state,action)=>{
   const res = Object.assign({},state);
   const {labelInx,excluName,existsName,nones,withsName,ban} = action.data;
   // 若每个选项都有符号,去掉最后一个,因与标签间的符号有冲突
-  let showText = (excluName||'')+(existsName||'')+(ban.name||'')+(withsName||'')+(nones||'');
+  let showText = (excluName||'')+(existsName||'')+(ban.name||'')+(withsName||'')+(nones&&nones.replace('、','')||'');
   let pattern = new RegExp(/\,+$|\,+$|\.+$|\。+$|\、+$/);//+ 一次或多次
   if(pattern.test(showText)){
     showText = showText.substr(0,showText.length-1);
@@ -432,6 +444,11 @@ export function setRadioValue(state,action){
   if(+item.tagType===1){
     item.value = text;
     res.saveText[labelInx] = item.labelPrefix+text+item.labelSuffix;
+    const exist = JSON.parse(localStorage.getItem('radio'+item.id)||null);
+    if(exist){    //选中状态处理
+      exist[0].selected=exist[0].id==id;
+      localStorage.setItem('radio'+item.id,JSON.stringify(exist));
+    }
     item.questionDetailList.map((its)=>{
       if(its.id === id){
         its.selected = true;
@@ -524,6 +541,33 @@ export const changeLabelVal = (state,action)=>{
   if(labText.trim()){
     if(item){
       item.value = newVal;
+      const canAdd=hasNoSame(item.questionDetailList,labText);
+      //单选双击编辑的内容自动加到下拉选项中,双击编辑但未修改不添加
+      if(canAdd&&+item.tagType===1&&(+item.controlType===1||+item.controlType===0)){
+        const li = {
+          id:-Math.floor(Math.random()*1000),
+          name:labText,
+          questionId:item.id,
+          orderNo:0,
+          code:0,
+          defaultSelect:"0",
+          remark:null,
+          abnormal:0,
+          selected:true
+        };
+
+        const exist = JSON.parse(localStorage.getItem('radio'+item.id)||null);
+        //console.log(exist)
+        if(exist&&typeof exist=='object'){     //已添加过编辑的数据
+          //exist.push(li);
+          exist[0]=li;        //暂限添1条
+          localStorage.setItem('radio'+item.id,JSON.stringify(exist));
+        }else{
+          localStorage.setItem('radio'+item.id,JSON.stringify([li]));
+        }
+        //取消原选中状态
+        item.questionDetailList.find((it)=>it.selected==true).selected=false;
+      }
       item.labelPrefix = prefix||'';
       item.labelSuffix = suffix||'';
       res.saveText[index] = labText;
@@ -537,6 +581,9 @@ export const changeLabelVal = (state,action)=>{
   return res;
 }
 
+function hasNoSame(arr,text){
+  return arr.findIndex((it)=>text==it.name)==-1;
+}
 // 数字键盘较特殊,有直接输入
 export const changeNumLabelVal = (state,action)=>{
   const res = Object.assign({},state);
@@ -831,12 +878,26 @@ export function removeId(state,action){
 // 单列多选
 export function multipleComfirn(state,action){
   let res = Object.assign({},state);
-  const {ikey,seleData} = action.data;
-  let data = res.data;
+  const {ikey,seleData,fullIkey} = action.data;
+  let data = res.data;//console.log(action,data[ikey])
+  let index = fullIkey.substr(fullIkey.length-1,1);
+  if(data[ikey].tagType==3){    //在组合项中
+    let item = data[ikey].questionMapping;
+    let arr=[];
+    item[index].value = seleData;
+    item.map((it)=>{
+      if(it.value){
+        arr.push(it.labelPrefix+it.value+it.labelSuffix);
+      }
+    });
+    res.saveText[ikey] = arr.join("");
+    res.update = Math.random();
+    res.selecteds[ikey] = {[index]:action.data};
+    return res;
+  }
   data[ikey].value = seleData;
   res.saveText[ikey] = seleData;
   res.selecteds[ikey] = action.data;
-  res.update = Math.random();
   return res;
 }
 

+ 16 - 8
src/store/actions/mainSuit.js

@@ -69,22 +69,33 @@ export const getBigSymptom = (state,action) => {
 //点击插入新模板--添加病程变化
 export const handleTailClick = (state,action)=>{
   const res = Object.assign({},state);
-  res.showDrop = !res.showDrop;
+  const sonId = action.id;//子模板id
   let num = res.moduleNum.num;
   num++;
-  const addSmoduleData = JSON.parse(JSON.stringify(res.addSmoduleData));
+  // const addSmoduleData = JSON.parse(JSON.stringify(res.addSmoduleData));
   // const addDatas = JSON.parse(JSON.stringify(fullfillText(action.info).newArr));
+  let addSmoduleData;
+  // const allModules = JSON.parse(localStorage.getItem('modules'));
+  let allModules = action.allModules;
+  for(let k=0; k<allModules.length; k++){
+    if(allModules[k].id==sonId){
+      addSmoduleData = JSON.parse(JSON.stringify(allModules[k].moduleDetailDTOList));
+    }
+  }
   let datas = JSON.parse(JSON.stringify(res.data));
   let leng = datas.length;
+  
   for(let i=0; i<addSmoduleData.length; i++){
     addSmoduleData[i].pos = num;
     // let pos = leng-1+i;
    /* let pos = leng-2+i;
     datas.splice(pos,0,addDatas[i]);*/
   }
-  res.data = insertPro(datas,addSmoduleData);
+  let newData = insertPro(datas,addSmoduleData);
+  res.data = fullfillText(newData).newArr;
   res.saveText = fullfillText(res.data).saveText;
   res.moduleNum.num = num;
+  res.showDrop = !res.showDrop;
   return res;
 }
 
@@ -266,7 +277,7 @@ export const commConfirm=(state,action)=>{
   const res = Object.assign({},state);
   const {labelInx,excluName,existsName,nones,withsName,ban} = action.data;
   // 若每个选项都有符号,去掉最后一个,因与标签间的符号有冲突
-  let showText = (excluName||'')+(existsName||'')+(ban.name||'')+(withsName||'')+(nones||'');
+  let showText = (excluName||'')+(existsName||'')+(ban.name||'')+(withsName||'')+(nones&&nones.replace('、','')||'');
   let pattern = new RegExp(/\,+$|\,+$|\.+$|\。+$|\、+$/);//+ 一次或多次
   if(pattern.test(showText)){
     showText = showText.substr(0,showText.length-1);
@@ -373,22 +384,19 @@ export const insertSearch = (state,action)=>{
     if(index < 1){//前
       if(data[focusIndex].value==searchStr){//为空标签则替换
         res.data.splice(focusIndex,1,nText);
-        res.saveText.splice(focusIndex,1,searchData);
       }else{
         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,nText);
-      res.saveText.splice(focusIndex+1,0,searchData);
       res.data[focusIndex].value = value;
     }
     span.current.innerText?(span.current.innerText = value):(span.current.innerHTML=value);
     res.mainIds.push(id);
   }
-  // console.log(456,res,action);
+  res.saveText = fullfillText(res.data).saveText;
   res.update=Math.random();
   return res;
 }

+ 57 - 8
src/store/actions/otherHistory.js

@@ -1,5 +1,6 @@
 import config from '@config/index';
 import {getLabelIndex,fullfillText} from '@common/js/func.js';
+import {formatContinueDots} from '@utils/tools.js';
 
 //多选标签选中确定处理
 export const confirm = (state,action) =>{
@@ -37,7 +38,6 @@ 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;
@@ -47,8 +47,6 @@ export const confirm = (state,action) =>{
     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;
@@ -69,6 +67,11 @@ export function setRadioValue(state,action){
   if(+item.tagType===1){
     item.value = text;
     res.saveText[labelInx] = item.labelPrefix+text+item.labelSuffix;
+    const exist = JSON.parse(localStorage.getItem('radio'+item.id)||null);
+    if(exist){    //选中状态处理
+      exist[0].selected=exist[0].id==id;
+      localStorage.setItem('radio'+item.id,JSON.stringify(exist));
+    }
     item.questionDetailList.map((its)=>{
       if(its.id === id){
         its.selected = true;
@@ -199,7 +202,7 @@ export function setCheckBoxValue(state,action) {
   const res = Object.assign({},state);
   const {labelInx,excluName,existsName,nones,withsName,ban} = action.data;
   // 若每个选项都有符号,去掉最后一个,因与标签间的符号有冲突
-  let showText = (excluName||'')+(existsName||'')+(ban.name||'')+(withsName||'')+(nones||'');
+  let showText = (excluName||'')+(existsName||'')+(ban.name||'')+(withsName||'')+(nones&&nones.replace('、','')||'');
   let pattern = new RegExp(/\,+$|\,+$|\.+$|\。+$|\、+$/);//+ 一次或多次
   if(pattern.test(showText)){
     showText = showText.substr(0,showText.length-1);
@@ -226,7 +229,8 @@ export function insertLabelData(state,action){
   const searchStr = res.searchStr;
   const {index,data,isReplace,span,searchInEnd}=action;
   const showText = res.saveText[index];
-  const spreadLabels = data.tagType==4?fullfillText(data.questionMapping).newArr:[data];
+  let searchLabels = data.tagType==4?fullfillText(data.questionMapping).newArr:[data];
+  const spreadLabels = formatContinueDots(searchLabels);
   let reg = searchInEnd?new RegExp(searchStr+"$"):new RegExp("^"+searchStr);
   const newText=showText.replace(reg,'')||' ';
   if(!isReplace){
@@ -278,6 +282,33 @@ export function changeTextLabel(state,action) {
       if(item.formulaCode){
         res[item.formulaCode] = newVal;
       }
+      const canAdd=hasNoSame(item.questionDetailList,labText);
+      //单选双击编辑的内容自动加到下拉选项中,双击编辑但未修改不添加
+      if(canAdd&&+item.tagType===1&&(+item.controlType===1||+item.controlType===0)){
+        const li = {
+          id:-Math.floor(Math.random()*1000),
+          name:labText,
+          questionId:item.id,
+          orderNo:0,
+          code:0,
+          defaultSelect:"0",
+          remark:null,
+          abnormal:0,
+          selected:true
+        };
+
+        const exist = JSON.parse(localStorage.getItem('radio'+item.id)||null);
+        //console.log(exist)
+        if(exist&&typeof exist=='object'){     //已添加过编辑的数据
+          //exist.push(li);
+          exist[0]=li;        //暂限添1条
+          localStorage.setItem('radio'+item.id,JSON.stringify(exist));
+        }else{
+          localStorage.setItem('radio'+item.id,JSON.stringify([li]));
+        }
+        //取消原选中状态
+        item.questionDetailList.find((it)=>it.selected==true).selected=false;
+      }
       item.labelPrefix = prefix||'';
       item.labelSuffix = suffix||'';
       res.saveText[index] = labText;
@@ -296,6 +327,10 @@ export function changeTextLabel(state,action) {
   return res;
 }
 
+function hasNoSame(arr,text){
+  return arr.findIndex((it)=>text==it.name)==-1;
+}
+
 // 数字键盘较特殊,有直接输入
 export const changeNumLabelVal = (state,action)=>{
   const res = Object.assign({},state);
@@ -404,12 +439,26 @@ export function removeId(state,action){
 // 单列多选
 export function multipleComfirn(state,action){
   let res = Object.assign({},state);
-  const {ikey,seleData} = action.data;
-  let data = res.data;
+  const {ikey,seleData,fullIkey} = action.data;
+  let data = res.data;//console.log(action,data[ikey])
+  let index = fullIkey.substr(fullIkey.length-1,1);
+  if(data[ikey].tagType==3){    //在组合项中
+    let item = data[ikey].questionMapping;
+    let arr=[];
+    item[index].value = seleData;
+    item.map((it)=>{
+      if(it.value){
+        arr.push(it.labelPrefix+it.value+it.labelSuffix);
+      }
+    });
+    res.saveText[ikey] = arr.join("");
+    res.update = Math.random();
+    res.selecteds[ikey] = {[index]:action.data};
+    return res;
+  }
   data[ikey].value = seleData;
   res.saveText[ikey] = seleData;
   res.selecteds[ikey] = action.data;
-  res.update = Math.random();
   return res;
 }
 

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

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

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

@@ -12,7 +12,7 @@ export const getSearchList = (val) => {
     let baseList = store.getState();
     let sex = baseList.patInfo.message.patientSex;
     return (dispatch) => {
-        axios.json('/api/icss/retrieval/getTagInfos',{
+        axios.json('/retrieval/getTagInfos',{
             type:'6',
             age:baseList.patInfo.message.patientAge,
             inputStr:val,

+ 2 - 2
src/store/async-actions/copyRight.js

@@ -5,7 +5,7 @@ import { storageLocal } from "@utils/tools"
 export const getMessage = (dispatch, getState) => {
     const state = getState();
     // 请求地址
-    post('/api/icss/versionInfo/getVersionInfoAlls')
+    post('/versionInfo/getVersionInfoAlls')
     .then((data) => {
         
         const versionInfo = JSON.parse(storageLocal.get('versionInfo'));
@@ -33,7 +33,7 @@ export const getMessage = (dispatch, getState) => {
 export const getDisMessage = (dispatch, getState) => {
     const state = getState();
     // 请求地址
-    post('/api/icss/disclaimerInformation/getDisclaimerInformations')
+    post('/disclaimerInformation/getDisclaimerInformations')
     .then((data) => {
         dispatch({
             type: GET_DISCLAIMER_MESSAGE,

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

@@ -18,7 +18,7 @@ export const getSearchList = (val) => {
         for(let i = 0; i < diagnosticList.length; i++) {
             noIds.push(diagnosticList[i].id)
         }
-        json('/api/icss/retrieval/getTagInfos',{
+        json('/retrieval/getTagInfos',{
             type:'7',
             age:state.patInfo.message.patientAge,
             inputStr:val,

+ 10 - 10
src/store/async-actions/fetchModules.js

@@ -9,13 +9,13 @@ import {SETOTHERHISTORY} from "../types/homePage";
 import config from "@config/index";
 
 const api={
-  getSpreadModule:'/api/icss/questionInfo/getByIds',
-  getModule:'/api/icss/questionInfo/getById',
-  searchURL: '/api/icss/retrieval/getTagInfos',
-  getOtherHisRecord: '/api/icss/inquiryInfo/getLastOther',
-  getBigPush:'/api/icss/push/pushInner',
-  saveMode:'/api/icss/doctorPageMode/saveDoctorPageModes',
-  getSymptomFeature:'/api/icss/feature/getSymptomFeature'
+  getSpreadModule:'/questionInfo/getByIds',
+  getModule:'/questionInfo/getById',
+  searchURL: '/retrieval/getTagInfos',
+  getOtherHisRecord: '/inquiryInfo/getLastOther',
+  getBigPush:'/push/pushInner',
+  saveMode:'/doctorPageMode/saveDoctorPageModes',
+  getSymptomFeature:'/feature/getSymptomFeature'
 };
 
 export const getFeature = (item)=>{
@@ -147,11 +147,11 @@ export function getInitData(){
     json(api.getBigPush,param).then((res)=>{
       if(+res.data.code === 0){
         const data = res.data.data&&res.data.data.vital;
-        const str = JSON.stringify(data);
-        const arr = fullfillText(JSON.parse(str),false,false,false).newArr;
+        //const str = JSON.stringify(data);
+        //const arr = fullfillText(JSON.parse(str),false,false,false).newArr;
         dispatch({
           type:SET,
-          data:[...arr],
+          data:[...data],
           isEmpty:false
         });
       }else{

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

@@ -6,7 +6,7 @@ import { getUrlArgObject } from '@utils/tools';
 
 export const initPersonInfo = () => {        //初始化数据
     return (dispatch) => {
-        axios.json('/api/icss/tranFieldInfo/getInfoByUuid',{
+        axios.json('/tranFieldInfo/getInfoByUuid',{
             "uuid":getUrlArgObject('hospitalId'),
         }).then((res)=>{
             const data =res.data;

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

@@ -8,7 +8,7 @@ export const initItemList = () => {
     // let whichSign = baseList.typeConfig.typeConfig;
     let state = baseList.patInfo.message;
     return (dispatch) => {
-        axios.json('/api/icss/inquiryInfo/hisInquirys',{
+        axios.json('/inquiryInfo/hisInquirys',{
             "hospitalId": state.hospitalId, 
             "patientId": state.patientId, 
             // "sign":whichSign

+ 14 - 8
src/store/async-actions/homePage.js

@@ -1,5 +1,5 @@
 import {post,json} from '@utils/ajax.js';
-import {SETINITDATA,MODI_LOADING,GET_ASSIST_LIST,GET_INSPECT_LIST} from '@store/types/homePage.js';
+import {SETINITDATA,MODI_LOADING,GET_ASSIST_LIST,GET_INSPECT_LIST,SETALLMODULES} from '@store/types/homePage.js';
 import {SET_CURRENT} from '@store/types/currentIll';
 import {SET_MAINSUIT} from '@store/types/mainSuit';
 import config from '@config/index.js';
@@ -11,10 +11,10 @@ import {initHistoryDetails} from '@store/async-actions/patInfo';
 import {storageLocal} from '@utils/tools';
 
 const api = {
-  getModules:'/api/icss/moduleInfo/getAll',
-  clickCount:'/api/icss/buriedSomeStatistical/saveBuriedSomeStatisticals', //埋点统计
-  getChronic:'/api/icss/disType/getDisType', //慢病列表
-  getQuestionUsual:'/api/icss/questionUsual/getQuestionUsual' //化验常用标签
+  getModules:'/moduleInfo/getAll',
+  clickCount:'/buriedSomeStatistical/saveBuriedSomeStatisticals', //埋点统计
+  getChronic:'/disType/getDisType', //慢病列表
+  getQuestionUsual:'/questionUsual/getQuestionUsual' //化验常用标签
 };
 
 function modulesParseJson(data){
@@ -46,6 +46,12 @@ export const getInitModules= (dispatch,getStore)=>{
         const initData = newObj.json;
         const initSaveText = newObj.saveTextJson;
         const initModuleName = newObj.moduleName;
+        // 将所有模板缓存,方便根据id取子模板
+        // localStorage.setItem('modules',JSON.stringify(res.data.data));
+        dispatch({
+          type: SETALLMODULES,
+          data: res.data.data
+        });
         dispatch({
           type: SETINITDATA,
           data: initData
@@ -108,8 +114,8 @@ export const getChronic = (dispatch,getState)=>{
       storageLocal.set('chronic',chronic);
     }else{
       console.log("请求失败",res);
-    } 
-  }) 
+    }
+  })
 }
 // 请求化验辅检常用标签
 export const getCommonList = (val)=>{
@@ -139,6 +145,6 @@ export const getCommonList = (val)=>{
       }else{
         console.log("请求失败",res);
       }
-    }) 
+    })
   }
 }

+ 2 - 2
src/store/async-actions/inspect.js

@@ -12,7 +12,7 @@ export const getSearchList = (val) => {
     let baseList = store.getState();
     let sex = baseList.patInfo.message.patientSex;
     return (dispatch) => {
-        axios.json('/api/icss/retrieval/getTagInfos',{
+        axios.json('/retrieval/getTagInfos',{
             type:'5',
             age:baseList.patInfo.message.patientAge,
             inputStr:val,
@@ -28,7 +28,7 @@ export const getSublableList = (id,idx) => {
     let baseList = store.getState();
     let sex = baseList.patInfo.message.patientSex;
     return (dispatch) => {
-        axios.json('/api/icss/questionInfo/getById',{
+        axios.json('/questionInfo/getById',{
             age:baseList.patInfo.message.patientAge,
             sexType:sex == '男'?'1' : sex == '女'?'2':'3',
             id: id

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

@@ -4,8 +4,8 @@ import {getEMRParams} from '@utils/tools';
 
 const host = '/api/icss/';
 const api = {
-  'getCommSymptoms': host + 'questionUsual/getQuestionUsual',
-  'symptomPush': host +'push/pushInner',
+  'getCommSymptoms': '/questionUsual/getQuestionUsual',
+  'symptomPush':'/push/pushInner',
 }
 
 

+ 4 - 4
src/store/async-actions/patInfo.js

@@ -9,13 +9,13 @@ import {ISREAD,MODI_LOADING} from "../types/homePage";
 import { initItemList } from '@store/async-actions/tabTemplate';
 
 const api = {
-    getPatInfo: '/api/icss/patientInfo/getTopPatientInfo',
-    getPatBaseInfo: '/api/icss/patientInfo/getPatientInfo'
+    getPatInfo: '/patientInfo/getTopPatientInfo',
+    getPatBaseInfo: '/patientInfo/getPatientInfo'
 };
 
 //参数转换
 export const initPersonInfo = (dispatch, getState) => {
-    json('/api/icss/tranFieldInfo/getInfoByUuid', {
+    json('/tranFieldInfo/getInfoByUuid', {
         "uuid": getUrlArgObject('hospitalId'),
     }).then((res) => {
         const data = res.data;
@@ -34,7 +34,7 @@ export const initHistoryDetails = (dispatch) => {
     let baseList = store.getState();
     let state = baseList.patInfo.message;
     return (dispatch) => {
-        json('/api/icss/inquiryInfo/readInquiry', {
+        json('/inquiryInfo/readInquiry', {
             "doctorId": state.doctorId,
             "hospitalDeptId": state.hospitalDeptId,
             "hospitalId": state.hospitalId,

+ 2 - 2
src/store/async-actions/print.js

@@ -18,7 +18,7 @@ export const saveMessage = (bool) => {
     let jsonData = getAllDataList(baseList);
     // console.log(jsonStr.diag,'保存历史病历')
     
-    json('/api/icss/inquiryInfo/saveInquiry', {
+    json('/inquiryInfo/saveInquiry', {
         "doctorId": state.doctorId,
         "hospitalDeptId": state.hospitalDeptId,
         "hospitalId": state.hospitalId,
@@ -73,7 +73,7 @@ export const saveMessage = (bool) => {
         }
     })
     if(bool){
-        json('/api/icss/printRecord/savePrintRecords', {
+        json('/printRecord/savePrintRecords', {
             "dataJson": JSON.stringify(getAllDataList(baseList)),
             "doctorId": state.doctorId,
             "hospitalDeptId": state.hospitalDeptId,

+ 5 - 5
src/store/async-actions/pushMessage.js

@@ -5,9 +5,9 @@ import {storageLocal,getEMRParams} from '@utils/tools';
 import {SET_IMPORT_CHECKBODY_LABEL} from "../types/checkBody";
 
 const api={
-  push:'/api/icss/push/pushInner',
-  textPush:'/api/icss/push/pushText',
-  getTableList:'/api/icss/scale/getList' //获取量表列表
+  push:'/push/pushInner',
+  textPush:'/push/pushText',
+  getTableList:'/scale/getList' //获取量表列表
 }
 
 //获取右侧推送信息
@@ -81,7 +81,7 @@ export const getTips = (diagItem) =>{
             type: SET_CLICK_DIAG,
             clickDiag: diagItem
         })
-        const url = '/api/icss/introduceInfo/getByQuestionId';
+        const url = '/introduceInfo/getByQuestionId';
         const params = {
             questionId: diagItem.id,
             type: 7,
@@ -107,7 +107,7 @@ export const getTipsDetails = () => {
         // window.open(`/static/pages/information.html?type=7&&questionId=${state.diagnosticList.clickDiag.id}`);
 
         //弹窗显示
-        const url ='/api/icss/introduceInfo/getByQuestionId'
+        const url ='/introduceInfo/getByQuestionId'
         const imageUrlPrefix = 'http://192.168.2.241:82'
         
         const params = {

+ 5 - 5
src/store/async-actions/tabTemplate.js

@@ -21,7 +21,7 @@ export const initItemList = (type) => { //初始化数据
   let state = baseList.patInfo.message;
 
   return (dispatch) => {
-    axios.json('/api/icss/templateInfo/getByDoctorIdTemplates', {
+    axios.json('/templateInfo/getByDoctorIdTemplates', {
       "doctorId": state.doctorId,
       "hospitalDeptId": state.hospitalDeptId,
       "hospitalId": state.hospitalId,
@@ -67,7 +67,7 @@ export const saveTemplateDetail = (val,sex) => { //保存为模板
     return tmpObj;
   }
   return (dispatch) => {
-    axios.json('/api/icss/templateInfo/saveTemplateInfo', getdata()).then((res) => {
+    axios.json('/templateInfo/saveTemplateInfo', getdata()).then((res) => {
       const data = res.data;
       if (data.code == 0) {
         Notify.success('模板保存成功');
@@ -97,7 +97,7 @@ export const saveTemplateDetail = (val,sex) => { //保存为模板
 
 export const delItem = (id) => { //删除
   return (dispatch) => {
-    axios.json('/api/icss/templateInfo/cancelTemplateInfos', {
+    axios.json('/templateInfo/cancelTemplateInfos', {
       ids: id
     }).then((res) => {
       let data = res.data;
@@ -112,7 +112,7 @@ export const delItem = (id) => { //删除
 };
 export const delBatchItem = (ids) => { //批量删除
   return (dispatch) => {
-    axios.json('/api/icss/templateInfo/cancelTemplateInfos', {
+    axios.json('/templateInfo/cancelTemplateInfos', {
       ids: ids.join(",")
     }).then((res) => {
       let data = res.data;
@@ -133,7 +133,7 @@ export const changeTitleAsync = (obj) => { //改标题
     return;
   }
   return (dispatch) => {
-    axios.json('/api/icss/templateInfo/updateByIdUsNames', {
+    axios.json('/templateInfo/updateByIdUsNames', {
       "doctorId": state.doctorId,
       "hospitalDeptId": state.hospitalDeptId,
       "hospitalId": state.hospitalId,

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

@@ -7,8 +7,8 @@ import {storageLocal,getEMRParams} from '@utils/tools';
 import { isAddMainSuit } from '@store/async-actions/diagnosticList';
 
 const api={
-    push:'/api/icss/push/pushInner',
-    textPush:'/api/icss/push/pushText'
+    push:'/push/pushInner',
+    textPush:'/push/pushText'
 }
 
 export const addDiagnostic = (item) => {
@@ -219,7 +219,7 @@ export const getTreatResult = (item) =>{
 export const getInstroduce = (item)=>{
 
     return (dispatch, getState) =>{
-        const url = '/api/icss/introduceInfo/getByQuestionId';
+        const url = '/introduceInfo/getByQuestionId';
         const params = {
             questionId: item.id,
             type: 8,
@@ -253,7 +253,7 @@ 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 url = '/introduceInfo/getByQuestionId';
             const params = {
                 questionId: drugIdList.drugIdList[i],
                 type: 8,
@@ -293,7 +293,7 @@ export const  getInstroduceMore = (drugIdList) =>{
 export const commonTreatAddToAdvice = () => {
     return (dispatch, getState) => {
         const state = getState();
-        if(state.treat.treatItem.treatIndex === 0 && state.treat.isFirstMainDiag) {
+        if(state.treat.treatItem.id === state.diagnosticList.diagnosticList[0].id && state.treat.isFirstMainDiag) {
             dispatch({
                 type: IS_FIRST_MAIN_DIAG
             })

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

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

+ 77 - 9
src/store/reducers/inspect.js

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

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

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

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

@@ -14,4 +14,5 @@ export const SETMINSCREEN = 'SETMINSCREEN';    //1024标识
 export const MODI_LOADING = 'MODI_LOADING';    //1024标识
 export const SEARCH_DROP_LOCATION = 'SEARCH_DROP_LOCATION';    //1024标识
 export const GET_ASSIST_LIST = 'GET_ASSIST_LIST';    //辅检
-export const GET_INSPECT_LIST = 'GET_INSPECT_LIST';    //化验
+export const GET_INSPECT_LIST = 'GET_INSPECT_LIST';    //化验
+export const SETALLMODULES = 'SETALLMODULES';    //储存所有模板数据

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

@@ -14,4 +14,4 @@ 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' //查询多个药品说明书(添加数据时查看药品说明用)
 export const IS_FIRST_MAIN_DIAG = 'IS_FIRST_MAIN_DIAG' //是否为主诊断第一次开单
-
+export const CLEAR_FIRST_MAIN_DIAG = 'CLEAR_FIRST_MAIN_DIAG' //回读清空是否为主诊断第一次开单

+ 16 - 8
src/utils/ajax.js

@@ -1,20 +1,24 @@
-import {host} from './config'
+import {host,prefix} from './config'
 import { getUrlArgObject } from "@utils/tools";
 const $ = require('jquery');
 $.support.cors = true;
 const axios=require('axios');
 const qs=require('querystring');
 const isLocal = window.location.hostname.indexOf('localhost')!=-1;
-const qhost = isLocal?host:'';
+const qhost = isLocal?host+prefix:prefix;
 axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';
 //axios.defaults.baseURL = host;       //默认地址
 // axios.defaults.timeout = 60000;       //请求超时
 
 
-    // const appkeyId = getUrlArgObject("appkey");
+    const securityCode = getUrlArgObject("code");
+    const appKeyId = getUrlArgObject("appI");
+    const appKeySecret = getUrlArgObject("appS");
     axios.interceptors.request.use(
         req => {
-            // req.headers.appKey = appkeyId;
+          req.headers.appKeyId = appKeyId;
+          req.headers.appKeySecret = appKeySecret;
+          req.headers.securityCode = securityCode;
             return req;
         },
         error => {
@@ -33,10 +37,10 @@ axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded
             if (error.response) {
                 switch (error.response.status) {
                     case 401:
-                        //alert(401)
+                        //alert("服务正在升级,请稍后再试");
                         break;
                     case 500:
-                        //alert(500)
+                        //alert('后台接口报错');
                         break;
                     default:
                         //alert('其他')
@@ -61,7 +65,11 @@ const post=(url,data)=>{
 //json传参
 const json=(url,data)=>{
   //兼容ie8,axios在ie8下content-type设置不成功且会把headers置为null
-  return new Promise((resolve,reject)=>{
+  return axios({
+    method:'post',
+    url:qhost+url,
+    data
+  });/*new Promise((resolve,reject)=>{
     $.ajax({
       method:'post',
       url:qhost+url,
@@ -74,7 +82,7 @@ const json=(url,data)=>{
         reject(error);
       },
     });
-  });
+  });*/
 };
 
 const get=(url)=>{

+ 2 - 1
src/utils/config.js

@@ -6,5 +6,6 @@ const host='http://192.168.2.236:5050';//后端接口访问地址
 // const host='http://192.168.3.117:8080'; //周铁刚
 // const newIcssVisitUrl = '223.93.170.82:13000';    //icss服务访问地址(跳转目的地),不能加http://
 module.exports={
-    host
+    host,
+    prefix:'/api/icss'            //带权限验证的api
 };

+ 63 - 17
src/utils/tools.js

@@ -8,6 +8,7 @@ import {clearAllLabel} from '@store/actions/inspect';
 import {CLEAR_ALL_DIAG} from '@store/types/diagnosticList';
 import {CLEAR_ALL_PUSH_MESSAGE, SET_TIPS} from '@store/types/pushMessage';
 import {ISREAD, SETREADDITEMS} from "../store/types/homePage";
+import {CLEAR_FIRST_MAIN_DIAG} from "../store/types/treat";
 import {tabChange} from '@store/actions/tabTemplate';
 import config from '@config/index.js';
 
@@ -187,7 +188,8 @@ const getAllDataList =(baseList) =>{           //获取所有模块结构化的
     jsonData.addItems = baseList.homePage.addItems||{};
     jsonData.mainsuitIds = baseList.mainSuit.mainIds;      //主诉去重
     jsonData.currentIds = baseList.currentIll.symptomIds;      //现病史去重
-    //console.log(jsonData,'结构化数据获取')
+    jsonData.isFirstMainDiag = baseList.treat.isFirstMainDiag;      //治疗方案
+    // console.log(jsonData,'结构化数据获取')
     return jsonData;
 }
 const getAllDataStringList =(baseList) =>{           //获取所有模块文本的数据
@@ -260,6 +262,10 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
             data:{},
             saveText:'',
         });
+        store.dispatch({
+          type:CLEAR_FIRST_MAIN_DIAG,
+          flag:true
+        });
         storageLocal.remove('emrParam');
        // Notify.success('页面已清空')
     }else{
@@ -325,6 +331,10 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
                   type:SETREADDITEMS,
                   data:dataJson.addItems
                 });
+                store.dispatch({
+                  type:CLEAR_FIRST_MAIN_DIAG,
+                  flag:dataJson.isFirstMainDiag
+                });
               //tab跳回辅助信息
               store.dispatch(tabChange('0'));
             }else{    //结构化历史病历回读
@@ -389,6 +399,10 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
                 type:SETREADDITEMS,
                 data:dataJson.addItems
               });
+              store.dispatch({
+                type:CLEAR_FIRST_MAIN_DIAG,
+                flag:dataJson.isFirstMainDiag
+              });
             }
         } else {
             if(type == 'template'){     //纯文本模板回读
@@ -438,6 +452,10 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
                 type:SETREADDITEMS,
                 data:dataJson.addItems
               });
+              store.dispatch({
+                type:CLEAR_FIRST_MAIN_DIAG,
+                flag:dataJson.isFirstMainDiag
+              });
               //tab跳回辅助信息
               store.dispatch(tabChange('0'));
             }else{  //纯文本历史病历回读
@@ -493,6 +511,10 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
                 type:SETREADDITEMS,
                 data:dataJson.addItems
               });
+              store.dispatch({
+                type:CLEAR_FIRST_MAIN_DIAG,
+                flag:dataJson.isFirstMainDiag
+              });
             }
         }
     }
@@ -550,21 +572,25 @@ function filterOtherDataArr(arrTmp,jsonArr){
       return word.substr(0,1);
     });
   });
-  const str1 = [...tmpArr].splice(0,index1).join("");
-  const str2 = [...tmpArr].splice(index1).join("");
+  const splitNum = [index1,index2,index3,index4].find((i)=>i!=-1);
+  const str1 = [...tmpArr].splice(0,splitNum).join("");
+  const str2 = [...tmpArr].splice(splitNum).join("");
   return {str1:trimDots(str1),str2:trimDots(str2),index:index1};
 }
 //去掉开头的标点符号,最后的标点保留第一个,中间连续的保留第一个
 function trimDots(str){
   return str.replace(config.punReg,function(word){
     return word.substr(0,1);
-  }).replace(/^[,,.。::"“??”;;、!!]+/,'');
+  }).replace(/^[,,.。::"“??”;;、!!\s]+/,'');
 }
 
 //标签间连续标点只保留一个,保留前面一个
 function formatContinueDots(data){
   let arr=data.filter((it,i)=>{
-    if(!(it.name==','&&data[i-1].name==',')){
+    if(i==0||(it.name&&(it.name.match(config.punctuationReg))||(data[i-1].name&&data[i-1].name.match(config.punctuationReg)))){
+      return it;
+    }
+    if(!it.name){       //主诉现病史病情变化
       return it;
     }
   });
@@ -717,24 +743,37 @@ function getPageLength(event) {     //兼容ie8获取页面距离左和上的距
   return page;
 }
 function dragBox(domWrap,domDrag){
-  let wrap = document.getElementById(domWrap);//呗拖拽的元素
   let drag = document.getElementById(domDrag);//拖拽区域
+  let wrap = document.getElementById(domWrap);//被拖拽的元素
   let width = window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;//屏幕宽度
   let height = window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;//屏幕高度
   let mouseX = 0,mouseY = 0,dragX = 0,dragY = 0,isDrag = false,isMove = false;
-  let maxDragX = width - wrap.offsetWidth;//最大可推拽x方向距离
-  let maxDragY = height - wrap.offsetHeight;//最大可拖拽y方向距离
   windowEventHandler('mousedown',(event)=>{    //鼠标位置获取,计算点击位置到拖拽元素左边的距离
-    wrap = document.getElementById(domWrap);
-    drag = document.getElementById(domDrag);
+    let wrap = document.getElementById(domWrap);
     let page = getPageLength(event);
+    drag = document.getElementById(domDrag);
     mouseX = page.pageX - wrap.offsetLeft      //鼠标到拖拽元素的左边界的距离
     mouseY = page.pageY - wrap.offsetTop       //鼠标到拖拽元素的上边界的距离
     isDrag = true
+    isMove = false
   },drag)
   // windowEventHandler('mousemove',handleMove,document)
   windowEventHandler('mousemove',(event)=>{      //移动的
+    let dragDes = document.getElementById('treatDescBox');//展開区域
     let page = getPageLength(event);
+    let maxDragX = 0,dragDesWidth = 0;
+    let maxDragY = height - wrap.offsetHeight;//最大可拖拽y方向距离
+
+    if(domDrag == 'dragTreatTitle'){//最大可推拽x方向距离
+      if(dragDes != null){
+        dragDesWidth = dragDes.offsetWidth
+      }else{
+        dragDesWidth = 0
+      }
+      maxDragX = width - wrap.offsetWidth - dragDesWidth
+    }else{
+      maxDragX = width - wrap.offsetWidth
+    }
     if(isDrag){
       dragX = page.pageX - mouseX          //鼠标可拖拽到左边的最大距离
       dragY = page.pageY - mouseY          //鼠标可拖拽到上边的最大距离
@@ -744,8 +783,14 @@ function dragBox(domWrap,domDrag){
       if(dragY < 0){      //不能超出上边界
         dragY = 0
       }
-      if(width-dragX < wrap.offsetWidth){    //不能超出右边界
-        dragX = maxDragX
+      if(domDrag == 'dragTreatTitle'){
+        if(width-dragX-dragDesWidth < wrap.offsetWidth){    //不能超出右边界
+          dragX = maxDragX
+        }
+      }else{
+        if(width-dragX < wrap.offsetWidth){    //不能超出右边界
+          dragX = maxDragX
+        }
       }
       if(height-dragY < wrap.offsetHeight){     //不能超出下边界
         dragY = maxDragY
@@ -756,11 +801,12 @@ function dragBox(domWrap,domDrag){
       wrap.style.top = dragY + 'px'
     }
   },document)
-  windowEventHandler('mouseup',(event)=>{
-    if(isMove){ //有move就设置位置没有移动就不处理
-      wrap.style.left = dragX + 'px'
-      wrap.style.top = dragY + 'px'
-    }
+  windowEventHandler('mouseup',()=>{
+    // if(isMove){ //有move就设置位置没有移动就不处理
+      // console.log(dragX)
+      // wrap.style.left = dragX + 'px'
+      // wrap.style.top = dragY + 'px'
+    // }
     isDrag = false
     return false
   },document)