Browse Source

化验标记添加完成

luolei 5 years ago
parent
commit
726e2e69da

BIN
src/common/images/edit1.png


BIN
src/common/images/edit2.png


+ 7 - 4
src/components/AddInspect/InspectName/index.jsx

@@ -17,9 +17,12 @@ class InspectName extends Component {
   componentDidMount(){
     const {item} = this.props
     this.setState({
-      value:item.inpValue
-    })
-    this.refs.iptTip.getDOMNode().value = item.inpValue
+      value:item.inpValue,
+      isEdit:item.inpValue?true:false
+    });
+    if(this.refs.iptTip){
+      this.refs.iptTip.getDOMNode().value = item.inpValue
+    }
   }
   handleEdit(){
     this.setState({
@@ -57,7 +60,7 @@ class InspectName extends Component {
             onInput={this.handleInput}
             className={styles.iptValue}
             type="text"/>
-            <i></i>
+            <span></span>
           </div>:<span className={styles.iptValueBtn} onClick={this.handleEdit}>点击备注</span>
         }
     </p>:

+ 14 - 4
src/components/AddInspect/InspectName/index.less

@@ -215,12 +215,12 @@
       }
 }
 .iptValue {
-    width: 60px;
+    width: 50px;
     color: #3B9ED0;
     font-size: 12px;
     margin-left: 10px;
     background-color: #EDF8FF;
-    padding: 0 3px;
+    padding: 0 16px 0 3px;
 }
 .iptValueBtn {
     color: #3B9ED0;
@@ -237,10 +237,20 @@
 }
 .iptTipWrap {
     display: inline-block;
-    i {
+    position: relative;
+    span {
         display: inline-block;
         width: 10px;
-        height: 10px;
+        height: 11px;
         background: url('../../../common/images/edit1.png') no-repeat;
+        position: absolute;
+        right: 3px;
+        top: 5px;
+        border-bottom: 0;
+    }
+}
+.iptTipWrap:hover {
+    span {
+        background: url('../../../common/images/edit2.png') no-repeat;
     }
 }