Browse Source

查体体征标签蓝色添加

zhouna 5 năm trước cách đây
mục cha
commit
4e14695d17

+ 9 - 8
src/common/components/EditableSpan/index.jsx

@@ -291,18 +291,18 @@ class EditableSpan extends Component{
   }
   componentDidMount(){
     const {value} = this.props;
-    const that = this;
+    //const that = this;
     if(value){
       this.$span.current.innerText?(this.$span.current.innerText = value||''):(this.$span.current.innerHTML = value||'');
     }
-    if(isIE()){
+    /*if(isIE()){
       // 左右移动没问题,但是输入过程中会失焦,并且有时光标在但是无法输入 
       // $(this.$span.current)[0].addEventListener('DOMCharacterDataModified', function(e){that.onChange(e);}, false);
       // 此方法会影响左右切换时光标消失
-      /*$(this.$span.current).onIe8Input(function(e){
+      $(this.$span.current).onIe8Input(function(e){
         this.onChange(e)
-      },this);*/
-    }
+      },this);
+    }*/
   }
   /*cancelSelect(e){//双击不选中
     if(document.selection&&document.selection.empty){
@@ -313,11 +313,12 @@ class EditableSpan extends Component{
       }
     }*/
   getClass(){
-    const {full,value,saveText,i} = this.props;
+    const {full,value,saveText,i,preIsExt} = this.props;
     const preSelected = saveText[i-1];
     const isFull = full?' '+style['full']:'';       //是否宽度设为整行宽度
-    //有标点符号之外的字符或者前一个标签有选中值时,显示为黑色,否则灰显
-    const unselect = value.match(config.punctuationReg)||preSelected?'':style['unselect'];
+    //有标点符号之外的字符或者前一个标签有选中值时,显示为黑色,否则查体中,有体征标记显示蓝色,否则灰显
+    const ext = preIsExt?style['ext']:style['unselect'];
+    const unselect = value.match(config.punctuationReg)||preSelected?'':ext;
     return classNames(style['editable-span'],isFull,unselect);
   }
 

+ 3 - 0
src/common/components/EditableSpan/index.less

@@ -17,4 +17,7 @@
 }
 .unselect{
   color: @placeholder-color;
+}
+.ext{
+  color: @extBlue;
 }

+ 5 - 4
src/common/components/InlineTag/index.jsx

@@ -58,16 +58,17 @@ class InlineTag extends Component {
     }
   }
   getStyle(){
-    const {hideTag,placeholder} = this.props;
-    const value = this.state.value;//this.$span.current&&this.$span.current.innerText.trim();
+    const {hideTag,placeholder,isExtBlue} = this.props;
+    const value = this.state.value;
+    const ext = isExtBlue?style['ext']:'';
     if(hideTag){
       if(value){
         return classNames(style['selected-no-tag']);
       }
-      return style['no-tag'];
+      return classNames(style['no-tag'],ext);
     }
     if(!value||value.trim()==placeholder){
-      return classNames(style['gray']);
+      return classNames(style['gray'],ext);
     }
     return style['selected-tag'];
   }

+ 3 - 0
src/common/components/InlineTag/index.less

@@ -14,6 +14,9 @@
 }
 .gray{
    .tag;
+  &.ext{
+    color: @extBlue;
+  }
  }
 .free-in{
   display: inline-block;

+ 3 - 2
src/common/less/variables.less

@@ -4,6 +4,7 @@
 @cyan: #00bcd4;
 @blue: #3B9ED0;
 @red:#ff0000;
+@extBlue:#71A9FE;
 @tab-color:#3B9ED0;
 
 @ipt-color:#E9F5FA;
@@ -139,7 +140,7 @@
    display: inline-block;
    position: relative;
   /* margin-right: 5px;*/
-   padding: 0 3px 3px 0;
+   padding: 0 3px 3px 2px;
    color: @placeholder-color;
   cursor: pointer;
   &:before{
@@ -165,7 +166,7 @@
   position: relative;
   /*margin-right: 5px;
   padding: 0 3px 0;*/
-  color: unset!important;
+  color: unset;
   border:none!important;
   &:before,&:after{
   content: ''!important;

+ 3 - 1
src/components/CheckBody/index.jsx

@@ -60,7 +60,9 @@ class CheckBody extends Component{
     if(showData){
       list = showData;
       arr = list.map((it,i)=>{
-        return chooseType({item:it,boxMark,i,showArr,saveText,selecteds,importLabel,setHighter});
+        const preIsExt = list[i-1]&&list[i-1].specFlag===4?true:false;//前一个标签是否为体征标签
+        const afterIsExt = list[i+1]&&list[i+1].specFlag===4?true:false;//后一个标签是否为体征标签
+        return chooseType({item:it,preIsExt,afterIsExt,boxMark,i,showArr,saveText,selecteds,importLabel,setHighter});
       });
     }
     showMoreBtn&&arr.push(more);      //是否显示收起展开按钮

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

@@ -6,6 +6,7 @@ import RadioInpDrop from "@containers/RadioInpDrop";
 import InlineTag from '@containers/InlineTag';
 import Multiple from '@containers/Multiple';
 import addIcon from '@images/addItem.png';
+import addIcon1 from '@images/addItem2.png';
 import style from "./index.less";
 import tools from '@utils/tools';
 import NumberUnitDrop from '@containers/NumberUnitDrop';
@@ -131,7 +132,7 @@ class MultSpread extends Component{
     }
   }
   getLabels(){
-    const {data,ikey,showArr,copyId,selecteds,boxMark} = this.props;
+    const {data,ikey,showArr,copyId,selecteds,boxMark,isExtBlue} = this.props;
     const {wrBmi,bmi} = this.state;
     let show = false;
     let inx = '',count=0;
@@ -145,6 +146,7 @@ class MultSpread extends Component{
           const list = it.questionDetailList&&it.questionDetailList.length>0?it.questionDetailList:it.questionMapping;
           return <RadioDrop data={list}
                             boxMark={boxMark}
+                            isExtBlue={isExtBlue}
                             placeholder={it.name}
                             show={show}
                             value = {it.value}
@@ -157,6 +159,7 @@ class MultSpread extends Component{
           return <Multiple data={dataList}
                            ikey={inx}
                            placeholder={it.name}
+                           isExtBlue={isExtBlue}
                            value={it.value}
                            copyType={it.copyType}
                            selecteds={selecteds ?selecteds[i]:[]}
@@ -170,6 +173,7 @@ class MultSpread extends Component{
                                suffix={it.labelSuffix}
                                placeholder={it.name}
                                boxMark={ikey.substr(0,1)}
+                               isExtBlue={isExtBlue}
                                id={it.id}
                                show={show}
                                ikey={inx}
@@ -180,6 +184,7 @@ class MultSpread extends Component{
           return <InlineTag prefix={it.labelPrefix}
                             suffix={it.labelSuffix}
                             placeholder={it.name}
+                            isExtBlue={isExtBlue}
                             value={it.value}
                             id={it.id}
                             ikey={inx} hideTag={true}></InlineTag>;
@@ -190,6 +195,7 @@ class MultSpread extends Component{
           return <NumberDrop prefix={it.labelPrefix}
                              suffix={it.labelSuffix}
                              placeholder={it.name}
+                             isExtBlue={isExtBlue}
                              //inputRef = {this['$inp'+(count++)]}
                              saveDoms={this.saveDoms.bind(this)}
                              reFocus={this.setNextFocus.bind(this)}
@@ -215,6 +221,7 @@ class MultSpread extends Component{
                              show={showArr&&showArr[inx]}
                              value = {it.value}
                              boxMark={boxMark}
+                             isExtBlue={isExtBlue}
                              id={it.id}
                              ikey={inx}
                              hideTag={true}></RadioInpDrop>;
@@ -235,21 +242,22 @@ class MultSpread extends Component{
     }
   }
   getContClass(){
-    const {isImports,ikey,saveText} = this.props;
+    const {isImports,ikey,saveText,isExtBlue} = this.props;
     const labelInx = tools.getLabelIndex(ikey);
     const text = saveText&&saveText[+labelInx];
+    const ext = !text&&isExtBlue?style['ext']:'';
     const orgBorder = isImports&&!text?style['orange-border']:'';
-    return classNames(orgBorder);
+    return classNames(orgBorder,ext);
   }
   render(){
-    const {showAdd,addLabelItem,ikey,copyId,textPrefix,textSuffix} = this.props;
+    const {showAdd,addLabelItem,ikey,copyId,textPrefix,textSuffix,isExtBlue} = this.props;
     return (<div className={this.getContClass()}
                  style={{display:'inline-block'}}>
       {textPrefix?<span>{textPrefix}</span>:''}
       <div className={this.getClass()}>
       {this.getLabels()}
       {textSuffix?<span>{textSuffix}</span>:''}
-      {showAdd?<img src={addIcon} alt="复制该项"
+      {showAdd?<img src={isExtBlue?addIcon1:addIcon} alt="复制该项"
                     className={style['add-icon']}
                     onClick={()=>addLabelItem({ikey,copyId})}/>:''}
     </div>

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

@@ -1,4 +1,7 @@
 @import "~@less/variables.less";
+.ext>div{
+    color: @extBlue;
+}
 .container{
   .tag;
   cursor: unset;

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

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

+ 6 - 0
src/components/Multiple/index.less

@@ -9,6 +9,9 @@
 .tag,.selected-tag{
   cursor: pointer;
   line-height: 20px;
+  &.ext{
+    color: @extBlue!important;
+  }
 }
 
 .selected-tag{
@@ -21,4 +24,7 @@
   padding: 0;
   color: @text-color;
   line-height: 22px;
+  &.ext{
+    color: @extBlue;
+  }
 }

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

@@ -197,12 +197,13 @@ class NumberDrop extends Component{
     handleHide&&handleHide();
   }
   getClasses(){         //整个标签是否有值的状态
-    const {hideTag,placeholder,isImports} = this.props;
+    const {hideTag,placeholder,isImports,isExtBlue} = 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);
+    return className(isSelected,noTag,orgBorder,ext);
   }
   getSpanClass(){       //将被替换的文字选中状态显示
     const cls = this.props.show?style['blued']:style['nol'];

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

@@ -1,6 +1,9 @@
 @import "~@less/variables.less";
 .container{
   .tag;
+  &.ext{
+    color: @extBlue!important;
+  }
   line-height: 22px;
   .blued{
     background: @blue;

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

@@ -34,21 +34,21 @@ class RadioDrop extends Component{
     this.handleEditLabel = this.handleEditLabel.bind(this);
   }
   getClass(){
-    const {value,hideTag,placeholder,show,isImports} = this.props;
-    const blueBorder = this.state.editable?style['blue-border']:'';
-    const orgBorder = isImports?style['orange-border']:'';
+    const {value,hideTag,show,isImports,isExtBlue} = this.props;
+    const ext = isExtBlue?style['ext']:'';
+    const orgBorder = isImports?style['orange-border']:'';      //橙色框高亮
     if(show){
       $(this.$cont.current).addClass(style['borderd']);
     }else{
       $(this.$cont.current).removeClass(style['borderd']);
     }
     if(hideTag){
-      return style['no-tag'];
+      return classNames(style['no-tag'],ext);
     }
     if(value){
-      return blueBorder?classNames(style['selected-tag'],blueBorder):style['selected-tag'];
+      return style['selected-tag'];
     }
-    return classNames(style['tag'],orgBorder);
+    return classNames(style['tag'],orgBorder,ext);
   }
   handleSelect(item){
     const {handleSelect,ikey,mainSaveText,value} = this.props;

+ 6 - 0
src/components/RadioDrop/index.less

@@ -10,8 +10,14 @@
   word-break: break-all;
   /*line-height: 20px;*/
 }
+.no-tag{
+  color:inherit;
+}
 .tag{
   color:@placeholder-color;
+  &.ext{
+    color: @extBlue!important;
+  }
 }
 .tag:before{
   content: '[';

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

@@ -36,21 +36,21 @@ class RadioInpDrop extends Component{
     this.handleInnerInp = this.handleInnerInp.bind(this);
   }
   getClass(){
-    const {value,hideTag,placeholder,show,isImports} = this.props;
-    const blueBorder = this.state.editable?style['blue-border']:'';
-    const orgBorder = isImports&&!value?style['orange-border']:'';
+    const {value,hideTag,show,isImports,isExtBlue} = this.props;
+    const orgBorder = isImports&&!value?style['orange-border']:'';    //查体,是否橙色框高亮
+    const ext = isExtBlue?style['ext']:'';      //查体,是否是体征
     if(show){
       $(this.$cont.current).addClass(style['borderd']);
     }else{
       $(this.$cont.current).removeClass(style['borderd']);
     }
     if(hideTag){
-      return style['no-tag'];
+      return classNames(style['no-tag'],ext);
     }
     if(value){
-      return blueBorder?classNames(style['selected-tag'],blueBorder):style['selected-tag'];
+      return style['selected-tag'];
     }
-    return classNames(style['tag'],orgBorder);
+    return classNames(style['tag'],orgBorder,ext);
   }
   handleSelect(item){
     const {handleSelect,ikey,value,placeholder,mainSaveText} = this.props;

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

@@ -7,6 +7,9 @@
 .tag,.selected-tag,.no-tag{
   display: inline-block;
   cursor: pointer;
+  &.ext{
+    color: @extBlue;
+  }
   /*line-height: 20px;*/
 }
 .tag{

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

@@ -330,9 +330,10 @@ class SpreadDrop extends Component{
     });
   }
   getClass(){
-    const {isImports,show,value} = this.props;
+    const {isImports,show,value,isExtBlue} = this.props;
     const blueBorder = this.state.editable?style['blue-border']:'';
     const orgBorder = isImports&&!value?style['orange-border']:'';
+    const ext = isExtBlue?style['ext']:'';
     if(show){
       $(this.$div.current).addClass(style['borderd']);
     }else{
@@ -341,7 +342,7 @@ class SpreadDrop extends Component{
     if(value){
       return classNames(style['selected-tag'],blueBorder);
     }
-    return classNames(style['tag'],orgBorder);
+    return classNames(style['tag'],orgBorder,ext);
   }
 
   componentDidMount(){

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

@@ -41,6 +41,9 @@
 .tag,.selected-tag{
   cursor: pointer;
   line-height: 20px;
+  &.ext{
+    color: @extBlue;
+  }
 }
 
 .selected-tag{

+ 9 - 0
src/containers/eleType.js

@@ -31,6 +31,7 @@ export function singleRadio(params){
       const list = data.questionDetailList&&data.questionDetailList.length>0?data.questionDetailList:data.questionMapping;
       return <RadioDrop data={custom&&custom.length?[...custom,...list]:list}
                         placeholder={data.name}
+                        isExtBlue={data.specFlag===4?true:false}
                         show={showArr&&showArr[showInx]}
                         value = {data.value}
                         boxMark={boxMark}
@@ -45,6 +46,7 @@ export function singleRadio(params){
                      placeholder={data.name}
                      value={data.value}
                      copyType={data.copyType}
+                     isExtBlue={data.specFlag===4?true:false}
                      selecteds={selecteds ?selecteds[i]:[]}
                      show={showArr&&showArr[showInx]}
                      order={data.textGenerate}
@@ -59,6 +61,7 @@ export function singleRadio(params){
       return <NumberUnitDrop prefix={data.labelPrefix}
                          suffix={data.labelSuffix}
                          placeholder={data.name}
+                         isExtBlue={data.specFlag===4?true:false}
                          formulaCode={data.formulaCode}
                          boxMark={boxMark}
                          id={data.id}
@@ -71,6 +74,7 @@ export function singleRadio(params){
       return <InlineTag prefix={data.labelPrefix}
                         suffix={data.labelSuffix}
                         placeholder={data.name}
+                        isExtBlue={data.specFlag===4?true:false}
                         value={data.value}
                         isImports={isHigh}
                         id={data.id}
@@ -78,10 +82,12 @@ export function singleRadio(params){
     case 7:
       const min = data.minValue;//!=null&&data.minValue!=undefined?data.minValue-1:undefined;
       const max = data.maxValue;//!=null&&data.maxValue!=undefined?+data.maxValue+1:undefined;
+
       return <NumberDrop prefix={data.labelPrefix}
                          suffix={data.labelSuffix}
                          min={min}
                          max={max}
+                         isExtBlue={data.specFlag===4?true:false}
                          placeholder={data.name}
                          boxMark={boxMark}
                          id={data.id}
@@ -95,6 +101,7 @@ export function singleRadio(params){
       return <RadioInpDrop data={data.questionDetailList}
                            vals={data.vals}
                         placeholder={data.name}
+                        isExtBlue={data.specFlag===4?true:false}
                         show={showArr&&showArr[showInx]}
                         value = {data.value}
                         boxMark={boxMark}
@@ -115,6 +122,7 @@ function multLabels(params){
                      showAdd = {+data.showAdd===1}
                      copyId={data.id}
                      fullData = {data}
+                     isExtBlue={data.specFlag===4?true:false}
                      showArr={showArr||{}}
                      update={Math.random()}
                      boxMark={boxMark}
@@ -138,6 +146,7 @@ function multCheckLabels(params,tagType){
                      placeholder={data.name}
                      value={data.value}
                      copyType={data.copyType}
+                     isExtBlue={data.specFlag===4?true:false}
                      selecteds={selecteds ?selecteds[i]:[]}
                      show={showArr&&showArr[showInx]}
                      order={data.textGenerate}

+ 1 - 1
src/utils/config.js

@@ -2,7 +2,7 @@
 // const host='http://192.168.3.100:5050';//王峰
 // const host='http://192.168.2.236:5050';//后端接口访问地址
 // const host='http://192.168.2.121:5050';//后端接口访问地址
-const host='http://192.168.2.241:5050';//后端接口访问地址
+const host='http://192.168.2.236: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'; //周铁刚