浏览代码

删除诊断判断

luolei 4 年之前
父节点
当前提交
99b6a49210
共有 1 个文件被更改,包括 9 次插入2 次删除
  1. 9 2
      src/components/DiagnosticList/index.jsx

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

@@ -87,6 +87,13 @@ class DiagnosticList extends Component {
         })
         Notify.success('删除成功')
     }
+    handleBlur(e,delItem,idxNum){
+      const { delDiagnostic } = this.props;
+      let name = e.target.value
+      if(name.trim() == ''){
+        delDiagnostic && delDiagnostic(delItem,idxNum);
+      }
+    }
     cancel() {
         this.setState({
             visible: false
@@ -296,7 +303,7 @@ class DiagnosticList extends Component {
       this.setState({timer})
     }
     render(){
-        const { list, treatment,pushMessage,delDiagnostic, showReferRecord, showHistoryCase ,chronicMagItem,loading,refreshScroller,windowWidth,hideChronic} = this.props;
+        const { list, treatment,pushMessage, showReferRecord, showHistoryCase ,chronicMagItem,loading,refreshScroller,windowWidth,hideChronic} = this.props;
       const {showTipsDetails,tipsDetails,showAllName}=pushMessage;
         const {visible, treatTitle, showAssess, isAssessConfirm, assessId, disName, hasOndel, hasOnIndex,hasEnterItem,hasEnterImg,delItem} = this.state;
         const chronicList = JSON.parse(localStorage.getItem('chronic')||null);
@@ -320,7 +327,7 @@ class DiagnosticList extends Component {
                                        onMouseLeave = {this.handleMouseLeaveDrug.bind(this)}
                                     >
                                       <span title={item.name} className={style['diag-name-box']} style={{'max-width': '300px'}}>
-                                        <input type="text" value={item.name} onBlur={()=>{delDiagnostic(item,index)}} onInput={(e)=>this.handleInput(e,index)}/>
+                                        <input type="text" value={item.name} onBlur={(e)=>{this.handleBlur(e,item,index)}} onInput={(e)=>this.handleInput(e,index)}/>
                                       </span>
                                       {/* <img className={`${style['info-img']}`}
                                           title='点击i图标可查看详细说明'