Pārlūkot izejas kodu

merge from 'optimize'

zhangxc 6 gadi atpakaļ
vecāks
revīzija
02739aad88

+ 9 - 8
src/common/components/Loading/index.jsx

@@ -5,9 +5,11 @@
  * text:显示在图标下的文字
  * img:自定义图标
  */
+import React, {Component} from 'react';
 /*import PropTypes from 'prop-types';*/
 import style from './index.less';
-import icon from './img/loading.gif';
+// import icon from './img/loading.gif';
+import icon from '@common/images/loading.gif';
 
 /*const propTypes = {
     text: PropTypes.string,
@@ -32,21 +34,20 @@ const defaultProps = {
 //     )
 // }
 
-const Loading = (props) =>{
-  const {text, img, show} = props;
+class Loading extends React.Component{
+    render(){
+        const {text,show} = this.props;
         return (
             <div className={style['loading']} style={{display: show ? 'block' : 'none'}}>
-                {this.props.shadeIsShow?<div className={style['cover']}/>:null}
+                {/*{this.props.shadeIsShow?<div className={style['cover']}/>:null}*/}
+                <div className={style['cover']}/>
                 <div className={style['info']}>
                     <img src={icon}/>
                     <p>{text}</p>
                 </div>
             </div>
         )
+    }
 }
 
-
-/*Loading.propTypes = propTypes;
-Loading.defaultProps = defaultProps;*/
-
 export default Loading;

+ 7 - 3
src/common/components/Loading/index.less

@@ -8,9 +8,9 @@
   .cover{
     width: 100%;
     height: 100%;
-    background: #333;
-    opacity: .6;
-    filter:alpha(opacity=60);
+    background: #000;
+    opacity: .4;
+    filter:alpha(opacity=40);
     -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(opacity=60);";
   }
   .info{
@@ -18,6 +18,10 @@
     top: 40%;
     left: 45%;//calc(50% - 50px);
     text-align: center;
+    img{
+      width: 40px;
+      height: 40px;
+    }
   }
   p{
     color: #fff;

+ 23 - 23
src/components/ChronicInfo/index.jsx

@@ -70,10 +70,10 @@ class ChronicInfo extends React.Component{
     });
   }
   
-  showTableList(id){//量表按钮
+  showTableList(name){//量表按钮
     const {getTableList} = this.props;
-    if(id){
-      getTableList(id);
+    if(name){
+      getTableList(name);
     }
   }
   close(){//关闭量表列表
@@ -126,11 +126,11 @@ class ChronicInfo extends React.Component{
     const {scaleInfo} = this.props;
     // 密西根糖尿病周围神经病评分(MDNS), id:40744
     const item = {
-      id:it.id,
+      id:it.conceptId,
       name:it.name
     };
     // 判断:store里已经有该量表就无需重新调接口
-    if(scaleInfo&&scaleInfo[it.id]){
+    if(scaleInfo&&scaleInfo[it.conceptId]){
       this.props.hideList({name:'showTable',value:true},it);
     }else{
       this.props.getScaleInfo(item);
@@ -214,7 +214,7 @@ class ChronicInfo extends React.Component{
   handleRadio(item,parent){//可能结果
     let {radioVal} = this.props;
     this.setState({
-      radioVal:Object.assign({},radioVal,{[parent.id]:item.detailName})
+      radioVal:Object.assign({},radioVal,{[parent.conceptId]:item.detailName})
     })
   }
   confirmOption(parent,pIndex){//可能结果确定
@@ -363,8 +363,8 @@ class ChronicInfo extends React.Component{
                         if(it.type==1){
                           return <p>
                                 <span className={style["listName"]}>
-                                  <i onClick={this.showTable.bind(this,it.content,v.id,i)}>{'【'+it.content.name+'】'}</i>
-                                  {formulaResult&&formulaResult[it.content.id]?<i>{'结果:'}{formulaResult[it.content.id].calcalculate&&formulaResult[it.content.id].calcalculate.result.value +' '+ formulaResult[it.content.id].calcalculate.result.text}</i>:''}
+                                  <i onClick={this.showTable.bind(this,it.content,v.conceptId,i)}>{'【'+it.content.name+'】'}</i>
+                                  {formulaResult&&formulaResult[it.content.conceptId]?<i>{'结果:'}{formulaResult[it.content.conceptId].calcalculate&&formulaResult[it.content.conceptId].calcalculate.result.value +' '+ formulaResult[it.content.conceptId].calcalculate.result.text}</i>:''}
                                 </span>
                                 {indexs[i]&&indexs[i].includes(j)?<span className={style["addResult"]}>
                                   <img src={added} />
@@ -376,22 +376,22 @@ class ChronicInfo extends React.Component{
                                 }
                               </p>
                         }else if(it.type==2){
-                          const cres = calcuResult&&calcuResult[v.id]||it.content.result;
+                          const cres = calcuResult&&calcuResult[v.conceptId]||it.content.result;
                           const result = cres&&cres[1]&&cres[1].text;
-                          const details = calcuValues&&calcuValues[v.id]||it.content.details;
+                          const details = calcuValues&&calcuValues[v.conceptId]||it.content.details;
                           return <div className={style["marTop"]}>
                             <span className={style["limit"]}>
                               计算公式结果:
-                              <i className={style["blue"]} onClick={this.showFormula.bind(this,v.id)}>{result?result:'请选择'}</i>
+                              <i className={style["blue"]} onClick={this.showFormula.bind(this,v.conceptId)}>{result?result:'请选择'}</i>
                               <img src={level1} />
                             </span>
                             {
                               this.getAddBtnState(result,v,i,j)
                             }
-                            {formulaId&&formulaId==v.id&&<MiniToast title={it.content.name}
+                            {formulaId&&formulaId==v.conceptId&&<MiniToast title={it.content.name}
                                 icon={allTableIcon}
                                 confirmText='关闭'
-                                show={formulaId&&formulaId==v.id?true:false}
+                                show={formulaId&&formulaId==v.conceptId?true:false}
                                 close={this.closeFormula.bind(this,it)}
                                 confirm={this.closeFormula.bind(this,it)}
                                 footer="true">
@@ -407,7 +407,7 @@ class ChronicInfo extends React.Component{
                                             return <div className={style["chooseItem"]}>
                                                     <Radio label={ii.detailName}
                                                              isSelect={ii.state == 1}
-                                                             handleClick={this.handleForRadio.bind(this,v.id,details,idd,ind)}>
+                                                             handleClick={this.handleForRadio.bind(this,v.conceptId,details,idd,ind)}>
                                                       </Radio>
                                                   </div>
                                           })}
@@ -419,7 +419,7 @@ class ChronicInfo extends React.Component{
                                           <span>{'请输入'+item.name+':'}</span>
                                         </td>
                                         <td>
-                                          <input type="text" placeholder="请输入"  value={item.value} onKeyDown={this.handleReg.bind(this)} onInput={this.handleInputformula.bind(this,v.id,details,idd)}/>
+                                          <input type="text" placeholder="请输入"  value={item.value} onKeyDown={this.handleReg.bind(this)} onInput={this.handleInputformula.bind(this,v.conceptId,details,idd)}/>
                                         </td>
                                         <td>
                                           <span>{item.uint}</span>
@@ -429,7 +429,7 @@ class ChronicInfo extends React.Component{
                                     }
                                 })}
                                 </table>
-                                <div className={style["forMulBtn"]} onClick={this.calcuFormula.bind(this,v.id,it)}>计算</div>
+                                <div className={style["forMulBtn"]} onClick={this.calcuFormula.bind(this,v.conceptId,it)}>计算</div>
                                 <table>
                                   {cres && Array.isArray(cres) &&cres.map((itemResult, resultIndex) => {
                                     return <tr>
@@ -449,15 +449,15 @@ class ChronicInfo extends React.Component{
                           return <div className={style["marTop"]}>
                             <span className={style["limit"]}>
                               可能结果:
-                              <i onClick={this.showOption.bind(this,v.id)} className={style["blue"]}>{possible[v.id]?possible[v.id]:'请选择'}</i>
+                              <i onClick={this.showOption.bind(this,v.conceptId)} className={style["blue"]}>{possible[v.conceptId]?possible[v.conceptId]:'请选择'}</i>
                               <img src={level1} />
                             </span>
                             {
-                              this.getAddBtnState(possible[v.id],v,i,j)
+                              this.getAddBtnState(possible[v.conceptId],v,i,j)
                             }
                             <MiniToast title='结果选择'
                                 icon={checkIcon}
-                                show={optionId&&optionId==v.id?true:false}
+                                show={optionId&&optionId==v.conceptId?true:false}
                                 close={this.closeOption}
                                 confirm={this.confirmOption.bind(this,v,i)}
                                 footer="true">
@@ -466,7 +466,7 @@ class ChronicInfo extends React.Component{
                                   {it.content.details&&it.content.details.map((lis,ind)=>{
                                     return <div className={style["chooseItem"]}>
                                       <Radio label={lis.detailName}
-                                               isSelect={radioVal[v.id]==lis.detailName}
+                                               isSelect={radioVal[v.conceptId]==lis.detailName}
                                                handleClick={this.handleRadio.bind(this,lis,v)}>
                                         </Radio>
                                         {lis.state==1?<span className={style['recomand']}>(智能推荐)</span>:''}
@@ -502,7 +502,7 @@ class ChronicInfo extends React.Component{
                   <span className={style["redTips"]}>(页面信息有更新可能影响评估结果)</span>
                 </div>
                 <div className={style["tips-btn"]} style={{display:chronicMagItem&&chronicMagItem.name||chronicDesease&&chronicDesease.name?'block':'none'}}>
-                  <span className={style["tipsDetails"]} onClick={() => this.showTableList(chronicDesease&&chronicDesease.id||chronicMagItem&&chronicMagItem.id)}>量表
+                  <span className={style["tipsDetails"]} onClick={() => this.showTableList(chronicDesease&&chronicDesease.name||chronicMagItem&&chronicMagItem.name)}>量表
                   </span>
                 </div>
               </div>
@@ -515,10 +515,10 @@ class ChronicInfo extends React.Component{
                           return <li>
                             <span className={style["scaleName"]}>
                               <i onClick={this.handleListClick.bind(this,v)}>{'【'+v.name+'】'}</i>
-                              {formulaResult&&formulaResult[v.id]?<i className={style['res']}>{'结果:'}{formulaResult[v.id].calcalculate&&formulaResult[v.id].calcalculate.result.value+' '+ (formulaResult[v.id].calcalculate.result.text?formulaResult[v.id].calcalculate.result.text:'')}</i>:''}
+                              {formulaResult&&formulaResult[v.conceptId]?<i className={style['res']}>{'结果:'}{formulaResult[v.conceptId].calcalculate&&formulaResult[v.conceptId].calcalculate.result.value+' '+ (formulaResult[v.conceptId].calcalculate.result.text?formulaResult[v.conceptId].calcalculate.result.text:'')}</i>:''}
                             </span>
                             {
-                              this.getAddBtnState(formulaResult&&formulaResult[v.id],v,i)
+                              this.getAddBtnState(formulaResult&&formulaResult[v.conceptId],v,i)
                             }
                           </li>
                         })}

+ 26 - 14
src/components/CommonSymptom/index.jsx

@@ -18,7 +18,8 @@ class CommonSymptom extends Component{
     this.state={
       select:[],
       ids:[],
-      hide:false
+      hide:false,
+      conceptId:[]
     }
     this.handleSelect = this.handleSelect.bind(this);
     this.handleClear = this.handleClear.bind(this);
@@ -31,29 +32,38 @@ class CommonSymptom extends Component{
 
   handleSelect(e,item){
     e.stopPropagation();
-    let {select,ids} = this.state;
+    let {select,ids,conceptId} = this.state;
     const id = item.questionId
-    if(ids.includes(id)){
-      ids.splice(ids.indexOf(id),1);
+    const copid = item.conceptId
+    if(conceptId.includes(copid)){
+      conceptId.splice(conceptId.indexOf(copid),1);
+      if(ids.includes(id)){
+        ids.splice(ids.indexOf(id),1);
+      }
       let selectData = select;  
       select.forEach((it,i)=>{
-        if(it.questionId==id){
+        if(it.conceptId==copid){
          selectData.splice(i,1); 
         }
       })
       select = selectData; 
     }else{
-      ids.push(id);
+      // ids.push(id); //questionId可能没有
+      if(id){
+        ids.push(id);
+      }
+      conceptId.push(copid);
       select.push(item);
     }
     this.setState({
       select,
-      ids
+      ids,
+      conceptId
     })
   }
   getStyle(id){
-    const {ids} = this.state;
-    if(ids.includes(id)){
+    const {conceptId} = this.state;
+    if(conceptId.includes(id)){
       return style['selected'];
     }
     return '';
@@ -62,14 +72,15 @@ class CommonSymptom extends Component{
     e.stopPropagation();
     this.setState({
       select:[],
-      ids:[]
+      ids:[],
+      conceptId:[]
     })
   }
   handleConfirm(e){
     e.stopPropagation();
     const {onSelect} = this.props;
-    const {select,ids} = this.state;
-    onSelect&&onSelect({select,ids});
+    const {select,ids,conceptId} = this.state;
+    onSelect&&onSelect({select,ids,conceptId});
   }
 
   componentDidMount(){
@@ -82,7 +93,8 @@ class CommonSymptom extends Component{
         this.setState({
           hide:true,
           select:[],
-          ids:[]
+          ids:[],
+          conceptId:[]
         })
       }else{
         this.setState({
@@ -98,7 +110,7 @@ class CommonSymptom extends Component{
     return <div className={this.getClass()} contenteditable="false" id="symptBox" style={{'display':hide?'none':'block'}}>
       <ul className={style["listBox"]} id="listBox">
         {data&&data.map((it)=>{
-          return <li onClick={(e)=>this.handleSelect(e,it)} className={this.getStyle(it.questionId)} title={it.name.length>5?it.name:''}>{it.name.length>5?it.name.slice(0,4)+'...':it.name}</li>
+          return <li onClick={(e)=>this.handleSelect(e,it)} className={this.getStyle(it.conceptId)} title={it.name.length>5?it.name:''}>{it.name.length>5?it.name.slice(0,4)+'...':it.name}</li>
         })}
       </ul>
       <div className={style['oper']} id="oper">

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

@@ -38,7 +38,7 @@ class CurrentIll extends Component{
 
   handleFocus(e){
     // 判断主诉是否为空
-    const {mainData,mainText,setData,moduleNum,mainIds,data,changeEditIll,editClear,symptomFeature,isChronic} = this.props;
+    const {mainData,mainText,setData,moduleNum,mainIds,mainTailIds,data,changeEditIll,editClear,symptomFeature,isChronic} = this.props;
     const that = this;
     const ev = e || window.event;
     const text = ev.target.innerText || ev.target.innerHTML;
@@ -55,7 +55,7 @@ class CurrentIll extends Component{
       if(data.length==0 && !isChronic || !isChronic.name ){
         clearTimeout(setDataTimer);
         setDataTimer = setTimeout(function(){//延时,等待主诉失焦数据返回
-            setData && setData({num,mainData,mainIds,symptomFeature:symptomFeature.featureData,isChronic});   
+            setData && setData({num,mainData,mainIds,symptomFeature:symptomFeature.featureData,isChronic,mainTailIds});   
         },200)  
         this.setState({
           setDataTimer
@@ -103,9 +103,9 @@ class CurrentIll extends Component{
   }
 
   handleSearchSelect(obj){
-    const {questionId,name} = obj;
+    const {questionId,name,conceptId} = obj;
     const {fetchModules,focusIndex,span} = this.props;
-    fetchModules&&fetchModules({id:questionId,index:focusIndex,name,span});
+    fetchModules&&fetchModules({id:questionId,index:focusIndex,name,span,conceptId});
   }
 
   getInlineTag(){  

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

@@ -124,7 +124,7 @@ class DiagnosticItem extends Component{
         const { visible,hasEnterItem,hasEnterImg } = this.state
         const { item, title, type } = this.props
         return (<span className={style['diag-item']} >
-                    <span className={style['diag-name']} 
+                    <span className={`${style['diag-name']} ${type == 'search' ? style['diag-name-search'] : ''}`} 
                           title = {title && item.name + (item.showType === 2 || item.showType === 3 ? '('+ item.retrievalName+')': '')}
                           onMouseEnter={this.handleMouseEnterDrug.bind(this)}
                           onMouseLeave = {this.handleMouseLeaveDrug.bind(this)}

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

@@ -9,6 +9,11 @@
     display: inline-block;
     width: 100%;
 }
+.diag-name-search {
+    overflow: hidden;
+    text-overflow: ellipsis;
+    white-space: nowrap;
+}
 .diag-name {
     position: relative;
     display: inline-block;

+ 5 - 4
src/components/DiagnosticList/index.jsx

@@ -5,7 +5,7 @@ import del_on from './img/delete-on.png'
 import diagUp from './img/diagUp.png'
 import diagDown from './img/diagDown.png'
 import manageIcon from '@common/images/manage.png';
-import {ConfirmModal, Message,ComplexModal,Footer} from '@commonComp';
+import {ConfirmModal, Message,ComplexModal,Footer,Loading} from '@commonComp';
 import Notify from '@commonComp/Notify';
 import Treat from '@containers/Treat'
 import store from '@store';
@@ -186,7 +186,7 @@ class DiagnosticList extends Component {
         return (<div className={style['history-info']}>
             {items.map((item, index) => {
                 return<div onClick={this.handleQuoteClick.bind(this, item, index)} style={this.state.activeHistory === index ? {color: '#3B9ED0'} : ''}>
-                    <img src={this.state.activeHistory === index ? iconRadioActive : iconRadioDefault}/>{item.diagnose + '(' + item.inquiryDate + ')'}
+                    <img src={this.state.activeHistory === index ? iconRadioActive : iconRadioDefault}/>{item.diagnose} {item.inquiryDate}{item.sign==0?'(智能模式)':'(文本模式)'}
                 </div>
             })}
         </div>)
@@ -245,7 +245,7 @@ class DiagnosticList extends Component {
       })
     }
     render(){
-        const { list, treatment, showReferRecord, showHistoryCase ,chronicMagItem} = this.props;
+        const { list, treatment, showReferRecord, showHistoryCase ,chronicMagItem,loading} = this.props;
         const { visible, treatTitle ,showAssess, isAssessConfirm, radioVal, possible,assessId,disName, hasOndel} = this.state;
         const chronicList = JSON.parse(localStorage.getItem('chronic')||null);
         const chronicLine = chronicMagItem&&chronicMagItem.name;     //当前是否走的慢病流程
@@ -294,7 +294,7 @@ class DiagnosticList extends Component {
                                      isAssessConfirm={isAssessConfirm}
                                      ></AssessResult>
                       </ComplexModal>:''}
-                    <ConfirmModal visible={visible}
+                    <ConfirmModal visible={visible} 
                                   okText='删除' 
                                   cancelText='取消' 
                                   confirm={this.deleteItem}  
@@ -310,6 +310,7 @@ class DiagnosticList extends Component {
                         {this.getHistoryCase()}
                         <div className={style['confirm-history']}><span className={style['confirm-history-btn']} onClick={this.referCase}>确定</span></div>
                     </ConfirmModal>
+                    <Loading show={loading}/>
                 </div>
                
         )

+ 11 - 6
src/components/InfoTitle/index.jsx

@@ -9,8 +9,9 @@ import { showHistory } from '@store/actions/historyTemplates';
 import { initItemList,setInitHistory } from '@store/async-actions/historyTemplates';
 import HistoryCases from '@containers/HistoryCases';
 import $ from 'jquery';
-import Notify from '@commonComp/Notify';
-import {MODI_LOADING} from '@store/types/homePage.js';
+import {Notify,Loading} from '@commonComp';
+// import {MODI_LOADING} from '@store/types/homePage.js';
+import {SHOW_LOADING} from '@store/types/copyRight.js';
 class InfoTitle extends Component {
     constructor(props){
         super(props);
@@ -49,7 +50,7 @@ class InfoTitle extends Component {
         }
     }
     render() {
-        const {disVisible,copyVisible,winWidth} = this.props;
+        const {disVisible,copyVisible,winWidth,loading} = this.props;
         const {le} = this.state;
         return <div className={style['title-wrapper']} style={{zIndex:disVisible||copyVisible?40:204,left:le}}>
             <PatInfoContainer sizeFlag={winWidth <= 1065?true:false}/>
@@ -60,6 +61,7 @@ class InfoTitle extends Component {
                 <span><img src={health} />&nbsp;健康档案</span>
             </div>
             <HistoryCases></HistoryCases>
+            <Loading show={loading}/>
         </div>;
     }
 }
@@ -67,17 +69,20 @@ function mapStateToProps(state) {
   return {
     disVisible: state.copyRight.disVisible,
     copyVisible:state.copyRight.copyVisible,
-    winWidth:state.homePage.windowWidth
+    winWidth:state.homePage.windowWidth,
+    loading:state.copyRight.loading,
   }
 }
 
 function mapDispatchToProps(dispatch){
     return{
         showLoading(){
-            dispatch({type:MODI_LOADING,flag:true});
+            // dispatch({type:MODI_LOADING,flag:true});
+            dispatch({type:SHOW_LOADING,flag:true});
         },
         hideLoading(){
-            dispatch({type:MODI_LOADING,flag:false});
+            // dispatch({type:MODI_LOADING,flag:false});
+            dispatch({type:SHOW_LOADING,flag:false});
         }
     }
 }

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

@@ -191,7 +191,7 @@ class ScaleTable extends React.Component{
   componentDidMount(){
     const {tableId,scaleInfo} = this.props;
     if(scaleInfo&&scaleInfo[tableId]){
-      let scale = this.filterScale(scaleInfo[tableId]);console.log(22,JSON.parse(scale.content));
+      let scale = this.filterScale(scaleInfo[tableId]);
       this.setState({
         // valueData:JSON.parse(scaleInfo[tableId][1].content)
         valueData:scale.content?JSON.parse(scale.content):{}
@@ -230,7 +230,7 @@ class ScaleTable extends React.Component{
     let {selecteds,valueData,start,scaleResult1} = this.state;
     const {tableId,formulaResult} = this.props;
     const scaleResult = scaleResult1 || formulaResult&&formulaResult[tableId]; //量表计算结果
-    const datas = valueData&&valueData.group?valueData:'';console.log(666,datas);
+    const datas = valueData&&valueData.group?valueData:'';//console.log(666,datas);
     let content =  datas&&datas.group&&datas.group.map((v,i)=>{
                 return <div className={style['group']}>
                   <p className={style['groupName']}>{v.groupName}</p>

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

@@ -304,9 +304,11 @@ class SpreadDrop extends Component{
         nones += name+'、';
         noneIds.push(id);
       }else if(nowOn=='with'){
-        withs.push({id:id,name:name,questionId:item.questionId});
+        // withs.push({id:id,name:name,questionId:item.questionId});
+        withs.push({id:id,name:name,questionId:item.questionId,conceptId:item.conceptId});
       }else{
-        exists.push({id:id,name:name,listIndex,questionId:item.questionId});
+        // exists.push({id:id,name:name,listIndex,questionId:item.questionId});
+        exists.push({id:id,name:name,listIndex,questionId:item.questionId,conceptId:item.conceptId});
       }
     }
     this.setState({

+ 2 - 2
src/containers/ChronicInfo.js

@@ -32,8 +32,8 @@ function mapStateToProps(state){
 
 function mapDispatchToProps(dispatch){
   return {
-    getTableList(id){
-      dispatch(getTableList(id))
+    getTableList(name){
+      dispatch(getTableList(name))
       // dispatch({type:SHOW_TABLE_LIST})
     },
     hideList(param,item){

+ 8 - 5
src/containers/CurrentIll.js

@@ -28,6 +28,7 @@ function mapStateToProps(state) { //console.log(111,state);
         moduleNum:mainSuit.moduleNum,//主诉使用的模板
         type: state.typeConfig.typeConfig,
         mainIds:mainSuit.mainIds,//主诉症状选中的id(去重用)
+        mainTailIds:mainSuit.mainTailIds,//主诉症状选中的id(去重用)
         showArr:homePage.showDrop,
         totalHide: homePage.totalHide,
         saveText:currentIll.saveText,
@@ -66,9 +67,10 @@ function mapDispatchToProps(dispatch) {
         })
        },
        async setData(info){//设置现病史使用模板
-        let idsArr = info.mainIds;
-        let ids = idsArr.join(",");
-        let labelModule = await getModules(ids);
+        // let idsArr = info.mainIds;
+        let idsArr = info.mainTailIds.filter((it,i)=>{return it});
+        // let ids = idsArr.join(",");
+        let labelModule = await getModules(idsArr);
         if(labelModule.data.code==0){//根据id获取标签模板
           dispatch({
             type:SET_LABEL_MODULE,
@@ -101,7 +103,7 @@ function mapDispatchToProps(dispatch) {
         })
       },
         fetchModules(param){
-            const {id,name,index,span} = param;
+            const {id,name,index,span,conceptId} = param;
             getModule(id).then((res)=>{
                 if(res.data.code=='0'){
                   dispatch({
@@ -110,7 +112,8 @@ function mapDispatchToProps(dispatch) {
                       name,
                       data: res.data.data,
                       span,
-                      isReplace:false
+                      isReplace:false,
+                      conceptId
                   })
                   dispatch({
                     type:ISREAD

+ 4 - 2
src/containers/DiagnosticList.js

@@ -1,7 +1,7 @@
 import React from 'react';
 import { connect } from 'react-redux';
 import DiagnosticList from '@components/DiagnosticList';
-import { ADD_DIAGNOSTIC,  DEL_DIAGNOSTIC, UP_DIAGNOSTIC, DOWN_DIAGNOSTIC, GET_DIAGNOSTIC_STR, GET_IS_FIRST, HIDE_REFER_RECORD, SHOW_HISTORY_CASE,HIDE_HISTORY_CASE } from '@store/types/diagnosticList'; 
+import { ADD_DIAGNOSTIC,  DEL_DIAGNOSTIC, UP_DIAGNOSTIC, DOWN_DIAGNOSTIC, GET_DIAGNOSTIC_STR, GET_IS_FIRST, HIDE_REFER_RECORD, SHOW_HISTORY_CASE,HIDE_HISTORY_CASE ,SHOW_LOADING} from '@store/types/diagnosticList'; 
 import { getTreatResult } from '@store/async-actions/treat';
 import { SHOW_TREAT, DEL_REACT, DEL_FOLLOW_UP } from '@store/types/treat.js';
 import {billing, getConceptDetail} from '../store/async-actions/pushMessage';
@@ -28,6 +28,7 @@ function mapStateToProps(state) {
         wholeResults:assessResult.wholeResults,
         scaleInfo: pushMessage.scaleInfo,//量表内容
         showHide: pushMessage.showHide,
+        loading: diagnosticList.loading,
     }
 }
 
@@ -81,7 +82,8 @@ function mapDispatchToProps(dispatch) {
             })
         },
         getTreatResult: (item) => {
-            dispatch({type:MODI_LOADING,flag:true});
+            // dispatch({type:MODI_LOADING,flag:true});
+            dispatch({type:SHOW_LOADING,flag:true});
             dispatch(getTreatResult(item));
         },
         getTips: (item) => {

+ 5 - 5
src/containers/EditableSpan.js

@@ -6,9 +6,8 @@ import {SETOTHERTEXT,SETOTHERSEARCHDATA,OTHER_FOCUS_INDEX,OTHERHIS_CLEAR,DEL_OTH
 import {SET_CURRENT_SEARCH,CURRENT_CLEAR,SETCURRENTTEXT,CURRENT_FOCUS_INDEX,DEL_CURRENT,REMOVE_CURR_ID,DEL_CURRENT_LABLE} from '@types/currentIll';
 import {getSearch} from '@store/async-actions/fetchModules.js';
 import {billing} from '@store/async-actions/pushMessage';
-import {didPushParamChange} from '@utils/tools.js';
-import {SETTEXTFOCUS,SEARCH_DROP_LOCATION} from '@types/homePage';
-import {RESET,SETDROPSHOW,ISREAD} from "@store/types/homePage";
+import {didPushParamChange,storageLocal} from '@utils/tools.js';
+import {SETTEXTFOCUS,SEARCH_DROP_LOCATION,RESET,SETDROPSHOW,ISREAD} from '@types/homePage';
 import config from '@config/index.js';
 
 function mapStateToProps(state){//console.log(state)
@@ -179,13 +178,14 @@ function mapDispatchToProps(dispatch,state) {
           break;
       }
       //右侧推送
-      clearTimeout(timer);
+      clearTimeout(storageLocal.get('delayTimer'));
       let timer = setTimeout(function(){      //延迟待确定后的数据更新后推送,避免获取的参数还是旧的
         if(didPushParamChange()){     //操作后内容有变化才推送
           dispatch(billing('',obj.boxMark));
-          clearTimeout(timer);
+          clearTimeout(storageLocal.get('delayTimer'));
         }
       },config.delayPushTime);
+      storageLocal.set('delayTimer',timer);
     },
     handleSearch(obj){
       switch (+obj.boxMark){

+ 6 - 3
src/containers/SpreadDrop.js

@@ -144,7 +144,8 @@ function currentIll(dispatch,store,params){
   let ikey = getLabelIndex(index);
   let existsId = exists && exists.length>0?getIds(exists):[];
   let withsId = withs && withs.length>0?getIds(withs):[];
-  const ids = (existsId.concat(withsId)).join(",");
+  // const ids = (existsId.concat(withsId)).join(",");
+  const ids = existsId.concat(withsId);
   let has = [],wes=[];
   //获取选中项目模板
   fetchModules(ids).then((res)=>{
@@ -196,7 +197,8 @@ function otherHisConfirm(dispatch,store,params){
   }
   let existsId = getIds(exists);
   let withsId = getIds(withs);
-  const ids = existsId.length>0?existsId.join(",")+','+withsId.join(","):withsId.join(",");
+  // const ids = existsId.length>0?existsId.join(",")+','+withsId.join(","):withsId.join(",");
+  const ids = existsId.concat(withsId);console.log(555,ids)
   if(!ids&&nones){      //只有无的项目
     dispatch({
       type: CONFIRMSELECTED,
@@ -244,7 +246,8 @@ function checkBodyConfirm(dispatch,store,params){
   }
   let existsId = getIds(exists);
   let withsId = getIds(withs);
-  const ids = existsId.join(",")+','+withsId.join(",");
+  // const ids = existsId.join(",")+','+withsId.join(",");
+  const ids = existsId.concat(withsId);
   if(!ids&&nones){      //只有无的项目
     dispatch({
       type: CHECKCONFIRMSELECTED,

+ 14 - 5
src/store/actions/currentIll.js

@@ -346,9 +346,18 @@ export const confirm = (state,action) =>{
   let length1 = res.data.length;
   let arr = JSON.parse(JSON.stringify(res.data));
   const {nones,exists,withs,ikey,exclusion,excluName,ban,noneIds} = action.data;
-  let existsId = exists && exists.length>0?getIds(exists):[];
+  /*let existsId = exists && exists.length>0?getIds(exists):[];
   let withsId = withs && withs.length>0?getIds(withs):[];
-  res.symptomIds = res.symptomIds.concat(existsId,withsId,noneIds);//搜索去重
+  res.symptomIds = res.symptomIds.concat(existsId,withsId,noneIds);//搜索去重*/
+  let existConpId = [];
+  let withConpId = [];
+  exists.map((v,i)=>{
+    existConpId.push(v.conceptId);
+  })
+  withs.map((v,i)=>{
+    withConpId.push(v.conceptId);
+  })
+  res.symptomIds = res.symptomIds.concat(existConpId,withConpId,noneIds);//搜索去重
   // 伴 标签
   const banText = JSON.stringify(ban)=='{}'?'':{id:ban.id,name:ban.name,value:ban.name,tagType:config.tagType};
 
@@ -658,7 +667,6 @@ export const clearCurrentIll = (state,action)=>{
   res.saveText = action.saveText;
   res.selecteds = action.selecteds?action.selecteds:[];
   res.symptomIds = action.symptomIds;
-  res.symptomIds = action.symptomIds;
   if(action.editClear){
     res.editClear = action.editClear;
   }
@@ -716,7 +724,7 @@ export function setCheckText(state,action) {
 //搜索 插入标签数据
 export function insertLabelData(state,action){
   let res = Object.assign({},state); 
-  const {index,data,isReplace,span}=action;
+  const {index,data,isReplace,span,conceptId}=action;
   let id = data.id;
   let searchData = action.name;
   // res.symptomIds.push(id);
@@ -750,7 +758,8 @@ export function insertLabelData(state,action){
     const value = innerText.replace(searchStr,"");
     const pText = Object.assign({},textEmpty,{value:value});
     if(data.itemType==0){//症状
-      res.symptomIds.push(id);
+      // res.symptomIds.push(id);
+      res.symptomIds.push(conceptId);
       // 没有伴展开主诉symptomType=0/1的尾巴,有伴一>第一个点选上去的伴为依据,伴前展开主诉,伴后展开伴随;多余的伴以及手动输入的伴不做处理(2-25)
       if(banIdx==-1){
 

+ 51 - 23
src/store/actions/mainSuit.js

@@ -131,6 +131,7 @@ export const insertMain = (state,action) => {
   const res = Object.assign({},state);
   const items = action.item.select;
   const id = action.item.ids;
+  const conceptId = action.item.conceptId;
   let data = JSON.parse(JSON.stringify(res.moduleData));
   if(items.length>1){
     for(let i=1; i<items.length; i++){
@@ -140,7 +141,7 @@ export const insertMain = (state,action) => {
   }
   let obj = [];
   for(let i=0; i<items.length; i++){
-    obj.push({id:items[i].questionId,name:items[i].name,value:items[i].name,tagType:config.tagType,exist:1});
+    obj.push({id:items[i].questionId,name:items[i].name,value:items[i].name,tagType:config.tagType,exist:1,conceptId:items[i].conceptId});
   }
   let inserIndx = null;
   data.map((it,i)=>{
@@ -160,17 +161,17 @@ export const insertMain = (state,action) => {
   res.saveText = [];//将手动输入的值清掉
   // res.saveText[inserIndx] = text.name;
   res.saveText = fullfillText(res.data).saveText;
-  // res.mainIds.push(id);
-  res.mainIds = res.mainIds.concat(id);
+  res.mainIds = res.mainIds.concat(conceptId);
+  res.mainTailIds = res.mainTailIds.concat(id);
   res.editClear = false;//主诉框编辑状态
   res.update=Math.random();
   return res;
 }
 
 
-function getTextLabel(id,name,flag){
+function getTextLabel(id,name,flag,copid){
   // exist 主症状1,伴随2
-  return {id:id,name:name,value:name,tagType:config.tagType,exist:flag};
+  return {id:id,name:name,value:name,tagType:config.tagType,exist:flag,conceptId:copid};
 }
 
 function addPoint(data,num){//给伴随添加顿号
@@ -188,12 +189,21 @@ export const confirm = (state,action) =>{
   const {exists,withs,ikey,withsName,existsName,ban} = action.data;
   let banText = JSON.stringify(ban) == "{}" ? '':{id:ban.id,name:ban.name,value:ban.name,tagType:config.tagType};
   let length = exists.length;
+  let existConpId = [];
+  let withConpId = [];
+  exists.map((v,i)=>{
+    existConpId.push(v.conceptId);
+  })
+  withs.map((v,i)=>{
+    withConpId.push(v.conceptId);
+  })
   let labelIndx = parseInt(ikey);//当前点击标签的index
   // 取第一个添加症状的主症状和伴随
   if(!arr[labelIndx].pos){
     let existsId = getIds(exists);
     let withsId = getIds(withs);
-    res.mainIds = res.mainIds?res.mainIds.concat(existsId,withsId):[];
+    res.mainIds = res.mainIds?res.mainIds.concat(existConpId,withConpId):[];
+    res.mainTailIds = res.mainTailIds?res.mainTailIds.concat(existsId,withsId):[];
   }
 
   // 第二病程-伴位置处理
@@ -217,7 +227,7 @@ export const confirm = (state,action) =>{
         let withsAddP = addPoint(exists,1);
         for(let i=0; i<withsAddP.length; i++){
           let pos = labelIndx + i;
-          arr.splice(pos,0,getTextLabel(withsAddP[i].id,withsAddP[i].name,1));
+          arr.splice(pos,0,getTextLabel(withsAddP[i].id,withsAddP[i].name,1,withsAddP[i].conceptId));
           res.saveText[pos] = withsAddP[i].name;
         }
       }
@@ -229,7 +239,7 @@ export const confirm = (state,action) =>{
        }
        for(let j=0; j<newWiths.length; j++){
         let withsPos = labelIndx +length + j;
-        arr.splice(withsPos,0,getTextLabel(newWiths[j].id,newWiths[j].name,2));
+        arr.splice(withsPos,0,getTextLabel(newWiths[j].id,newWiths[j].name,2,newWiths[j].conceptId));
         res.saveText[withsPos] = newWiths[j].name;
       }
     }
@@ -248,7 +258,7 @@ export const confirm = (state,action) =>{
         existsAddP = addPoint(exists,startInd);
         for(let i=0; i<existsAddP.length; i++){
           let pos = forwardId + index + i;
-          arr.splice(pos,0,getTextLabel(existsAddP[i].id,existsAddP[i].name,1));
+          arr.splice(pos,0,getTextLabel(existsAddP[i].id,existsAddP[i].name,1,existsAddP[i].conceptId));
           res.saveText[pos] = existsAddP[i].name;
         }
       }
@@ -257,7 +267,7 @@ export const confirm = (state,action) =>{
         let withsAddP = addPoint(withs,0);     
         for(let j=0; j<withsAddP.length; j++){
           let withsPos = labelIndx +length + j;
-          arr.splice(withsPos,0,getTextLabel(withsAddP[j].id,withsAddP[j].name,2));
+          arr.splice(withsPos,0,getTextLabel(withsAddP[j].id,withsAddP[j].name,2,withsAddP[j].conceptId));
           res.saveText[withsPos] = withsAddP[j].name;
         }
       }
@@ -269,7 +279,7 @@ export const confirm = (state,action) =>{
       if(exists.length > 0){
         for(let i=0; i<exists.length; i++){
           let pos = labelIndx + i;
-          arr.splice(pos,0,getTextLabel(exists[i].id,'、'+exists[i].name,1));
+          arr.splice(pos,0,getTextLabel(exists[i].id,'、'+exists[i].name,1,exists[i].conceptId));
           res.saveText[pos] = exists[i].name;
         }
       }
@@ -281,7 +291,7 @@ export const confirm = (state,action) =>{
        }
        for(let j=0; j<newWiths.length; j++){
         let withsPos = labelIndx +length + j;
-        arr.splice(withsPos,0,getTextLabel(newWiths[j].id,newWiths[j].name,2));
+        arr.splice(withsPos,0,getTextLabel(newWiths[j].id,newWiths[j].name,2,newWiths[j].conceptId));
         res.saveText[withsPos] = newWiths[j].name;
       }
     }
@@ -289,7 +299,7 @@ export const confirm = (state,action) =>{
       if(exists.length > 0){
         for(let i=0; i<exists.length; i++){
           let pos = index + i;
-          arr.splice(pos,0,getTextLabel(exists[i].id,'、'+exists[i].name,1));
+          arr.splice(pos,0,getTextLabel(exists[i].id,'、'+exists[i].name,1,exists[i].conceptId));
           res.saveText[pos] = exists[i].name;
         }
       }
@@ -298,7 +308,7 @@ export const confirm = (state,action) =>{
         let withsAddP = addPoint(withs,0);     
         for(let j=0; j<withsAddP.length; j++){
           let withsPos = labelIndx +length + j;
-          arr.splice(withsPos,0,getTextLabel(withsAddP[j].id,withsAddP[j].name,2));
+          arr.splice(withsPos,0,getTextLabel(withsAddP[j].id,withsAddP[j].name,2,withsAddP[j].conceptId));
           res.saveText[withsPos] = withsAddP[j].name;
         }
       }
@@ -345,10 +355,11 @@ export const insertSearch = (state,action)=>{
   let data = res.data;
   let moduleData = JSON.parse(JSON.stringify(res.moduleData));
   let searchData = action.info.name;
-  const id = action.info.questionId;
+  const id = action.info.questionId;//获取尾巴id
+  const ids = action.info.conceptId;//去重id
   let focusIndex = res.focusIndex;
   let span = action.span;
-  let text = {id:id,name:searchData,value:searchData,tagType:config.tagType};
+  let text = {id:id,name:searchData,value:searchData,tagType:config.tagType,conceptId:ids};
   const emptySpan = JSON.parse(config.textLabel);
   if(data.length==0){   
     let inserIndx = null;
@@ -360,14 +371,17 @@ export const insertSearch = (state,action)=>{
     // flag=1前是文本标签就替换,否则插入
     const iftext = inserIndx&&moduleData[inserIndx-1]&&moduleData[inserIndx-1].tagType;
     if(iftext==config.tagType){
-       moduleData.splice(inserIndx-1,1,{id:id,name:searchData,value:searchData,tagType:config.tagType,exist:1});
+       moduleData.splice(inserIndx-1,1,{id:id,name:searchData,value:searchData,tagType:config.tagType,exist:1,conceptId:ids});
      }else{
-       moduleData.splice(inserIndx,0,{id:id,name:searchData,value:searchData,tagType:config.tagType,exist:1});
+       moduleData.splice(inserIndx,0,{id:id,name:searchData,value:searchData,tagType:config.tagType,exist:1,conceptId:ids});
      }  
     res.saveText = [];//将手动输入的值清掉
     res.data = moduleData;
     res.saveText = fullfillText(res.data).saveText;
-    res.mainIds.push(id);
+    res.mainIds.push(ids);
+    if(id){
+      res.mainTailIds.push(id);
+    }
     res.editClear = false;//主诉框编辑状态
   }else{
     /*******************第一病程搜索结果也移植到现病史修改(2-18)********************/
@@ -411,7 +425,10 @@ export const insertSearch = (state,action)=>{
       res.data[focusIndex].value = value;
     }
     span.current.innerText?(span.current.innerText = value):(span.current.innerHTML=value);
-    res.mainIds.push(id);
+    res.mainIds.push(ids);
+    if(id){
+      res.mainTailIds.push(id);
+    }
   }
   res.update=Math.random();
   return res;
@@ -644,6 +661,7 @@ export const clearMainSuit = (state,action)=>{//回读和清除
   // res.saveText = fullfillText(action.data).saveText;//解决删除data里的值保存,回读后页面上有内容saveText里没有的情况
   res.selecteds = action.selecteds?action.selecteds:[];
   res.mainIds = action.mainIds;
+  res.mainTailIds = action.mainTailIds || [];
   res.chronicDesease = action.chronicDesease;//慢病疾病字段
   if(action.editClear){
     res.editClear = action.editClear;
@@ -747,10 +765,17 @@ export function removeId(state,action){
   let res = Object.assign({},state);
   const {index,text} = action;
   const data = res.data;
+  // 获取尾巴id-questionId
   const id = data[index].id;
+  let tailIds = res.mainTailIds;
+  if(tailIds.includes(id)){
+    tailIds.splice(tailIds.indexOf(id),1);
+  }
+  // 去重id
+  const copid = data[index].conceptId;
   let ids = res.mainIds;
-  if(ids.includes(id)){
-    ids.splice(ids.indexOf(id),1);
+  if(ids.includes(copid)){
+    ids.splice(ids.indexOf(copid),1);
   }
   if(!data[index].value && data[index-1].tagType==8){
     data.splice(index,1);
@@ -799,7 +824,10 @@ export function getSymptomFeature(state,action){
   if(data && data.length>0){
     for(let i=0; i<data.length; i++){
       data[i].tagType = '8';
-      res.mainIds.push(data[i].id);
+      res.mainIds.push(data[i].conceptId);
+      if(data[i].id){//questionId有可能为null
+        res.mainTailIds.push(data[i].id);
+      } 
     }
     res.symptomFeature.featureData = data;
     res.symptomFeature.refresh = !res.symptomFeature.refresh;

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

@@ -2,7 +2,7 @@ import axios from '@utils/ajax';
 import store from '@store';
 import { searchList } from '../actions/assistCheck';
 import { SET_TIPS } from '../types/pushMessage';
-
+import { Notify} from '@commonComp';
 
 export const getSearchList = (val) => {
     if(val.trim() == ''){

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

@@ -44,7 +44,7 @@ export const isChronicMag = (item) => {
                  getChronic().then(() =>{
                     chronicList = JSON.parse(storageLocal.get('chronic'));
                     for(let i=0; i<chronicList.length; i++){
-                        if(chronicList[i].id==item.id&&chronicList[i].name==item.name){
+                        if(chronicList[i].conceptId==item.conceptId&&chronicList[i].name==item.name){
                             //弹窗提示 “是否引用往期病例”?--往期病例接口、弹窗、引用
                             // 是--引用   否--走慢病流程
                             dispatch({
@@ -65,7 +65,7 @@ export const isChronicMag = (item) => {
                  });
              } else {
                 for(let i=0; i<chronicList.length; i++){
-                    if(chronicList[i].id==item.id&&chronicList[i].name==item.name){
+                    if(chronicList[i].conceptId==item.conceptId&&chronicList[i].name==item.name){
                         //弹窗提示 “是否引用往期病例”?--往期病例接口、弹窗、引用
                         // 是--引用   否--走慢病流程
                         dispatch({

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

@@ -12,7 +12,8 @@ import {CURRENT_CHRONIC} from '@store/types/currentIll';
 import {MODI_LOADING} from '@store/types/homePage.js';
 
 const api={
-  getSpreadModule:'/questionInfo/getByIds',
+  // getSpreadModule:'/questionInfo/getByIds',
+  getSpreadModule:'/questionInfo/getByIds2',//优化
   getModule:'/questionInfo/getById',
   searchURL: '/retrieval/getTagInfos',
   getOtherHisRecord: '/inquiryInfo/getLastOther',
@@ -182,7 +183,7 @@ export function pregetCheckbodyData(flag){     //flag=true获取到数据后立
 export function getInitData(){
   return (dispatch,getStore)=>{
     const state =  getStore();
-    const preData = [...state.checkBody.preData];
+    const preData = [...state.checkBody.preData||[]];
     if(!preData||preData.length==0){
       dispatch(pregetCheckbodyData(true));
     }

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

@@ -34,7 +34,7 @@ export const getInitModules= (dispatch,getStore)=>{
   const chronicMagItem = state.diagnosticList.chronicMagItem;//诊断入口
   // const chronicId = chronicMagItem?chronicMagItem.id:'';
   const chronicDesease = state.mainSuit.chronicDesease; //主诉入口
-  const chronicId = chronicDesease&&chronicDesease.id||chronicMagItem&&chronicMagItem.id||'';
+  const chronicId = chronicDesease&&chronicDesease.id||chronicMagItem&&chronicMagItem.conceptId||'';
   const param = {
     age:message.patientAge,
     sexType:message.sex,

+ 1 - 0
src/store/async-actions/inspect.js

@@ -3,6 +3,7 @@ import store from '@store';
 
 import { searchList,resetLabel } from '../actions/inspect';
 import { SET_TIPS } from '../types/pushMessage';
+import { Notify} from '@commonComp';
 
 export const getSearchList = (val) => {
     if(val.trim() == ''){

+ 16 - 8
src/store/async-actions/pushMessage.js

@@ -2,7 +2,7 @@ import { get, post, json } from "@utils/ajax";
 import { BILLING_ADVICE, SET_TIPS, SET_TIPS_DETAILS ,SET_CHRONIC_TABLELIST,SET_SCALE_INFO,SET_CHRONIC_PUSHS,SHOW_TABLE_LIST} from '../types/pushMessage';
 import { SET_CLICK_DIAG } from '../types/diagnosticList';
 import {storageLocal,getEMRParams} from '@utils/tools';
-import {SET_IMPORT_CHECKBODY_LABEL} from "../types/checkBody";
+import {SET_IMPORT_CHECKBODY_LABEL,PRESET} from "../types/checkBody";
 import { Notify} from '@commonComp';
 import {pregetCheckbodyData} from '@store/async-actions/fetchModules';
 
@@ -22,10 +22,12 @@ export const billing = (mdata,boxMark) => {
   if(+state.typeConfig.typeConfig===1){
     url=api.textPush;
   }
+   const checkBody = state.checkBody.data;
+   let getCheck = boxMark==2&&!(checkBody&&checkBody.length>0&&!checkBody[0].full);
   const emrData = getEMRParams();
   const params = {
     age: emrData.age,
-    featureType: "5,6,7",
+    featureType: getCheck?"4,5,6,7":"5,6,7",
     // featureType: "22",
     diag: emrData.dis,
     lis: emrData.lis,
@@ -35,9 +37,11 @@ export const billing = (mdata,boxMark) => {
     vital:emrData.vital,
     symptom: mdata?(emrData.current + mdata):(emrData.current + emrData.main)
   };
-  storageLocal.set('emrParam',params);      //推送数据存储,用作推送前对比是否有变,有变才推送
+  let savePm = Object.assign({},params);
+   delete savePm.featureType;
+  storageLocal.set('emrParam',savePm);      //推送数据存储,用作推送前对比是否有变,有变才推送
     json(url, params).then((data) => {
-        let {dis, lab, pacs,markedVitalIds} = data.data.data||{};
+        let {dis, lab, pacs,markedVitalIds,vital} = data.data.data||{};
         lab = lab||[];
         pacs = pacs||[];
         // console.log('推送数据', data.data.data);
@@ -68,6 +72,10 @@ export const billing = (mdata,boxMark) => {
             lab: lab||[],
             pacs: pacs||[],
         });
+        dispatch({
+          type:PRESET,
+          data:vital
+        });
         //查体高亮标签
         dispatch({
           type:SET_IMPORT_CHECKBODY_LABEL,
@@ -91,10 +99,10 @@ export const billing = (mdata,boxMark) => {
    });
 
    //调查体,现病史触发推送且查体无数据时获取查体模板
-   const checkBody = state.checkBody.data;
+   /*const checkBody = state.checkBody.data;
    if(boxMark==2&&!(checkBody&&checkBody.length>0&&!checkBody[0].full)){
      dispatch(pregetCheckbodyData());
-   }
+   }*/
  }
 };
 
@@ -165,9 +173,9 @@ export const getAllConceptDetail = () => {
 }
 
 // 量表列表
-export const getTableList = (id)=>{
+export const getTableList = (name)=>{
     return (dispatch,getState)=>{
-        json(api.getTableList, {disId:id})
+        json(api.getTableList, {disName:name})
         .then((res)=>{
             if(res.data.code==0 && res.data.data && res.data.data.length>0){
                 dispatch({

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

@@ -1,6 +1,6 @@
 import { json } from "@utils/ajax";
 // import { SET_TREAT } from '@store/types/diagnosticList';
-import { ADD_DIAGNOSTIC, GET_DIAGNOSTIC_STR,SET_TREAT} from '@store/types/diagnosticList';
+import { ADD_DIAGNOSTIC, GET_DIAGNOSTIC_STR,SET_TREAT,SHOW_LOADING} from '@store/types/diagnosticList';
 import { SET_COMMONTREATMENT } from '@store/types/pushMessage'
 import { SET_DRUG_INFO, SET_TREATMENT, SET_TREAT_INFO, SET_RECOMMEND_BASIC, SET_DRUG_INFO_LIST, IS_FIRST_MAIN_DIAG, SET_ADVERSE_REACTIONS, SET_ALL_ADVERSE_REACTIONS, SET_FOLLOW_UP, DEL_FOLLOW_UP, SET_ALL_FOLLOW_UP } from '@store/types/treat';
 import {storageLocal,getEMRParams} from '@utils/tools';

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

@@ -1,4 +1,4 @@
-import { SHOW_COPY_MODAL, CLOSE_COPY_MODAL, GET_COPY_MESSAGE, SHOW_DISCLAIMER_MODAL, CLOSE_DISCLAIMER_MODAL, GET_DISCLAIMER_MESSAGE, GET_VERSION } from "../types/copyRight";
+import { SHOW_COPY_MODAL, CLOSE_COPY_MODAL, GET_COPY_MESSAGE, SHOW_DISCLAIMER_MODAL, CLOSE_DISCLAIMER_MODAL, GET_DISCLAIMER_MESSAGE, GET_VERSION ,SHOW_LOADING} from "../types/copyRight";
 import { showCopyModal, closeCopyModal, getMessage, showDisclatmerModal,  closeDisclatmerModal, getDisMessage, getVersion} from "../actions/copyRight";
 
 const initState = {
@@ -11,6 +11,7 @@ const initState = {
   hasNewVersion: false
 };
 export default function(state = initState, action) {
+  const res = Object.assign({},state);
   switch (action.type) {
     case SHOW_COPY_MODAL:
       return showCopyModal(state, action);
@@ -25,7 +26,10 @@ export default function(state = initState, action) {
     case GET_DISCLAIMER_MESSAGE:
       return getDisMessage(state, action);
     case GET_VERSION: 
-      return getVersion(state, action)
+      return getVersion(state, action);
+    case SHOW_LOADING:
+      res.loading = action.flag;
+      return res;
     default:
       return state;
   }

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

@@ -1,6 +1,6 @@
 import { ADD_DIAGNOSTIC,  DEL_DIAGNOSTIC, UP_DIAGNOSTIC, DOWN_DIAGNOSTIC, SET_TREAT, GET_DIAGNOSTIC_STR, SET_DIAG_TO_MAINSUIT, 
             GET_IS_FIRST,CLEAR_ALL_DIAG, SET_CLICK_DIAG ,CLEAR_DIAGNOSE, SET_CHRONIC_MAG_ITEM, SHOW_REFER_RECORD, HIDE_REFER_RECORD, 
-            SHOW_HISTORY_CASE,  HIDE_HISTORY_CASE} from '../types/diagnosticList';
+            SHOW_HISTORY_CASE,  HIDE_HISTORY_CASE,SHOW_LOADING} from '../types/diagnosticList';
 import { addDiagnostic,  delDiagnostic, upDiagnostic, downDiagnostic, setTreat, getDiagnosticStr, setDiagToMainSuit, 
         getIsFirst,clearAllDiag, setClickDiag, setChronicMagItem, showReferRecord, hideReferRecord, showHistoryCase, hideHistoryCase} from '../actions/diagnosticList';
 
@@ -74,6 +74,9 @@ export default function (state=initState, action) {
         case CLEAR_DIAGNOSE: 
             res.mainSuitStr = "";
             return res;
+        case SHOW_LOADING: 
+            res.loading = action.flag;
+            return res;
         default:
             return state;
     }

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

@@ -27,7 +27,8 @@ const initState = {
     featureData:[],
     refresh:false //用于数据更新
   },
-  chronicDesease:{} //慢病
+  chronicDesease:{}, //慢病
+  mainTailIds:[]  //获取症状尾巴用
 }
 
 export default function(state=initState,action){

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

@@ -4,4 +4,5 @@ export const GET_COPY_MESSAGE = 'GET_COPY_MESSAGE'
 export const GET_DISCLAIMER_MESSAGE = 'GET_DISCLAIMER_MESSAGE'
 export const SHOW_DISCLAIMER_MODAL = 'SHOW_DISCLAIMER_MODAL'
 export const CLOSE_DISCLAIMER_MODAL = 'CLOSE_DISCLAIMER_MODAL'
-export const GET_VERSION = 'GET_VERSION' //获取版本信息
+export const GET_VERSION = 'GET_VERSION' ;//获取版本信息
+export const SHOW_LOADING = 'SHOW_LOADING'; //loading

+ 8 - 7
src/store/types/diagnosticList.js

@@ -8,12 +8,13 @@ export const GET_DIAGNOSTIC_STR = 'GET_DIAGNOSTIC_STR';
 export const SET_DIAG_TO_MAINSUIT = 'SET_DIAG_TO_MAINSUIT'; //判断第一次添加诊断是否添加到主诉
 export const GET_IS_FIRST = 'GET_IS_FIRST'; //判断是否第一次添加诊断
 export const CLEAR_ALL_DIAG = 'CLEAR_ALL_DIAG'; //清除所有诊断
-export const SET_CLICK_DIAG = 'SET_CLICK_DIAG' //设置点击的诊断,获取提示详情时需要
-export const CLEAR_DIAGNOSE = 'CLEAR_DIAGNOSE' //
-export const SET_CHRONIC_MAG_ITEM = 'SET_CHRONIC_MAG_ITEM'  //设置慢病信息
-export const SHOW_REFER_RECORD = 'SHOW_REFER_RECORD'  //显示引用历史病历弹窗
-export const HIDE_REFER_RECORD = 'HIDE_REFER_RECORD'  //隐藏引用历史病历弹窗
-export const SHOW_HISTORY_CASE = 'SHOW_HISTORY_CASE'  //显示历史病历列表弹窗
-export const HIDE_HISTORY_CASE = 'HIDE_HISTORY_CASE'  //隐藏历史病历列表弹窗
+export const SET_CLICK_DIAG = 'SET_CLICK_DIAG' ;//设置点击的诊断,获取提示详情时需要
+export const CLEAR_DIAGNOSE = 'CLEAR_DIAGNOSE'; //
+export const SET_CHRONIC_MAG_ITEM = 'SET_CHRONIC_MAG_ITEM';  //设置慢病信息
+export const SHOW_REFER_RECORD = 'SHOW_REFER_RECORD';  //显示引用历史病历弹窗
+export const HIDE_REFER_RECORD = 'HIDE_REFER_RECORD';  //隐藏引用历史病历弹窗
+export const SHOW_HISTORY_CASE = 'SHOW_HISTORY_CASE';  //显示历史病历列表弹窗
+export const HIDE_HISTORY_CASE = 'HIDE_HISTORY_CASE' ; //隐藏历史病历列表弹窗
+export const SHOW_LOADING = 'SHOW_LOADING';    //显示loading
 
 

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

@@ -10,16 +10,16 @@ export const SHOW_DRUG_INFO = 'SHOW_DRUG_INFO';
 export const HIDE_DRUG_INFO = 'HIDE_DRUG_INFO';
 export const SET_GENERAL_TREAT = 'SET_GENERAL_TREAT'; //设置一般治疗
 export const SET_SURGERY_TREAT = 'SET_SURGERY_TREAT'; //设置手术治疗
-export const SET_TREATMENT = 'SET_TREATMENT' //设置治疗方案
-export const SET_RECOMMEND_BASIC = 'SET_RECOMMEND_BASIC'//设置其他推荐推荐依据
-export const SET_TREAT_INFO = 'SET_TREAT_INFO' //设置治疗方案信息(name,id等)
-export const SET_DRUG_INFO_LIST = 'SET_DRUG_INFO_LIST' //查询多个药品说明书(添加数据时查看药品说明用)
-export const IS_FIRST_MAIN_DIAG = 'IS_FIRST_MAIN_DIAG' //是否为主诊断第一次开单
-export const CLEAR_FIRST_MAIN_DIAG = 'CLEAR_FIRST_MAIN_DIAG' //回读清空是否为主诊断第一次开单
-export const SET_ADVERSE_REACTIONS = 'SET_ADVERSE_REACTIONS'    //设置不良反应
-export const SET_ALL_ADVERSE_REACTIONS = 'SET_ALL_ADVERSE_REACTIONS'    //设置所有不良反应
-export const CHANGE_REACT = 'CHANGE_REACT'  //改变不良反应状态
-export const DEL_REACT = 'DEL_REACT'  //删除不良反应
-export const SET_FOLLOW_UP = 'SET_FOLLOW_UP'    //设置回访时间
-export const DEL_FOLLOW_UP = 'DEL_FOLLOW_UP'    //删除回访时间
-export const SET_ALL_FOLLOW_UP = 'SET_ALL_FOLLOW_UP'    //设置所有回访时间
+export const SET_TREATMENT = 'SET_TREATMENT'; //设置治疗方案
+export const SET_RECOMMEND_BASIC = 'SET_RECOMMEND_BASIC';//设置其他推荐推荐依据
+export const SET_TREAT_INFO = 'SET_TREAT_INFO' ;//设置治疗方案信息(name,id等)
+export const SET_DRUG_INFO_LIST = 'SET_DRUG_INFO_LIST' ;//查询多个药品说明书(添加数据时查看药品说明用)
+export const IS_FIRST_MAIN_DIAG = 'IS_FIRST_MAIN_DIAG' ;//是否为主诊断第一次开单
+export const CLEAR_FIRST_MAIN_DIAG = 'CLEAR_FIRST_MAIN_DIAG'; //回读清空是否为主诊断第一次开单
+export const SET_ADVERSE_REACTIONS = 'SET_ADVERSE_REACTIONS' ;   //设置不良反应
+export const SET_ALL_ADVERSE_REACTIONS = 'SET_ALL_ADVERSE_REACTIONS';    //设置所有不良反应
+export const CHANGE_REACT = 'CHANGE_REACT' ; //改变不良反应状态
+export const DEL_REACT = 'DEL_REACT' ; //删除不良反应
+export const SET_FOLLOW_UP = 'SET_FOLLOW_UP'  ;  //设置回访时间
+export const DEL_FOLLOW_UP = 'DEL_FOLLOW_UP'  ;  //删除回访时间
+export const SET_ALL_FOLLOW_UP = 'SET_ALL_FOLLOW_UP' ;   //设置所有回访时间

+ 12 - 8
src/utils/tools.js

@@ -244,7 +244,7 @@ const getAllDataStringList =(baseList) =>{           //获取所有模块文本
 const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清空所有的数据
     if(action == 'clear'){     //清空
       const block = Object.assign(JSON.parse(config.textLabel),{full:true});//空白时保留一个自由文本标签
-      store.dispatch({type: CLEAR_MAIN_SUIT,data:[],saveText:[],selecteds:[],editClear:true,mainIds:[],clearAction:true,symptomFeature:[],chronicDesease:{}});
+      store.dispatch({type: CLEAR_MAIN_SUIT,data:[],saveText:[],selecteds:[],editClear:true,mainIds:[],mainTailIds:[],clearAction:true,symptomFeature:[],chronicDesease:{}});
         store.dispatch({type: CLEAR_CURRENT_ILL,data:[],saveText:[],selecteds:[],editClear:true,symptomIds:[]});
         store.dispatch({type: CLEAROTHERHISTORY,data:[block],isEmpty:true,saveText:[],selecteds:[],editClear:true,yjs_1:'',yjs_2:'',yjs_3:'',yjs_4:''});
         store.dispatch({type: CLEARCHECKBODY,data:[block],isEmpty:true,saveText:[],selecteds:[]});
@@ -667,7 +667,6 @@ function didPushParamChange(){
   const oldParams = storageLocal.get('emrParam');
   const newParams = JSON.stringify({
     age: emrData.age,
-    featureType: "4,5,6,7,22",
     diag: emrData.dis,
     lis: emrData.lis,
     other: emrData.other,
@@ -1025,12 +1024,15 @@ function fullfillText(arr,noPre=false,noEnd=false,ifEmpty=true){
     tempText = '',
     value = '',
     item={},
-    checkHiddenDefault=false;
+    cNum = 0,
+    checkHiddenDefault=false;//console.log(arr)
   arr&&arr.map((it,i)=>{
     notText = notTextLabel(it);
+    cNum = i;
     value = it.value||'';
     textLabel = !ifEmpty&&i==0?Object.assign({},JSON.parse(config.textLabel),{showInCheck:true}):JSON.parse(config.textLabel);
-    _textLabel = !ifEmpty&&i<config.showCheckNum+1?Object.assign({},JSON.parse(config._textLabel),{showInCheck:true}):JSON.parse(config._textLabel);
+    //n个显示的标签最后一个标签后面要落关标,所以+1
+    _textLabel = !ifEmpty&&cNum<config.showCheckNum+1?Object.assign({},JSON.parse(config._textLabel),{showInCheck:true}):JSON.parse(config._textLabel);
     if(i===0){
       //第一个标签不是文本标签时在前面添加文本标签
       if(!noPre&&notText){
@@ -1046,15 +1048,16 @@ function fullfillText(arr,noPre=false,noEnd=false,ifEmpty=true){
         tempText = getSaveText(it);
       }
       saveText.push(tempText);
-      if(arr.length==1){
+      // 模板只有一个标签时第一项后面也要加空标签
+      if(arr.length==1&&notText){
         newArr.push(textLabel);
         saveText.push('');
       }
     }else{
       pre = arr[i-1];
-      item = !ifEmpty&&i<config.showCheckNum?Object.assign({},it,{showInCheck:true}):it;
+      item = !ifEmpty&&cNum<config.showCheckNum?Object.assign({},it,{showInCheck:true}):it;
       //判断单选项是否有默认选中,位置在隐藏区域时,查体所有标签展示
-      if(!ifEmpty&&!checkHiddenDefault&&i>config.showCheckNum&&+it.tagType===1&&(+it.controlType===0||+it.controlType===1)){
+      if(!ifEmpty&&!checkHiddenDefault&&cNum>config.showCheckNum&&+it.tagType===1&&(+it.controlType===0||+it.controlType===1)){
         if(it.questionDetailList.find((it)=>it.defaultSelect=='1')){
           checkHiddenDefault=true;
         }
@@ -1082,7 +1085,8 @@ function fullfillText(arr,noPre=false,noEnd=false,ifEmpty=true){
       }
       if(notText&&!noEnd&&i===arr.length-1){//最后一个非文本标签,后面添加一个文本标签
         //不能用上面的变量textLabel,因为上一个if可能也进了,这样就是同一个对象,值改变时会同步
-        newArr.push(JSON.parse(config.textLabel));
+        const _text = arr.length>config.showCheckNum?JSON.parse(config._textLabel):_textLabel;
+        newArr.push(ifEmpty?textLabel:_text);
         saveText.push("");
       }
     }