|
@@ -12,6 +12,27 @@ import { getDeviceAlarms } from '@/api/device'
|
|
|
import { createListOptions } from '@/utils'
|
|
import { createListOptions } from '@/utils'
|
|
|
import { AssetType } from '@/constant'
|
|
import { AssetType } from '@/constant'
|
|
|
|
|
|
|
|
|
|
+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 {
|
|
export default {
|
|
|
name: 'DeviceAlarm',
|
|
name: 'DeviceAlarm',
|
|
|
props: {
|
|
props: {
|
|
@@ -44,16 +65,20 @@ export default {
|
|
|
methods: {
|
|
methods: {
|
|
|
transform ({ pic, picUrl, type, handle, status, note, email, happenTime }) {
|
|
transform ({ pic, picUrl, type, handle, status, note, email, happenTime }) {
|
|
|
return {
|
|
return {
|
|
|
- asset: pic && picUrl ? {
|
|
|
|
|
- type: AssetType.IMAGE,
|
|
|
|
|
- url: picUrl
|
|
|
|
|
- } : null,
|
|
|
|
|
- type: ['疑似黑屏', '设备离线', '屏幕拓扑结构异常'][type] || '-',
|
|
|
|
|
|
|
+ asset: pic && picUrl
|
|
|
|
|
+ ? {
|
|
|
|
|
+ type: AssetType.IMAGE,
|
|
|
|
|
+ url: picUrl
|
|
|
|
|
+ }
|
|
|
|
|
+ : null,
|
|
|
|
|
+ type: getAlarmType(type),
|
|
|
handle: ['应用重启', '设备重启', '恢复出厂', '未干预'][handle] || '-',
|
|
handle: ['应用重启', '设备重启', '恢复出厂', '未干预'][handle] || '-',
|
|
|
- status: handle <= 2 && status <= 2 ? {
|
|
|
|
|
- type: ['primary', 'success', 'danger'][status],
|
|
|
|
|
- label: ['处理中', '成功', '失败'][status]
|
|
|
|
|
- } : null,
|
|
|
|
|
|
|
+ status: handle <= 2 && status <= 2
|
|
|
|
|
+ ? {
|
|
|
|
|
+ type: ['primary', 'success', 'danger'][status],
|
|
|
|
|
+ label: ['处理中', '成功', '失败'][status]
|
|
|
|
|
+ }
|
|
|
|
|
+ : null,
|
|
|
note: {
|
|
note: {
|
|
|
type: ['danger', 'success'][note],
|
|
type: ['danger', 'success'][note],
|
|
|
label: ['否', '是'][note]
|
|
label: ['否', '是'][note]
|