Bläddra i källkod

Merge branch 'ChronicMag' of http://192.168.2.236:10080/zhouna/newICSS into ChronicMag

Luolei 6 år sedan
förälder
incheckning
e9785b039e

+ 14 - 1
src/common/components/InlineTag/index.jsx

@@ -29,6 +29,7 @@ class InlineTag extends Component {
     this.handleInput = this.handleInput.bind(this);
     this.handleFocus = this.handleFocus.bind(this);
     this.handleFixClick = this.handleFixClick.bind(this);
+    this.handleBoxInput = this.handleBoxInput.bind(this);
   }
   changeToEdit(e){
     const {handledbClick,id} = this.props;
@@ -43,6 +44,14 @@ class InlineTag extends Component {
     //埋点记录
     handledbClick&&handledbClick({id});
   }
+  handleBoxInput(e){
+    const {handleInput,ikey,prefix,suffix} = this.props;
+    const total = e.target.innerText;
+    const text = this.$span.current.innerText;
+    if(!total){
+      handleInput&&handleInput({text:total,ikey});
+    }
+  }
   changeToClick(event){
     event.returnValue = true;
     const {canEditable} = this.props;
@@ -52,6 +61,7 @@ class InlineTag extends Component {
     });
   }
   handleInput(e){       //输入时保存临时值,在修改灰显为黑色时判断用
+    e.stopPropagation();
     const {handleInput,ikey,prefix,suffix} = this.props;
     const text = e.target.innerText || e.target.innerHTML;
     // 内容全部删除时,要把空值存到store,否则会遗留最后一个字且为灰色无法删除
@@ -130,7 +140,10 @@ class InlineTag extends Component {
                  onDoubleClick={this.changeToEdit}
                   onClick={!editable?this.handleFixClick:''}
                  onkeydown={handleEnter}
-                 onBlur={this.changeToClick} ref={this.$box} contentEditable={editable}>
+                 onBlur={this.changeToClick} 
+                 ref={this.$box} 
+                 contentEditable={editable}
+                 onInput={this.handleBoxInput}>
                 {prefix}
                 <span className={style['free-in']}
                       contentEditable={true}

+ 2 - 2
src/common/less/variables.less

@@ -45,8 +45,8 @@
 @dropdwon-height:200px;
 @selected-bg:#fff;
 @import-color:#ffad5f;
-@closeIcon:url(../images/del_nor.png);
-@closeHor:url(../images/del_hor.png);
+@closeIcon:url(../images/del_nor.png) no-repeat;
+@closeHor:url(../images/del_hor.png) no-repeat;
 
 /*********推送内容容器宽度*************/
 @push-width: 450px;

+ 1 - 1
src/components/AddAssistCheck/index.less

@@ -69,7 +69,7 @@
               height: 15px;
               cursor: pointer;
               position: absolute;
-              right: 3px;
+              right: 2px;
               top: 2px;
               background: @closeIcon;
               background-size: 100% 100%;

+ 2 - 2
src/components/AddInspect/SlideSelect/index.less

@@ -3,7 +3,7 @@
     // cursor: pointer;
     // color: #767676;
     position: relative;
-    padding: 10px 10px 10px 0;
+    padding: 10px 20px 10px 0;
     border-bottom:1px dashed #989DA3;
     i {
         font-style: normal;
@@ -31,7 +31,7 @@
         cursor: pointer;
         display: inline-block;
         position: absolute;
-        right: 3px;
+        right: 2px;
         top: 13px;
         // background-color: #fff;
         background: @closeIcon;

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

@@ -180,8 +180,8 @@
         width: 15px;
         height: 15px;
         position: absolute;
-        top: -10px;
-        right: -6px;
+        top: -5px;
+        right: -5px;
         z-index: 30;
         border-radius: 50%;
         background: @closeIcon;

BIN
src/components/DiagnosticList/img/delete-on.png


+ 14 - 2
src/components/DiagnosticList/index.jsx

@@ -1,6 +1,7 @@
 import React, { Component } from 'react';
 import style from './index.less';
 import del_icon from './img/delete.png'
+import del_on from './img/delete-on.png'
 import diagUp from './img/diagUp.png'
 import diagDown from './img/diagDown.png'
 import printIcon from '@common/images/team.png';
@@ -33,6 +34,7 @@ class DiagnosticList extends Component {
             isAssessConfirm:false,
             radioVal:{},  //可能结果选择内容
             possible:{},  //可能结果
+            hasOndel: false
         }
         this.deleteItem = this.deleteItem.bind(this);
         this.cancel = this.cancel.bind(this);
@@ -233,9 +235,19 @@ class DiagnosticList extends Component {
           })
       }
     }
+    handleEnterDel() {
+      this.setState({
+        hasOndel: true
+      })
+    }
+    handleLeaveDel() {
+      this.setState({
+        hasOndel: false
+      })
+    }
     render(){
         const { list, treatment, showReferRecord, showHistoryCase ,chronicMagItem} = this.props;
-        const { visible, treatTitle ,showAssess, isAssessConfirm, radioVal, possible,assessId,disName} = this.state;
+        const { visible, treatTitle ,showAssess, isAssessConfirm, radioVal, possible,assessId,disName, hasOndel} = this.state;
         const chronicList = JSON.parse(localStorage.getItem('chronic')||null);
         const chronicLine = chronicMagItem&&chronicMagItem.name;     //当前是否走的慢病流程
         let isChronic = false;      //是否要显示管理评估
@@ -264,7 +276,7 @@ class DiagnosticList extends Component {
                                           onClick={this.showAssessFn.bind(this,item)}>
                                         管理评估
                                     </span>:''}
-                                    <img className={style['diag-del']} src={del_icon} onClick={()=>{this.handleDeleteItem(item)}}/>
+                                    <img className={style['diag-del']} src={hasOndel ? del_on : del_icon} onMouseEnter={this.handleEnterDel.bind(this)} onMouseLeave={this.handleLeaveDel.bind(this)} onClick={()=>{this.handleDeleteItem(item)}}/>
                         </div>)
                     })}
                      {treatment&&<Treat title={treatTitle}></Treat>}

+ 4 - 1
src/store/actions/currentIll.js

@@ -874,7 +874,10 @@ export function setInputLabel(state,action){
     }
   }
   if(text){
-    res.saveText[i] = prefix+text+suffix;
+    res.saveText[i] = prefix ||''+ text + suffix||'';
+  }else if(!text && !prefix && !suffix){//整个标签内容完全删除
+    res.data.splice(i,1);
+    res.saveText.splice(i,1);
   }else{//删除完要清空
     res.saveText[i] = "";
   }