Explorar o código

设置项配置:回读和模式联动

zhouna %!s(int64=5) %!d(string=hai) anos
pai
achega
a12a849562

+ 14 - 11
src/components/Banner/ModeChange/index.jsx

@@ -14,8 +14,11 @@ class ModeChange extends Component {
       this.getStyle=this.getStyle.bind(this);
 
     }
-    getStyle(){
-        const {hideBtn} = this.props;
+    getStyle(flag){
+        const {hideBtn,config0} = this.props;
+        if(flag===1&&config0===1){
+          return style['fade'];
+        }
         return hideBtn?'':style['fade'];
     }
     render(){
@@ -34,43 +37,43 @@ 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('config0',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()}>
+                  <p className={this.getStyle(1)}>
                     <span>开启一般情况默认值:</span>
-                    <a className={style['switch']} href="javascript:void(0)" onClick={hideBtn?()=>changeType('config1',general?'0':'1'):null}>
+                    <a className={style['switch']} href="javascript:void(0)" onClick={hideBtn&&isOpen?()=>changeType('config1',general?1:0):null}>
                       <img src={general?sclose:sopen} alt=""/>
                       {general?'关':'开'}
                     </a>
                   </p>
-                  <p className={this.getStyle()+" "+style['big-marb']}>
+                  <p className={this.getStyle(1)+" "+style['big-marb']}>
                     <span>开启开启其他史默认值:</span>
-                    <a className={style['switch']} href="javascript:void(0)" onClick={hideBtn?()=>changeType('config2',ohis?'0':'1'):null}>
+                    <a className={style['switch']} href="javascript:void(0)" onClick={hideBtn&&isOpen?()=>changeType('config2',ohis?1:0):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}>
+                    <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}>
+                    <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}>
+                    <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}>
+                    <a className={style['switch']} href="javascript:void(0)" onClick={hideBtn?()=>changeType('config4',1):null}>
                       <img src={color?radio_off:radio_on} alt=""/>
                       增黑
                     </a>

+ 9 - 1
src/components/Banner/index.jsx

@@ -39,6 +39,14 @@ class Banner extends Component {
   }
 
   changeType(type,typeConfig){
+    if(type==='config0'&&typeConfig===1){     //智能模式关闭,一般情况和其他史默认值也关闭
+      this.setState({
+        config0: 1,
+        config1: 0,
+        config2: 0,
+      });
+      return;
+    }
     this.setState({
       [type]:typeConfig
     });
@@ -72,7 +80,7 @@ class Banner extends Component {
       config1:conf[1],
       config2:conf[2],
       config3:conf[3],
-      config4:conf[0],
+      config4:conf[4],
     });
   }
   showHisModal(){

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

@@ -25,10 +25,11 @@ class OtherHistory extends Component{
     fetchModules&&fetchModules({id:questionId,index:focusTextIndex,name,span,searchInEnd});
   }
   getLabels(){
-    const {data,showArr,saveText} = this.props;
+    const {data,showArr,saveText,readConfig,docConfig} = this.props;
+    const configs = readConfig===null||readConfig ===-1?docConfig:readConfig;
     const {boxMark} = this.state;
     let list = data.map((item,i)=>{
-      return chooseType({item,boxMark,i,hideTag:false,showArr,saveText});
+      return chooseType({item,boxMark,i,hideTag:false,showArr,saveText,configs});
     });
     return list;
   }

+ 2 - 0
src/containers/OtherHistory.js

@@ -27,6 +27,8 @@ function mapStateToProps(state){
     editClear:otherHistory.editClear,       //编辑状态
     isRead:state.homePage.isRead,
     readMode:typeConfig.readMode,       //回读回来的模式(与当前模式并存)
+    readConfig:typeConfig.readConfig,
+    docConfig:typeConfig.typeConfig,
   }
 }
 

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

@@ -13,10 +13,11 @@ import {
 
 export const saveMessage = (bool) => {
     let baseList = store.getState();
-    const readMode = baseList.typeConfig.readMode;          //回读模式
+    const dConfig = baseList.typeConfig;
+    const readMode = dConfig.readMode;          //回读模式
     let state = baseList.patInfo.message;
     //保存时保存当前的数据实际模式,不是系统模式,针对回读模式与系统模式不一致的情况处理
-    let whichSign = readMode===-1||readMode===null?baseList.typeConfig.mode:readMode;
+    let whichSign = readMode===-1||readMode===null?dConfig.mode:readMode;
     const pushMessage = baseList.pushMessage;
     let jsonStr = getAllDataStringList(baseList);
     let jsonData = getAllDataList(baseList);
@@ -24,7 +25,7 @@ export const saveMessage = (bool) => {
     const lisArr = transferIndexData(lisData);
     const haveAssess = Object.keys(baseList.assessResult.data).length>0;
     let otherData = {},pacsData={};
-    const docConfigs = baseList.typeConfig.typeConfig;
+    const docConfigs = dConfig.readConfig===-1||!dConfig.readConfig?dConfig.typeConfig:dConfig.readConfig;
     const evaluation={
       htmlContent:haveAssess?JSON.stringify(getEvaluations(baseList.assessResult,pushMessage)):'{}',
       //scaleList:[]