Casper Dai 3 лет назад
Родитель
Сommit
f36fcb830e
2 измененных файлов с 18 добавлено и 7 удалено
  1. 11 3
      src/views/dashboard/Dashboard.vue
  2. 7 4
      src/views/dashboard/components/Device.vue

+ 11 - 3
src/views/dashboard/Dashboard.vue

@@ -1,6 +1,9 @@
 <template>
   <wrapper margin>
-    <div class="l-flex--row c-sibling-item--v c-count">
+    <div
+      class="l-flex--row c-sibling-item--v c-count u-pointer"
+      @click="onClickMineDevices"
+    >
       <div class="l-flex__none u-color--black u-bold">我的设备</div>
       <div class="l-flex__none c-count__item u-color--black u-bold u-text-center">
         <div>总数</div>
@@ -36,7 +39,7 @@
       </div>
       <i
         class="c-count__refresh o-icon--active el-icon-refresh u-pointer"
-        @click="onRefresh"
+        @click.stop="onRefresh"
       />
     </div>
     <div
@@ -226,6 +229,11 @@ export default {
           }
         }
       )
+    },
+    onClickMineDevices () {
+      this.$router.push({
+        name: 'device-list'
+      })
     }
   }
 }
@@ -244,7 +252,7 @@ export default {
 
   &__refresh {
     color: $blue;
-    font-size: 24px;
+    font-size: 28px;
   }
 }
 

+ 7 - 4
src/views/dashboard/components/Device.vue

@@ -36,7 +36,7 @@
       <template v-if="isOnline">
         <i
           v-if="loadingTimeline"
-          class="l-flex__none el-icon-loading"
+          class="l-flex__auto l-flex--row el-icon-loading"
         />
         <template v-else-if="current">
           <auto-text
@@ -65,9 +65,7 @@
         </span>
       </template>
       <template v-else>
-        <span class="l-flex__auto l-flex--row u-bold">
-          当前设备离线了
-        </span>
+        <span class="l-flex__auto l-flex--row u-bold">{{ lastOnline }}</span>
       </template>
     </div>
     <div class="l-flex__none o-device__next">
@@ -126,6 +124,11 @@ export default {
     address () {
       return this.device.address
     },
+    lastOnline () {
+      return this.device.lastOnline
+        ? `${this.device.lastOnline} 离线`
+        : '当前设备离线了'
+    },
     isOnline () {
       return this.device.onlineStatus === 1
     },