Quellcode durchsuchen

设置项配置1

zhouna vor 5 Jahren
Ursprung
Commit
7b37f55079

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

@@ -21,11 +21,11 @@ class ModeChange extends Component {
     render(){
         const {closeConfigModal, changeType, confirmType, config0,config1,config2,config3,config4,hideBtn} = this.props;
         const domNode = document.getElementById('root');
-        const isOpen = +config0===0;
-        const general = +config1===0;
-        const ohis = +config2===0;
-        const fontsize = +config3===0;
-        const color = +config4===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>
@@ -41,16 +41,16 @@ class ModeChange extends Component {
                     </p>
                   <p className={this.getStyle()}>
                     <span>开启一般情况默认值:</span>
-                    <a className={style['switch']} href="javascript:void(0)" onClick={hideBtn?()=>changeType('config1',general?'1':'0'):null}>
-                      <img src={general?sopen:sclose} alt=""/>
-                      {general?'开':'关'}
+                    <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?'1':'0'):null}>
-                      <img src={ohis?sopen:sclose} alt=""/>
-                      {ohis?'开':'关'}
+                    <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()}>

+ 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){

+ 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

+ 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;
 };

+ 1 - 1
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

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

@@ -16,7 +16,7 @@ export const saveMessage = (bool) => {
     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);
@@ -24,6 +24,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 evaluation={
       htmlContent:haveAssess?JSON.stringify(getEvaluations(baseList.assessResult,pushMessage)):'{}',
       //scaleList:[]
@@ -37,13 +38,13 @@ export const saveMessage = (bool) => {
     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,
         "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": [{
@@ -176,6 +177,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, // 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;