Browse Source

uas手机版
日历新增回到今天按钮

samhoo 5 years ago
parent
commit
24f0af05d5

+ 12 - 1
uas-office-web/uas-mobile/src/components/common/calendar/CommonCalendar.jsx

@@ -4,7 +4,7 @@
  */
 
 import React, { Component } from 'react'
-import { Calendar, Select, Col, Row } from 'antd'
+import { Calendar, Select, Row } from 'antd'
 import './common-calendar.less'
 import moment from 'moment'
 import {
@@ -117,6 +117,17 @@ export default class CommonCalendar extends Component {
                       >
                         {monthOptions}
                       </Select>
+
+                      <button
+                        className="todaybtn"
+                        onClick={() => {
+                          const now = moment()
+                          onChange(now)
+                        }}
+                      >
+                        今
+                      </button>
+
                     </div>
 
                     <div className="right-box arrow-box">

+ 17 - 0
uas-office-web/uas-mobile/src/components/common/calendar/common-calendar.less

@@ -35,6 +35,7 @@
       width: 100%;
       display: flex;
       justify-content: space-between;
+      flex-wrap: nowrap;
 
       .arrow-box {
         .arrow {
@@ -49,6 +50,22 @@
           margin-right: 8px;
         }
       }
+
+      .middle-box {
+        display: flex;
+        margin-left: 15px;
+
+        .todaybtn {
+          display: inline-block;
+          height: 24px;
+          width: 24px;
+          line-height: 24px;
+          background: #1890ff;
+          color: #fff;
+          margin-left: 15px;
+          border-radius: 50%;
+        }
+      }
     }
   }
 }