diff --git a/spug_api/apps/alarm/views.py b/spug_api/apps/alarm/views.py index fb6347b..834796d 100644 --- a/spug_api/apps/alarm/views.py +++ b/spug_api/apps/alarm/views.py @@ -40,7 +40,7 @@ class GroupView(View): Argument('id', type=int, help='请指定操作对象') ).parse(request.GET) if error is None: - detection = Detection.objects.filter(notify_grp__contains=f'\"{form.id}\"').first() + detection = Detection.objects.filter(notify_grp__regex=fr'\D{form.id}\D').first() if detection: return json_response(error=f'监控任务【{detection.name}】正在使用该报警组,请解除关联后再尝试删除该联系组') Group.objects.filter(pk=form.id).delete() diff --git a/spug_web/src/pages/alarm/group/Table.js b/spug_web/src/pages/alarm/group/Table.js index c6a2dc5..8d4f047 100644 --- a/spug_web/src/pages/alarm/group/Table.js +++ b/spug_web/src/pages/alarm/group/Table.js @@ -72,7 +72,7 @@ class ComTable extends React.Component { title: '删除确认', content: `确定要删除【${text['name']}】?`, onOk: () => { - return http.delete('/api/exec/template/', {params: {id: text.id}}) + return http.delete('/api/alarm/group/', {params: {id: text.id}}) .then(() => { message.success('删除成功'); store.fetchRecords()