Browse Source

高亮bug修改,已选不高亮

zhouna 6 years ago
parent
commit
a4b090cc08

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

@@ -41,16 +41,17 @@ class Multiple extends react.Component{
   }
 
   getClass(){
-    const {show,value,hideTag} = this.props;
+    const {show,value,hideTag,isImports} = this.props;
+    const orgBorder = isImports&&!value?style['orange-border']:'';
     if(show){
       $(this.$div.current).addClass(style['borderd']);
     }else{
       $(this.$div.current).removeClass(style['borderd']);
     }
     if(value){
-      return hideTag?style['hide-tag']:style['selected-tag'];
+      return hideTag?classNames(style['hide-tag'],orgBorder):classNames(style['selected-tag'],orgBorder);
     }
-    return hideTag?'':style['tag'];
+    return hideTag?'':classNames(style['tag'],orgBorder);
   }
 
   getListClass(){

+ 3 - 2
src/components/NumberUnitDrop/index.jsx

@@ -138,17 +138,18 @@ class NumberUnitDrop extends Component{
     }
   }
   getClasses(){         //整个标签是否有值的状态
-    const {value,hideTag,show} = this.props;
+    const {value,hideTag,show,isImports} = this.props;
     const inpValue = this.state.value;
     const blueBorder = this.state.editable?style['blue-border']:'';
     const isSelected = value||inpValue?style['selected']:style['container'];
+    const orgBorder = isImports&&!(value||inpValue)?style['orange-border']:'';
     const noTag = hideTag?style['no-tag']:'';
     if(show){
       $(this.$cont.current).addClass(style['borderd']);
     }else{
       $(this.$cont.current).removeClass(style['borderd']);
     }
-    return className(isSelected,noTag,blueBorder);
+    return className(isSelected,noTag,blueBorder,orgBorder);
   }
   changeToEdit(e){        //整个标签双击编辑状态
     e.stopPropagation();

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

@@ -344,7 +344,7 @@ class SpreadDrop extends Component{
   getClass(){
     const {isImports,show,value} = this.props;
     const blueBorder = this.state.editable?style['blue-border']:'';
-    const orgBorder = isImports?style['orange-border']:'';
+    const orgBorder = isImports&&!value?style['orange-border']:'';
     if(show){
       $(this.$div.current).addClass(style['borderd']);
     }else{