@@ -1176,39 +1176,43 @@ export default {
1176
1176
return resData
1177
1177
},
1178
1178
getDetail (targetId ) {
1179
- this .targetId = targetId
1180
- const api = ' /monitor/api/v2/alarm/strategy/query'
1181
- const params = {
1182
- queryType: this .type ,
1183
- guid: this .targetId ,
1184
- show: this .onlyShowCreated ,
1185
- alarmName: this .alarmName
1186
- }
1187
- this .totalPageConfig = []
1188
- this .request (' post' , api, params, responseData => {
1189
- this .$emit (' feedbackInfo' , responseData .length === 0 )
1190
- const allConfigDetail = responseData
1191
- allConfigDetail .forEach ((item , alarmIndex ) => {
1192
- const strategy = item .strategy || []
1193
- const tempTableData = strategy .map (s => {
1194
- s .monitor_type = item .monitor_type
1195
- return s
1196
- })
1197
- const tableData = this .handleTableData (tempTableData, alarmIndex)
1198
- this .totalPageConfig .push ({
1199
- tableData,
1200
- endpoint_group: item .endpoint_group ,
1201
- display_name: item .display_name ,
1202
- service_group: item .service_group ,
1203
- monitor_type: item .monitor_type ,
1204
- notify: item .notify ,
1205
- mergeSpanMap: this .mergeSpanMap
1179
+ if (targetId) {
1180
+ this .targetId = targetId
1181
+ const api = ' /monitor/api/v2/alarm/strategy/query'
1182
+ const params = {
1183
+ queryType: this .type ,
1184
+ guid: this .targetId ,
1185
+ show: this .onlyShowCreated ,
1186
+ alarmName: this .alarmName
1187
+ }
1188
+ this .totalPageConfig = []
1189
+ this .request (' post' , api, params, responseData => {
1190
+ this .$emit (' feedbackInfo' , responseData .length === 0 )
1191
+ const allConfigDetail = responseData
1192
+ allConfigDetail .forEach ((item , alarmIndex ) => {
1193
+ const strategy = item .strategy || []
1194
+ const tempTableData = strategy .map (s => {
1195
+ s .monitor_type = item .monitor_type
1196
+ return s
1197
+ })
1198
+ const tableData = this .handleTableData (tempTableData, alarmIndex)
1199
+ this .totalPageConfig .push ({
1200
+ tableData,
1201
+ endpoint_group: item .endpoint_group ,
1202
+ display_name: item .display_name ,
1203
+ service_group: item .service_group ,
1204
+ monitor_type: item .monitor_type ,
1205
+ notify: item .notify ,
1206
+ mergeSpanMap: this .mergeSpanMap
1207
+ })
1208
+ this .originTotalPageConfig = cloneDeep (this .totalPageConfig )
1206
1209
})
1207
- this .originTotalPageConfig = cloneDeep (this .totalPageConfig )
1208
- })
1209
- }, {isNeedloading: true })
1210
- this .getAllRole ()
1211
- this .getWorkFlow ()
1210
+ }, {isNeedloading: true })
1211
+ this .getAllRole ()
1212
+ this .getWorkFlow ()
1213
+ } else {
1214
+ this .totalPageConfig = []
1215
+ }
1212
1216
},
1213
1217
onAddIconClick () {
1214
1218
const metricItem = Object .assign ({}, cloneDeep (initFormData .conditions [0 ]), {
0 commit comments