浏览代码

Squashed commit of the following:

commit 79e0195a9b13069db729afe732bc5b466d43a37f
Author: Luolei <16657115156@163.com>
Date:   Fri Jan 25 14:06:09 2019 +0800

    date修改
liucf 6 年之前
父节点
当前提交
eec53100dc
共有 1 个文件被更改,包括 5 次插入4 次删除
  1. 5 4
      src/components/AddInspect/index.jsx

+ 5 - 4
src/components/AddInspect/index.jsx

@@ -110,12 +110,11 @@ class Inspect extends React.Component {
     handleFillShow(e,idx) {
         let tmpShow = this.state.showFill;
         let baseList = store.getState().inspect.fillActive;
-        const tmpTime = this.state.dateTime
         this.setState({
             showFill: !tmpShow, 
             currentIdx:idx,
             currentData:baseList,
-            dateTime:baseList.time?baseList.time:tmpTime
+            dateTime:baseList.time?baseList.time:this.getCurrentDate()
         })
         e.stopPropagation();
     }
@@ -131,7 +130,7 @@ class Inspect extends React.Component {
         let day = myDate.getDate();            //获取当前日(1-31)
         let date = year+'-'+(mon<10?'0'+mon:mon)+'-'+(day<10?'0'+day:day);
         this.setState({dateTime:date})
-        
+        return date;
     }
     changeActivePart(idx,val){
         let nums = this.state.num;
@@ -358,7 +357,9 @@ class Inspect extends React.Component {
                                                     <div className={styles.searchResultT}>
                                                         <img style={{"position":"absolute","top":"8px","right":"8px"}} src={date1} alt="" onClick={this.handleShowDate}/>
                                                         <p style={{position:"absolute",right:"38px",top:"4px",lineHeight:"28px"}}>
-                                                            {this.state.dateTime}
+                                                            {
+                                                              this.state.dateTime
+                                                            }
                                                         </p>
                                                         <div style={{display:this.state.date?"block":"none",position:"relative"}}>
                                                             {/* 日期组件 */}