浏览代码

Merge branch 'optimize' into optimize-zxc

zhangxc 6 年之前
父节点
当前提交
3b05925cdc

+ 7 - 5
src/components/Banner/index.jsx

@@ -19,7 +19,6 @@ class Banner extends Component {
     this.state = {
       mode: props.typeConfig,
       zIndex:204,
-      emergency:true,
       emergencyBox:false
     };
     this.showConfigModal = this.showConfigModal.bind(this);
@@ -90,8 +89,8 @@ class Banner extends Component {
     dragBox('previewWrapper','previewStatic','del')    
   }
   render() {
-    const {visible,disVisible,copyVisible} = this.props;
-    const {mode,zIndex,emergency,emergencyBox} = this.state;
+    const {visible,disVisible,copyVisible,ifShow,deptName} = this.props;
+    const {mode,zIndex,emergencyBox} = this.state;
     const {showConfigModal, closeConfigModal, changeType, confirmType} = this;
 
     return (
@@ -99,7 +98,7 @@ class Banner extends Component {
         <img src={logo} />
         <span className={style["logo-name"]}>|&nbsp;&nbsp;智能辅助临床决策系统</span>
         <div className={style["buon"]}>
-          {emergency?<div className={style["buon1"]} onClick={this.showHisModal}>
+          {ifShow==1&&deptName=='急诊科'?<div className={style["buon1"]} onClick={this.showHisModal}>
                       <img className={`${style["st"]} ${style["his"]}`} src={emergIcon} />
                       本科室近期全部病历
                     </div>:''}
@@ -131,8 +130,11 @@ class Banner extends Component {
 }
 
 const mapStateToProps = function(state){
+  const {sysConfig} = state.homePage;
+  const {message} = state.patInfo;
   return {
-
+    ifShow:sysConfig.general_show,
+    deptName:message.selfDeptName
   }
 }
 

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

@@ -52,7 +52,8 @@ class CurrentIll extends Component{
       })
     }else if(!text) {//现病史框里没有内容时才设置模板
       let num = moduleNum.num;//主诉使用了几个模板
-      if(data.length==0 && (!isChronic || JSON.stringify(isChronic)=='{}') ){
+      console.log(999,isChronic)
+      if(data.length==0 && !isChronic){
         clearTimeout(setDataTimer);
         setDataTimer = setTimeout(function(){//延时,等待主诉失焦数据返回
             setData && setData({num,mainData,mainIds,symptomFeature:symptomFeature.featureData,isChronic,mainTailIds});   

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

@@ -254,7 +254,6 @@ class DiagnosticList extends Component {
         const { list, treatment, showReferRecord, showHistoryCase ,chronicMagItem,loading} = this.props;
         const { visible, treatTitle ,showAssess, isAssessConfirm, radioVal, possible,assessId,disName, hasOndel, hasOnIndex} = this.state;
         const chronicList = JSON.parse(localStorage.getItem('chronic')||null);
-        const chronicLine = chronicMagItem&&chronicMagItem.name;     //当前是否走的慢病流程
         let isChronic = false;      //是否要显示管理评估
         const footer = <Footer print={true}
                                footText="确定"
@@ -265,7 +264,7 @@ class DiagnosticList extends Component {
                     {list && (list.length > 0) && list.map((item, index) => {
                         const hasTreat = item.treat && ((item.treat.commonTreatment&&item.treat.commonTreatment.content) || (item.treat.surgeryTreatment&&item.treat.surgeryTreatment.content) || item.treat.treatment.length>0 ||(item.adverseReactions&&item.adverseReactions.length > 0)
                            || (item.drugHistory && item.drugHistory['慢病用药内容'] &&  item.drugHistory['慢病用药内容'].length > 0) || (item.drugHistory &&item.drugHistory['普通病用药内容'] &&  item.drugHistory['普通病用药内容'].length > 0) ||item.follow)
-                        isChronic = chronicLine&&item.type==2&&chronicList.findIndex((it)=>it.conceptId==item.conceptId)!=-1;
+                        isChronic = chronicMagItem&&item.type==2&&chronicList.findIndex((it)=>it.conceptId==item.conceptId)!=-1;
                         return (<div draggable={true} className={style['diag-box'] + ' clearfix'}  key={item.conceptId} >
                                     {index === 0 ? '' : <span className={style['diag-up']} onClick={() => {this.upDiagnostic(index)}}><img className={style["diag-up"]} src={diagUp}/></span>}
                                     {list.length === 1 ? '' : index !== 0 ? '' : <span onClick={() => {this.downDiagnostic(index)}} className={style['diag-down']}><img className={style["diag-down"]} src={diagDown}/></span>}

+ 12 - 0
src/components/EmergencyProcedure/emergency.js

@@ -14,6 +14,8 @@
 let data = [
     {
       emergencyname:'胸痛危机重症排除与救治流程',
+      emergencyillname:'胸痛',
+      idx:0,
       step1:{//步骤1
         checks:'吸氧、建立12导联心电图、血压监护、抽血测心肌损伤标志物、血气分析、血常规、肾功能、凝血功能'
       },
@@ -67,6 +69,8 @@ let data = [
     },
     {
       emergencyname:'心包积液救治流程',
+      emergencyillname:'心包积液',
+      idx:1,
       step1:{//步骤1
         checks:'检查超声心动图',
       },
@@ -147,6 +151,8 @@ let data = [
     },
     {
       emergencyname:'气胸救治流程',
+      emergencyillname:'气胸',
+      idx:2,
       step1:{//步骤1
         checks:'听诊呼吸音是否减弱或消失',
       },
@@ -219,6 +225,8 @@ let data = [
     },
     {
       emergencyname:'肺栓塞救治流程',
+      emergencyillname:'肺栓塞',
+      idx:3,
       step1:{//步骤1
         checks:'立即检查D-二聚体+床旁超声心动图',
       },
@@ -317,6 +325,8 @@ let data = [
     },
     {
       emergencyname:'急性冠脉综合征救治流程',
+      emergencyillname:'急性冠脉综合征',
+      idx:4,
       step1:{//步骤1
         checks:'立即检查18导联心电图',
       },
@@ -427,6 +437,8 @@ let data = [
     },
     {
       emergencyname:'主动脉夹层救治流程',
+      emergencyillname:'主动脉夹层',
+      idx:5,
       step1:{//步骤1
         checks:'立即检查D-二聚体+床旁超声心动图',
       },

+ 20 - 20
src/components/MedicalInfo/index.jsx

@@ -8,7 +8,6 @@ class MedicalInfo extends Component {
         super(props);
         this.$inp = React.createRef();
         this.$cont = React.createRef();
-        this.$contList = React.createRef();
         this.state={
           val:''
         };
@@ -16,6 +15,7 @@ class MedicalInfo extends Component {
         this.handleChange = this.handleChange.bind(this);
         this.clear = this.clear.bind(this);
         this.getSearchList = this.getSearchList.bind(this);
+        this.handleEnter = this.handleEnter.bind(this);
     }
     getSearchList() {
         const { getAllConceptDetail,searchResult } = this.props;
@@ -37,6 +37,11 @@ class MedicalInfo extends Component {
         val:this.$inp.current.value
       });
   }
+  handleEnter(e){
+      if(e.keyCode==13){
+        this.search();
+      }
+  }
   clear(){
     this.$inp.current.value = '';
     this.setState({
@@ -44,14 +49,12 @@ class MedicalInfo extends Component {
     });
   }
   componentDidMount(){
-    const height = getWindowInnerHeight()-234;
+    const height = getWindowInnerHeight()-170;
     this.$cont.current.style.height = height+"px";
-    this.$contList.current.style.height = height-30+"px";
     if(this.$cont.current){
       windowEventHandler('resize', ()=>{
-        const height = getWindowInnerHeight()-234;
+        const height = getWindowInnerHeight()-170;
         this.$cont.current.style.height = height+"px";
-        this.$contList.current.style.height = height-30+"px";
       });
     }
   }
@@ -59,27 +62,24 @@ class MedicalInfo extends Component {
         const {searchResult} = this.props;
         const {val} = this.state;
         return (
-        <div className={style['mefical-info-wrapper']}>
-            <div className={style['search-cont']}>
+            <div className={style['search-cont']} ref={this.$cont}>
+              <div className={style['search-box']}>
                 <p className={style['title']}>医学知识搜索</p>
                 <p className={style['cont']}>
-                  <input type="text" className={style['input']} ref={this.$inp} onInput={this.handleChange}/>
+                  <input type="text" className={style['input']} ref={this.$inp} onInput={this.handleChange} onKeyUp={this.handleEnter}/>
                   {val?<img src={delIcon} alt="清空" onClick={this.clear}/>:''}
                   <button onClick={this.search}>搜索</button>
                 </p>
-                <div className={style['result-box']} ref={this.$cont}>
-                  <div className={style['result']} style={searchResult&&searchResult.length>0? {'display': 'block'} : {'display': 'none'}}>
-                      <p className={style['title']}>查询内容</p>
-                      <ul className={style['result-list']} ref={this.$contList}>
-                        {this.getSearchList()}
-                      </ul>
-                  </div>
-                  <p className={style['no-data']} style={searchResult&&searchResult.length>0? {'display': 'none'} : {'display': 'block'}}>暂无搜索结果!</p>
-                </div>
-              
+              </div>
+              {searchResult&&searchResult.length>0?<div className={style['result']}>
+                    <p className={style['title']}>查询内容</p>
+                    <ul>
+                      {this.getSearchList()}
+                    </ul>
+              </div>:<p className={style['no-data']}>暂无搜索结果!</p>}
              </div>
-        </div>
-        
+
+
         )
 
         

+ 16 - 5
src/components/MedicalInfo/index.less

@@ -7,6 +7,17 @@
     position: relative;
 }
 .search-cont{
+    padding: 0px 15px;
+    line-height: 20px;
+    position: relative;
+    overflow: hidden;
+    .search-box{
+        position: fixed;
+        z-index: 9;
+        background: #fff;
+        width: 430px;
+        padding: 0 0 15px;
+    }
     .cont{
         position: relative;
         img{
@@ -37,15 +48,14 @@
         line-height: 34px;
         color: #fff;
         background: #2A9BD5;
-        border:1px #2A9BD5 solid;
         text-align: center;
         border: none;
     }
-    .result-list {
-        overflow: auto;
-    }
     .result{
-        padding-top: 15px;
+        padding: 78px 5px 0 0;
+        height: 100%;
+        overflow: auto;
+        box-sizing: border-box;
         li{
             border-bottom:1px #CECECE solid;
             line-height: 42px;
@@ -78,5 +88,6 @@
         color:#979797;
         text-align: center;
         line-height: 40px;
+        margin-top: 66px;
     }
 }

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

@@ -41,13 +41,13 @@ class MultSpread extends Component{
     this.handleEdit = this.handleEdit.bind(this);
   }
   getClass(){
-    const {saveText,ikey,showAdd,isImports} = this.props;
+    const {saveText,ikey,showAdd} = this.props;
     const labelInx = ikey.substr(1);
     const text = saveText&&saveText[+labelInx];
-    const orgBorder = isImports&&!text?style['orange-border']:'';
+    //const orgBorder = isImports&&!text?style['orange-border']:'';
     const isSelected = text?style['selected']:style['container'];
     const hasAdd = showAdd?style['add']:'';
-    return classNames(isSelected,hasAdd,orgBorder);
+    return classNames(isSelected,hasAdd);
   }
   saveDoms(it){
     const doms = this.state.numDoms;
@@ -203,8 +203,12 @@ class MultSpread extends Component{
   }
   getContClass(){
     const {editable} = this.state;
+    const {isImports,ikey,saveText} = this.props;
+    const labelInx = ikey.substr(1);
+    const text = saveText&&saveText[+labelInx];
+    const orgBorder = isImports&&!text?style['orange-border']:'';
     const edit = editable?style['blue-border']:'';
-    return classNames(edit);
+    return classNames(edit,orgBorder);
   }
   render(){
     const {showAdd,addLabelItem,ikey,copyId,textPrefix,textSuffix} = this.props;

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

@@ -272,7 +272,7 @@ class Operation extends Component {
       diagShowTmp(false)
       this.setState({ title: '' })
       // 慢病标识
-      const chronicFlag = chronicMagItem&&chronicMagItem.name || chronicDesease&&chronicDesease.name?true:false;
+      const chronicFlag = chronicMagItem || chronicDesease?true:false;
       clear(chronicFlag);
     } else if (type == 3) {
       if (this.state.title.trim() == '') {

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

@@ -78,7 +78,6 @@ class PreviewBody extends Component {
     const { show, preInfo, dataJson, dataStr, baseObj, flg ,showAssessBtn,showHistoryCases} = this.props;
     const other_yjs = dataStr.other?filterOtherDataArr(JSON.parse(dataStr.other),dataJson.other):'';
     const noData = JSON.stringify(preInfo) == '{}';
-    const isChronic = (dataJson.diagChronicMagItem&&dataJson.diagChronicMagItem.name)||(dataJson.mainChronicDesease&&dataJson.mainChronicDesease.name);
     return <div className={style['content']} style={{ width: flg ? '700' : '820' }}>
       <div className={style['contents']} id="content" style={{ margin: "0 auto", maxWidth: "620px" }}>
         <Information baseObj={baseObj} preInfo={preInfo}></Information>

+ 25 - 26
src/components/ScaleSearch/index.jsx

@@ -8,13 +8,13 @@ class ScaleSearch extends Component {
     super(props);
     this.$inp = React.createRef();
     this.$cont = React.createRef();
-    this.$contList = React.createRef();
     this.state={
       val:''
     };
     this.search = this.search.bind(this);
     this.handleChange = this.handleChange.bind(this);
     this.clear = this.clear.bind(this);
+    this.handleEnter = this.handleEnter.bind(this);
   }
   getResult(id){
     const {formulaResult} = this.props;
@@ -52,6 +52,11 @@ class ScaleSearch extends Component {
       val:this.$inp.current.value
     });
   }
+  handleEnter(e){
+    if(e.keyCode==13){
+      this.search();
+    }
+  }
   clear(){
     this.$inp.current.value = '';
     this.setState({
@@ -59,14 +64,12 @@ class ScaleSearch extends Component {
     });
   }
   componentDidMount(){
-    const height = getWindowInnerHeight()-234;
+    const height = getWindowInnerHeight()-170;
     this.$cont.current.style.height = height+"px";
-    this.$contList.current.style.height = height-30+"px";
     if(this.$cont.current){
       windowEventHandler('resize', ()=>{
-        const height = getWindowInnerHeight()-234;
+        const height = getWindowInnerHeight()-170;
         this.$cont.current.style.height = height+"px";
-        this.$contList.current.style.height = height-30+"px";
       });
     }
   }
@@ -74,31 +77,27 @@ class ScaleSearch extends Component {
     const {searchResult} = this.props;
     const {val} = this.state;
     return (
-      <div className={style['mefical-info-wrapper']}>
-            <div className={style['search-cont']}>
-                <p className={style['title']}>量表搜索</p>
-                <p className={style['cont']}>
-                  <input type="text" className={style['input']} ref={this.$inp} onInput={this.handleChange}/>
-                  {val?<img src={delIcon} alt="清空" onClick={this.clear}/>:''}
-                  <button onClick={this.search}>搜索</button>
-                </p>
-                <div className={style['result-box']} ref={this.$cont}>
-                  <div className={style['result']} style={searchResult&&searchResult.length>0? {'display': 'block'} : {'display': 'none'}}>
-                      <p className={style['title']}>查询内容</p>
-                      <ul className={style['result-list']} ref={this.$contList}>
-                        {this.getSearchList()}
-                      </ul>
-                  </div>
-                  <p className={style['no-data']} style={searchResult&&searchResult.length>0? {'display': 'none'} : {'display': 'block'}}>暂无搜索结果!</p>
-                </div>
-              
-             </div>
+        <div className={style['search-cont']} ref={this.$cont}>
+          <div className={style['search-box']}>
+            <p className={style['title']}>量表搜索</p>
+            <p className={style['cont']}>
+              <input type="text" className={style['input']} ref={this.$inp} onInput={this.handleChange} onKeyUp={this.handleEnter}/>
+              {val?<img src={delIcon} alt="清空" onClick={this.clear}/>:''}
+              <button onClick={this.search}>搜索</button>
+            </p>
+          </div>
+          {searchResult&&searchResult.length>0?<div className={style['result']}>
+            <p className={style['title']}>查询内容</p>
+            <ul>
+              {this.getSearchList()}
+            </ul>
+          </div>:<p className={style['no-data']}>暂无搜索结果!</p>}
         </div>
-
     )
 
 
+
   }
 }
 
-export default ScaleSearch;
+export default ScaleSearch;

+ 16 - 5
src/components/ScaleSearch/index.less

@@ -7,6 +7,17 @@
   position: relative;
 }
 .search-cont{
+  padding: 0px 15px;
+  line-height: 20px;
+  position: relative;
+  overflow: hidden;
+  .search-box{
+    position: fixed;
+    z-index: 9;
+    background: #fff;
+    width: 430px;
+    padding: 0 0 15px;
+  }
   .cont{
     position: relative;
     img{
@@ -37,15 +48,14 @@
     line-height: 34px;
     color: #fff;
     background: #2A9BD5;
-    border:1px #2A9BD5 solid;
     text-align: center;
     border: none;
   }
-  .result-list {
-    overflow: auto;
-  }
   .result{
-    padding-top: 15px;
+    padding: 78px 5px 0 0;
+    height: 100%;
+    overflow: auto;
+    box-sizing: border-box;
     li{
       border-bottom:1px #CECECE solid;
       line-height: 42px;
@@ -83,5 +93,6 @@
     color:#979797;
     text-align: center;
     line-height: 40px;
+    margin-top: 66px;
   }
 }

+ 2 - 2
src/containers/AssistCheck.js

@@ -8,7 +8,7 @@ import { getSearchList,getInstroduce ,getImportLists,getSonDetailList} from '@st
 import {ISREAD} from '@store/types/homePage.js';
 import {billing, getConceptDetail} from '@store/async-actions/pushMessage';
 
-function mapStateToProps(state) {//console.log(state.assistCheck)
+function mapStateToProps(state) {//console.log(state)
     return {
         list:state.assistCheck.list,
         assistLabel:state.assistCheck.assistLabel,
@@ -25,7 +25,7 @@ function mapStateToProps(state) {//console.log(state.assistCheck)
         checkedList: state.assistCheck.checkedList,
         selectGroupList: state.assistCheck.selectGroupList,
         allCheck: state.assistCheck.allCheck,
-        msgObj: state.assistCheck.msgObj,
+        msgObj: state.assistCheck.msgObj
     }
 }
 

+ 2 - 2
src/containers/CurrentIll.js

@@ -11,7 +11,7 @@ import {getModule} from '@store/async-actions/fetchModules.js';
 import {didPushParamChange} from '@utils/tools.js';
 
 
-function mapStateToProps(state) { //console.log(111,state);
+function mapStateToProps(state) { console.log(111,state);
   const {homePage,currentIll,mainSuit,diagnosticList} = state;
     return {
         data:currentIll.data,//主诉模板
@@ -41,7 +41,7 @@ function mapStateToProps(state) { //console.log(111,state);
         boxLeft:homePage.boxLeft,
         allModules:homePage.allModules,
         // isChronic:!!diagnosticList.chronicMagItem,
-        isChronic:mainSuit.chronicDesease&&mainSuit.chronicDesease.name?mainSuit.chronicDesease:diagnosticList.chronicMagItem,
+        isChronic:mainSuit.chronicDesease?mainSuit.chronicDesease:diagnosticList.chronicMagItem,
 
     }
 }

+ 1 - 1
src/containers/DiagnosticList.js

@@ -23,7 +23,7 @@ function mapStateToProps(state) {
         showReferRecord: diagnosticList.showReferRecord,
         showHistoryCase: diagnosticList.showHistoryCase,
         items:state.historyTemplates.items,
-        chronicMagItem: diagnC&&diagnC.name?diagnC:state.mainSuit.chronicDesease,
+        chronicMagItem: diagnC?diagnC:state.mainSuit.chronicDesease,
         typeConfig: state.typeConfig.typeConfig,
         wholeResults:assessResult.wholeResults,
         scaleInfo: pushMessage.scaleInfo,//量表内容

+ 1 - 1
src/containers/MainSuit.js

@@ -38,7 +38,7 @@ function mapStateToProps(state) {//console.log(state)
     boxLeft:homePage.boxLeft,
     currentData:state.currentIll.data,
     allModules:homePage.allModules,
-    chronicDesease:mainSuit.chronicDesease&&mainSuit.chronicDesease.name?mainSuit.chronicDesease:diagnosticList.chronicMagItem,
+    chronicDesease:mainSuit.chronicDesease?mainSuit.chronicDesease:diagnosticList.chronicMagItem,
     items:state.historyTemplates.items,
     showHisBox:mainSuit.showHisBox,
   }

+ 1 - 0
src/containers/eleType.js

@@ -87,6 +87,7 @@ export function singleRadio(params){
                          boxMark={boxMark}
                          id={data.id}
                          allClick={true}
+                         isImports={isHigh}
                          show={showArr&&showArr[showInx]}
                          ikey={showInx}
                          value={data.value}

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

@@ -9,15 +9,16 @@ import {HIDEDROP,SETMINSCREEN,SETSYSTEMCONFIG} from '@store/types/homePage.js';
 import style from './index.less';
 import {getInitModules,getChronic,getSystemConfig} from '@store/async-actions/homePage.js';
 import { getUrlArgObject,parseNameVal } from "@utils/tools";
+import dataLis from '@components/EmergencyProcedure/emergency';
 import $ from 'jquery';
-import data from '@components/EmergencyProcedure/emergency';
 import loading from '@common/images/loading.gif';
 class HomePage extends Component {
     constructor() {
         super();
         this.state={
             timer:null,
-            idx:getUrlArgObject('emergency')+''
+            dataEmergency:{},
+            idx:''
         }
         this.setDataIdx = this.setDataIdx.bind(this)
     }
@@ -25,7 +26,6 @@ class HomePage extends Component {
         const {setWindow,getChronicList,getConfig} = this.props;
         getConfig();
         getChronicList&&getChronicList();//获取慢病列表
-
         // 获取并监听窗口宽度,用于有横向滚动条时患者信息和打印预览跟随滚动
         let width = $(window).width();
         let height = $(window).height();
@@ -54,13 +54,13 @@ class HomePage extends Component {
       })
     }
     render() {
-        const {flag} = this.props;
+        const {flag,setPushEmergencyIdx,sysConfig} = this.props;
         return <div className={style['home-page']} onClick={this.props.hideAllDrop}>
             <BannerContainer />
             {/* <InfoTitle /> */}
             <BodyContainer></BodyContainer>
             {
-              this.state.idx&&data[this.state.idx]?<EmergencyProcedure data={data[this.state.idx]} idx={this.state.idx} setDataIdx={this.setDataIdx}></EmergencyProcedure>:null
+              (setPushEmergencyIdx+'')&&(sysConfig.emergency_show==1)?<EmergencyProcedure data={dataLis[this.state.idx]||dataLis[setPushEmergencyIdx]} idx={this.state.idx||setPushEmergencyIdx} setDataIdx={this.setDataIdx}></EmergencyProcedure>:null
             }
             <div className={style['mask']} style={{display:flag?"block":"none"}}>
                 <img src={loading} className={style['load']}/>
@@ -71,7 +71,9 @@ class HomePage extends Component {
 
 const mapStateToProps = function (state) {
   return {
-    flag:state.homePage.loadingFlag
+    flag:state.homePage.loadingFlag,
+    setPushEmergencyIdx: state.pushMessage.setPushEmergencyIdx || '',  
+    sysConfig:state.homePage.sysConfig
   }
 };
 const mapDispatchToProps = function (dispatch) {

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

@@ -109,4 +109,4 @@ export const getAssistList = (state,action)=>{
   let res = Object.assign({},state);
   res.assistList = action.data
   return res;
-};
+};

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

@@ -31,6 +31,8 @@ export const setAdvice=(state,action)=>{
   res.likely = action.likely;
   res.assay = action.lab;
 	res.check = action.pacs;
+  res.setPushEmergency = action.setPushEmergency;
+  res.setPushEmergencyIdx=action.setPushEmergencyIdx
   return res;
 };
 
@@ -305,4 +307,5 @@ export const delFollowUp = (state, action) => {
 	const res = JSON.parse(JSON.stringify(state));
 	res.advice.follow = '';
 	return res;
-}
+}
+

+ 17 - 3
src/store/async-actions/pushMessage.js

@@ -4,6 +4,7 @@ import { SET_DRUG_INFO, SHOW_DRUG_INFO } from '@store/types/treat';
 import { SET_CLICK_DIAG } from '../types/diagnosticList';
 import {storageLocal,getEMRParams} from '@utils/tools';
 import {SET_IMPORT_CHECKBODY_LABEL,PRESET} from "../types/checkBody";
+import dataLis from '@components/EmergencyProcedure/emergency';
 import { Notify} from '@commonComp';
 import {pregetCheckbodyData} from '@store/async-actions/fetchModules';
 const api={
@@ -38,7 +39,7 @@ export const billing = (mdata,boxMark) => {
    delete savePm.featureType;
   storageLocal.set('emrParam',savePm);      //推送数据存储,用作推送前对比是否有变,有变才推送
     json(url, params).then((data) => {
-        let {dis, lab, pacs,markedVitalIds,moduleVital} = data.data.data||{};
+        let {dis, lab, pacs,vitalIds,moduleVital} = data.data.data||{};
         lab = lab||[];
         pacs = pacs||[];
         // console.log('推送数据', data.data.data);
@@ -46,12 +47,23 @@ export const billing = (mdata,boxMark) => {
              doubt=[],    //疑似诊断
             possible = [],  //可能诊断
             determine=[], //确诊
-            likely=[];//  鉴别诊断
+            setPushEmergency={}, //急诊
+            setPushEmergencyIdx='',//急诊对应本地数据
+            likely=[];//鉴别诊断
             doubt = dis&&dis['疑似诊断'],
             possible = dis&&dis['可能诊断'];
             vigilant = dis&&dis['警惕'];
             determine = dis&&dis['确诊']; //确诊
             likely = dis&&dis['鉴别诊断'];
+        if(dis&&dis['急诊']&&dis['急诊'].length>0){
+          setPushEmergency=dis['急诊'][0]
+          let name = dis['急诊'][0].name || ''
+          for(let i = 0;i < dataLis.length;i++){
+            if(name == dataLis[i].emergencyillname){
+              setPushEmergencyIdx=i
+            }
+          }
+        }
         if(lab) {
             for(let i = 0; i < lab.length; i++) {
                 lab[i].checked = false
@@ -76,6 +88,8 @@ export const billing = (mdata,boxMark) => {
             likely:likely||[],
             lab: lab||[],
             pacs: pacs||[],
+            setPushEmergency: setPushEmergency||[],
+            setPushEmergencyIdx:setPushEmergencyIdx
         });
         dispatch({
           type:PRESET,
@@ -84,7 +98,7 @@ export const billing = (mdata,boxMark) => {
         //查体高亮标签
         dispatch({
           type:SET_IMPORT_CHECKBODY_LABEL,
-          labels:markedVitalIds
+          labels:vitalIds
         })
   }).catch((e) =>{
       console.log(e)

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

@@ -53,7 +53,7 @@ export const addDiagnostic = (item) => {
                 "scaleName": "string",
             };
             //判断是否走慢病系统
-            const isChronic = state.diagnosticList.chronicMagItem && state.diagnosticList.chronicMagItem.name||state.mainSuit.chronicDesease && state.mainSuit.chronicDesease.name;
+            const isChronic = state.diagnosticList.chronicMagItem ||state.mainSuit.chronicDesease;
             // const isChronic = true
             if (isChronic) {
                 let chronicList = JSON.parse(storageLocal.get('chronic'));
@@ -161,7 +161,7 @@ export const getTreatResult = (item) =>{
         //         "symptom": "恶心,呕吐",
         //         "vital": ""
         // }
-        const isChronic = state.diagnosticList.chronicMagItem && state.diagnosticList.chronicMagItem.name||state.mainSuit.chronicDesease && state.mainSuit.chronicDesease.name;
+        const isChronic = state.diagnosticList.chronicMagItem ||state.mainSuit.chronicDesease;
         // const isChronic = true
         if (isChronic) {
             let chronicList = JSON.parse(storageLocal.get('chronic'));

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

@@ -17,7 +17,7 @@ const initState = {
   allModules:[],
   assistList:[],
   inspectList:[],
-  sysConfig:{}
+  sysConfig:{},
 };
 
 export default function (state=initState,action) {

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

@@ -27,7 +27,7 @@ const initState = {
     featureData:[],
     refresh:false //用于数据更新
   },
-  chronicDesease:{}, //慢病
+  chronicDesease:null, //慢病
   mainTailIds:[]  //获取症状尾巴用
 }
 

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

@@ -23,6 +23,8 @@ const initState = {
   formulaResult:{},
   scaleInfo:{},
   showHide:{},
+  setPushEmergency:{},
+  setPushEmergencyIdx:''
 };
 export default function(state = initState, action) {
   let res = Object.assign({},state);

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

@@ -16,4 +16,4 @@ 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 SETALLMODULES = 'SETALLMODULES';    //储存所有模板数据
-export const SETSYSTEMCONFIG = 'SETSYSTEMCONFIG';   //设置配置数据
+export const SETSYSTEMCONFIG = 'SETSYSTEMCONFIG';   //设置配置数据

+ 2 - 2
src/utils/tools.js

@@ -231,7 +231,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:[],mainTailIds:[],clearAction:true,symptomFeature:[],chronicDesease:{}});
+      store.dispatch({type: CLEAR_MAIN_SUIT,data:[],saveText:[],selecteds:[],editClear:true,mainIds:[],mainTailIds:[],clearAction:true,symptomFeature:[],chronicDesease:null});
         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:[]});
@@ -246,7 +246,7 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
             data:[],
             saveText:'',
             mainSuitStr: '',
-            chronicMagItem:{}
+            chronicMagItem:null
         });
         store.dispatch({
             type: CLEAR_ALL_PUSH_MESSAGE,