瀏覽代碼

Merge branch 'dev/new1' of http://192.168.2.236:10080/zhouna/newICSS into dev/new1

Luolei 6 年之前
父節點
當前提交
ba10608653

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

@@ -149,7 +149,7 @@ class ChronicInfo extends React.Component{
         Notify.info("请先计算量表结果!");
         return ;
       }
-      this.handleAddAssessItem(scaleParam.v,scaleParam.i,scaleParam.j);
+      !isClose&&this.handleAddAssessItem(scaleParam.v,scaleParam.i,scaleParam.j);
       this.setState({
         scaleParam:{}
       });

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

@@ -23,7 +23,7 @@
         img{
             position: absolute;
             width: 15px;
-            left: 266px;
+            left: 278px;
             top: 9px;
             cursor: pointer;
         }
@@ -37,7 +37,7 @@
         display: inline-block;
         width: 300px;
         height: 34px;
-        padding: 5px;
+        padding: 5px 25px 5px 5px;
         border:1px #CECECE solid;
         vertical-align: top
     }

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

@@ -248,6 +248,9 @@ class NumberDrop extends Component{
     const cls = this.props.show?style['blued']:'';
     return cls;
   }
+  stopBubble(e){
+    e.stopPropagation();
+  }
   componentDidMount(){
     //设置最小宽度避免输入后宽度跳动
     const spanWidth = window.getComputedStyle(this.$span.current).width;
@@ -262,12 +265,12 @@ class NumberDrop extends Component{
     //console.log(prefix,value,placeholder+'1',this.props.placeholder)
     return <div className={this.getClasses()}
                 ref={this.$cont}
-                onDoubleClick={this.changeToEdit}
+                onDblClick ={this.changeToEdit}
                 onClick={allClick?this.handleNumClick:null}
                 contentEditable={editable}
                 onBlur={this.handleBlur}
                 onKeyDown={handleEnter}
-                onFocus={(e)=>{e.stopPropagation()}}>
+                onFocus={this.stopBubble.bind(this)}>
       <span ref = {this.$pre}>&nbsp;{prefix}</span>
       <span onFocus={this.handleNumFocus}
             onClick={allClick?null:this.handleNumClick}

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

@@ -23,7 +23,7 @@
     img{
       position: absolute;
       width: 15px;
-      left: 266px;
+      left: 278px;
       top: 9px;
       cursor: pointer;
     }
@@ -37,7 +37,7 @@
     display: inline-block;
     width: 300px;
     height: 34px;
-    padding: 5px;
+    padding: 5px 25px 5px 5px;
     border:1px #CECECE solid;
     vertical-align: top
   }

+ 16 - 6
src/components/SpreadDrop/index.jsx

@@ -229,9 +229,15 @@ class SpreadDrop extends Component{
     const linkStr = joint||'';
     const name = item.name+linkStr;
     if(isExclu){      //操作“互斥项”
-      if([...noneIds,...exists,...withs].length>0){     //已选非互斥项,互斥项不可操作
+      if([...noneIds,...exists,...withs].length>0){     //已选非互斥项,清空已选项,选中该互斥项
+        this.clearState();
+        this.setState({
+          exclusion:id,
+          excluName:name
+        });
         return;
       }
+      //未选中互斥项,直接选中该互斥项
       let temp = '';
       if(exclusion==''){
         temp = id;
@@ -262,8 +268,11 @@ class SpreadDrop extends Component{
       }
       return;
     }
-    if(exclusion!==''){     //互斥项被选中,其他不可操作
-      return;
+    if(exclusion!==''){     //互斥项已选中,清空互斥项
+      this.setState({
+        exclusion:'',
+        excluName:''
+      });
     }
     if(+item.code===1){     //操作“伴”类型
       this.setState({
@@ -356,7 +365,7 @@ class SpreadDrop extends Component{
   }
 
   render(){
-    const {placeholder,value,show,data} = this.props;
+    const {placeholder,value,show,data,order} = this.props;
     const {editable,boxLeft,boxTop} = this.state;
     return  <div className={style['container']}
               onFocus={(e)=>e.stopPropagation()}
@@ -372,7 +381,7 @@ class SpreadDrop extends Component{
         onInput={this.onChange}
         onkeydown={handleEnter}
         >{value||placeholder}</div>
-          <ListItems data={data} left={boxLeft}
+          <ListItems data={data} left={boxLeft} order={order}
             top={boxTop} show={show} handleSelect={this.handleSelect} handleConfirm={this.handleConfirm} handleClear={this.handleClear} {...this.state}></ListItems>
       </div>
   }
@@ -417,10 +426,11 @@ class ListItems extends Component{
     }
   }
   render (){
-    const {handleClear,handleConfirm} = this.props;
+    const {handleClear,handleConfirm,order} = this.props;
     const domNode = document.getElementById('root');
     return ReactDom.createPortal(
       <div className={style["drop-list"]} style={this.getStyle()} contentEditable="false" onClick={(e)=>{e.stopPropagation();}}>
+        <p className={style['orderTips']}>按{order?'从左到右列':'点选'}顺序成文</p>
         {this.getLabels()}
         <div className="oper">
           <span className={style['clear']} onClick={handleClear}>清空选项</span>

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

@@ -47,6 +47,10 @@
   border-bottom: 1px @border-color solid;
   line-height: 22px;
 }
+.orderTips{
+  color: #bfbfbf;
+  margin:0 0 10px 28px;
+}
 .clear{
   .btnCom;
   .clear;