Pārlūkot izejas kodu

添加离线设备显示

xiaohaizhao 1 gadu atpakaļ
vecāks
revīzija
2e8a52ba16
1 mainītis faili ar 16 papildinājumiem un 6 dzēšanām
  1. 16 6
      pages/index/modules/spectaculars.vue

+ 16 - 6
pages/index/modules/spectaculars.vue

@@ -1,11 +1,17 @@
 <template>
     <view class="container" v-if="showList.length">
-        <navigator v-if="isShow('在线设备')" url="/pages/facility/index?page=设备中心&status=在线" hover-class="navigator-hover"
+        <navigator v-if="isShow('设备')" url="/pages/facility/index?page=设备中心&status=在线" hover-class="navigator-hover"
             class="item">
             <view class="label">在线设备</view>
             <view class="count u-line-1">{{ statistics.today_devices }}</view>
         </navigator>
 
+        <navigator v-if="isShow('设备')" url="/pages/facility/index?page=设备中心&status=离线" hover-class="navigator-hover"
+            class="item">
+            <view class="label">离线设备</view>
+            <view class="count u-line-1">{{ statistics.today_devices_off }}</view>
+        </navigator>
+
         <navigator v-if="isShow('今日警告')" url="/pages/alerts/index?date=今天" hover-class="navigator-hover" class="item">
             <view class="label">今日警告</view>
             <view class="count u-line-1">{{ statistics.today_warns }}</view>
@@ -41,7 +47,7 @@ export default {
     created() {
         let auth = uni.getStorageSync('authList'),
             showList = [];
-        typeof auth.设备中心 == 'object' && showList.push("在线设备");
+        typeof auth.设备中心 == 'object' && showList.push("设备");
         typeof auth.告警中心 == 'object' && showList.push("今日警告");
         typeof auth.工单 == 'object' && showList.push("今日工单");
         this.showList = showList;
@@ -65,14 +71,18 @@ export default {
 .container {
     display: flex;
     width: 355px;
-    height: 72px;
+    // height: 72px;
+    height: 68px;
     margin: 0 auto;
     margin-top: 10px;
 
     .item {
-        width: 112px;
-        height: 72px;
-        padding: 10px;
+        // width: 112px;
+        // height: 72px;
+
+        width: 81.5px;
+        height: 68px;
+        padding: 10px 8px;
         box-sizing: border-box;
         border-radius: 4px;
         background: #FFFFFF;