瀏覽代碼

Merge branch 'dev5.3.2' of http://192.168.2.236:10080/zhouna/newICSS into dev5.3.2

zhangxc 5 年之前
父節點
當前提交
7e257b3e12

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

@@ -98,7 +98,8 @@ class EditableSpan extends Component{
       clearTimeout(that.state.timer);
       temp = newText.replace(searchPre,'');
       isEnd = !(newText.indexOf(searchPre)>0);
-      search = temp.replace(/[(^\s*)|(\s*$)|(^\,*)|(\,*$)]/g,'');
+      // search = temp.replace(/[(^\s*)|(\s*$)|(^\,*)|(\,*$)]/g,'');
+      search = temp.replace(config.regPreAndAft,'');
       // if(!search&&searchPre){
       if(!temp&&searchPre&&newText){
         search = searchPre;
@@ -291,18 +292,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,15 +314,32 @@ 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);
   }
 
   render() {
+    const {preIsExt,afterIsExt} = this.props;
+    const br = preIsExt&&!afterIsExt;       //最后一个体征标签
+    if(br){
+      return <React.Fragment>
+      <span className={this.getClass()}
+            contentEditable='true'
+            ref={this.$span}
+            onInput={this.onChange}
+            onFocus={this.handleFocus}
+            onBlur={this.handleBlur}
+            onKeyDown={this.handleKeydown}
+            onClick={this.handleClick}
+            onKeyUp={this.handleKeyup}></span>
+        <br/>
+      </React.Fragment>;
+    }
     return <span className={this.getClass()}
                  contentEditable='true'
                  ref={this.$span}

+ 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/components/NumberPan/index.jsx

@@ -59,6 +59,7 @@ class NumberPan extends Component{
   }
   render(){
     const select = this.handleSelect;
+    const noString=this.props.noString;
     const domNode = document.getElementById('root');
     return <div className={style['panBox']}
                 style={this.getStyle()}
@@ -70,7 +71,7 @@ class NumberPan extends Component{
           <td><button onMouseUp={select}>1</button></td>
           <td><button onMouseUp={select}>2</button></td>
           <td><button onMouseUp={select}>3</button></td>
-          <td><button onMouseUp={select}>/</button></td>
+          <td><button className={noString?style['disabled']:''} onMouseUp={noString?null:select}>/</button></td>
         </tr>
         <tr>
           <td><button onMouseUp={select}>4</button></td>
@@ -87,7 +88,7 @@ class NumberPan extends Component{
         <tr>
           <td><button onMouseUp={select}>.</button></td>
           <td><button onMouseUp={select}>0</button></td>
-          <td><button onMouseUp={select}>~</button></td>
+          <td><button className={noString?style['disabled']:''} onMouseUp={noString?null:select}>~</button></td>
           <td><button onMouseUp={this.handleClose.bind(this)} className={style['confirm']}>确定</button></td>
         </tr>
       </table>

+ 7 - 0
src/common/components/NumberPan/index.less

@@ -9,6 +9,13 @@
   td{
     width: 68px;
     height:44px;
+    .disabled{
+      opacity: .4;
+      cursor: not-allowed;
+    }
+    .disabled:hover{
+      border: none;
+    }
   }
   button{
     border:1px #fff solid;

二進制
src/common/images/addItem2.png


+ 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);      //是否显示收起展开按钮

+ 81 - 6
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';
@@ -33,8 +34,16 @@ class MultSpread extends Component{
   constructor(props){
     super(props);
     this.state = {
-      numDoms:[]
+      numDoms:[],
+      tall:0,       //升高
+      weight:0,     //体重
+      bmi:'',        //BMI
+      wrBmi:false,      //是否无效bmi值,是则要清空身高体重,不能用判断bmi是否为空来判断,因为初始就是为空
     };
+    this.setBMIParam = this.setBMIParam.bind(this);
+    this.setBMI = this.setBMI.bind(this);
+    this.isBMIUseable = this.isBMIUseable.bind(this);
+    this.setBMIstate = this.setBMIstate.bind(this);
   }
   getClass(){
     const {saveText,ikey,showAdd} = this.props;
@@ -70,8 +79,61 @@ class MultSpread extends Component{
     const doms = this.state.numDoms;
     doms[i+1]&&this.moveEnd(doms[i+1].current)
   }
+  isBMIUseable(name,val){
+    const {tall,weight} = this.state;
+    //身高不能为0,否则分母为0,身高体重任何一个为空,则BMI清空
+    if((name==='tall'&&(!val||!weight))||(name==='weight'&&(!tall||!val))){
+      return false;
+    }
+    return true;
+  }
+  setBMIParam(name,val){        //设置bmi相关数据,身高、体重
+    const {tall,weight} = this.state;
+    const useable = this.isBMIUseable(name,val);
+    this.setState({
+      [name]:val
+    });
+    if(useable){
+      const result = name==='tall'?weight/Math.pow(val/100,2):val/Math.pow(tall/100,2);
+      this.setState({
+        bmi:result.toFixed(1),
+        wrBmi:false
+      })
+    }else{
+      this.setState({
+        bmi:'',
+        wrBmi:false
+      })
+    }
+  }
+  setBMI(val){
+    //手动修改BMI赋值,且身高体重清空
+    this.setState({
+      bmi:val,
+      wrBmi:true,
+      tall:0,
+      weight:0
+    });
+  }
+  setBMIstate(item){
+    //回读时bmi相关state赋值
+    const map={
+      BMI_SG:'tall',
+      BMI_TZ:'weight',
+      BMI_RES:'bmi',
+    };
+    const st = this.state;
+    const key = map[item.formulaCode];
+    //回读BMI相关项有值时,state赋值
+    if(key&&st[key]!==item.value){
+      this.setState({
+        [key]:item.value
+      });
+    }
+  }
   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;
     const list = data.map((it,i)=>{
@@ -84,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}
@@ -96,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]:[]}
@@ -109,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}
@@ -119,18 +184,26 @@ 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>;
         case +it.controlType===7:
           const min = it.minValue;//!=null&&it.minValue!=undefined?it.minValue-1:undefined;
           const max = it.maxValue;//!=null&&it.maxValue!=undefined?+it.maxValue+1:undefined;
+          this.setBMIstate(it);
           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)}
+                             setBMI={this.setBMI}
+                             wrBmi={wrBmi}
+                             bmi={bmi}
+                             setBMIParam={this.setBMIParam}
+                             formulaCode={it.formulaCode}
                              num = {count++}
                              min={min}
                              max={max}
@@ -148,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>;
@@ -168,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;
+  }
 }

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

@@ -31,6 +31,7 @@ class NumberDrop extends Component{
     this.handleNumFocus = this.handleNumFocus.bind(this);
     this.handleKeyDowm = this.handleKeyDowm.bind(this);
     this.beyondArea = this.beyondArea.bind(this);
+    this.emitBMIData = this.emitBMIData.bind(this);
   }
   select(text){        //选中键盘上数字事件
     //placeholder修改后,第一次点击键盘触发blur后onClick不触发,原因未知,改为onMouseup可触发
@@ -64,11 +65,30 @@ class NumberDrop extends Component{
     }
 
     handleSelect&&handleSelect({ikey,text,suffix,prefix,mainSaveText});
+    //BMI相关数据上传
+    this.emitBMIData(text);
+  }
+  emitBMIData(text){
+    //手动修改BMI相关值时数据上传
+    const {setBMIParam,formulaCode,setBMI} = this.props;
+    if(formulaCode==="BMI_RES"){
+      setBMI&&setBMI(text);
+    }
+    if(text!==0&&(formulaCode==="BMI_SG"||formulaCode==="BMI_TZ")){
+      const map={
+        BMI_SG:'tall',
+        BMI_TZ:'weight'
+      };
+      setTimeout(function(){
+        setBMIParam&&setBMIParam(map[formulaCode],text);
+      });
+    }
   }
   beyondArea(){
     const {handleSelect,ikey,suffix,prefix,mainSaveText} = this.props;
     Notify.info("输入数值不符合规范,请重新输入!");
     handleSelect&&handleSelect({ikey,text:'',suffix,prefix,mainSaveText});
+    this.emitBMIData('');
     this.setState({
       placeholder:this.props.placeholder,
       hasSelect:false
@@ -165,6 +185,7 @@ class NumberDrop extends Component{
     let text = val===placeholder?'':val;
     //e.target.innerText = '';      //避免出现重复输入值
     handleSelect&&handleSelect({ikey,text,suffix,prefix,mainSaveText});
+    this.emitBMIData(text);
   }
   handleSpanInp(e){   //数字框输入事件
     e.stopPropagation();
@@ -176,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'];
@@ -202,16 +224,27 @@ class NumberDrop extends Component{
     })
   }
   componentWillReceiveProps(nextProps){
+    //BMI存值
+    const {formulaCode,bmi,suffix,prefix,ikey,handleSelect,mainSaveText,wrBmi} = this.props;
+    if(formulaCode==="BMI_RES"&&nextProps.bmi!==bmi){
+      handleSelect&&handleSelect({ikey,text:nextProps.bmi,suffix,prefix,mainSaveText});
+    }
+    //手动修改BMI时身高体重清空
+    if(wrBmi!==nextProps.wrBmi&&(formulaCode==="BMI_SG"||formulaCode==="BMI_TZ")){
+      handleSelect&&handleSelect({ikey,text:'',suffix,prefix,mainSaveText});
+    }
+
     if((nextProps.placeholder == this.props.placeholder)&&(nextProps.value == this.props.value)){
       return
     }
     this.setState({
       placeholder:nextProps.placeholder,
       value:nextProps.value
-    })
+    });
   }
   render(){
-    const {prefix,suffix,show,value,handleHide,allClick} = this.props;
+    const {prefix,suffix,show,value,handleHide,allClick,bmi,formulaCode} = this.props;
+    const val = formulaCode==="BMI_RES"?(+bmi===Infinity||isNaN(bmi)?'':bmi):value;
     const {placeholder,hasSelect} = this.state;
     return <div className={this.getClasses()}
                 style={{position:'relative'}}
@@ -226,9 +259,10 @@ class NumberDrop extends Component{
             onBlur={this.numInpBlur}
             onInput={this.handleSpanInp}
             className={this.getSpanClass()}
-            >&nbsp;{value||placeholder}</span>
+            >&nbsp;{val||placeholder}</span>
       <span>{suffix}</span>
       <NumberPan handleSelect={this.select.bind(this)}
+                 noString={formulaCode?true:false}
                  onClose={handleHide}
                  show={show}
                  toClear={!hasSelect}/>

+ 5 - 2
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;
@@ -9,7 +12,7 @@
   .nol,.blued{
     min-width:10px;
     height: 22px;
-    vertical-align: text-bottom;
+    /*vertical-align: bottom;*/
     display:inline-block;
     text-align:center;
     word-break:break-all;
@@ -33,6 +36,6 @@
     text-align:center;
     word-break:break-all;
     height: 22px;
-    vertical-align: text-bottom;
+    /*vertical-align: bottom;*/
   }
 }

+ 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{

+ 1 - 0
src/config/index.js

@@ -35,4 +35,5 @@ export default {
     textReg:new RegExp("([\u4E00-\uFA29]|[\uE7C7-\uE7F3]|[a-zA-Z0-9])"), //包含中英文或数字
     slideTime:400,      //右侧指标推送展开/收起动画时间
     recoverTagNum:3,    //可回退标签的个数
+    regPreAndAft:/[^\u4e00-\u9fa5|0-9|a-z|A-Z|Ⅰ|Ⅱ|Ⅲ|Ⅳ|Ⅴ|Ⅵ|Ⅶ|Ⅷ|Ⅸ|Ⅹ]+$|^[^\u4e00-\u9fa5|0-9|a-z|A-Z|Ⅰ|Ⅱ|Ⅲ|Ⅳ|Ⅴ|Ⅵ|Ⅶ|Ⅷ|Ⅸ|Ⅹ]+/g  //搜索去掉前后的标点
 };

+ 8 - 4
src/containers/EditableSpan.js

@@ -19,7 +19,8 @@ function mapStateToProps(state){//console.log(state)
 
 function mainSuitSearch(obj){
   return (dispatch)=>{
-    const text = obj.text.replace(/\,/,'');
+    // const text = obj.text.replace(/\,/,'');
+    const text = obj.text;
     getSearch({boxMark:1,inpStr:text,mainIds:obj.mainIds,itemType:0}).then((res)=>{
       if(res.data.code=='0'){
         dispatch({
@@ -35,7 +36,8 @@ function mainSuitSearch(obj){
 
 function currentSearch(obj){
   return (dispatch)=>{
-    const text = obj.text.replace(/\,/,'');
+    // const text = obj.text.replace(/\,/,'');
+    const text = obj.text;
     getSearch({boxMark:1,inpStr:text,mainIds:obj.mainIds}).then((res)=>{
       if(res.data.code=='0'){
         dispatch({
@@ -51,7 +53,8 @@ function currentSearch(obj){
 
 function checkBodySearch(obj){
   return (dispatch)=>{
-    const text = obj.text.replace(/\,/,'');
+    // const text = obj.text.replace(/\,/,'');
+    const text = obj.text;
     getSearch({boxMark:4,inpStr:text}).then((res)=>{
       if(res.data.code=='0'){
         dispatch({
@@ -67,7 +70,8 @@ function checkBodySearch(obj){
 
 function otherHisSearch(obj) {
   return (dispatch)=>{
-    const text = obj.text.replace(/\,/,'');
+    // const text = obj.text.replace(/\,/,'');
+    const text = obj.text;
     getSearch({boxMark:3,inpStr:text}).then((res)=>{
       if(res.data.code=='0'){
         dispatch({

+ 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}