import React, { Component } from "react"; import styles from "./index.less"; import { normalVal,timestampToTime } 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 date1 from '../img/date1.png'; import close from '../img/close.png'; class SlideSelect extends Component { constructor(props) { super(props); this.state = { show:false, 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) } toTime(time){ let tmpTim = time.split(',').join('')-0 if(time && tmpTim.toString() != 'NaN'){ let date = new Date('1900-01-01'); let dateTim = date.getTime(); let times = (tmpTim-2)*24*60*60*1000; let result = timestampToTime(dateTim+times).split(' ')[0] return result; }else{ return time; } } handleSlide(){ let tmpShow = this.state.show this.setState({ show:!tmpShow }) } handleDel(){ const {handleDelClick,idx,item} = this.props; this.setState({ activeInd:true, activeName:item.name }) handleDelClick&&handleDelClick(1,idx); } handleCancel(){ this.setState({ activeInd:false, activeName:'' }) } delConfirm(){ const {handleDelConfirm} = this.props; handleDelConfirm&&handleDelConfirm(); this.setState({ activeInd:false, activeName:'' }) } 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 {show,activeInd,activeName} = this.state; let numPlus = 0,numPlus1 = 0; return (
{ handleLabelSub(e, item.questionId,idx); handleFillShow(e,idx) }}> {item.name} getInfomation(item.questionId,item.name)}>
:{ handleLabelSub(e,item.questionId,idx); handleFillShow(e,idx) }}> {item.name} getInfomation(item.questionId,item.name)}>
} { item.details && item.details.map((val)=>{ if(val.value && val.value != ''){ numPlus = ++numPlus } }) } { item.show ?{val.name} getInfomation(val.id)}> | {showDetails(val)}{normalVal(val.minValue,val.maxValue)} | {'化验时间:'+item.time} |
{val.name} getInfomation(val.id)}> | {showDetails(val)}{normalVal(val.minValue,val.maxValue)} | {'化验时间:'+item.time} |
{ dateTime }