소스 검색

血压类可选中

zhouna 5 년 전
부모
커밋
f7b9de208d
4개의 변경된 파일22개의 추가작업 그리고 3개의 파일을 삭제
  1. 1 0
      src/common/less/variables.less
  2. 8 1
      src/components/MultSpread/index.jsx
  3. 3 0
      src/components/SpreadDrop/index.less
  4. 10 2
      src/containers/MultSpread.js

+ 1 - 0
src/common/less/variables.less

@@ -157,6 +157,7 @@
   border-bottom: 1px @border-color solid;
   &.selected-area{
     background: #338fff;
+    color: #fff!important;
   }
 }
 

+ 8 - 1
src/components/MultSpread/index.jsx

@@ -240,6 +240,12 @@ class MultSpread extends Component{
     });
     return list;
   }
+  handleMouseUp(){
+    const {select_start,i,setSelectArea,boxMark}= this.props;
+    if(select_start!==undefined){
+      setSelectArea({i,boxMark,dir:'end'});
+    }
+  }
   componentDidMount(){
     //挂载完成保存有加号的项目数据
     const {saveAddItem,fullData,copyId,showAdd} = this.props;
@@ -261,7 +267,8 @@ class MultSpread extends Component{
   render(){
     const {showAdd,addLabelItem,ikey,copyId,textPrefix,textSuffix,isExtBlue} = this.props;
     return (<div className={this.getContClass()}
-                 style={{display:'inline-block'}}>
+                 style={{display:'inline-block'}}
+                 onMouseUp={this.handleMouseUp.bind(this)}>
         {textPrefix?<span className="prefixUnset">{textPrefix}</span>:''}
         <div className={this.getClass()}>
           {this.getLabels()}

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

@@ -8,5 +8,8 @@
   }
   .ext {
     color: @extBlue !important;
+    &.selected-area{
+      color: #fff!important;
+    }
   }
 }

+ 10 - 2
src/containers/MultSpread.js

@@ -5,10 +5,12 @@ import {OTHERADDLABELITEM} from '@types/otherHistory';
 import {ADDLABELITEM} from '@types/checkBody';
 import {MAINADDLABELITEM} from '@store/types/mainSuit';
 import {CURRENTADDLABELITEM} from '@store/types/currentIll';
-import {HIDE,RESET,CLICKCOUNT,SETADDITEMINIT,ISREAD} from '@store/types/homePage';
+import {HIDE,RESET,CLICKCOUNT,SETADDITEMINIT,ISREAD,SET_SELECTED_AREA} from '@store/types/homePage';
 
 function mapStateToProps(state){
-  return {}
+  return {
+    select_start:state.homePage.select_start,
+  }
 }
 
 const typeObj={
@@ -75,6 +77,12 @@ function mapDispatchToProps(dispatch){
         clickType:'单击',
         num:1
       });
+    },
+    setSelectArea(data){
+      dispatch({
+        type:SET_SELECTED_AREA,
+        data
+      })
     }
   }
 }