Ver código fonte

组合标签子标签不可编辑

zhouna 5 anos atrás
pai
commit
0302f6f3b0

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

@@ -173,16 +173,16 @@ class Multiple extends react.Component{
     }
   }
   render(){
-    const {placeholder,value,show,data,handleConfirm,ikey,order,mainSaveText,handleHide,type} = this.props;
+    const {placeholder,value,show,data,hideTag} = this.props;
     const {editable,boxTop,boxLeft,seleData,seleId} = this.state;
     return <div className={style["container"]}>
       <div className={this.getClass()}
       ref={this.$div}
       onClick={this.handleShow}
-      onDoubleClick={this.changeToEdit}
+      onDoubleClick={hideTag?null:this.changeToEdit}
       onBlur={this.handleBlur}
       onInput={this.onChange}
-      onkeydown={handleEnter}
+      onKeyDown={handleEnter}
       contentEditable={editable}>{value||placeholder}</div>
       <div className={this.getListClass()} contentEditable="false">
         <SlideItem 

+ 5 - 5
src/components/NumberUnitDrop/index.jsx

@@ -185,19 +185,19 @@ class NumberUnitDrop extends Component{
   }
 
   render(){
-    const {placeholder,prefix,suffix,show,value,handleHide} = this.props;
-    const {numEditable,editable,hasSelect,boxLeft,boxTop} = this.state;
+    const {placeholder,prefix,suffix,show,value,handleHide,hideTag} = this.props;
+    const {editable,hasSelect,boxLeft,boxTop} = this.state;
     return <div className={this.getClasses()}
                 ref={this.$cont}
                 onClick={this.handleNumClick}
                 contentEditable={editable}
                 onBlur={this.numInpBlur}
-                onDoubleClick={this.changeToEdit}
-                onkeydown={handleEnter}
+                onDoubleClick={hideTag?null:this.changeToEdit}
+                onKeyDown={handleEnter}
                 onInput={this.handleSpanInp}>
       <span ref = {this.$pre}>{prefix?prefix+' ':prefix}</span>
       <span ref = {this.$span}
-            onkeydown={handleEnter}
+            onKeyDown={handleEnter}
             style={{cursor:editable?'text':'pointer'}}>{value||placeholder}</span>
       <span ref = {this.$suf}>{suffix?' '+suffix:suffix}</span>
       <NumberUnitPan handleSelect={(obj)=>this.select(obj)}

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

@@ -152,7 +152,7 @@ class RadioDrop extends Component{
       <div className={this.getClass()}
            onBlur={this.handleEditLabel}
            contentEditable={this.state.editable}
-           onDoubleClick={this.handledbClick}
+           onDoubleClick={hideTag?null:this.handledbClick}
            onFocus={(e)=>{e.stopPropagation()}}
            onClick={(e)=>this.handleShow(e,true)}
            onkeydown={handleEnter}>

+ 3 - 3
src/components/RadioInpDrop/index.jsx

@@ -205,15 +205,15 @@ class RadioInpDrop extends Component{
     return list;
   }
   render(){
-    const {data,show,vals,placeholder} = this.props;
+    const {data,show,vals,placeholder,hideTag} = this.props;
     const {boxLeft,boxTop} = this.state;
     return <div className={style['container']} ref = {this.$cont}>
       <div className={this.getClass()}
            onBlur={this.handleEditLabel}
            contentEditable={this.state.editable}
-           onDoubleClick={this.handledbClick}
+           onDoubleClick={hideTag?null:this.handledbClick}
            onClick={(e)=>this.handleShow(e,true)}
-           onkeydown={handleEnter}>
+           onKeyDown={handleEnter}>
         {vals?this.parseInputDom():<span>{placeholder}</span>}
       </div>
       <DropList onSelect={this.handleSelect} data={data} left={boxLeft} top={boxTop} show={show}/>