Explorar o código

Merge remote-tracking branch 'origin/adverseReact' into testedMerge

zhouna %!s(int64=5) %!d(string=hai) anos
pai
achega
85195b3959

+ 3 - 3
src/common/components/Radio/index.jsx

@@ -36,10 +36,10 @@ class Radio extends React.Component {
   }
 
   render() {
-    const {id,label,isSelect,disabled} = this.props;
+    const {id,label,isSelect,disabled, noSelected} = this.props;
     if(disabled){
       return (
-        <div className={style['radio']}
+        <div className={`${style['radio']} ${noSelected ? style['noSelected']:''}`}
              style={this.getStyle()}>
           <img src={isSelect?disable:off}/>
           <span style={{color:'#aaa'}}>{label}</span>
@@ -47,7 +47,7 @@ class Radio extends React.Component {
       )
     }
     return (
-      <div className={style['radio']}
+      <div className={`${style['radio']} ${noSelected ? style['noSelected']:''}`}
            onClick={() =>this.handleClick(id)}
            style={this.getStyle()}>
         <img src={isSelect?on:off}/>

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

@@ -7,4 +7,7 @@
     vertical-align: middle;
     margin-right: 6px;
   }
+}
+.noSelected {
+  cursor:not-allowed;
 }

+ 4 - 2
src/components/AssessResult/ChooseItem/index.jsx

@@ -41,12 +41,14 @@ class ChooseItem extends Component {
                 <div className={style['row']}>
                   {it.details&&it.details.map((i)=> {
                     if(it.controltype ==0){
-                      return <div className={style['choose-item']}>
+                      return <div className={`${style['choose-item']}  ${selecteds&&selecteds[it.name]==i.detailName||(selecteds&&!selecteds[it.name]&&i.state==1) ? style['selectd']:style['dis-selectd']}`}>
                                 <Radio label={i.detailName}
                                        value={i.detailName}
                                        disabled={disabled}
                                        isSelect={selecteds&&selecteds[it.name]==i.detailName||(selecteds&&!selecteds[it.name]&&i.state==1)}
-                                       handleClick={this.handleRadio.bind(this,it.name,i.detailName)}></Radio>
+                                       noSelected = {title == '风险因素评估:'}
+                                       handleClick={title == '风险因素评估:' ? '':this.handleRadio.bind(this,it.name,i.detailName)}
+                                       ></Radio>
                                 {/*{i.state?<i>(智能推荐)</i>:''}*/}
                               </div>;
                     }else{

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

@@ -34,10 +34,10 @@
   }
   li {
     line-height: 35px;
-    /*.row{
+    .row{
       display: inline-block;
       max-width: 86%;
-    }*/
+    }
     .results{
       position: relative;
     }

+ 11 - 3
src/components/Treat/AdverseReactions/index.jsx

@@ -1,4 +1,5 @@
 import React, { Component } from 'react';
+import { Radio } from '@commonComp';
 import style from './index.less';
 import info2 from './../img/info2.png';
 import info3 from './../img/info3.png';
@@ -75,9 +76,16 @@ class AdverseReactions extends Component {
                         
                     </span>
                         {item.details.map((it, idx) => {
-                            return <span className={`style['adverse-reactions-name'] ${it.value == 1 ? style['selectd']:''}`} key={item.conceptId + item.name + it.name}>
-                                <input type="radio" checked={it.value == 1}  id={item.conceptId +item.name + it.name} onChange={this.changeReact.bind(this, it, index)}/>
-                                <label for={item.conceptId +item.name + it.name}> {it.name} </label>
+                            return <span className={`${style['adverse-reactions-name']} ${it.value == 1 ? style['selectd']:style['dis-selectd']}`} key={item.conceptId + item.name + it.name}>
+                                {/* <input type="radio" checked={it.value == 1}  id={item.conceptId +item.name + it.name} 
+                                    // onChange={this.changeReact.bind(this, it, index)}
+                                />
+                                <label for={item.conceptId +item.name + it.name}> {it.name} </label> */}
+                                <Radio label={it.name}
+                                       isSelect={it.value == 1}
+                                       noSelected = 'true'
+                                      //  handleClick={this.handleRadio.bind(this,it.name,i.detailName)}
+                                ></Radio>
                                 {/* {it.value==1 && <span className={style['adverse-reactions-recommend']}>(智能推荐)</span>} */}
                             </span>
                         })}