|
@@ -0,0 +1,80 @@
|
|
|
|
+<template>
|
|
|
|
+ <div>
|
|
|
|
+ <div class="my-title">查看</div>
|
|
|
|
+ <div style="margin-left: 20px;margin-right: 20px">
|
|
|
|
+ <e-desc title="基本信息" column="2" labelWidth="160px">
|
|
|
|
+ <e-desc-item label="设备名称">{{dataForm.equipmentName}}</e-desc-item>
|
|
|
|
+ <e-desc-item label="设备编号">{{dataForm.codeNumber}}</e-desc-item>
|
|
|
|
+ <e-desc-item label="报警接收人">{{dataForm.alarmName}}</e-desc-item>
|
|
|
|
+ <e-desc-item label="报警时间">{{dataForm.createTime}}</e-desc-item>
|
|
|
|
+ <e-desc-item label="设备报警内容" :span="2">{{dataForm.alarmMsg}}</e-desc-item>
|
|
|
|
+ </e-desc>
|
|
|
|
+ </div>
|
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
|
+ <el-button @click="onChose">返回</el-button>
|
|
|
|
+ </span>
|
|
|
|
+ <!-- 文件预览 -->
|
|
|
|
+ <preview-component v-if="previewVisible" ref="preview"/>
|
|
|
|
+ </div>
|
|
|
|
+</template>
|
|
|
|
+
|
|
|
|
+<script>
|
|
|
|
+ import EDesc from '../common/e-desc'
|
|
|
|
+ import EDescItem from '../common/e-desc-item'
|
|
|
|
+ import {getAlarmDetail} from '@/api/device'
|
|
|
|
+ import {getDate} from '@/utils/date-util'
|
|
|
|
+ import PreviewComponent from '@/views/modules/common/preview-component.vue'
|
|
|
|
+ import {optionsEquipmentRepairState} from '@/utils/enums'
|
|
|
|
+export default {
|
|
|
|
+ name: 'alarm-detail',
|
|
|
|
+ components: {
|
|
|
|
+ PreviewComponent,
|
|
|
|
+ EDesc,
|
|
|
|
+ EDescItem
|
|
|
|
+ },
|
|
|
|
+ data () {
|
|
|
|
+ return {
|
|
|
|
+ visible: false,
|
|
|
|
+ id: 0,
|
|
|
|
+ dataForm: {},
|
|
|
|
+ previewVisible: false,
|
|
|
|
+ optionsState: optionsEquipmentRepairState
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ getDate,
|
|
|
|
+ onChose () {
|
|
|
|
+ this.$emit('onChose')
|
|
|
|
+ },
|
|
|
|
+ async init (id) {
|
|
|
|
+ this.visible = true
|
|
|
|
+ this.id = id || 0
|
|
|
|
+ this.dataForm = {}
|
|
|
|
+ this.getDetails()
|
|
|
|
+ },
|
|
|
|
+ getDetails () {
|
|
|
|
+ getAlarmDetail(this.id).then(({data}) => {
|
|
|
|
+ if (data && data.code === '200') {
|
|
|
|
+ this.dataForm = data.data
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ previewFile (fileName, url) {
|
|
|
|
+ this.previewVisible = true
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
+ this.$refs.preview.init(fileName, url)
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+</script>
|
|
|
|
+
|
|
|
|
+<style scoped>
|
|
|
|
+.my-line{
|
|
|
|
+ border-bottom: 1px solid #c0c4cc;
|
|
|
|
+ margin-bottom: 10px;
|
|
|
|
+}
|
|
|
|
+.title{
|
|
|
|
+ padding: 10px 0 ;
|
|
|
|
+}
|
|
|
|
+</style>
|