|
|
@@ -9,9 +9,12 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { getDeviceAlarms } from '@/api/device'
|
|
|
+import {
|
|
|
+ AlarmLevelInfo,
|
|
|
+ SupportedAlarmStrategies
|
|
|
+} from '@/constant'
|
|
|
import { createListOptions } from '@/utils'
|
|
|
-import { SupportedAlarmStrategies } from '@/constant'
|
|
|
+import { getDeviceAlarms } from '@/api/device'
|
|
|
|
|
|
export default {
|
|
|
name: 'DeviceAlarm',
|
|
|
@@ -25,12 +28,17 @@ export default {
|
|
|
return {
|
|
|
options: createListOptions({ deviceId: this.device.id }),
|
|
|
schema: {
|
|
|
- condition: { deviceId: this.device.id },
|
|
|
list: getDeviceAlarms,
|
|
|
+ condition: { deviceId: this.device.id },
|
|
|
cols: [
|
|
|
{ prop: 'file', label: '截图', type: 'asset', refresh: true, on: this.onView },
|
|
|
- { prop: 'type', label: '类型', 'min-width': 120 },
|
|
|
- { prop: 'handle', label: '处理方式' },
|
|
|
+ { label: '预警级别', type: 'tag', render: ({ level }) => AlarmLevelInfo[level] && {
|
|
|
+ type: ['primary', 'wraning', 'danger'],
|
|
|
+ label: AlarmLevelInfo[level]
|
|
|
+ }, width: 108, align: 'center' },
|
|
|
+ { prop: 'happenTime', label: '预警时间', width: 180, align: 'center' },
|
|
|
+ { prop: 'type', label: '预警类型' },
|
|
|
+ { prop: 'handle', label: '处理方式', width: 100, align: 'center' },
|
|
|
{ prop: 'status', label: '处理结果', type: 'tag' },
|
|
|
...SupportedAlarmStrategies.map(({ key, label }) => {
|
|
|
return {
|
|
|
@@ -38,8 +46,7 @@ export default {
|
|
|
label: `${label}通知`,
|
|
|
type: 'tag'
|
|
|
}
|
|
|
- }),
|
|
|
- { prop: 'happenTime', label: '时间', 'min-width': 120 }
|
|
|
+ })
|
|
|
]
|
|
|
}
|
|
|
}
|