8
8
<div class =" alarm-list" >
9
9
<template v-for =" (alarmItem , alarmIndex ) in resultData " >
10
10
<section :key =" alarmIndex" class =" alarm-item c-dark-exclude-color" :class =" 'alarm-item-border-'+ alarmItem.s_priority" >
11
- <i class =" fa fa-bar-chart fa-operate" v-if =" !alarmItem.is_custom" @click =" goToEndpointView(alarmItem)" aria-hidden =" true" ></i >
11
+ <div style =" float :right " >
12
+ <Tooltip :content =" $t('menu.endpointView')" >
13
+ <Icon type =" ios-stats" size =" 18" class =" fa-operate" v-if =" !alarmItem.is_custom" @click =" goToEndpointView(alarmItem)" />
14
+ </Tooltip >
15
+ <Tooltip :content =" $t('close')" >
16
+ <Icon type =" ios-eye-off" size =" 18" class =" fa-operate" @click =" deleteConfirmModal(alarmItem)" />
17
+ </Tooltip >
18
+ <Tooltip :content =" $t('m_remark')" >
19
+ <Icon type =" ios-pricetags-outline" size =" 18" class =" fa-operate" @click =" remarkModal(alarmItem)" />
20
+ </Tooltip >
21
+ </div >
12
22
<ul >
13
23
<li >
14
24
<label class =" alarm-item-label" >{{$t('field.endpoint')}}:</label >
26
36
<label class =" alarm-item-label" >{{$t('tableKey.tags')}}:</label >
27
37
<Tag type =" border" v-for =" (t,tIndex) in alarmItem.tags.split('^')" :key =" tIndex" color =" cyan" >{{t}}</Tag >
28
38
</li >
39
+ <li v-if =" alarmItem.custom_message" >
40
+ <label class =" alarm-item-label" >{{$t('m_remark')}}:</label >
41
+ <div class =" col-md-9" style =" display : inline-block ;padding :0 " >
42
+ <Tag type =" border" color =" primary" >{{alarmItem.custom_message}}</Tag >
43
+ </div >
44
+ </li >
29
45
<li >
30
46
<label class =" alarm-item-label" >{{$t('tableKey.start')}}:</label ><span >{{alarmItem.start_string}}</span >
31
47
</li >
47
63
</section >
48
64
</template >
49
65
</div >
66
+ <Modal
67
+ v-model =" isShowWarning"
68
+ :title =" $t('closeConfirm.title')"
69
+ @on-ok =" ok"
70
+ @on-cancel =" cancel" >
71
+ <div class =" modal-body" style =" padding :30px " >
72
+ <div style =" text-align :center " >
73
+ <p style =" color : red " >{{$t('closeConfirm.tip')}}</p >
74
+ </div >
75
+ </div >
76
+ </Modal >
77
+ <ModalComponent :modelConfig =" modelConfig" ></ModalComponent >
50
78
</div >
51
79
</template >
52
80
@@ -59,9 +87,29 @@ export default {
59
87
interval: ' ' ,
60
88
61
89
resultData: [],
90
+ selectedData: ' ' , // 存放选中数据
91
+ isShowWarning: false ,
62
92
low: 0 ,
63
93
mid: 0 ,
64
- high: 0
94
+ high: 0 ,
95
+ modelConfig: {
96
+ modalId: ' remark_Modal' ,
97
+ modalTitle: ' m_remark' ,
98
+ saveFunc: ' remarkAlarm' ,
99
+ isAdd: true ,
100
+ config: [
101
+ {label: ' m_remark' , value: ' message' , placeholder: ' ' , v_validate: ' ' , disabled: false , type: ' text' }
102
+ ],
103
+ addRow: { // [通用]-保存用户新增、编辑时数据
104
+ id: ' ' ,
105
+ message: ' ' ,
106
+ is_custom: false
107
+ }
108
+ },
109
+ cacheParams: {
110
+ id: ' ' ,
111
+ viewCondition: ' '
112
+ }
65
113
}
66
114
},
67
115
mounted () {},
@@ -73,6 +121,8 @@ export default {
73
121
clearInterval (this .interval )
74
122
},
75
123
getAlarm (id , viewCondition ) {
124
+ this .cacheParams .id = id
125
+ this .cacheParams .viewCondition = viewCondition
76
126
this .getAlarmdata (id)
77
127
this .interval = setInterval (()=> {
78
128
this .getAlarmdata (id)
@@ -94,8 +144,47 @@ export default {
94
144
type: alarmItem .endpoint .split (' _' ).slice (- 1 )[0 ]
95
145
}
96
146
localStorage .setItem (' jumpCallData' , JSON .stringify (endpointObject))
97
- const news = this .$router .resolve ({name: ' endpointView' })
98
- window .open (news .href , ' _blank' )
147
+ this .$router .push ({path: ' /endpointView' })
148
+ // const news = this.$router.resolve({name: 'endpointView'})
149
+ // window.open(news.href, '_blank')
150
+ },
151
+ deleteConfirmModal (rowData ) {
152
+ this .selectedData = rowData
153
+ this .isShowWarning = true
154
+ },
155
+ ok () {
156
+ this .removeAlarm (this .selectedData )
157
+ },
158
+ cancel () {
159
+ this .isShowWarning = false
160
+ },
161
+ removeAlarm (alarmItem ) {
162
+ let params = {
163
+ id: alarmItem .id ,
164
+ custom: true
165
+ }
166
+ if (! alarmItem .is_custom ) {
167
+ params .custom = false
168
+ }
169
+ this .$root .$httpRequestEntrance .httpRequestEntrance (' GET' , this .$root .apiCenter .alarmManagement .close .api , params, () => {
170
+ // this.$root.$eventBus.$emit('hideConfirmModal')
171
+ this .getAlarm (this .cacheParams .id , this .cacheParams .viewCondition )
172
+ })
173
+ },
174
+ remarkModal (item ) {
175
+ this .modelConfig .addRow = {
176
+ id: item .id ,
177
+ message: item .custom_message ,
178
+ is_custom: false
179
+ }
180
+ this .$root .JQ (' #remark_Modal' ).modal (' show' )
181
+ },
182
+ remarkAlarm () {
183
+ this .$root .$httpRequestEntrance .httpRequestEntrance (' POST' , this .apiCenter .remarkAlarm , this .modelConfig .addRow , () => {
184
+ this .$Message .success (this .$t (' tips.success' ))
185
+ this .getAlarm (this .cacheParams .id , this .cacheParams .viewCondition )
186
+ this .$root .JQ (' #remark_Modal' ).modal (' hide' )
187
+ })
99
188
}
100
189
},
101
190
components: {},
0 commit comments