From cd988e20aba711a15d6675322bb823b4843b3400 Mon Sep 17 00:00:00 2001
From: chenghx <chenghx@nfex.com>
Date: 星期四, 09 八月 2018 17:05:50 +0800
Subject: [PATCH] feat: add Mock Data for Workplace page

---
 src/components/dashboard/WorkPlace.vue |   83 +++++++++++++++++++++++++++++------------
 1 files changed, 58 insertions(+), 25 deletions(-)

diff --git a/src/components/dashboard/WorkPlace.vue b/src/components/dashboard/WorkPlace.vue
index 369b4e3..8d645d2 100644
--- a/src/components/dashboard/WorkPlace.vue
+++ b/src/components/dashboard/WorkPlace.vue
@@ -39,14 +39,12 @@
               </a-card-grid>
             </div>
           </a-card>
-          <a-card title="鍔ㄦ��" :bordered="false">
+          <a-card :loading="loading" title="鍔ㄦ��" :bordered="false">
             <a-list>
-              <a-list-item :key="n" v-for="n in 6">
+              <a-list-item :key="index" v-for="(item, index) in activities">
                 <a-list-item-meta>
-                  <a-avatar slot="avatar" src="https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png" />
-                  <div slot="title">
-                    鏇蹭附涓� 鍦� <a>楂橀�兼牸璁捐澶╁洟</a> 鏂板缓椤圭洰 <a>鍏湀杩唬</a>
-                  </div>
+                  <a-avatar slot="avatar" :src="item.user.avatar" />
+                  <div slot="title" v-html="item.template" />
                   <div slot="description">9灏忔椂鍓�</div>
                 </a-list-item-meta>
               </a-list-item>
@@ -70,15 +68,17 @@
               <radar />
             </div>
           </a-card>
-          <a-card title="鍥㈤槦" :bordered="false">
-            <a-row>
-              <a-col :span="12" v-for="n in 5" :key="n">
-                <a class="member">
-                  <a-avatar size="small" src="https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png" />
-                  <span>绋嬪簭鍛樻棩甯�</span>
-                </a>
-              </a-col>
-            </a-row>
+          <a-card :loading="loading" title="鍥㈤槦" :bordered="false">
+            <div class="members">
+              <a-row>
+                <a-col :span="12" v-for="(item, index) in teams" :key="index">
+                  <a>
+                    <a-avatar size="small" :src="item.avatar" />
+                    <span class="member">{{item.name}}</span>
+                  </a>
+                </a-col>
+              </a-row>
+            </div>
           </a-card>
         </a-col>
       </a-row>
@@ -126,12 +126,16 @@
     return {
       currUser: {},
       projects: [],
-      loading: true
+      loading: true,
+      activities: [],
+      teams: []
     }
   },
   mounted () {
     this.currentUser()
     this.getProjectList()
+    this.getActivites()
+    this.getTeams()
   },
   methods: {
     currentUser () {
@@ -149,6 +153,22 @@
       }).then(res => {
         this.projects = res.data
         this.loading = false
+      })
+    },
+    getActivites () {
+      this.$axios({
+        method: 'get',
+        url: '/work/activity'
+      }).then(res => {
+        this.activities = res.data
+      })
+    },
+    getTeams () {
+      this.$axios({
+        method: 'get',
+        url: '/work/team'
+      }).then(res => {
+        this.teams = res.data
       })
     }
   }
@@ -217,14 +237,27 @@
       width: 25%;
     }
   }
-  .member{
-    display: block;
-    margin: 12px 0;
-    line-height: 24px;
-    height: 24px;
-    overflow: hidden;
-    text-overflow: ellipsis;
-    word-break: break-all;
-    white-space: nowrap;
+  .members {
+    a {
+      display: block;
+      margin: 12px 0;
+      line-height: 24px;
+      height: 24px;
+      .member {
+        font-size: 14px;
+        color: rgba(0,0,0,.65);
+        line-height: 24px;
+        max-width: 100px;
+        vertical-align: top;
+        margin-left: 12px;
+        transition: all 0.3s;
+        display: inline-block;
+      }
+      &:hover {
+        span {
+          color: #1890ff;
+        }
+      }
+    }
   }
 </style>

--
Gitblit v1.9.1