liangyan0105 hace 3 años
padre
commit
44ed5f18af
Se han modificado 3 ficheros con 59 adiciones y 2 borrados
  1. 17 0
      src/assets/less/mytodo.css
  2. 20 0
      src/assets/less/mytodo.less
  3. 22 2
      src/views/dashboard/MyToDo.vue

+ 17 - 0
src/assets/less/mytodo.css

@@ -57,6 +57,23 @@
   color: white;
   box-shadow: 1px 1px 3px #333;
 }
+#home .secondLine .tips {
+  position: relative;
+}
+#home .secondLine .tips #showTime {
+  border: 1px solid #b4adad;
+  box-shadow: 2px 2px 2px #888888;
+  position: absolute;
+  top: 10%;
+  right: 4%;
+  background-color: rgba(133, 128, 128, 0.3);
+  border-radius: 10px;
+  padding: 0 10px;
+  color: #333;
+  font-style: normal;
+  font-size: 40px;
+  font-weight: 700;
+}
 #home /deep/ .ant-card-head-title {
   color: #1890ff;
 }

+ 20 - 0
src/assets/less/mytodo.less

@@ -70,6 +70,26 @@
         box-shadow: 1px 1px 3px #333;
       }
     }
+
+    // 日程时间
+    .tips {
+      position: relative;
+      #showTime {
+        border: 1px solid rgb(180, 173, 173);
+        box-shadow: 2px 2px 2px  #888888;
+        position: absolute;
+        top: 10%;
+        right: 4%;
+        background-color: rgba(133, 128, 128,.3);
+        border-radius: 10px;
+        padding: 0 10px;
+        // color: rgba(188, 71, 73);
+        color: #333;
+        font-style: normal;
+        font-size: 40px;
+        font-weight: 700;
+      }
+    }
   }
 
   // card 标题颜色

+ 22 - 2
src/views/dashboard/MyToDo.vue

@@ -130,7 +130,10 @@
             <!-- 图片 -->
             <a-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
               <div style="height:186px;">
-                <img src="../../assets/date.jpg" alt="" height="186px;" width="100%"/>
+                <div class="tips">
+                  <img src="../../assets/date.jpg" alt="" height="186px;" width="100%" />
+                  <!-- <i id="showTime"></i> -->
+                </div>
               </div>
             </a-col>
 
@@ -191,6 +194,8 @@ export default {
   },
   data() {
     return {
+      timer: '',
+      value: 0,
       annDetail: {}, //公告详情 数据
       annList: [], //公告列表 数据
       config: {}, //轮播表配置
@@ -330,9 +335,24 @@ export default {
   mounted() {
     this.loadData()
     this.getAnnList()
+    this.timer = setInterval(this.getCurrentTime, 1000) //时间
   },
   methods: {
-
+    //获取当前时间
+    getCurrentTime() {
+      var _this = this
+      let yy = new Date().getFullYear()
+      let mm = new Date().getMonth() + 1
+      let dd = new Date().getDate()
+      let hh = new Date().getHours()
+      let mf = new Date().getMinutes() < 10 ? '0' + new Date().getMinutes() : new Date().getMinutes()
+      let ss = new Date().getSeconds() < 10 ? '0' + new Date().getSeconds() : new Date().getSeconds()
+      //  yy + '/' + mm + '/' +dd + ' ' +  省掉年月日
+      _this.gettime = hh + ':' + mf + ':' + ss
+      this.value = _this.gettime
+      showTime.innerHTML = _this.gettime
+      // console.log(_this.gettime)
+    },
     // 公告数据 ----|**查询条件:已发布、数据条数**|------
     async getAnnList() {
       await enterpriseEList({ isRelease: '1', pageSize: 1000 }).then(res => {