Bläddra i källkod

refactor: adjust some styles

Casper Dai 3 år sedan
förälder
incheckning
c76690a14e

+ 16 - 0
src/constant.js

@@ -131,3 +131,19 @@ export const AlarmStrategy = {
 }
 
 export const AlarmStrategies = ['note', 'email', 'wechat', 'wechatApplet']
+
+export const AlarmType = {
+  0: '疑似黑屏',
+  1: '设备离线',
+  2: '屏幕拓扑结构异常',
+  3: '播放非法视频',
+  4: '接收卡离线',
+  5: '发送控制设备离线',
+  6: '浪潮智能网关离线',
+  7: '屏幕监控摄像头离线',
+  8: '人流监测摄像头离线',
+  9: '设备上线',
+  10: '设备回采审核疑似',
+  11: '设备回采审核不合规',
+  1000: '分割器异常'
+}

+ 3 - 2
src/views/dashboard/components/Card.vue

@@ -83,8 +83,8 @@ export default {
 
   &__count {
     position: absolute;
-    top: -4px;
-    right: -10px;
+    top: 0;
+    right: 0;
     min-width: 20px;
     padding: 2px 4px;
     color: #fff;
@@ -94,6 +94,7 @@ export default {
     border: 2px solid #fff;
     border-radius: 10px;
     background-color: $error--dark;
+    transform: translate(50%, -50%);
   }
 
   &__tip {

+ 3 - 16
src/views/device/detail/components/DeviceAlarm.vue

@@ -13,23 +13,10 @@ import { createListOptions } from '@/utils'
 import {
   AssetType,
   AlarmStrategy,
-  AlarmStrategies
+  AlarmStrategies,
+  AlarmType
 } from '@/constant'
 
-const Alarm = {
-  0: '疑似黑屏',
-  1: '设备离线',
-  2: '屏幕拓扑结构异常',
-  3: '播放非法视频',
-  4: '接收卡离线',
-  5: '发送控制设备离线',
-  6: '浪潮智能网关离线',
-  7: '屏幕监控摄像头离线',
-  8: '人流监测摄像头离线',
-  9: '设备上线',
-  1000: '分割器异常'
-}
-
 export default {
   name: 'DeviceAlarm',
   props: {
@@ -92,7 +79,7 @@ export default {
       if (type >= 1101 && type <= 1116) {
         type = 1000
       }
-      return Alarm[type] || '-'
+      return AlarmType[type] || '-'
     },
     getTag (value) {
       switch (value) {

+ 8 - 22
src/views/device/detail/dashboard/DeviceAlarm.vue

@@ -66,29 +66,9 @@
 <script>
 import Box from './Box'
 import { getDeviceAlarms } from '@/api/device'
+import { AlarmType } from '@/constant'
 import vueSeamlessScroll from './vue-seamless-scroll.min.js'
 
-const Alarms = {
-  0: '疑似黑屏',
-  1: '设备离线',
-  2: '屏幕拓扑结构异常',
-  3: '播放非法视频',
-  4: '接收卡离线',
-  5: '发送控制设备离线',
-  6: '浪潮智能网关离线',
-  7: '屏幕监控摄像头离线',
-  8: '人流监测摄像头离线',
-  9: '设备上线',
-  1000: '分割器异常'
-}
-
-function getAlarmType (type) {
-  if (type >= 1101 && type <= 1116) {
-    return '分割器异常'
-  }
-  return Alarms[type] || '-'
-}
-
 export default {
   components: {
     Box,
@@ -132,7 +112,7 @@ export default {
           this.listData = data.map(item => {
             return {
               ...item,
-              type: getAlarmType(item.type),
+              type: this.getType(item.type),
               handle: ['应用重启', '设备重启', '恢复出厂', '未干预'][item.handle] || '-',
               status: item.handle <= 2 && item.status <= 2
                 ? ['处理中', '成功', '失败'][item.status] || '-'
@@ -144,6 +124,12 @@ export default {
           this.error = true
         }
       )
+    },
+    getType (type) {
+      if (type >= 1101 && type <= 1116) {
+        type = 1000
+      }
+      return AlarmType[type] || '-'
     }
   }
 }

+ 4 - 15
src/views/device/detail/dashboard/Header.vue

@@ -1,14 +1,10 @@
 <template>
   <div class="c-device-dashboard-header">
-    <img
-      class="c-device-dashboard-header__logo"
-      src="/logo.png"
-    >
-    <div class="u-bold">{{ title }}</div>
+    <div class="c-device-dashboard-header__name u-bold">{{ title }}</div>
     <div class="l-flex c-device-dashboard-header__wrapper">
       <div class="c-device-dashboard-header__time">{{ now }}</div>
       <div
-        class="c-device-dashboard-header__exit u-pointer"
+        class="u-pointer"
         @click="onExit"
       >
         退出
@@ -57,11 +53,8 @@ export default {
   text-align: center;
   background: url("~@/assets/line.png") 0 16px / 100% 38px no-repeat;
 
-  &__logo {
-    position: absolute;
-    top: 8px;
-    left: 16px;
-    height: 24px;
+  &__name {
+    letter-spacing: 0.2em;
   }
 
   &__wrapper {
@@ -76,9 +69,5 @@ export default {
     margin-right: 32px;
     white-space: pre;
   }
-
-  &__exit {
-    color: #2956f0;
-  }
 }
 </style>