houzhongjian
2024-07-23 8501060c4f921d1e744c477e4dc08eb47b52693c
提交 | 用户 | 时间
850106 1 <template>
H 2   <el-drawer
3       direction="rtl"
4       :visible.sync="visible"
5       title="查看故障"
6       size="50%">
7     <div style="padding: 0px 16px;width: 100%;height: 100%">
8       <el-divider content-position="left">基本信息</el-divider>
9       <div style="padding-left: 24px;height: 45%;display: flex;flex-direction: column;justify-content: space-around">
10         <el-row>
11           <el-col :span="12">
12             <div class="infoRow">
13               <div class="infoLabel">设备名称:</div>
14               <div class="infoValue">{{alarmInfo.devName}}</div>
15             </div>
16           </el-col>
17           <el-col :span="12">
18             <div class="infoRow">
19               <div class="infoLabel">故障时间:</div>
20               <div class="infoValue">{{alarmInfo.faultTime}}</div>
21             </div>
22           </el-col>
23         </el-row>
24         <el-row>
25           <el-col :span="24">
26             <div class="infoRow">
27               <div class="infoLabel">故障部件与类型:</div>
28               <div>
29                 <div v-for="item in alarmInfo.deviceFaults" class="infoValue">{{item.className}} | {{ $getDictItem('health_index_type', item.indexType) }}</div>
30               </div>
31             </div>
32           </el-col>
33         </el-row>
34         <el-row>
35           <el-col :span="24">
36             <div class="infoRow">
37               <div class="infoLabel">故障原因:</div>
38               <div>
39                 <div v-for="item in alarmInfo.deviceFaults" class="infoValue">{{item.faultName}}</div>
40               </div>
41             </div>
42           </el-col>
43         </el-row>
44         <el-row>
45           <el-col :span="24">
46             <div class="infoRow">
47               <div class="infoLabel"><span>故障建议:</span></div>
48               <div>
49                 <div v-for="item in alarmInfo.deviceFaults" class="infoValue">{{item.solution}}</div>
50               </div>
51             </div>
52           </el-col>
53         </el-row>
54       </div>
55
56     </div>
57   </el-drawer>
58 </template>
59 <script>
60
61   export default {
62     mixins: [],
63     components: {},
64     data() {
65       return {
66         visible: false,
67         dataForm: {
68           id: ''
69         },
70         alarmInfo: {
71           devName: '',
72           faultTime: '',
73           deviceFaults: []
74         }
75       }
76     },
77     methods: {
78       init() {
79         this.visible = true
80         this.$nextTick(() => {
81           this.getInfo()
82         })
83       },
84       getInfo() {
85         this.$http.get(`/iailab-ntt-model/device/health-alarm/${this.dataForm.id}`).then(({data: res}) => {
86           if (res.code !== 0) {
87             return this.$message.error(res.msg)
88           }
89           this.alarmInfo = {
90             ...this.alarmInfo,
91             ...res.data
92           }
93         }).catch(() => {
94         })
95       },
96     }
97
98   }
99 </script>
100
101 <style scoped>
102   .infoRow {
103     display: flex;
104     flex-direction: row;
105     justify-content: left;
106   }
107
108   .infoLabel {
109     font-weight: bold;
110     white-space: nowrap;
111   }
112
113   .infoValue {
114     color: #888d93;
115     margin-bottom: 6px;
116   }
117 </style>