Ver código fonte

Merge branch 'dev5.3.2' into dev/new1

luolei 5 anos atrás
pai
commit
310e237fdc

+ 1 - 0
src/components/AddAssistCheck/index.jsx

@@ -27,6 +27,7 @@ class AddAssistCheck extends React.Component {
     this.handleCancel = this.handleCancel.bind(this)
     this.timeSure = this.timeSure.bind(this)
   }
+  
   componentDidMount() {
     $(document).click((event) => {
       let _con = $('#searchWrapAssist');   // 设置目标区域

+ 32 - 27
src/components/CommonSymptom/index.jsx

@@ -22,9 +22,11 @@ class CommonSymptom extends Component{
       hide:false,
       conceptId:[]
     }
+    this.div = React.createRef();
     this.handleSelect = this.handleSelect.bind(this);
     this.handleClear = this.handleClear.bind(this);
     this.handleConfirm = this.handleConfirm.bind(this);
+    this.handleOuter = this.handleOuter.bind(this);
   }
   getClass(){
     let isHide = this.props.show?'':style['hide'];
@@ -32,7 +34,7 @@ class CommonSymptom extends Component{
   }
 
   handleSelect(e,item){
-    e.stopPropagation();
+    // e.stopPropagation();
     let {select,ids,conceptId} = this.state;
     const id = item.questionId||item.id; //缓存localStorage中的数据有id
     const copid = item.conceptId
@@ -70,7 +72,7 @@ class CommonSymptom extends Component{
     return '';
   }
   handleClear(e){
-    e.stopPropagation();
+    // e.stopPropagation();
     this.setState({
       select:[],
       ids:[],
@@ -78,32 +80,35 @@ class CommonSymptom extends Component{
     })
   }
   handleConfirm(e){
-    e.stopPropagation();
+    // e.stopPropagation();
     const {onSelect} = this.props;
     const {select,ids,conceptId} = this.state;
     onSelect&&onSelect({select,ids,conceptId});
   }
 
-  componentDidMount(){
-    $(document).click((e)=>{     
-      let itemBox = $('#mainSuit')[0];
-      let divBox = $('#symptBox')[0];
-      let listBox = $('#listBox')[0];
-      let hisBox = $('#his')[0];
-      let operBox = $('#oper')[0];
-      if(e.target != itemBox && e.target.parentNode != divBox && e.target.parentNode != listBox && e.target.parentNode != hisBox && e.target.parentNode != operBox && e.target != divBox ){
-        this.setState({
-          hide:true,
-          select:[],
-          ids:[],
-          conceptId:[]
-        })
-      }else{
-        this.setState({
-          hide:false
-        })
-      }
-    })
+  handleOuter(e){
+    e.stopPropagation();
+    let itemBox = $('#mainSuit')[0]; //主诉框
+    if(this.div.current.contains(e.target) || e.target == itemBox){
+      this.setState({
+        hide:false
+      })
+    }else{
+      this.setState({
+        hide:true,
+        select:[],
+        ids:[],
+        conceptId:[]
+      })
+    }
+  }
+
+  componentDidMount() {
+    window.addEventListener('click', this.handleOuter);
+  }
+
+  componentWillUnmount() {
+    window.removeEventListener('click', this.handleOuter);
   }
 
   render(){ 
@@ -111,9 +116,9 @@ class CommonSymptom extends Component{
     const {hide} = this.state;
     const mainSymp = storageLocal.get('mainSymp');
     const mainHis = mainSymp?JSON.parse(mainSymp).reverse():[];
-    return <div className={this.getClass()} contenteditable="false" id="symptBox" style={{'display':hide?'none':'block'}}>
-      <ul className={style["listBox"]} id="listBox">
-        {mainHis.length>0?<ul className={style["his"]} id="his">
+    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"]}>
           <p>最近输入症状:</p>
           {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>
@@ -124,7 +129,7 @@ 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']} id="oper">
+      <div className={style['oper']}>
         <span className={style['clear']} onClick={this.handleClear}>清空选项</span>
         <span className={style['confirm']} onClick={this.handleConfirm}>确定</span>
       </div>

+ 2 - 2
src/components/EmergencyProcedure/EmergencyPart/PartSec/index.jsx

@@ -91,7 +91,7 @@ class PartSec extends React.Component{
             <img src={down} alt=""/>
           </div>
           <div className={`${styles.goDownPub} ${styles.goDownB}`}>
-            <span>穿刺分析对症治疗</span>
+            <span>穿刺分析对症治疗</span>
           </div>
           <div className={`${styles.goDownPub} ${styles.goDownImg}`}>
             <img src={down} alt=""/>
@@ -125,7 +125,7 @@ class PartSec extends React.Component{
             <img src={down} alt=""/>
           </div>
           <div className={`${styles.goDownPub} ${styles.goDownB}`}>
-            <span>穿刺分析对症治疗</span>
+            <span>穿刺分析对症治疗</span>
           </div>
           <div className={`${styles.goDownPub} ${styles.goDownImg}`}>
             <img src={down} alt=""/>

+ 4 - 4
src/components/EmergencyProcedure/EmergencyPart/PartTrd/index.jsx

@@ -396,7 +396,7 @@ class PartTrd extends React.Component {
                       <img src={down} alt="" />
                     </div>
                     <div className={`${styles.goDownPub} ${styles.goDownB}`}>
-                      <span>{'排除禁忌后考虑立即溶栓(D-D <30min)'}</span>
+                      <span>{'排除禁忌后考虑立即溶栓(D-B <30min)'}</span>
                     </div>
                     <br />
                     <br />
@@ -443,7 +443,7 @@ class PartTrd extends React.Component {
                         <img src={down} alt="" />
                       </div>
                       <div className={`${styles.goDownPub} ${styles.goDownB}`}>
-                        <span>{'排除禁忌后考虑立即溶栓(D-D <30min)'}</span>
+                        <span>{'排除禁忌后考虑立即溶栓(D-B <30min)'}</span>
                       </div>
                       <br />
                       {/* <div className={styles.line}></div>
@@ -538,7 +538,7 @@ class PartTrd extends React.Component {
                           <img src={down} alt="" />
                         </div>
                         <div className={`${styles.goDownPub} ${styles.goDownB}`}>
-                          <span>{'排除禁忌后考虑立即溶栓(D-D <30min)'}</span>
+                          <span>{'排除禁忌后考虑立即溶栓(D-B <30min)'}</span>
                         </div>
                         <br />
                         {/* <div className={styles.line}></div>
@@ -605,7 +605,7 @@ class PartTrd extends React.Component {
   }
   render() {
     const { idx, num ,trdNum } = this.props
-    console.log(idx, num ,trdNum)
+    // console.log(idx, num ,trdNum)
     return <div className={`${styles.partTrd} ${styles.partPub}`}>
       {
         idx == 3 && num == 1 ? <React.Fragment>

+ 3 - 3
src/components/EmergencyProcedure/emergency.js

@@ -95,7 +95,7 @@ let data = [
                     link:''
                   },
                   {
-                    message:'穿刺分析对症治疗',
+                    message:'穿刺分析对症治疗',
                     text:'肺栓塞救治流程',
                     link:''
                   },
@@ -125,7 +125,7 @@ let data = [
                     link:''
                   },
                   {
-                    message:'穿刺分析对症治疗',
+                    message:'穿刺分析对症治疗',
                     text:'',
                     link:''
                   },
@@ -157,7 +157,7 @@ let data = [
         checks:'听诊呼吸音是否减弱或消失',
       },
       step2:{//步骤2
-        waring:'进行全血细胞计数+血型鉴定、术前免疫、凝血功能、肺部B超、X线或者CT检查',
+        waring:'进行全血细胞计数+血型鉴定、术前免疫、凝血功能、肺部B超、肺部X线或者肺部CT检查',
         tips:'',
         select:['胸外科会诊'],//按钮
         items:[

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

@@ -54,18 +54,22 @@ class PushContainer extends Component {
     this.handleDelList = this.handleDelList.bind(this)
     this.makeSure = this.makeSure.bind(this)
     this.handleClose = this.handleClose.bind(this);
+    this.templateSearch = this.templateSearch.bind(this);
   }
   componentDidMount() {
     // const height = getWindowInnerHeight()-160;
     // this.$cont.current.style.height = height+"px";
   }
+  templateSearch(name){
+    store.dispatch(initItemList(1,name));
+  }
   /**
    * 
    * @param {tab组件切换id} id
    */
   handleActiveClick(id) {
     if (id == '1') {
-      store.dispatch(initItemList(1));
+      store.dispatch(initItemList(1,0));
     }
     store.dispatch(tabChange(id))
   }
@@ -268,6 +272,7 @@ class PushContainer extends Component {
             handleMangerTemplate={this.handleMangerTemplate}
             handleAllCheckbox={this.handleAllCheckbox}
             handleClickGetMore={this.handleClickGetMore}
+            templateSearch={this.templateSearch}
           ></TemplateItems>
           <MedicalInfoContainer></MedicalInfoContainer>
           <ScaleSearchContainer></ScaleSearchContainer>

+ 17 - 2
src/components/ScaleTable/index.jsx

@@ -77,10 +77,18 @@ class ScaleTable extends React.Component{
         let row = rows[j].row;
         let required = rows[j].required;
         let rowsId = rows[j].indexId;
+        let metux = rows[j].metux; //互斥
+        
         // 必填项处理
         if(required==1&&rowsId==indexId){
           for(let k=0;k < row.length; k++){
             row[k].isSelect = true;
+            if(metux == 1){//互斥,把其他的清空
+              let detList = row[k].details;
+              for(let f=0; f<detList.length; f++){
+                detList[f].select = 0;
+              }
+            }
             if(row[k].name==name){
               details = row[k].details;
               // break;
@@ -88,6 +96,12 @@ class ScaleTable extends React.Component{
           }
         }else{
           for(let k=0;k < row.length; k++){
+            if(metux == 1){//互斥,把其他的清空
+              let detList = row[k].details;
+              for(let f=0; f<detList.length; f++){
+                detList[f].select = 0;
+              }
+            }
             if(row[k].name==name){
               details = row[k].details;
               row[k].isSelect = true;
@@ -343,7 +357,8 @@ class ScaleTable extends React.Component{
     const {tableId,formulaResult,comfirnFlag} = this.props;
     const scaleResult = scaleResult1 || formulaResult&&formulaResult[tableId]; //量表计算结果
     // const datas = valueData&&valueData.group?valueData:'';
-    const datas = valueData;
+    // const datas = valueData;
+    const datas = JSON.parse(JSON.stringify(valueData));
     let content;
     if(valueData&&valueData.scaleType==1){//计分
       content =  datas&&datas.group&&datas.group.map((v,i)=>{
@@ -363,7 +378,7 @@ class ScaleTable extends React.Component{
                               {item.details&&item.details.map((vv,ii)=>{
                                 return <div className={style['item']}>
                                         <Radio label={vv.detailName+'('+vv.score+')'}
-                                           isSelect={vv.select==1||selecteds[item.name]==vv.detailName}
+                                           isSelect={vv.select==1}
                                            handleClick={this.handleRadio.bind(this,v.groupName,item.name,vv,it.indexId)}>
                                         </Radio>
                                         {vv.state==1?<span className={style['recomand']}>(智能推荐)</span>:''}

+ 2 - 1
src/components/TemplateItems/TemplateItem/index.less

@@ -58,7 +58,7 @@
       height: 100%;
       vertical-align: top;
     //   margin-top: 3px;
-    padding: 0 5px;
+    // padding: 0 5px;
       max-width: 150px;
       overflow: hidden;
       text-overflow: ellipsis;
@@ -90,6 +90,7 @@
       display: none;
       width: 20px;
       height: 20px;
+      margin-left: 5px;
     }
     
     .quote {

+ 26 - 7
src/components/TemplateItems/index.jsx

@@ -12,14 +12,16 @@ class TemplateItems extends React.Component {
     constructor(props) {
         super(props);
         this.$cont = React.createRef();
+        this.$search = React.createRef();
         this.genItems = this.genItems.bind(this);
+        this.templateSearch = this.templateSearch.bind(this);
     }  
     componentDidMount(){
-        const height = getWindowInnerHeight()-206;
+        const height = getWindowInnerHeight()-226;
         this.$cont.current.style.height = height+"px";
         windowEventHandler('resize', ()=>{
             if(this.$cont.current){
-                const height = getWindowInnerHeight()-206;
+                const height = getWindowInnerHeight()-226;
                 this.$cont.current.style.height = height+"px";
             }
         });
@@ -49,13 +51,17 @@ class TemplateItems extends React.Component {
             return check_circle;
         }
     }
+    templateSearch(){
+        const {templateSearch} = this.props
+        templateSearch(this.$search.current.value)
+    }
     render() {
         const { allCheckShow, handleMangerTemplate,handleClickGetMore, handleDelList, handleAllCheckbox, items,checkItems,current,hasMore } = this.props;
-        // console.log(hasMore,current,7877877)
+        // console.log(allCheckShow,7877877)
         return (
             <div className={style.wrapper}>
                 {
-                    items && items.length > 0 ? (allCheckShow ?
+                    items ? (allCheckShow ?
                         <div className={style.wrapperTop}>
                             <div className={style['check-wrap']} onClick={handleAllCheckbox}>
                                 <img className={`${style['fl-element']} ${style['check-box']}`} src={this.getCheckIcon()} />
@@ -68,13 +74,26 @@ class TemplateItems extends React.Component {
                             }
                         </div> :
                         <div className={style.wrapperTop}>
-                            <span className={`${style['fr-element']} ${style['manger']}`} onClick={handleMangerTemplate}>管理</span>
+                            <div className={style.templateSearch}>
+                                <input ref={this.$search} type="text" />
+                                <div className={style.search} onClick={this.templateSearch}>检索</div>
+                            </div>
+                            {
+                                items.length > 0&&<span className={`${style['fr-element']} ${style['manger']}`} onClick={handleMangerTemplate}>管理</span>
+                            }
                     </div>) : <div style={{height:'36px'}}></div>
+                    // <div className={style.emptyWrap}>
+                    //     <div className={`${style.templateSearch}`}>
+                    //         <input ref={this.$search} type="text" />
+                    //         <div className={style.search} onClick={this.templateSearch}>检索</div>
+                            
+                    //     </div>
+                    //     <span className={`${style['fr-element']} ${style['manger']}`} onClick={handleMangerTemplate}>管理</span>
+                    // </div>
                 }
                 <div className={style.tempLists} ref={this.$cont}>
                     {
-                        this.genItems().length > 0?this.genItems():
-                        <Empty message={'还没有保存模板'}></Empty>
+                        this.genItems().length > 0?this.genItems(): <Empty message={'还没有保存模板'}></Empty>
                     }
                     {/* {//注释掉的暂时没有分也功能
                       hasMore?<p onClick={()=>handleClickGetMore(current)} className={style.loadMore}>点击查看更多</p>:null

+ 37 - 2
src/components/TemplateItems/index.less

@@ -1,17 +1,32 @@
 @import "~@less/mixin.less";
 
 .wrapper{
-    background-color: @gray-background-color;
+    // background-color: @gray-background-color;
     user-select: none;
     position: relative;
+    // padding: 0 15px;
+    // border: 1px solid #EAEDF1;
     .tempLists {
         overflow-y: auto;
         background-color: #fff;
+        margin-top: 15px;
+    }
+    .emptyWrap {
+        padding: 0 20px;
+        margin-top: 15px;
+        .fr-element {
+            float: right;
+            color: #3B9ED0;
+            display: inline-block;
+            height: 36px;
+            line-height: 36px;
+        }
     }
     .wrapperTop {
         height: 36px;
         padding: 0 20px;
-        background-color: #EAEDF1;
+        margin-top: 15px;
+        // background-color: #EAEDF1;
         cursor: pointer;
         .check-box {
             height: 18px;
@@ -58,5 +73,25 @@
       cursor: pointer;
       margin-top: 15px;
     }
+    .templateSearch {
+        display: inline-block;
+        input {
+            height: 35px;
+            line-height: 35px;
+            border: 1px solid #CECECE;
+            box-sizing: border-box;
+            width: 270px;
+            padding: 0 10px;
+        }
+        .search {
+            display: inline-block;
+            width: 80px;
+            text-align: center;
+            background-color: #2A9BD5;
+            color: #fff;
+            height: 35px;
+            line-height: 35px;
+        }
+    }
 }
 

+ 1 - 1
src/containers/PushItemsContainer.js

@@ -9,7 +9,7 @@ import { HIDEDROP } from '@store/types/homePage.js';
 
 function mapStateToProps(state) {//console.log(state)
   const {pushMessage,diagnosticList,inspect} = state;
-        return {
+    return {
         pushMessage: pushMessage,
         tipsDiscalimer:  state.copyRight.disContent,
         chronicMagItem: diagnosticList.chronicMagItem,

+ 1 - 1
src/store/async-actions/historyTemplates.js

@@ -42,7 +42,7 @@ export const getHistempDetail = (item) => {
                 // console.log(tmpData)
                 pushAllDataList(item.sign,'push',tmpData,'history')       //引用                
             }else{
-                console.log(data)
+                // console.log(data)
                 Notify.error(data.msg);
             }
         })

+ 1 - 1
src/store/async-actions/patInfo.js

@@ -67,7 +67,7 @@ export const initHistoryDetails = (dispatch) => {
                 dispatch({
                   type:ISREAD
                 });
-                dispatch(initItemList(1));        //模板列表没有就获取模板列表用于保存时做数据对比是否保存过
+                dispatch(initItemList(1,''));        //模板列表没有就获取模板列表用于保存时做数据对比是否保存过
                 dispatch({type:MODI_LOADING,flag:false});
             } else {
                 dispatch({type:MODI_LOADING,flag:false});

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

@@ -16,7 +16,7 @@ import {
   pushAllDataList
 } from '@utils/tools';
 
-export const initItemList = (current,flg) => { //初始化数据
+export const initItemList = (current,name) => { //初始化数据
   let baseList = store.getState();
   let state = baseList.patInfo.message;
 
@@ -27,7 +27,8 @@ export const initItemList = (current,flg) => { //初始化数据
       "hospitalId": state.hospitalId,
       "current": current,
       "sex":[1,2,3],
-      "size": 9999
+      "size": 9999,
+      "name":name||''
     }).then((res) => {
       const data = res.data;
       if (data.code == 0) {
@@ -75,7 +76,7 @@ export const saveTemplateDetail = (val,sex) => { //保存为模板
       const data = res.data;
       if (data.code == 0) {
         Notify.success('模板保存成功');
-        dispatch(initItemList("",1));
+        dispatch(initItemList(1,""));
         dispatch(keepPushData(getdata(1),'part'));
         dispatch({
           type: DIAG_SHOW,

+ 6 - 0
src/store/reducers/tabTemplate.js

@@ -36,6 +36,9 @@ export default (state = initDataList, action) => {
     let tempArr = newState.items;
     tempArr.splice(tempArr.findIndex(item => item.id == action.id), 1)
     newState.items = [...tempArr];
+    // if(tempArr.length == 0){
+    //   newState.allCheckShow = false
+    // }
     return newState;
   }
   if (action.type === BATCH_DEL_ITEMS) {
@@ -46,6 +49,9 @@ export default (state = initDataList, action) => {
       tempArr.splice(tempArr.findIndex(item => item.id == currentId), 1)
     }
     newState.items = [...tempArr];
+    // if(tempArr.length == 0){
+    //   newState.allCheckShow = false
+    // }
     newState.checkItems = [];
     return newState;
   }

+ 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.236:5050';//后端接口访问地址
+const host='http://192.168.2.236:5050';//后端接口访问地址
 // const host='http://192.168.2.121:5050';//后端接口访问地址
-const host='http://192.168.2.241: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'; //周铁刚