|
@@ -1,12 +1,12 @@
|
|
|
import React, { Component } from "react";
|
|
|
import styles from "./index.less";
|
|
|
-import { normalVal,timestampToTime } from '@utils/tools';
|
|
|
+import { normalVal,timestampToTime,getPageCoordinate } from '@utils/tools';
|
|
|
import { InspectCommon, Calendar,DelToast} from '@commonComp';
|
|
|
import slideUp from "@common/images/slide-up.png";
|
|
|
import slideDown from "@common/images/slide-down.png";
|
|
|
import $ from 'jquery';
|
|
|
import date1 from '../img/date1.png';
|
|
|
-import close from '../img/close.png';
|
|
|
+import ScrollArea from 'react-scrollbar';
|
|
|
|
|
|
class SlideSelect extends Component {
|
|
|
constructor(props) {
|
|
@@ -16,12 +16,13 @@ class SlideSelect extends Component {
|
|
|
activeInd:false,
|
|
|
activeName:'',
|
|
|
};
|
|
|
- this.toTime = this.toTime.bind(this)
|
|
|
- this.handleSlide = this.handleSlide.bind(this)
|
|
|
- this.handleDel = this.handleDel.bind(this)
|
|
|
- this.handleCancel = this.handleCancel.bind(this)
|
|
|
- this.delConfirm = this.delConfirm.bind(this)
|
|
|
- this.timeSure = this.timeSure.bind(this)
|
|
|
+ this.toTime = this.toTime.bind(this);
|
|
|
+ this.handleSlide = this.handleSlide.bind(this);
|
|
|
+ this.handleDel = this.handleDel.bind(this);
|
|
|
+ this.handleCancel = this.handleCancel.bind(this);
|
|
|
+ this.delConfirm = this.delConfirm.bind(this);
|
|
|
+ this.timeSure = this.timeSure.bind(this);
|
|
|
+ this.handleLabelSub = this.handleLabelSub.bind(this);
|
|
|
}
|
|
|
handleChangeDate(date) {
|
|
|
// console.log(date,'外')
|
|
@@ -82,8 +83,24 @@ class SlideSelect extends Component {
|
|
|
const {handleChangeDate} = this.props;
|
|
|
handleChangeDate&&handleChangeDate(date)
|
|
|
}
|
|
|
+ handleLabelSub(e,questionId,idx){
|
|
|
+ const {handleLabelSub,handleFillShow,windowHeight,listDom,setHighter} = this.props;
|
|
|
+ handleLabelSub(e,questionId,idx);
|
|
|
+ handleFillShow(e,idx);
|
|
|
+ //弹窗高度超出屏幕,增加页面高度
|
|
|
+ setTimeout(function(){
|
|
|
+ const listHeight =$(listDom.current).height();
|
|
|
+ const contHt = listHeight>358?450:(100+listHeight);
|
|
|
+ const lastHt = windowHeight-getPageCoordinate(e).boxTop;
|
|
|
+ if(lastHt < contHt){
|
|
|
+ //console.log(windowHeight,getPageCoordinate(e).boxTop,contHt,lastHt)
|
|
|
+ setHighter(contHt-lastHt+80);
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ }
|
|
|
render() {
|
|
|
- const {getInfomation,handleConfirm,changeActivePart,handleDelClick,getItemList,date,item,idx,handleFillShow,showDetails,handleLabelSub,showFill,changeShowFill,handlePush,dateTime,currentIdx,currentData,fillActive,handleShowDate,handleChangeDate,showToast} = this.props;
|
|
|
+ const {getInfomation,handleConfirm,changeActivePart,handleDelClick,getItemList,date,item,idx,handleFillShow,showDetails,showFill,changeShowFill,handlePush,dateTime,currentIdx,currentData,fillActive,handleShowDate,handleChangeDate,showToast} = this.props;
|
|
|
const {show,activeInd,activeName} = this.state;
|
|
|
let numPlus = 0,numPlus1 = 0;
|
|
|
let staticTime = {}
|
|
@@ -99,19 +116,27 @@ class SlideSelect extends Component {
|
|
|
second: tmp2[2]
|
|
|
}
|
|
|
}
|
|
|
+ const contStyle={
|
|
|
+ opacity:'0.4',
|
|
|
+ right:'0',
|
|
|
+ top:'6px',
|
|
|
+ zIndex:'15',
|
|
|
+ width:'14px',
|
|
|
+ background:'#f1f1f1'};
|
|
|
+ const barStyle={background:'#777',width:'100%'};
|
|
|
return (
|
|
|
<li key={item.questionId} className={styles.slideLi}>
|
|
|
{
|
|
|
// 标签,血常规。。
|
|
|
item.show ?
|
|
|
<p className={styles.staticTagActive}>
|
|
|
- <span className={styles.tagSpan} data-flg="current" style={{color:"#000"}} onClick={(e) => { handleLabelSub(e, item.questionId,idx); handleFillShow(e,idx) }}>
|
|
|
+ <span className={styles.tagSpan} data-flg="current" style={{color:"#000"}} onClick={(e)=>this.handleLabelSub(e,item.questionId,idx)}>
|
|
|
{item.name}
|
|
|
<span className={styles.imgInfo} onClick={()=>getInfomation({name:item.uniqueName || '', position: 1, type: 12})}></span>
|
|
|
</span>
|
|
|
</p>:
|
|
|
<p >
|
|
|
- <i className={styles.tagSpan} data-flg="current" onClick={(e) => { handleLabelSub(e,item.questionId,idx); handleFillShow(e,idx) }}>
|
|
|
+ <i className={styles.tagSpan} data-flg="current" onClick={(e)=>this.handleLabelSub(e,item.questionId,idx)}>
|
|
|
{item.name}
|
|
|
<span className={styles.imgInfo} onClick={()=>getInfomation({name:item.uniqueName || '', position: 1, type: 12})}></span>
|
|
|
</i>
|
|
@@ -212,7 +237,16 @@ class SlideSelect extends Component {
|
|
|
</div>
|
|
|
</div>
|
|
|
{/* 填写单内容显示 */}
|
|
|
+ <ScrollArea speed={0.8}
|
|
|
+ horizontal={false}
|
|
|
+ stopScrollPropagation={true}
|
|
|
+ style={{maxHeight:'358px'}}
|
|
|
+ className={styles["area"]}
|
|
|
+ verticalContainerStyle={contStyle}
|
|
|
+ verticalScrollbarStyle={barStyle}
|
|
|
+ contentClassName="content">
|
|
|
{ getItemList() }
|
|
|
+ </ScrollArea>
|
|
|
</InspectCommon>
|
|
|
: null
|
|
|
}
|