Bläddra i källkod

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

zhouna 5 år sedan
förälder
incheckning
f8e4ae73b7

+ 13 - 13
src/common/components/EditableSpan/index.jsx

@@ -164,7 +164,7 @@ class EditableSpan extends Component{
       if(textIndex == 0){
         preventDefault(ev);
         if(obj){
-          obj[0]&&this.moveEnd(obj[0]);
+          obj[0]&&moveEnd(obj[0]);
         }
       }
     }
@@ -208,9 +208,9 @@ class EditableSpan extends Component{
         //如果后一个不是标签,则光标移到最前
         if(nextObj && nextObj[0].nodeName !=="DIV"){
           // nextObj.focus();
-          this.moveEnd(nextObj[0],1)
+          moveEnd(nextObj[0],1)
         }else{
-          this.moveEnd(preObj[0])
+          moveEnd(preObj[0])
         }
       }
       //action里往后删除
@@ -222,9 +222,9 @@ class EditableSpan extends Component{
             // IE浏览器focus光标在最后,其他浏览器在最前
             // nextObj.focus();
             if(boxMark==2&&this.props.data[index+1]&&this.props.data[index+1].flag==3){
-              this.moveEnd(nexObjN[0],1);
+              moveEnd(nexObjN[0],1);
             }else{
-              this.moveEnd(nextObj[0],1);
+              moveEnd(nextObj[0],1);
             }
           }
           /*this.setState({
@@ -232,17 +232,17 @@ class EditableSpan extends Component{
           })*/
         }else if(indexNum ==innerVal.length&&nexObj[0]&&nexObj[0].nodeName=="DIV"){//span最后一位后面为div标签
           handleKeydown&&handleKeydown({boxMark,i:index+1,text:data,flag:'del'});
-          this.moveEnd(nextObj[0]);
+          moveEnd(nextObj[0]);
         }else if(nexObj[0]&&nexObj[0].nodeName=="SPAN"){
           if(nexVal.length <= 1){//为空或者一个字delete时候
             removeId && removeId({boxMark,i:index+1,text:"",flag:'del'});
             handleClear && handleClear({boxMark});
-            this.moveEnd(nexObj[0])
+            moveEnd(nexObj[0])
           }else if(nexVal.length > 1){
             let tmpVal = nexVal.substr(1,data.length)
             handleChange&&handleChange({text1:tmpVal,boxMark,i:index+1});
             nexObj.html(tmpVal)
-            this.moveEnd(nexObj[0],1)
+            moveEnd(nexObj[0],1)
           }
         }
       }
@@ -257,7 +257,7 @@ class EditableSpan extends Component{
         removeId && removeId({boxMark,i:index,text:""});
         handleClear && handleClear({boxMark});//删除最后一个字时清空搜索结果,避免现病史搜索框不立即消失的情况
         if(preObj[0].nodeName !=="DIV"){
-          this.moveEnd(preObj[0]);
+          moveEnd(preObj[0]);
         }
       }
 
@@ -285,7 +285,7 @@ class EditableSpan extends Component{
           // let preObj = $(this.$span.current).prev();
           let obj = preObj[0].nodeName=="DIV"?preObj.prev():preObj;
           handleKeydown&&handleKeydown({boxMark,i:index,text:data,flag:'backsp'});
-          this.moveEnd(obj[0]);
+          moveEnd(obj[0]);
           this.setState({
             index: null
           })
@@ -296,9 +296,9 @@ class EditableSpan extends Component{
             handleClear && handleClear({boxMark});
             if(preObj[0].nodeName !=="DIV"){
               if(boxMark==2){
-                this.moveEnd(preObj[0],1);
+                moveEnd(preObj[0],1);
               }else{
-                this.moveEnd(preObj[0]);
+                moveEnd(preObj[0]);
               }
             }
           }else{
@@ -306,7 +306,7 @@ class EditableSpan extends Component{
             handleChange&&handleChange({text1:tmpVal,boxMark,i:index});
             preObj.html(tmpVal)
             if(preObj[0].nodeName !=="DIV"){
-              this.moveEnd(preObj[0]);
+              moveEnd(preObj[0]);
             }
           }
         }

+ 4 - 4
src/common/components/Textarea/index.jsx

@@ -112,11 +112,11 @@ class Textarea extends Component {
     return flg;
   }
   handleBlur(e){
-    const {saveChronic} = this.props;
-    const text = e.target.innerText || e.target.innerHTML;
+    //const {saveChronic} = this.props;
+    //const text = e.target.innerText || e.target.innerHTML;
     //解除绑定事件
     $(this.$dom.current).off("paste");
-    getFeature(text).then((res)=>{
+    /*getFeature(text).then((res)=>{
       if(res.data.code==0){
         const result = res.data.data;
         // 慢病
@@ -127,7 +127,7 @@ class Textarea extends Component {
           }
         }
       }
-    })
+    })*/
   }
   handleKeydown(e){
     const {boxMark} = this.props;

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

@@ -111,10 +111,10 @@ class CheckBody extends Component{
     });
   }
   render(){
-    const {searchData,totalHide,data,saveText,rePush,hasMain,isEmpty} = this.props;
+    const {searchData,totalHide,rePush,hasMain,isEmpty,isChronic} = this.props;
     const {boxLeft,boxTop} = this.state;
     return <ItemBox title='查体' handleClick={this.handleClick}>
-        <img className={style['refresh']} src={rePushIcon} title='重新加载' onClick={!hasMain&&isEmpty?null:rePush}/>
+      {!isEmpty&&!isChronic?<img className={style['refresh']} src={rePushIcon} title='重新加载' onClick={!hasMain&&isEmpty?null:rePush}/>:''}
         {this.getLabels()}
         {/*{showMoreBtn?more:''}*/}
         {searchData && searchData.length>0?<SearchDrop data={searchData} show={!totalHide} left={boxLeft} top={boxTop} onSelect={this.handleSearchSelect}></SearchDrop>:''}

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

@@ -146,7 +146,7 @@ class ChronicInfo extends React.Component{
   // 量表明细-关闭,isClose是否是点击关闭按钮
   closeTable(isClose){
     const {scaleParam} = this.state;
-    const {showHide} = this.props;
+    const {showHide,chronicMagItem} = this.props;
     if(!showHide.isPop){
       //量表结果,判断需要计算并且dom中有值才能加入病例记录
       // innerHTML 兼容FF26
@@ -155,7 +155,7 @@ class ChronicInfo extends React.Component{
         Notify.info("请先计算量表结果!");
         return ;
       }
-      !isClose&&this.handleAddAssessItem(scaleParam.v,scaleParam.i,scaleParam.j);
+      !isClose&&chronicMagItem&&this.handleAddAssessItem(scaleParam.v,scaleParam.i,scaleParam.j);   //是慢病流程才能加入病例
       this.setState({
         scaleParam:{}
       });

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

@@ -315,7 +315,7 @@ class DiagnosticList extends Component {
                                           onClick={() =>{this.showTreat(item, index)}}>
                                           治疗方案
                                     </span>
-                                    {isChronic?<span className={style['assess']}
+                                    {isChronic&&index===0&&item.conceptId===chronicMagItem.conceptId?<span className={style['assess']}
                                           onClick={this.showAssessFn.bind(this,item)}>
                                         管理评估
                                     </span>:''}

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

@@ -272,7 +272,7 @@ class MainSuit extends Component{
       }
   }*/
   render(){
-    const {saveChronic,readMode,type,CommonSymptoms,searchData,fetchPushInfos,isRead,totalHide,handleInput,fuzhen,saveText,editClear,datas,commSymHide} = this.props;
+    const {readMode,type,CommonSymptoms,searchData,fetchPushInfos,isRead,totalHide,handleInput,fuzhen,saveText,editClear,datas,commSymHide} = this.props;
     const {symptom,boxLeft,boxTop} = this.state;
     const symptomFlag = CommonSymptoms.length>0 ? true : false;
     const searchFlag = searchData.length>0 ? true : false;
@@ -280,7 +280,7 @@ class MainSuit extends Component{
     const boxLeft1 = datas.length>0?boxLeft:85;
     const mode = readMode===null||readMode===-1?type:readMode;
     if(+mode===1){      //文本模式
-      return <Textarea title='主诉' boxMark='1' saveChronic={saveChronic} isRead={isRead} value={saveText[0]} handlePush={fetchPushInfos} handleInput={handleInput} />;
+      return <Textarea title='主诉' boxMark='1' isRead={isRead} value={saveText[0]} handlePush={fetchPushInfos} handleInput={handleInput} />;
     }
     return  <div className={style['main-suit']}>
       <ItemBox

+ 1 - 1
src/components/MedicalInfo/Filters/index.jsx

@@ -19,7 +19,7 @@ class Filters extends Component {
     })
   }
   render() {
-    return <div className={style["filters"]}>
+    return <div className={style["filters"]} id='medicalInfoFilter'>
               {this.drawItem()}
             </div>
 

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

@@ -142,7 +142,7 @@ class MedicalInfo extends Component {
               <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} alt="清空" onClick={this.clear}/>:''}
+                  {val?<img src={delIcon} id='clearMedicalInfoSearch' alt="清空" onClick={this.clear}/>:''}
                   <button onClick={this.search}>搜索</button>
                 </p>
                 <Filters data ={filterList} checkeds={typeChecks} handleCheck={this.handleTypeCheck}></Filters>

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

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

+ 2 - 2
src/components/PushItems/index.less

@@ -1,7 +1,7 @@
 @import "~@less/variables.less";
 .push-content-wrapper{
   // padding-top: 50px;
-  padding: 10px 15px 40px;
+  padding: 0px 15px 40px;
   line-height: 20px; 
   width: @push-width;
   overflow: hidden;
@@ -119,6 +119,6 @@
   color: #979797;
   text-align: center;
   position: absolute;
-  bottom: -10px;
+  bottom: 0px;
 }
 

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

@@ -139,7 +139,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} alt="清空" onClick={this.clear}/>:''}
+                                {this.state.val?<img src={delIcon} id='clearTemplateSearch' alt="清空" onClick={this.clear}/>:''}
                                 <div className={style.search} onClick={this.templateSearch}>搜索</div>
                             </div>
                             {

+ 4 - 2
src/containers/CheckBody.js

@@ -7,8 +7,9 @@ import {billing} from '@store/async-actions/pushMessage';
 import {didPushParamChange,filterDataArr} from '@utils/tools.js';
 
 function mapStateToProps(state){ 
-  const {homePage,mainSuit,checkBody} = state;
+  const {homePage,mainSuit,checkBody,diagnosticList} = state;
   const hasMain = filterDataArr(mainSuit.saveText);//||mainSuit.data.length;
+  let diagnC = diagnosticList.chronicMagItem;
   return {
     data:checkBody.data,
     defaultShowAll:checkBody.showAll,
@@ -24,6 +25,7 @@ function mapStateToProps(state){
     searchInEnd:checkBody.searchInEnd,      //是否在搜索末尾插入结果
     importLabel:checkBody.importLabel,    //需高亮的标签id
     typeConfig: state.typeConfig,  //bug2764
+    isChronic:diagnC?diagnC:state.mainSuit.chronicDesease,
   }
 }
 
@@ -56,7 +58,7 @@ function mapDispatchToProps(dispatch){
         }
       });
     },
-    rePush(){console.log(222)
+    rePush(){
       dispatch(pregetCheckbodyData(false,true));
     }
   }

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

@@ -159,6 +159,9 @@ export function pregetCheckbodyData(flag,addValued){     //flag=true获取到数
           dispatch({
             type:REPUSH_CHECK_LABELS,
             data:data
+          });
+          dispatch({
+            type: ISREAD
           })
         }
         if(flag){

+ 10 - 1
src/store/reducers/assessResult.js

@@ -48,13 +48,22 @@ export default (state=init,action)=>{
       return res;
     case CLEAR_ASSESS_RESULT_VALUE:
       res.data = {};
+      res.indexTimeTypes={};
+      res.indexData={};
       res.indexNames = {};
       res.addedScaleIds = [];
       res.calcuResult = {};
       res.calcuValues = {};
       res.wholeAssess = [];
       res.wholeIndexs = {};
-      res.wholeResults = {};
+      res.wholeResults = {
+        possible:{},
+        radioVal:{}
+        };
+      res.chooseSelecteds={};
+      res.wholeAssessText ={};
+      res.wholeScaleItems={};
+      //res = deepClone(init)     //量表信息仍在,原因未明
       return res;
     case SET_INDEX_SUB_TYPE:
       if(!index){

+ 2 - 2
src/utils/config.js

@@ -1,8 +1,8 @@
 // const host='http://192.168.3.1:5050';//赵
 // const host='http://192.168.3.100:5050';//王峰
 // const host='http://192.168.2.121:5050';//后端接口访问地址
-const host='http://192.168.2.236:5050';//后端接口访问地址
-// const host='http://192.168.2.241:5050';//后端接口访问地址
+// const host='http://192.168.2.236:5050';//后端接口访问地址
+const host='http://192.168.2.241:5050';//后端接口访问地址
 // const host='http://192.168.3.11:5050';//王宇
 //const host='http://192.168.2.164:8080';
 // const host='http://192.168.3.117:5050'; //周铁刚

+ 12 - 0
src/utils/drag.js

@@ -4,6 +4,7 @@
  */
 import $ from 'jquery';
 import {
+  windowEventHandler,
   getWindowInnerHeight,
   getWindowInnerWidth,
   getPageCoordinate
@@ -84,7 +85,9 @@ function handleUp(){
  * @param {拖动元素/清除拖动事件监听} type add:添加事件监听  del:移除事件监听
  * @param {展开元素id} addDom 
  */
+let timer 
 function dragBox(dragWrap,dragTop,type,addDom,img,free) {
+  clearTimeout(timer)
   let drag = $("#"+dragTop); //拖拽区域
   let wrap = $("#"+dragWrap); //被拖拽的元素
   width = getWindowInnerWidth(); 
@@ -109,6 +112,15 @@ function dragBox(dragWrap,dragTop,type,addDom,img,free) {
     })
     $(document).on('mousemove', handleMove)
     $(document).on('mouseup', handleUp)
+  
+    windowEventHandler('resize', ()=>{
+      clearTimeout(timer)
+      timer = setTimeout(()=>{
+        dragBox(dragWrap,dragTop,'del',addDom,img,free)
+        dragBox(dragWrap,dragTop,type,addDom,img,free)
+      }, 200)
+    });
+    
   }
 }
 

+ 18 - 0
src/utils/tools.js

@@ -165,6 +165,10 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
         store.dispatch({type:SETREADDITEMS});     //清空已存的血压加号项
         store.dispatch(clearAssistData([],'',[]));
         store.dispatch(clearAllLabel([],[],''));
+        //右侧搜索条件清空
+        $("#clearTemplateSearch,#clearMedicalInfoSearch,#medicalInfoFilter:first-child").click();
+        //tab跳回辅助信息
+        store.dispatch(tabChange('0'));
         store.dispatch({
             type: SET_TIPS,
             tips: {}
@@ -285,6 +289,10 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
           if(type == 'template'){        //结构化模板回读
               let dataJsonStr = JSON.parse(reData.preview);
                 // console.log(dataJson,dataJsonStr,'结构化模板引用')
+                //清空已选的指标推送数据及填的值
+                store.dispatch({
+                  type: CLEAR_ASSESS_RESULT_VALUE,
+                });
                 store.dispatch({
                     type: CLEAR_MAIN_SUIT,
                     data:dataJson.chief,
@@ -347,6 +355,10 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
               store.dispatch(tabChange('0'));
             }else{    //结构化历史病历回读
                 let dataJsonStr = reData.detailList;
+                //清空已选的指标推送数据及填的值
+                store.dispatch({
+                  type: CLEAR_ASSESS_RESULT_VALUE,
+                });
                 store.dispatch({
                     type: CLEAR_MAIN_SUIT,
                     data:dataJson.chief,
@@ -1494,6 +1506,12 @@ const setFontColorSize = (flg,pacs) => {
 //获取查体体征和已选中的标签
 function getValuedLabels(arr){
   const newArr = arr.filter((it)=>{
+    if(it.tagType=='3'){      //血压类型
+      if(it.questionMapping.findIndex((i)=>i.value!==undefined)!==-1||+it.specFlag===4){
+        return true;
+      }
+      return false;
+    }
     return it.value||+it.specFlag===4;
   });
   return newArr;