Parcourir la source

Merge remote-tracking branch 'origin/dev5.4.1' into dev/new1

zhouna il y a 5 ans
Parent
commit
918eaf90f9

+ 42 - 40
src/components/Banner/ModeChange/index.jsx

@@ -34,52 +34,53 @@ class ModeChange extends Component {
               <div className={style['shade']} onClick={closeConfigModal}></div>
               <div className={style['content']}>
                 <div className={style['close']}>设置<img src={close} onClick={closeConfigModal} /></div>
-                <div className={style["oper"]}>
+                <div className="scroller">
+                  <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}>
                         <img src={isOpen?sopen:sclose} alt=""/>
                         {isOpen?'开':'关'}
-                        </a>
+                      </a>
                     </p>
-                  <p className={this.getStyle(1)}>
-                    <span>开启一般情况默认值:</span>
-                    <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(1)+" "+style['big-marb']}>
-                    <span>开启其他史默认值:</span>
-                    <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}>
-                      <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 className={this.getStyle(1)}>
+                      <span>开启一般情况默认值:</span>
+                      <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(1)+" "+style['big-marb']}>
+                      <span>开启其他史默认值:</span>
+                      <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}>
+                        <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>
@@ -87,6 +88,7 @@ class ModeChange extends Component {
                     <p>4、其他史默认值:既往史无殊、过敏史无殊、个人史无殊;</p>
                     <p>5、病历书写模块,字体大小标准为14px,增大为18px;</p>
                     <p>6、病历书写模块,字体颜色标准为灰黑色,增黑为全黑色;</p>
+                  </div>
                 </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>

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

@@ -15,10 +15,11 @@
     .content {
       .maskContentZIndex1;
       position: fixed;
-      top: 100px;
+      top: 50%;
       width: 45%;
       min-width: 450px;
       left:27%;
+      margin-top:-265px;
       /*margin-left: -216px;*/
       min-height: 284px;
       background: #fff;

+ 11 - 4
src/components/MedicalInfo/index.jsx

@@ -37,7 +37,7 @@ class MedicalInfo extends Component {
         const that = this;
         if(searchResult&&searchResult.length>0){
           setTimeout(function(){
-            that.$ul.current.style.height = getWindowInnerHeight()-278+'px';
+            if(that.$ul.current)that.$ul.current.style.height = getWindowInnerHeight()-278+'px';
           },100);
         }
         return searchResult && searchResult.map((item) => {
@@ -129,10 +129,17 @@ class MedicalInfo extends Component {
       }
     });
   }
-  componentWillReceiveProps(){
+  componentWillReceiveProps(next){
     this.setState({
       hasSearch: false
     });
+    //点清空恢复初始状态
+    if(this.props.clearSearch!==next.clearSearch){
+      this.clear();
+      this.setState({
+        typeChecks:['0']
+      });
+    }
   }
     render() {
         const {searchResult,filterList} = this.props;
@@ -141,8 +148,8 @@ class MedicalInfo extends Component {
             <div className={style['search-cont']} ref={this.$cont}>
               <div className={style['search-box']}>
                 <p className={style['cont']}>
-                  <input placeholder="医学知识搜索" type="text" className={style['input']} ref={this.$inp} onInput={this.handleChange} onKeyUp={this.handleEnter}/>
-                  {val?<img src={delIcon} id='clearMedicalInfoSearch' alt="清空" onClick={this.clear}/>:''}
+                  <input placeholder="医学知识搜索" id='medicalInfoSearch' 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>
                 <Filters data ={filterList} checkeds={typeChecks} handleCheck={this.handleTypeCheck}></Filters>

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

@@ -163,7 +163,7 @@ class Multiple extends react.Component{
   }
   handleMouseDown(){
     const {i,setSelectArea,boxMark}= this.props;
-    setSelectArea({i,boxMark,dir:'start'});
+    !this.state.editable&&setSelectArea({i,boxMark,dir:'start'});
   }
   componentDidMount(){
     if(isIE()){

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

@@ -101,8 +101,8 @@ class Operation extends Component {
     let jsonData = getAllDataList(baseList);
     let jsonStr = getAllDataStringList(baseList);
     let flg = isAllPartClear(jsonData,jsonStr,baseList);
-    const tpVal = $("#clearTemplateSearch").prev().val();   //模板是否有搜索条件未清空
-    const mdVal = $("#clearMedicalInfoSearch").prev().val();    //知识是否有搜索条件未清空
+    const tpVal = $("#templateSearch").val();   //模板是否有搜索条件未清空
+    const mdVal = $("#medicalInfoSearch").val();    //知识是否有搜索条件未清空
     if(flg||tpVal||mdVal){
       this.setState({
         type: type,

+ 3 - 1
src/components/PushContainer/index.jsx

@@ -274,7 +274,7 @@ class PushContainer extends Component {
     store.dispatch(changeVisible(false));
   }
   render() {
-    const { activeId, checkItems, visible, showMsg,hasMore,current, items, allCheckShow,allCheckShowAdmin,adminItems,admin,checkItemsAdmin } = this.props;
+    const { activeId, checkItems, visible, showMsg,hasMore,current, items, allCheckShow,allCheckShowAdmin,adminItems,admin,checkItemsAdmin,clearSearch } = this.props;
     return <div className={style["container"]} ref={this.$cont} >
       <Tab tabs={this.state.tabs}
         activeId={activeId}
@@ -285,6 +285,7 @@ class PushContainer extends Component {
           <CaseQuailty></CaseQuailty>
           <TemplateItems
             items={items}
+            clearSearch={clearSearch}
             adminItems={adminItems}
             admin={admin}
             handleAllCheckboxAdmin={this.handleAllCheckboxAdmin}
@@ -341,6 +342,7 @@ const mapStateToProps = (state) => {//console.log(state)
     allCheckedAdmin: state.tabTemplate.allCheckedAdmin,
     allCheckShowAdmin: state.tabTemplate.allCheckShowAdmin,
     checkItemsAdmin: state.tabTemplate.checkItemsAdmin,
+    clearSearch:state.print.clearSearch,
   }
 }
 

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

@@ -151,7 +151,7 @@ class RadioDrop extends Component{
   }
   handleMouseDown(){
     const {i,setSelectArea,boxMark}= this.props;
-    setSelectArea({i,boxMark,dir:'start'});
+    !this.state.editable&&setSelectArea({i,boxMark,dir:'start'});
   }
   render(){
     const {data,placeholder,show,value,hideTag,boxMark,select_start,i} = this.props;

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

@@ -376,7 +376,7 @@ class SpreadDrop extends Component{
   }
   handleMouseDown(){
     const {i,setSelectArea,boxMark}= this.props;
-    setSelectArea({i,boxMark,dir:'start'});
+    !this.state.editable&&setSelectArea({i,boxMark,dir:'start'});
   }
   componentDidMount(){
     if(isIE()){

+ 10 - 4
src/components/TemplateItems/index.jsx

@@ -113,10 +113,16 @@ class TemplateItems extends React.Component {
         this.$search.current.value = '';
         this.setState({
             val:''
-        })
+        });
         this.$search.current.focus();
+        this.templateSearch();
+    }
+  componentWillReceiveProps(next){
+        //点清空恢复初始状态
+      if(this.props.clearSearch!==next.clearSearch){
+        this.clear();
+      }
     }
-
     render() {
         const { checkItemsAdmin,handleAllCheckboxAdmin,handleMangerTemplateAdmin,allCheckShowAdmin,admin,adminItems,allCheckShow, handleMangerTemplate,handleClickGetMore, handleDelList, handleAllCheckbox, items,checkItems,current,hasMore } = this.props;
         const {height} = this.state
@@ -138,7 +144,7 @@ class TemplateItems extends React.Component {
                         <div className={style.wrapperTop}>
                             <div className={style.templateSearch}>
                                 <input placeholder="模板搜索" maxLength="30" ref={this.$search} type="text" onInput={this.handleChange} onPropertyChange={this.handleChange} onKeyUp={this.handleEnter}/>
-                                {this.state.val?<img src={delIcon} id='clearTemplateSearch' alt="清空" onClick={this.clear}/>:''}
+                                {this.state.val?<img src={delIcon} alt="清空" onClick={this.clear}/>:''}
                                 <div className={style.search} onClick={this.templateSearch}>搜索</div>
                             </div>
                             {
@@ -150,7 +156,7 @@ class TemplateItems extends React.Component {
                     items&&!admin ? 
                         <div className={style.wrapperTop}>
                             <div className={style.templateSearch}>
-                                <input placeholder="模板搜索" maxLength="30" ref={this.$search} type="text" onInput={this.handleChange} onPropertyChange={this.handleChange} onKeyUp={this.handleEnter}/>
+                                <input placeholder="模板搜索" id='templateSearch' maxLength="30" ref={this.$search} type="text" onInput={this.handleChange} onPropertyChange={this.handleChange} onKeyUp={this.handleEnter}/>
                                 {this.state.val?<img src={delIcon} alt="清空" onClick={this.clear}/>:''}
                                 <div className={style.search} onClick={this.templateSearch}>搜索</div>
                             </div>

+ 3 - 3
src/components/Treat/AdverseReactions/index.jsx

@@ -75,10 +75,10 @@ class AdverseReactions extends Component {
                         
                     </span>
                         {item.details.map((it, idx) => {
-                            return <span className={style['adverse-reactions-name']} key={item.conceptId + item.name + it.name}>
-                                <input type="radio" checked={it.select} id={item.conceptId +item.name + it.name} onChange={this.changeReact.bind(this, it, index)}/>
+                            return <span className={`style['adverse-reactions-name'] ${it.value == 1 ? style['selectd']:''}`} key={item.conceptId + item.name + it.name}>
+                                <input type="radio" checked={it.value == 1}  id={item.conceptId +item.name + it.name} onChange={this.changeReact.bind(this, it, index)}/>
                                 <label for={item.conceptId +item.name + it.name}> {it.name} </label>
-                                {it.value==1 && <span className={style['adverse-reactions-recommend']}>(智能推荐)</span>}
+                                {/* {it.value==1 && <span className={style['adverse-reactions-recommend']}>(智能推荐)</span>} */}
                             </span>
                         })}
                     </div>)

+ 3 - 0
src/components/Treat/AdverseReactions/index.less

@@ -58,4 +58,7 @@
     }
 
 }
+.selectd{
+    color: #3B9ED0;
+}
 

+ 2 - 1
src/containers/MedicalInfoContainer.js

@@ -9,12 +9,13 @@ import {CLEAR_INFO_SEARCH_LIST,SET_FILTER_LIST} from '@types/medicalInfo';
 import {SHOW_TABLE_LIST} from '@store/types/pushMessage';
 
 function mapStateToProps(state) {
-    const {medicalInfo,pushMessage} = state;
+    const {medicalInfo,pushMessage,print} = state;
     return{
         searchResult: medicalInfo.searchResult,
         filterList:medicalInfo.filterList,
         formulaResult: pushMessage.formulaResult,
         scaleInfo: pushMessage.scaleInfo,//量表内容
+        clearSearch:print.clearSearch,
     }
 }
 

+ 0 - 1
src/containers/OperationContainer.js

@@ -117,7 +117,6 @@ function mapDispatchToProps(dispatch) {
               dispatch(billing());
             }
           },200);
-
         }
     };
 }

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

@@ -34,8 +34,8 @@ export const diagShow=(state,action)=>{
   return res;
 };
 
-export const recoverTag = (state,action)=> {
-  const res = Object.assign({}, state);
-  console.log(res);
+export const clearSearchParam=(state,action)=>{
+  const res=Object.assign({},state);
+  res.clearSearch = action.data;
   return res;
-}
+};

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

@@ -167,9 +167,9 @@ export const changeReact=(state,action)=>{
     const res = JSON.parse(JSON.stringify(state));
     const index = action.index
     res.adversReactionList[index].details = res.adversReactionList[index].details.map(item => {
-      item.select = false;
+      item.value = 0;
       if(item.name == action.it.name){
-        item.select = !item.select
+        item.value = 1
       }
       return item
     })

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

@@ -178,8 +178,8 @@ function getTreatment(item, dispatch, state,url,params, isChronic) {
                                          if(adverseEvent[j].conceptId == allAdversReactionList[i].adversReactionList[z].conceptId && adverseEvent[j].name == allAdversReactionList[i].adversReactionList[z].name) {
                                              for(let x = 0; x < allAdversReactionList[i].adversReactionList[z].details.length; x++) {
                                                  for(let y = 0; y < adverseEvent[j].details.length; y++) {//判断每一项是否选择过
-                                                     if(allAdversReactionList[i].adversReactionList[z].details[x].name == adverseEvent[j].details[y].name && allAdversReactionList[i].adversReactionList[z].details[x].select) {
-                                                        adverseEvent[j].details[y].select = allAdversReactionList[i].adversReactionList[z].details[x].select
+                                                     if(allAdversReactionList[i].adversReactionList[z].details[x].name == adverseEvent[j].details[y].name && allAdversReactionList[i].adversReactionList[z].details[x].value == '1') {
+                                                        adverseEvent[j].details[y].value = allAdversReactionList[i].adversReactionList[z].details[x].value
                                                      }
                                                  }
                                              }

+ 6 - 5
src/store/reducers/print.js

@@ -1,11 +1,12 @@
-import { RECOVER_TAG,SHOW_PRINT_PREVIEW, CLOSE_PRINT_PREVIEW, SAVE_MESSAGE, CLOSE_PREVIEW, SHOW_PREVIEW,DIAG_SHOW } from "../types/print";
-import {recoverTag, showPrintPreview, closePrintPreview, saveMessage, showPreview, closePreview,diagShow } from "../actions/print";
+import { SHOW_PRINT_PREVIEW, CLOSE_PRINT_PREVIEW, SAVE_MESSAGE, CLOSE_PREVIEW, SHOW_PREVIEW,DIAG_SHOW,CLEAR_SEARCH_PARAM } from "../types/print";
+import { showPrintPreview, closePrintPreview, saveMessage, showPreview, closePreview,diagShow,clearSearchParam } from "../actions/print";
 
 const initState = {
   visible: false,
   preVisible: false,
   saveMessage: {},
-  diagShow: false
+  diagShow: false,
+  clearSearch:0,
 };
 export default function(state = initState, action) {
   switch (action.type) {
@@ -21,8 +22,8 @@ export default function(state = initState, action) {
       return saveMessage(state, action);
     case DIAG_SHOW:
       return diagShow(state, action);
-    case RECOVER_TAG:
-      return recoverTag(state,action);
+    case CLEAR_SEARCH_PARAM:
+      return clearSearchParam(state,action);
     default:
       return state;
   }

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

@@ -4,4 +4,4 @@ export const SAVE_MESSAGE = 'SAVE_MESSAGE';
 export const SHOW_PREVIEW = 'SHOW_PREVIEW';
 export const CLOSE_PREVIEW = 'CLOSE_PREVIEW';
 export const DIAG_SHOW = 'DIAG_SHOW';
-export const RECOVER_TAG = 'RECOVER_TAG';
+export const CLEAR_SEARCH_PARAM='CLEAR_SEARCH_PARAM';

+ 17 - 3
src/utils/tools.js

@@ -16,6 +16,7 @@ import config from '@config/index';
 import up from '@images/up.png';
 import down from '@images/down.png';
 import $ from 'jquery';
+import {CLEAR_SEARCH_PARAM} from "../store/types/print";
 
 
 /***
@@ -166,7 +167,10 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
         store.dispatch(clearAssistData([],'',[]));
         store.dispatch(clearAllLabel([],[],''));
         //右侧搜索条件清空
-        $("#clearTemplateSearch,#clearMedicalInfoSearch,#medicalInfoFilter:first-child").click();
+        store.dispatch({
+          type: CLEAR_SEARCH_PARAM,
+          data: Math.random()
+        });
         //tab跳回辅助信息
         store.dispatch(tabChange('0'));
         store.dispatch({
@@ -1533,10 +1537,20 @@ function getValuedLabels(arr){
 
 //对象数组去重
 function removeRepeat(arr1,arr2){     //arr1被完全保留的数组
-  const arr = arr2.reduce(function(newArr,item){
+  const arr = arr2.reduce(function(newArr,item,inx){
     const it = newArr.findIndex((i)=>i.id===item.id);
+    const firstInx = arr2.findIndex((i)=>i.id===item.id);
+    //旧体征标签比新体征标签多出的标签,已填值的保留,未填值的舍弃
     if(it!==-1){
-      newArr.splice(it,1,item);
+      //多个相同标签,保留已填值的
+      if(firstInx!==inx&&(item.value!==undefined||(item.tagType=='3'&&item.questionMapping.findIndex((i)=>i.value!==undefined)!==-1))){     //重复的已填值标签
+        newArr.splice(inx-firstInx+it,0,item);
+      }
+      if(firstInx===inx){
+        newArr.splice(it,1,item);
+      }
+    }else if(item.value!==undefined||(it.tagType=='3'&&it.questionMapping.findIndex((i)=>i.value!==undefined)!==-1)){
+      newArr.push(item);
     }
     return newArr;
   },[...arr1]);

+ 7 - 1
src/utils/utils.js

@@ -140,7 +140,7 @@ export const setRadioInputValue = (state,action)=>{
 export function recoveTag(state,action) {
   let res = Object.assign({},state);
   let arr = [...res.data];
-  arr.splice(action.index,0,action.data);
+  //arr.splice(action.index,0,action.data);
   const isArr= !action.data.tagType;
   if(!isArr){
     arr.splice(action.index,0,action.data);
@@ -151,6 +151,12 @@ export function recoveTag(state,action) {
       const sonMInx = arr.findIndex((it)=>it.flag=='3');
       arr.splice(sonMInx,1);
     }
+    const lastReTag = [...action.data].reverse()[0];
+    if(lastReTag.tagType=='8'&&arr[action.index].tagType=='8'){
+      //要恢复的标签组最后为文本标签,插入位置也为文本标签,则将2个合并为一个文本标签
+      arr[action.index]=Object.assign(arr[action.index],lastReTag,{value:lastReTag.value+arr[action.index].value});
+      action.data.length=action.data.length-1;
+    }
     arr.splice(action.index,0,...action.data);
   }
   const dataArr = fullfillText(arr);