Browse Source

uas手机版
我的日程数据结构更改

samhoo 5 years ago
parent
commit
d07f89a281

+ 6 - 4
uas-office-web/uas-mobile/src/components/common/calendar/CommonCalendar.jsx

@@ -41,10 +41,6 @@ export default class CommonCalendar extends Component {
     return clickDate
   }
 
-  onSelectTime = (date) => {
-    let clickDate = this.dateformat(date) //点击时间
-  }
-
   getListData = (value) => {
     let clickDate = this.dateformat(value),
       { calendarData } = this.props,
@@ -87,4 +83,10 @@ export default class CommonCalendar extends Component {
     )
   }
 
+  //日历点击事件
+  onSelectTime = (date) => {
+    let clickDate = this.dateformat(date)
+    this.props.clickDate(clickDate)
+  }
+
 }

+ 1 - 10
uas-office-web/uas-mobile/src/components/private/noticematter/NoticeMatter.jsx

@@ -26,16 +26,7 @@ export default class NoticeMatter extends Component {
   }
 
   render () {
-    let noticeMatterData = [{
-      time: '9:30-10:30',
-      meetingName: '部门例会',
-      meetingFrom: '会议',
-    }, {
-      time: '14:00-16:30',
-      meetingName: '深爱半导体(业务办理)',
-      meetingFrom: '外勤',
-    }]
-
+    let { noticeMatterData } = this.props
     let MeetingList = []
     noticeMatterData.forEach((item, index) => {
       MeetingList.push(

+ 2 - 22
uas-office-web/uas-mobile/src/components/private/punchclock/PunchClock.jsx

@@ -26,30 +26,10 @@ export default class PunchClock extends Component {
   }
 
   render () {
-    let punchClockData = {
-      companyClass: '优软班次',
-      clockRecord: {
-        onTime: {
-          onTime: '8:30',
-          punchTime: '08:45',
-          auto: false,
-          isPunch: true,
-          type: '迟到打卡',
-        },
-        offTime: {
-          offTime: '18:00',
-          punchTime: '19:00',
-          auto: true,
-          isPunch: false,
-          type: '正常打卡',
-        },
-      },
-    }
-
-    let { companyClass, clockRecord } = punchClockData
+    let { companyClass, clockRecord } = this.props.punchClockData
 
     return (
-      isEmptyObject(punchClockData)
+      isEmptyObject(this.props.punchClockData)
         ?
         ''
         :

+ 73 - 5
uas-office-web/uas-mobile/src/pages/private/schedulePage/SchedulePage.jsx

@@ -16,7 +16,36 @@ class SchedulePage extends Component {
   constructor () {
     super()
 
-    this.state = {}
+    this.state = {
+      punchClockData: {
+        companyClass: '优软班次',
+        clockRecord: {
+          onTime: {
+            onTime: '8:30',
+            punchTime: '08:45',
+            auto: false,
+            isPunch: true,
+            type: '迟到打卡',
+          },
+          offTime: {
+            offTime: '18:00',
+            punchTime: '19:00',
+            auto: true,
+            isPunch: false,
+            type: '正常打卡',
+          },
+        },
+      },
+      noticeMatterData: [{
+        time: '9:30-10:30',
+        meetingName: '部门例会',
+        meetingFrom: '会议',
+      }, {
+        time: '14:00-16:30',
+        meetingName: '深爱半导体(业务办理)',
+        meetingFrom: '外勤',
+      }],
+    }
   }
 
   componentDidMount () {
@@ -28,7 +57,7 @@ class SchedulePage extends Component {
   }
 
   render () {
-    let { tabBarHidden } = this.state
+    let { punchClockData, noticeMatterData } = this.state
     let scheduleData = {
       calendarData: [{
         date: '2020-11-12',
@@ -47,13 +76,52 @@ class SchedulePage extends Component {
 
     return (
       <div className='schedule-root'>
-        <CommonCalendar calendarData={calendarData}/>
-        <PunchClock/>
-        <NoticeMatter/>
+        <CommonCalendar clickDate={this.clickDate} calendarData={calendarData}/>
+        <PunchClock punchClockData={punchClockData}/>
+        <NoticeMatter noticeMatterData={noticeMatterData}/>
       </div>
     )
   }
 
+  clickDate = (date) => {
+    let testData1 = {
+      companyClass: '测试班次',
+      clockRecord: {
+        onTime: {
+          onTime: '9:30',
+          punchTime: '08:45',
+          auto: false,
+          isPunch: true,
+          type: '正常打卡',
+        },
+        offTime: {
+          offTime: '19:00',
+          punchTime: '19:00',
+          auto: true,
+          isPunch: true,
+          type: '正常打卡',
+        },
+      },
+    }
+    let testData2 = [{
+      time: '9:30-10:30',
+      meetingName: '部门例会',
+      meetingFrom: '会议',
+    }, {
+      time: '11:30-13:30',
+      meetingName: '部门例会',
+      meetingFrom: '会议',
+    }, {
+      time: '13:30-17:30',
+      meetingName: '部门例会',
+      meetingFrom: '会议',
+    }]
+    this.setState({
+      punchClockData: testData1,
+      noticeMatterData: testData2,
+    })
+  }
+
 }
 
 let mapStateToProps = (state) => ({})