|
@@ -4,31 +4,39 @@ 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 $ from 'jquery';
|
|
|
import date1 from '../img/date1.png';
|
|
|
import close from '../img/close.png';
|
|
|
|
|
|
class SlideSelect extends Component {
|
|
|
constructor(props) {
|
|
|
super(props);
|
|
|
- const date = new Date();
|
|
|
this.state = {
|
|
|
show:false,
|
|
|
activeInd:false,
|
|
|
activeName:'',
|
|
|
- timeLis: {
|
|
|
- year: date.getFullYear(),
|
|
|
- month: date.getMonth() + 1,
|
|
|
- day: date.getDate(),
|
|
|
- hour: '00',
|
|
|
- minute: '00',
|
|
|
- second: '00'
|
|
|
- },
|
|
|
};
|
|
|
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)
|
|
|
+ }
|
|
|
+ handleChangeDate(date) {
|
|
|
+ // console.log(date,'外')
|
|
|
+ }
|
|
|
+ componentDidMount() {
|
|
|
+ $(document).click((event) => {
|
|
|
+ let inspectToggleDate = document.getElementById("inspectToggleDate")
|
|
|
+ let timeIcon = document.getElementById("timeIcon")
|
|
|
+ let calendarDate = document.getElementById("calendarDate")
|
|
|
+ if (calendarDate) {
|
|
|
+ if (inspectToggleDate != event.target && timeIcon != event.target && !calendarDate.contains(event.target)) {
|
|
|
+ this.props.handleShowDate();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
toTime(time){
|
|
|
let tmpTim = time.split(',').join('')-0
|
|
@@ -71,12 +79,26 @@ class SlideSelect extends Component {
|
|
|
})
|
|
|
}
|
|
|
timeSure(date){
|
|
|
- console.log(date)
|
|
|
+ const {handleChangeDate} = this.props;
|
|
|
+ handleChangeDate&&handleChangeDate(date)
|
|
|
}
|
|
|
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,timeLis} = this.state;
|
|
|
+ const {show,activeInd,activeName} = this.state;
|
|
|
let numPlus = 0,numPlus1 = 0;
|
|
|
+ let staticTime = {}
|
|
|
+ if(dateTime){
|
|
|
+ let tmp1 = dateTime.split(' ')[0].split('-')
|
|
|
+ let tmp2 = (item.time).split(' ').length>1&&(item.time).split(' ')[1].split(':')
|
|
|
+ staticTime = {
|
|
|
+ year: tmp1[0]-0,
|
|
|
+ month: tmp1[1]-0,
|
|
|
+ day: tmp1[2]-0,
|
|
|
+ hour: tmp2[0],
|
|
|
+ minute: tmp2[1],
|
|
|
+ second: tmp2[2]
|
|
|
+ }
|
|
|
+ }
|
|
|
return (
|
|
|
<li key={item.questionId} className={styles.slideLi}>
|
|
|
{
|
|
@@ -175,15 +197,18 @@ class SlideSelect extends Component {
|
|
|
>
|
|
|
|
|
|
<div className={styles.searchResultT}>
|
|
|
- <img style={{"position":"absolute","top":"8px","right":"8px",cursor:"pointer"}} src={date1} alt="" onClick={handleShowDate}/>
|
|
|
- <p style={{position:"absolute",right:"25px",top:"4px",lineHeight:"28px",cursor:"pointer",paddingRight:"10px"}} onClick={handleShowDate}>
|
|
|
+ <img style={{"position":"absolute","top":"8px","right":"8px",cursor:"pointer"}} onClick={handleShowDate} src={date1} alt="" id="inspectToggleDate"/>
|
|
|
+ <p style={{position:"absolute",right:"25px",top:"4px",lineHeight:"28px",cursor:"pointer",paddingRight:"10px"}} onClick={handleShowDate} id="timeIcon">
|
|
|
{
|
|
|
dateTime
|
|
|
}
|
|
|
</p>
|
|
|
<div style={{display:date?"block":"none",position:"relative"}}>
|
|
|
{/* 日期组件 */}
|
|
|
- <Calendar timeLis={timeLis} isShow={true} timeSure={this.timeSure} needTime={true} sure={true} handleChange={handleChangeDate}></Calendar>
|
|
|
+ {
|
|
|
+ date?<Calendar timeLis={staticTime} isShow={true} timeSure={this.timeSure} needTime={true} sure={true} handleChange={this.handleChangeDate}></Calendar>:null
|
|
|
+ }
|
|
|
+ {/* <Calendar timeLis={staticTime} isShow={true} timeSure={this.timeSure} needTime={true} sure={true} handleChange={handleChangeDate}></Calendar> */}
|
|
|
</div>
|
|
|
</div>
|
|
|
{/* 填写单内容显示 */}
|