Quellcode durchsuchen

标签颜色体征标记修改

luolei vor 5 Jahren
Ursprung
Commit
a1829dcef7

+ 2 - 2
src/common/components/InlineTag/index.jsx

@@ -87,9 +87,9 @@ class InlineTag extends Component {
       return classNames(style['no-tag'],ext, setFontColorSize(2),'prefixUnsetColor');
     }
     if(!value||value.trim()==placeholder){//灰色标签
-      return classNames(style['gray'],ext, setFontColorSize(1));
+      return classNames(style['gray'],ext, setFontColorSize(2));
     }
-    return classNames(style['selected-tag'], setFontColorSize());
+    return classNames(style['selected-tag'],ext, setFontColorSize());
   }
   moveEnd(obj) {
     if(window.getSelection){//ie11 10 9 ff safari

+ 9 - 5
src/components/MultSpread/index.jsx

@@ -40,6 +40,7 @@ class MultSpread extends Component{
       weight:0,     //体重
       bmi:'',        //BMI
       wrBmi:false,      //是否无效bmi值,是则要清空身高体重,不能用判断bmi是否为空来判断,因为初始就是为空
+      isSelectAll:false
     };
     this.setBMIParam = this.setBMIParam.bind(this);
     this.setBMI = this.setBMI.bind(this);
@@ -53,7 +54,7 @@ class MultSpread extends Component{
     //const orgBorder = isImports&&!text?style['orange-border']:'';
     const isSelected = text?style['selected']:style['container'];
     const hasAdd = showAdd?style['add']:'';
-    return classNames(isSelected,hasAdd,setFontColorSize(isExtBlue?2:isSelected?2:1));
+    return classNames(isSelected,hasAdd,setFontColorSize(isExtBlue?2:!!text?'':1));
   }
   saveDoms(it){
     const doms = this.state.numDoms;
@@ -136,8 +137,10 @@ class MultSpread extends Component{
     }
   }
   getLabels(){
-    const {data,ikey,showArr,copyId,boxMark,isExtBlue} = this.props;
-    const {wrBmi,bmi} = this.state;
+    const {data,ikey,showArr,copyId,boxMark,isExtBlue,saveText} = this.props;
+    const {wrBmi,bmi,isSelectAll} = this.state;
+    const labelInx = tools.getLabelIndex(ikey);
+    const text = !!(saveText&&saveText[+labelInx]);
     let show = false;
     let inx = '',count=0;
     const list = data.map((it,i)=>{
@@ -200,6 +203,7 @@ class MultSpread extends Component{
                              suffix={it.labelSuffix}
                              placeholder={it.name}
                              isExtBlue={isExtBlue}
+                             isSelectAll={text}
                              //inputRef = {this['$inp'+(count++)]}
                              saveDoms={this.saveDoms.bind(this)}
                              reFocus={this.setNextFocus.bind(this)}
@@ -257,10 +261,10 @@ class MultSpread extends Component{
     const {showAdd,addLabelItem,ikey,copyId,textPrefix,textSuffix,isExtBlue} = this.props;
     return (<div className={this.getContClass()}
                  style={{display:'inline-block'}}>
-        {textPrefix?<span className={`${setFontColorSize(isExtBlue?2:'')}`}>{textPrefix}</span>:''}
+        {textPrefix?<span className="prefixUnset">{textPrefix}</span>:''}
         <div className={this.getClass()}>
           {this.getLabels()}
-          {textSuffix?<span className={`${setFontColorSize(isExtBlue?2:'')}`}>{textSuffix}</span>:''}
+          {textSuffix?<span className="prefixUnset">{textSuffix}</span>:''}
           {showAdd?<img src={isExtBlue?addIcon1:addIcon} alt="复制该项"
                         className={style['add-icon']}
                         onClick={()=>addLabelItem({ikey,copyId})}/>:''}

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

@@ -7,7 +7,7 @@
   cursor: pointer;
   line-height: 20px;
   &.ext{
-    // color: @extBlue!important;
+    color: @extBlue!important;
   }
 }
 
@@ -22,6 +22,6 @@
   // color: @text-color;
   line-height: 22px;
   &.ext{
-    // color: @extBlue;
+    color: @extBlue;
   }
 }

+ 6 - 5
src/components/NumberDrop/index.jsx

@@ -198,15 +198,16 @@ class NumberDrop extends Component{
     handleHide&&handleHide();
   }
   getClasses(nospecial){         //整个标签是否有值的状态
-    const {hideTag,placeholder,isImports,isExtBlue} = this.props;
+    const {hideTag,placeholder,isImports,isExtBlue,isSelectAll} = this.props;
     const val = this.state.value;
     const isSelected = val&&val!=placeholder?style['selected']:style['container'];
     const orgBorder = isImports&&!(val&&val!=placeholder)?style['orange-border']:'';
     const ext = isExtBlue?style['ext']:'';
     const noTag = hideTag?style['no-tag']:'';
-    return className(isSelected,noTag,orgBorder,ext,setFontColorSize(isExtBlue?2:val?2:1));
+    return className(isSelected,noTag,orgBorder,ext,setFontColorSize(isExtBlue?2:val?2:isSelectAll?2:1));
   }
   getSpanClass(nospecial){       //将被替换的文字选中状态显示
+    const {isSelectAll} = this.props;
     const cls = this.props.show?style['blued']:style['nol'];
     return cls+' '+setFontColorSize(nospecial?'':2);
   }
@@ -244,13 +245,13 @@ class NumberDrop extends Component{
     });
   }
   render(){
-    const {prefix,suffix,show,value,handleHide,allClick,bmi,formulaCode,nospecial} = this.props;
+    const {prefix,suffix,show,value,handleHide,allClick,bmi,formulaCode,nospecial,isSelectAll,isExtBlue} = this.props;
     const val = formulaCode==="BMI_RES"?(+bmi===Infinity||isNaN(bmi)?'':bmi):value;
     const {placeholder,hasSelect} = this.state;
     return <div className={this.getClasses(nospecial)}
                 style={{position:'relative'}}
                 onClick={allClick?this.handleNumClick:null}>
-      <span className="prefixUnset">{prefix}</span>
+      <span className={`${setFontColorSize(isSelectAll?2:isExtBlue?2:1)}`}>{prefix}</span>
       <span onFocus={this.handleNumFocus}
             onClick={allClick?null:this.handleNumClick}
             contentEditable={true}
@@ -261,7 +262,7 @@ class NumberDrop extends Component{
             onInput={this.handleSpanInp}
             className={this.getSpanClass(nospecial)}
             >&nbsp;{val||placeholder}</span>
-      <span className="prefixUnset">{suffix}</span>
+      <span className={`${setFontColorSize(isSelectAll?2:isExtBlue?2:1)}`}>{suffix}</span>
       <NumberPan handleSelect={this.select.bind(this)}
                  noString={formulaCode?true:false}
                  onClose={handleHide}

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

@@ -50,7 +50,7 @@ class RadioDrop extends Component{
       if(hideTag){
         return classNames(style['no-tag'],ext,setFontColorSize(isExtBlue?2:''));
       }
-      return classNames(style['selected-tag'],editBorder,setFontColorSize());
+      return classNames(style['selected-tag'],ext,editBorder,setFontColorSize());
     }else{
       if(hideTag){
         return isExtBlue?classNames(setFontColorSize(2)):classNames(setFontColorSize(2),'prefixUnsetColor')

+ 8 - 4
src/components/RadioInpDrop/index.jsx

@@ -38,13 +38,17 @@ class RadioInpDrop extends Component{
     }else{
       $(this.$cont.current).removeClass(style['borderd']);
     }
-    if(hideTag){
-      return classNames(style['no-tag'],ext);
-    }
     if(value){
+      if(hideTag){
+        return classNames(style['no-tag'],ext,setFontColorSize());
+      }
       return classNames(style['selected-tag'],setFontColorSize());
+    }else{
+      if(hideTag){
+        return classNames(style['no-tag'],ext,setFontColorSize(2));
+      }
+      return classNames(style['tag'],orgBorder,ext,setFontColorSize(2));
     }
-    return classNames(style['tag'],orgBorder,ext,setFontColorSize(1));
   }
   handleSelect(item){
     const {handleSelect,ikey,value,placeholder,mainSaveText} = this.props;

+ 1 - 0
src/components/RadioInpDrop/index.less

@@ -32,5 +32,6 @@
   word-break: break-all;
   /**ff26必需**/
   min-height: 22px;
+  font-size: unset;
   vertical-align: middle;
 }

+ 3 - 0
src/components/SpreadDrop/index.jsx

@@ -354,6 +354,9 @@ class SpreadDrop extends Component{
     if(value||(showDefaulted&&value===undefined&&defaulted)){
       return classNames(style['selected-tag'],blueBorder,setFontColorSize());
     }
+    if(!value){
+      return classNames(style['tag'],orgBorder,ext,setFontColorSize(2));
+    }
     return classNames(style['tag'],orgBorder,ext,setFontColorSize(1));
   }
   ifDefault(){

+ 3 - 0
src/components/SpreadDrop/index.less

@@ -6,4 +6,7 @@
   .selected-tag{
     cursor: pointer;
   }
+  .ext {
+    color: @extBlue !important;
+  }
 }

+ 2 - 2
src/utils/config.js

@@ -1,8 +1,8 @@
 // const host='http://192.168.3.1:5050';//赵
 // const host='http://192.168.3.100:5050';//王峰
 // const host='http://192.168.2.121:5050';//后端接口访问地址
-const host='http://192.168.2.236:5050';//后端接口访问地址
-// const host='http://192.168.2.241:5050';//后端接口访问地址
+// const host='http://192.168.2.236:5050';//后端接口访问地址
+const host='http://192.168.2.241:5050';//后端接口访问地址
 // const host='http://192.168.3.11:5050';//王宇
 //const host='http://192.168.2.164:8080';
 // const host='http://192.168.3.117:5050'; //周铁刚

+ 0 - 4
src/utils/tools.js

@@ -1342,10 +1342,6 @@ const setFontColorSize = (flg,pacs) => {
     const state = store.getState();
     let readConfig = state.typeConfig.readConfig
     let mainType = readConfig==-1?state.typeConfig.typeConfig:readConfig;
-    setInterval(()=>{ 
-      readConfig = state.typeConfig.readConfig
-      mainType = readConfig==-1?state.typeConfig.typeConfig:readConfig;
-    },300)
     let font = mainType[3],colour = mainType[4],classStr = '';
     if(font == 1&&colour == 1){//字体加大颜色加深
       if(flg == 2){