Procházet zdrojové kódy

Merge branch 'dev5.3.4' of http://192.168.2.236:10080/zhouna/newICSS into dev5.3.4

luolei před 5 roky
rodič
revize
be90f01e37

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

@@ -7,9 +7,10 @@
   // line-height: 2;
   min-height: 16px;//火狐需要
   line-height: 22px;
-  vertical-align: middle;
+  vertical-align: unset;
   text-align: left;
   padding-right: 1px;//火狐左右移动需要
+  font-weight: bold;
 }
 .editable-br{
   .editable-span;

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

@@ -102,15 +102,11 @@
   line-height: 44px;
   font-size: 12px;
   color:@red;
-  // border: none;
   background: #fff;
-  float: left;
-  // outline: none;
-  // text-align: center;
-  // cursor: pointer;
+  //float: left;
   margin-left: 22px;
   position: relative;
-  bottom: -10px;
+  //bottom: -10px;
 }
 .confirm{
   width: 120px;
@@ -118,16 +114,13 @@
   line-height: 44px;
   color:@blue;
   font-size: 12px;
-  // border: 1px solid @blue;
   background: #fff;
   margin-left: 20px;
-  float: right;
-  // outline: none;
+  //float: right;
   text-align: right;
-  // cursor: pointer;
   font-weight: bold;
   position: relative;
-  bottom: -10px;
+  //bottom: -10px;
   padding-right: 10px;
 }
 :global(.red){
@@ -155,6 +148,7 @@
   position: relative;//发热
   display: inline-block;
   color: @text-color;
+  font-weight: bold;
   /*padding: 0 3px 0;*/
   border-bottom: 1px @border-color solid;
 }

+ 54 - 7
src/components/Banner/ModeChange/index.jsx

@@ -2,8 +2,11 @@ import React, { Component } from "react";
 import style from "./index.less";
 import ReactDom from "react-dom";
 import close from '@images/icon_close.png';
-import sopen from '@images/btn-open.png'
-import sclose from '@images/btn-closed.png'
+import sopen from '@images/btn-open.png';
+import sclose from '@images/btn-closed.png';
+import radio_off from '@images/icon-radio-default.png';
+import radio_on from '@images/icon-radio-active.png';
+
 
 class ModeChange extends Component {
     constructor(props){
@@ -16,9 +19,13 @@ class ModeChange extends Component {
         return hideBtn?'':style['fade'];
     }
     render(){
-        const {closeConfigModal, changeType, confirmType, mode,hideBtn} = this.props;
+        const {closeConfigModal, changeType, confirmType, config0,config1,config2,config3,config4,hideBtn} = this.props;
         const domNode = document.getElementById('root');
-        const isOpen = +mode===0;
+        const isOpen = +config0!==1;
+        const general = +config1!==1;
+        const ohis = +config2!==1;
+        const fontsize = +config3!==1;
+        const color = +config4!==1;
         return ReactDom.createPortal(<React.Fragment>
             <div className={style['modal']}>
               <div className={style['shade']} onClick={closeConfigModal}></div>
@@ -27,16 +34,56 @@ class ModeChange extends Component {
                 <div className={style["oper"]}>
                     <p className={this.getStyle()}>
                       <span>开启模板智能推送:</span>
-                      <a className={style['switch']} href="javascript:void(0)" onClick={hideBtn?()=>changeType(isOpen?'1':'0'):null}>
+                      <a className={style['switch']} href="javascript:void(0)" onClick={hideBtn?()=>changeType('config0',isOpen?'1':'0'):null}>
                         <img src={isOpen?sopen:sclose} alt=""/>
                         {isOpen?'开':'关'}
                         </a>
                     </p>
+                  <p className={this.getStyle()}>
+                    <span>开启一般情况默认值:</span>
+                    <a className={style['switch']} href="javascript:void(0)" onClick={hideBtn?()=>changeType('config1',general?'0':'1'):null}>
+                      <img src={general?sclose:sopen} alt=""/>
+                      {general?'关':'开'}
+                    </a>
+                  </p>
+                  <p className={this.getStyle()+" "+style['big-marb']}>
+                    <span>开启开启其他史默认值:</span>
+                    <a className={style['switch']} href="javascript:void(0)" onClick={hideBtn?()=>changeType('config2',ohis?'0':'1'):null}>
+                      <img src={ohis?sclose:sopen} alt=""/>
+                      {ohis?'关':'开'}
+                    </a>
+                  </p>
+                  <p className={this.getStyle()}>
+                    <span>默认字体大小:</span>
+                    <a className={style['switch']} href="javascript:void(0)" onClick={hideBtn?()=>changeType('config3','0'):null}>
+                      <img src={fontsize?radio_on:radio_off} alt=""/>
+                      标准
+                    </a>
+                    <a className={style['switch']} href="javascript:void(0)" onClick={hideBtn?()=>changeType('config3','1'):null}>
+                      <img src={fontsize?radio_off:radio_on} alt=""/>
+                      增大
+                    </a>
+                  </p>
+                  <p className={this.getStyle()}>
+                    <span>默认字体颜色:</span>
+                    <a className={style['switch']} href="javascript:void(0)" onClick={hideBtn?()=>changeType('config4','0'):null}>
+                      <img src={color?radio_on:radio_off} alt=""/>
+                      标准
+                    </a>
+                    <a className={style['switch']} href="javascript:void(0)" onClick={hideBtn?()=>changeType('config4','1'):null}>
+                      <img src={color?radio_off:radio_on} alt=""/>
+                      增黑
+                    </a>
+                  </p>
                 </div>
                 <div className={style["explain"]}>
                     <p>说明:</p>
-                    <p>1.该设置只针对问诊模块中的“主诉”、“现病史”、“其他史”功能;</p>
-                    <p>2.慢病模式下,该模板智能推送的设置功能不可使用。</p>
+                    <p>1、智能推送模式只针对问诊模块中的“主诉”、“现病史”、“其他史”展示科室模版功能;</p>
+                    <p>2、慢病模式下,该模版智能推送的设置功能不可用;</p>
+                    <p>3、一般情况默认值:神清、精神可、胃纳可、睡眠可、二遍无殊、体重无明显减轻;</p>
+                    <p>4、其他史默认值:既往史无殊、过敏史无殊、个人史无殊;</p>
+                    <p>5、标准字号:</p>
+                    <p>6、标准字体颜色:</p>
                 </div>
                 {hideBtn?<div className={style['btn']} onClick={confirmType}><button>保存修改</button></div>:<div className={style['btn']} onClick={closeConfigModal}><button>&nbsp;&nbsp;关闭&nbsp;&nbsp;</button></div>}
             </div>

+ 10 - 2
src/components/Banner/ModeChange/index.less

@@ -16,20 +16,28 @@
       .maskContentZIndex1;
       position: fixed;
       top: 100px;
-      width: 432px;
+      width: 45%;
+      min-width: 450px;
       left:50%;
       margin-left: -216px;
       min-height: 284px;
       background: #fff;
       .oper{
         margin: 20px 30px;
+        p{
+          margin-bottom: 10px;
+          &.big-marb{
+            margin-bottom: 20px;
+          }
+        }
         .fade{
           opacity: .4;
         }
       }
       .explain{
         margin: 50px 30px;
-        opacity: .5;
+        /*opacity: .5;*/
+        color: #777;
         p{
           font-size: 12px;
           line-height: 20px;

+ 37 - 14
src/components/Banner/index.jsx

@@ -15,9 +15,14 @@ import ModeChange from './ModeChange'
 
 class Banner extends Component {
   constructor(props){
-    super(props)
+    super(props);
+    const conf = props.typeConfig;
     this.state = {
-      mode: props.typeConfig,
+      config0: conf[0],    //模式
+      config1:conf[1],   //一般情况默认
+      config2:conf[2],      //其他史默认
+      config3:conf[3],    //字体大小
+      config4:conf[4],       //字体颜色
       emergencyBox:false
     };
     this.showConfigModal = this.showConfigModal.bind(this);
@@ -25,32 +30,50 @@ class Banner extends Component {
     this.confirmType = this.confirmType.bind(this);
     this.showHisModal = this.showHisModal.bind(this);
     this.handleHisClose = this.handleHisClose.bind(this);
+    this.setInitConfig = this.setInitConfig.bind(this);
   }
 
   showConfigModal(){
-    this.setState({
-      mode:this.props.typeConfig,
-    });
+    this.setInitConfig();
     this.props.showConfigModal()
   }
 
-  changeType(typeConfig){
+  changeType(type,typeConfig){
     this.setState({
-      mode:typeConfig
+      [type]:typeConfig
     });
   }
 
   confirmType(){
     const {typeConfig,confirmType,clearCommS,closeConfigModal,readMode} = this.props;
-    const mode = this.state.mode;
     // 清空主诉常见症状
     clearCommS();
-    if(mode==typeConfig&&typeConfig==readMode){
+    /*if(mode==typeConfig&&typeConfig==readMode){
       closeConfigModal();
       return;
+    }*/
+    const configs= this.parseConf();
+    confirmType&&confirmType(configs);
+    closeConfigModal();
+  }
+  parseConf(){
+    let configs = Object.assign({},this.state);
+    delete configs.emergencyBox;
+    let obj = {};
+    for(let i in configs){
+      obj[i.replace('config','')] = configs[i];
     }
-    confirmType&&confirmType(mode);
-    closeConfigModal()
+    return obj;
+  }
+  setInitConfig(){
+    const conf = this.props.typeConfig;
+    this.setState({
+      config0: conf[0],
+      config1:conf[1],
+      config2:conf[2],
+      config3:conf[3],
+      config4:conf[0],
+    });
   }
   showHisModal(){
     const {getAllRecord} = this.props;
@@ -68,12 +91,12 @@ class Banner extends Component {
   handleHisClose(){
     this.setState({
       emergencyBox:false,
-    })
+    });
     dragBox('previewWrapper','previewStatic','del')    
   }
   render() {
     const {visible,ifShow,deptName, closeConfigModal,hasMain,hasCurrent,hasOther} = this.props;
-    const {mode,emergencyBox} = this.state;
+    const {emergencyBox} = this.state;
     const {showConfigModal, changeType, confirmType} = this;
     const domNode = document.getElementById('root');
     const disabled = !(hasMain||hasCurrent||hasOther);
@@ -92,7 +115,7 @@ class Banner extends Component {
           </div>
         </div>
         {visible&& <ModeChange
-          mode = {mode}
+          {...this.state}
           hideBtn={disabled}
           closeConfigModal = {closeConfigModal}
           changeType = {changeType}

+ 6 - 4
src/components/CommonSymptom/index.jsx

@@ -119,7 +119,13 @@ class CommonSymptom extends Component{
     return <div className={this.getClass()} contenteditable="false" style={{'display':hide?'none':'block'}} ref={this.div} onClick={this.handleOuter}>
       <ul className={style["listBox"]}>
         {mainHis.length>0?<ul className={style["his"]}>
+          <div className='clearfix'>
           <p>最近输入症状:</p>
+          <div className={style['oper']}>
+            <span className={style['clear']} onClick={this.handleClear}>清空选项</span>
+            <span className={style['confirm']} onClick={this.handleConfirm}>确定</span>
+          </div>
+          </div>
           {mainHis.map((it)=>{
             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>
           })}
@@ -129,10 +135,6 @@ class CommonSymptom extends Component{
           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']}>
-        <span className={style['clear']} onClick={this.handleClear}>清空选项</span>
-        <span className={style['confirm']} onClick={this.handleConfirm}>确定</span>
-      </div>
     </div>
   }
 }

+ 8 - 3
src/components/CommonSymptom/index.less

@@ -11,9 +11,11 @@
       color: #3B9ED0;
       border-bottom: 1px solid #EAEDF1;
       p{
-        line-height: 32px;
+        line-height: 44px;
         padding-left: 15px;
         color: #000;
+        width: 180px;
+        float: left;
       }
     }
   .c-title{
@@ -36,20 +38,23 @@
   .clear{
     .btnCom;
     .clear;
+    border: 1px #ff0000 solid;
+    padding: 5px 8px;
     margin-left: 15px;
     bottom: 0;
   }
   .confirm{
     .btnCom;
     .confirm;
+    border: 1px #3B9ED0 solid;
+    padding: 5px 8px;
     width: 75px;
     margin-left: 15px;
     bottom: 0;
-    padding-right: 20px;
   }
   .oper{
-    margin-top: 5px;
     padding-right: 5px;
+    float: right;
   }
 }
 .hide{

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

@@ -69,15 +69,17 @@ class ListItems extends Component{
     const noPush = tagType===11&&(!pushList||pushList.length===0);
     const noSearch = boxMark==1 && tagType==11 && !pos;       //非第一病程添加症状标签不显示搜索
     return <div className={style["drop-list"]} ref={parDiv} style={this.getStyle()} contentEditable="false" onClick={(e)=>{e.stopPropagation();}}>
-      {noPush?'':<p className={style['orderTips']}>按{order?'从左到右从上到下':'点击'}顺序成文</p>}
+      <div className='clearfix'>
+        {noPush?'':<p className={order?style['orderTips']:style['orderTips-m']}>按{order?'从左到右从上到下':'点击'}顺序成文</p>}
+        <div className={style["oper"]}>
+          <span className={style['clear']} onClick={handleClear}>清空选项</span>
+          <span className={style['confirm']} onClick={this.clickConfirm}>确定</span>
+        </div>
+      </div>
       {this.getLabels()}
       {noSearch && <div className="search">
         <SearchBox show={show} pushIds={this.getPushItemIds(pushList)} onSelect={this.searchSelect.bind(this)} onRef={(child)=>{this.child = child;}}/>
       </div>}
-      <div className="oper clearfix">
-        <span className={style['clear']} onClick={handleClear}>清空选项</span>
-        <span className={style['confirm']} onClick={this.clickConfirm}>确定</span>
-      </div>
     </div>
   }
 }

+ 21 - 6
src/components/ListItems/index.less

@@ -1,22 +1,37 @@
 @import "~@less/mixin.less";
 .drop-list{
   .pop;
-  padding:8px 20px 25px 0;
+  padding:14px 20px 8px 0;
+  min-width: 300px;
 }
 .orderTips{
+  float: left;
   color: #bfbfbf;
-  margin:0 0 0 28px;
+  margin:0 0 10px 28px;
+  max-width: 98px;
+  white-space: initial;
+}
+.orderTips-m{
+  .orderTips;
+  margin-top:10px;
+}
+.oper{
+  float: right;
 }
 .clear{
   .btnCom;
   .clear;
-  height: auto;
-  line-height: unset;
+  border: 1px #ff0000 solid;
+  padding: 5px 8px;
+  /*height: auto;
+  line-height: unset;*/
 }
 .confirm{
   .btnCom;
   .confirm;
-  height: auto;
-  line-height: unset;
+  border: 1px #3B9ED0 solid;
+  padding: 5px 8px;
+ /* height: auto;
+  line-height: unset;*/
   width: 60px;
 }

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

@@ -148,7 +148,7 @@ class Operation extends Component {
     let baseList = store.getState();
     let jsonData = getAllDataList(baseList);
     let jsonStr = getAllDataStringList(baseList);
-    let whichSign = baseList.typeConfig.typeConfig;
+    let whichSign = baseList.typeConfig.mode;
     let tmpLis = baseList.tabTemplate.items;
     let flg = isAllClear(jsonStr)
     if(!flg){

+ 22 - 9
src/components/SpreadDrop/index.jsx

@@ -32,16 +32,17 @@ class SpreadDrop extends Component{
   constructor(props){
     super(props);
     const {nones,noneOn,noneIds,withOn,exists,nowOn,withs,exclusion,excluName} = deepClone(props.selecteds||[]);
+    const initEx = this.getInitExclu();
     this.state = {
       nones:nones||'',       //无,字符串拼接
       exists:exists||[],      //主症状id
-      excluName:excluName||'',
+      excluName:excluName||initEx.excName,
       withs:withs||[],       //伴随 id
       noneIds:noneIds||[],
       noneOn:noneOn||false,       //无是否选中
       withOn:withOn||false,       //伴是否选中
       nowOn:nowOn||'',           //最近选中“无”还是“伴”
-      exclusion:exclusion||'',      //选中互斥项id
+      exclusion:exclusion||initEx.excluId,      //选中互斥项id
       timer:null,  //延时,区分单击双击
       ban:{},  //放'伴'字段
       editable:false,      //双击编辑
@@ -166,21 +167,33 @@ class SpreadDrop extends Component{
     this.setState({
       editable:false
     });
-
-
+  }
+  getInitExclu(){
+    const {defaulted,data,value} = this.props;
+    let excluId = '',excName='';
+    if(defaulted&&value===undefined){
+      const it = data[0];
+      excluId = it.exclusionType===1?it.questionDetailList[0].id:'';
+      excName = it.exclusionType===1?it.questionDetailList[0].name:'';
+    }
+    return {
+      excluId,
+      excName
+    }
   }
   setStateInit(){
     const {nones,noneOn,noneIds,withOn,exists,nowOn,withs,exclusion,excluName,ban} = deepClone(this.props.selecteds||[]);
+    const initEx = this.getInitExclu();
     this.setState({
       nones:nones||'',
       exists:exists||[],
-      excluName:excluName||'',
+      excluName:excluName||initEx.excName,
       withs:withs||[],
       noneIds:noneIds||[],
       noneOn:noneOn||false,
       withOn:withOn||false,
       nowOn:nowOn||'',
-      exclusion:exclusion||'',
+      exclusion:exclusion||initEx.excluId,
       ban:ban||{},
     });
   }
@@ -363,8 +376,8 @@ class SpreadDrop extends Component{
     }
   }*/
   render(){
-    const {placeholder,value,show,data,order,type,tagType,ikey,pos} = this.props;
-    const {tmpDom,left} = this.state
+    const {placeholder,value,show,data,order,type,tagType,ikey,pos,defaulted} = this.props;
+    const {tmpDom,left} = this.state;
     const clickIndx = ikey.split('-')[1];//展开下拉的index
     if(!show&&tmpDom){
       $(tmpDom).parent().prev().attr({"contentEditable":true})
@@ -384,7 +397,7 @@ class SpreadDrop extends Component{
         onInput={this.onChange}
         onkeydown={handleEnter}
         >{value||placeholder}</div>
-          <ListItems parDiv={this.$list} pos={pos} data={data} order={order} left={left} boxMark={type} tagType={tagType}
+          <ListItems parDiv={this.$list} defaulted={defaulted} pos={pos} data={data} order={order} left={left} boxMark={type} tagType={tagType}
              show={show} handleSelect={this.handleSelect} handleConfirm={this.handleConfirm} handleClear={this.handleClear} {...this.state}></ListItems>
       </div>
   }

+ 5 - 1
src/config/index.js

@@ -1,6 +1,10 @@
 export default {
     defaultValue:{      //默认配置
-      mode: 0     //0为半结构化模式,1为纯文本模式(主诉现病史其他史只自由文本输入)
+      0:0,     //0为半结构化模式,1为纯文本模式(主诉现病史其他史只自由文本输入)
+      1:0,    //一般情况默认值,1开启,2关闭
+      2:0,    //其他史默认值,1开启,2关闭
+      3:0,    //字体大小:1增大,0标准
+      4:0,    //字体颜色:1增黑,0标准
     },
     moduleCP:{//使用type
       '1':'mainSuit',          //主诉

+ 1 - 1
src/containers/AdviceContainer.js

@@ -11,7 +11,7 @@ function mapStateToProps(state) {
         isFirstMainDiag:  state.treat.isFirstMainDiag,
         followUp: state.pushMessage.advice.followUp,
         hasFollowUp: state.pushMessage.advice.hasFollowUp,
-        typeConfig: state.typeConfig.typeConfig
+        typeConfig: state.typeConfig.mode
     })
 }
 

+ 1 - 1
src/containers/CurrentIll.js

@@ -26,7 +26,7 @@ function mapStateToProps(state) {
         mainData:mainSuit.data,//主诉使用的模板
         symptomFeature:mainSuit.symptomFeature,//主诉分词数据
         moduleNum:mainSuit.moduleNum,//主诉使用的模板
-        type: typeConfig.typeConfig,
+        type: typeConfig.mode,
         mainIds:mainSuit.mainIds,//主诉症状选中的id(去重用)
         mainTailIds:mainSuit.mainTailIds,//主诉症状选中的id(去重用)
         totalHide: homePage.totalHide,

+ 1 - 1
src/containers/DiagnosticItem.js

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

+ 1 - 1
src/containers/DiagnosticList.js

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

+ 1 - 1
src/containers/MainSuit.js

@@ -23,7 +23,7 @@ function mapStateToProps(state) {
     datas:mainSuit.data,//数据源
     saveText:mainSuit.saveText,
 	  searchData:mainSuit.searchDatas,//搜索结果
-    type: typeConfig.typeConfig,
+    type: typeConfig.mode,
     showArr:homePage.showDrop,
     totalHide:homePage.totalHide,
     focusIndex:mainSuit.focusIndex,

+ 1 - 1
src/containers/OtherHistory.js

@@ -18,7 +18,7 @@ function mapStateToProps(state){
     showArr:homePage.showDrop,
     totalHide:homePage.totalHide,
     saveText:otherHistory.saveText,
-    type: typeConfig.typeConfig,
+    type: typeConfig.mode,
     hasMain,//主诉是否有数据
     searchData:otherHistory.searchData,    //延迟搜索结果
     focusTextIndex:otherHistory.focusIndex,    //聚焦的自由文本标签index

+ 1 - 2
src/containers/TypeConfigContainer.js

@@ -4,7 +4,6 @@ import Banner from "../components/Banner";
 import { SHOW_CONFIG_MODAL, CLOSE_CONFIG_MODAL, CONFIRM_TYPE } from "../store/types/typeConfig";
 import {pushAllDataList} from '@utils/tools';
 import {saveMode,getOtherHisRecord} from '@store/async-actions/fetchModules';
-import config from "@config/index";
 import { allCheckedShow } from '@store/actions/tabTemplate';
 import {Notify} from '@commonComp';
 
@@ -22,7 +21,7 @@ function mapStateToProps(state) {
   const other = state.otherHistory;
   const typeConfig = state.typeConfig;
   return {
-    typeConfig:typeConfig.typeConfig||config.defaultValue.mode,
+    typeConfig:typeConfig.typeConfig,
     visible:typeConfig.visible,
     hasMain:ifHasData(main.data,main.saveText),
     hasCurrent:ifHasData(current.data,current.saveText),

+ 3 - 1
src/containers/eleType.js

@@ -142,12 +142,14 @@ function multCheckLabels(params,tagType){
   const {i,boxMark,showArr,importLabel,setHighter} = params;
   let isHigh=importLabel&&importLabel.includes(data.id);
   const showInx = boxMark+"-"+i+'-0';
+  const showVal = data.value!==undefined?data.value:data.selFlag===1?data.remark:undefined;
   return <SpreadDrop data={data.questionMapping}
                      pos={data.pos}
                      ikey={showInx}
+                     defaulted={data.selFlag}
                      setHighter={setHighter}
                      placeholder={data.name}
-                     value={data.value}
+                     value={showVal}
                      copyType={data.copyType}
                      isExtBlue={data.specFlag===4?true:false}
                      selecteds={data.selecteds}

+ 12 - 2
src/store/actions/typeConfig.js

@@ -12,12 +12,22 @@ export const closeConfigModal=(state,action)=>{
 
 export const confirmType=(state,action)=>{
   const res=Object.assign({},state);
-  res.typeConfig = action.confirmType;
+  const configs = action.confirmType;
+  res.mode = configs[0];
+  for(let i in configs){
+    if(configs[i]!==null&&configs[i]!==undefined){
+      res.typeConfig[i] = configs[i];
+    }
+  }
+  //res.typeConfig = Object.assign({},res.typeConfig,action.confirmType);
   return res;
 };
 
 export const setReadMode=(state,action)=>{
   const res=Object.assign({},state);
-  res.readMode = action.readMode;
+  res.readMode = action.readMode||(action.readConfig&&action.readConfig[0]);
+  if(action.readConfig){
+    res.readConfig = action.readConfig;
+  }
   return res;
 };

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

@@ -192,7 +192,7 @@ export function setOtherHisModule(){
     const otherModel = initData.otherHisModel;
     const block = Object.assign(JSON.parse(config.textLabel),{full:true});
     const readMode = state.typeConfig.readMode;     //数据实际模式
-    const mode = readMode!==-1&&readMode!==null?readMode:state.typeConfig.typeConfig;
+    const mode = readMode!==-1&&readMode!==null?readMode:state.typeConfig.mode;
     const model = otherModel&&otherModel.length>0?deepClone(otherModel):[block];     //其他史模板,没有模板数据则显示一个空文本标签
     const arr = deepClone(initData.otherHis);        //最近其他史数据
     const arrSave = deepClone(initData.otherHisSave);    //最近其他史saveText
@@ -223,14 +223,24 @@ export function setOtherHisModule(){
   }
 }
 
+//转换设置传参
+function parseConfigParam(configs){
+  let arr = [];
+  for(let key in configs){
+    arr.push({
+      modeClassify:key.replace("config",''),
+      modeValue:configs[key]
+    })
+  }
+  return arr;
+}
 //保存切换模式
 export function saveMode(mode){
   return (dispatch,getStore)=>{
     const {patInfo} = getStore();
     const param = {
       doctorId:patInfo.message.doctorId,
-      modeClassify:0,
-      modeValue:mode
+      doctorPageMode: parseConfigParam(mode)
     };
     return json(api.saveMode,param);
   }

+ 35 - 39
src/store/async-actions/patInfo.js

@@ -14,7 +14,8 @@ const api = {
     getPatInfo: '/patientInfo/getTopPatientInfo',
     getPatBaseInfo: '/patientInfo/getPatientInfo',
     getHospitalInfo:'/hospitalInfo/getHospitalInfo',
-    getPreMsg:'/api/prec/inquiryInfo/getInquiryDetail'
+    getPreMsg:'/api/prec/inquiryInfo/getInquiryDetail',
+    getDoctorConfig:'/doctorPageMode/getDoctorPageModes',       //获取医生设置
 };
 
 //获取预问诊信息
@@ -111,7 +112,39 @@ export const initHistoryDetails = (dispatch) => {
             }
         })
     }
+};
+//转换设置存值
+function parseDoctorCon(arr){
+  let obj = {};
+  let it;
+  if(!arr){
+    return null;
+  }
+  for(let i=0;i<arr.length;i++){
+    it = arr[i];
+    obj[it.modeClassify] = it.modeValue;
+  }
+  return obj;
 }
+
+//获取医生设置信息
+function getDoctorConfig(id,dispatch){
+  json(api.getDoctorConfig,{doctorId:id}).then((res)=>{
+    if(res.data.code==='0'){
+      const configs = parseDoctorCon(res.data.data);
+      if(!configs){
+        return ;
+      }
+      dispatch({
+        type:CONFIRM_TYPE,
+        confirmType:configs
+      })
+    }else{
+      Notify.info(res.data.msg);
+    }
+  });
+}
+
 //技术部需求,先获取第一个接口再去第二个
 export async function getPatientMessage(dispatch, getState){
   const state = getState();
@@ -132,6 +165,7 @@ export async function getPatientMessage(dispatch, getState){
   let data1 = {},data2 = {};
   if(res1.data.code=='0'){
     data1 = res1.data.data;
+    getDoctorConfig(data1.doctorId,dispatch);
   }
   if(res2.data.code=='0'){
     data2 = res2.data.data;
@@ -140,11 +174,6 @@ export async function getPatientMessage(dispatch, getState){
     type: GET_PATIENT_MESSAGE,
     data:Object.assign(data1,data2)
   });
-  //设置初始模式
-  dispatch({
-    type: CONFIRM_TYPE,
-    confirmType:data1.modeValue||config.defaultValue.mode
-  });
   localStorage.removeItem('deletedTags');
   dispatch(getInitModules);     //确保病人信息获取以后再获取模板等数据,否则参数为空
   dispatch(getCommonList(5));     //获取常用化验标签列表
@@ -153,36 +182,3 @@ export async function getPatientMessage(dispatch, getState){
   // initHospitalInfo(dispatch, getState) //不需要的
 }
 
-/*
-export const getPatientMessage = (dispatch, getState) => {
-  const state = getState();
-  const urlDatas = state.getInfoByUuid;
-  const params = {
-    hospitalCode:urlDatas.hospitalId,
-    hospitalDeptCode: urlDatas.deptNo,
-    doctorCode: urlDatas.doctorNo,
-    patientCode:urlDatas.patientNo,
-    recordId:urlDatas.recordId
-  };
-  // 获取医生,患者基本信息
-  Promise.all([json(api.getPatInfo, params),json(api.getPatBaseInfo, params)])
-    .then((data) => {
-      let data1 = {},data2={};
-      if(data[0].data.code=='0'){
-        data1 = data[0].data.data;
-      }
-      if(data[1].data.code=='0'){
-        data2 = data[1].data.data;
-      }
-      dispatch({
-        type: GET_PATIENT_MESSAGE,
-        data:Object.assign(data1,data2)
-      });
-      //设置初始模式
-      dispatch({
-        type: CONFIRM_TYPE,
-        confirmType:data1.modeValue
-      });
-      dispatch(getInitModules);     //确保病人信息获取以后再获取模板等数据,否则参数为空
-    })
-};*/

+ 5 - 4
src/store/async-actions/print.js

@@ -46,7 +46,7 @@ export const realSaveData = (bool,list) => {
     const readMode = baseList.typeConfig.readMode;          //回读模式
     let state = baseList.patInfo.message;
     //保存时保存当前的数据实际模式,不是系统模式,针对回读模式与系统模式不一致的情况处理
-    let whichSign = readMode===-1||readMode===null?baseList.typeConfig.typeConfig:readMode;
+    let whichSign = readMode===-1||readMode===null?baseList.typeConfig.mode:readMode;
     const pushMessage = baseList.pushMessage;
     let jsonStr = getAllDataStringList(baseList);
     let jsonData = getAllDataList(baseList);
@@ -54,6 +54,7 @@ export const realSaveData = (bool,list) => {
     const lisArr = transferIndexData(lisData);
     const haveAssess = Object.keys(baseList.assessResult.data).length>0;
     let otherData = {},pacsData={};
+    const docConfigs = baseList.typeConfig.typeConfig;
     const evaluation={
       htmlContent:haveAssess?JSON.stringify(getEvaluations(baseList.assessResult,pushMessage)):'{}',
       //scaleList:[]
@@ -67,14 +68,14 @@ export const realSaveData = (bool,list) => {
     otherData['haveAssess']=haveAssess
     otherData['pfix']=jsonStr.other?filterOtherDataArr(JSON.parse(jsonStr.other),jsonData.other):''
     pacsData.pacs = jsonData.pacs
-    pacsData.checkedListImport = jsonData.checkedListImport
+    pacsData.checkedListImport = jsonData.checkedListImport;
     json('/inquiryInfo/saveInquiry', {
         "doctorId": state.doctorId,
         "conceptIntroduceDTO":list||[],
         "hospitalDeptId": state.hospitalDeptId,
         "hospitalId": state.hospitalId,
         "patientId": state.patientId,         //患者id              
-        "dataJson": JSON.stringify(Object.assign({haveAssess:haveAssess},jsonData)),
+        "dataJson": JSON.stringify(Object.assign({haveAssess:haveAssess,docConfigs:docConfigs},jsonData)),
         "indexData":lisArr,
         "inquiryEvaluation":evaluation,
         "detailList": [{
@@ -209,6 +210,6 @@ function getEvaluations(base,pushMessage){
 
 export const clearMessages = () => {
     let baseList = store.getState();
-    let whichSign = baseList.typeConfig.typeConfig;
+    let whichSign = baseList.typeConfig.mode;
     pushAllDataList(whichSign,'clear');
 };

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

@@ -48,7 +48,7 @@ export const saveTemplateDetail = (val,sex) => { //保存为模板
   let jsonData = getAllDataList(baseList);
   let jsonStr = getAllDataStringList(baseList);
   const readMode = baseList.typeConfig.readMode;          //回读模式
-  let whichSign = readMode===-1||readMode===null?baseList.typeConfig.typeConfig:readMode;
+  let whichSign = readMode===-1||readMode===null?baseList.typeConfig.mode:readMode;
   let state = baseList.patInfo.message;
   let preview = {
     "chief": jsonStr.chief,
@@ -134,7 +134,7 @@ export const delBatchItem = (ids) => { //批量删除
 
 export const changeTitleAsync = (obj) => { //改标题
   let baseList = store.getState();
-  let whichSign = baseList.typeConfig.typeConfig;
+  let whichSign = baseList.typeConfig.mode;
   let state = baseList.patInfo.message;
   if (obj.title.trim() == '') {
     Notify.info('请输入模板名称');

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

@@ -4,8 +4,10 @@ import config from '@config/index';
 
 const initState = {
   visible: false,
-  typeConfig: config.defaultValue.mode, // 0:智能推送模式, 1:纯文本模式,用于切换选中状态
-  readMode:-1,  //回读回来的模式,-1即没有回读模式
+  typeConfig: config.defaultValue,
+  readConfig:-1,    //回读/引用回来的配置
+  readMode:-1,  //回读/引用回来的模式,-1即没有回读模式
+  mode:config.defaultValue[0],       //设置的模式, 0:智能推送模式, 1:纯文本模式,用于切换选中状态
 };
 export default function(state = initState, action) {
   switch (action.type) {

+ 7 - 6
src/utils/tools.js

@@ -157,7 +157,7 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
       const block = Object.assign(JSON.parse(config.textLabel),{full:true});//空白时保留一个自由文本标签
       //清除已删除标签记录
       localStorage.removeItem('deletedTags');
-      store.dispatch({type: SET_READ_MODE, readMode: -1});      //清除回读模式值
+      store.dispatch({type: SET_READ_MODE, readMode: -1,readConfig:-1});      //清除回读模式值
       store.dispatch({type: CLEAR_MAIN_SUIT,data:[],saveText:[],editClear:true,mainIds:[],mainTailIds:[],clearAction:true,symptomFeature:[],chronicDesease:null,mainReadSonM:[]});
         store.dispatch({type: CLEAR_CURRENT_ILL,data:[],saveText:[],editClear:true,symptomIds:[],currReadSonM:[]});
         store.dispatch({type: CLEAROTHERHISTORY,data:[block],isEmpty:true,saveText:[],editClear:true,yjs_1:'',yjs_2:'',yjs_3:'',yjs_4:''});
@@ -231,10 +231,11 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
           isText:true,    //查体只显示文本
       });
     }else{
+        let dataJson = JSON.parse(reData.dataJson);
+        const docConfig = dataJson.docConfigs;
         //回读/引用设置回读模式值(主诉-其他史使用)
-        store.dispatch({type: SET_READ_MODE, readMode: whichSign});
+        store.dispatch({type: SET_READ_MODE, readMode: whichSign,readConfig:docConfig});
         if (whichSign == 0) {
-          let dataJson = JSON.parse(reData.dataJson);
           //其他史data
           const oData = dataJson.other;
           const onlyOneText = oData.length==1&&oData[0].tagType==8&&!(oData[0].name||oData[0].value);
@@ -368,7 +369,7 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
             }
         } else {
             if(type == 'template'){     //纯文本模板回读
-                let dataJson = JSON.parse(reData.dataJson);
+                //let dataJson = JSON.parse(reData.dataJson);
                 let dataJsonStr = JSON.parse(reData.preview);
                 // console.log(dataJson,dataJsonStr,'纯文本模板引用')
                 store.dispatch({     //主诉文本框
@@ -422,7 +423,7 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
               //tab跳回辅助信息
               store.dispatch(tabChange('0'));
             }else{  //纯文本历史病历回读
-                let dataJson = JSON.parse(reData.dataJson);
+                //let dataJson = JSON.parse(reData.dataJson);
                 let dataJsonStr = reData.detailList;
                 // console.log(dataJson,dataJsonStr,'纯文本历史病历回读')
                 if(!dataJson && !dataJsonStr && !reData.sign){
@@ -764,7 +765,7 @@ function getCurrentDate(flg,con){
 }
 function inspectAndAssist(){
   const state = store.getState();
-  let mainType = state.typeConfig.typeConfig
+  let mainType = state.typeConfig.mode
   if(mainType == 1){return}//文本模式不放化验辅检的模板
   let tmpAll = state.homePage.allModules;
   let tmpInspected = state.inspect.labelList;