Commit 39618130 authored by Kerwin_Cui's avatar Kerwin_Cui

修改

parent b9ca163b
...@@ -290,6 +290,8 @@ class Error_alarm(models.Model): ...@@ -290,6 +290,8 @@ class Error_alarm(models.Model):
user = models.CharField(null=True, max_length=100, verbose_name="处理人") user = models.CharField(null=True, max_length=100, verbose_name="处理人")
cant_auto_info = models.TextField(null=True, verbose_name="不可自动化信息") cant_auto_info = models.TextField(null=True, verbose_name="不可自动化信息")
not_auto_yet = models.TextField(null=True, verbose_name="未自动化信息") not_auto_yet = models.TextField(null=True, verbose_name="未自动化信息")
other_alarminfo = models.TextField(null=True, verbose_name="其他监控信息")
icube_alarminfo = models.TextField(null=True, verbose_name="一体化告警信息")
def toDic(self): def toDic(self):
return dict([(attr, getattr(self, attr)) for attr in [f.name for f in self._meta.fields]]) return dict([(attr, getattr(self, attr)) for attr in [f.name for f in self._meta.fields]])
......
...@@ -2224,6 +2224,8 @@ def create_alarm(request): ...@@ -2224,6 +2224,8 @@ def create_alarm(request):
monitor_name = data['monitor_name'] monitor_name = data['monitor_name']
if_icube = data['if_icube'] if_icube = data['if_icube']
not_auto_yet = data['notautoyetinfo'] not_auto_yet = data['notautoyetinfo']
other_alarminfo = data['other_alarminfo']
icube_alarminfo = ''
if alarm_time and recover_time and alarm_summary and alarm_type and alarm_system: if alarm_time and recover_time and alarm_summary and alarm_type and alarm_system:
pass pass
...@@ -2296,7 +2298,9 @@ def create_alarm(request): ...@@ -2296,7 +2298,9 @@ def create_alarm(request):
if_icube = if_icube, if_icube = if_icube,
cant_auto_info = cant_auto_info, cant_auto_info = cant_auto_info,
user = login_person, user = login_person,
not_auto_yet = not_auto_yet not_auto_yet = not_auto_yet,
other_alarminfo = other_alarminfo,
icube_alarminfo = icube_alarminfo
) )
error_alarm.save() error_alarm.save()
return render_json( return render_json(
...@@ -2352,7 +2356,9 @@ def edit_alarm_display(request): ...@@ -2352,7 +2356,9 @@ def edit_alarm_display(request):
'if_icube': int(alarm.if_icube) if alarm.if_icube else '', 'if_icube': int(alarm.if_icube) if alarm.if_icube else '',
'show_src': show_src, 'show_src': show_src,
'cantautoinfo': alarm.cant_auto_info if alarm.cant_auto_info else '', 'cantautoinfo': alarm.cant_auto_info if alarm.cant_auto_info else '',
'notautoyetinfo': alarm.not_auto_yet if alarm.not_auto_yet else '' 'notautoyetinfo': alarm.not_auto_yet if alarm.not_auto_yet else '',
'icube_alarminfo':alarm.icube_alarminfo if alarm.icube_alarminfo else '',
'other_alarminfo':alarm.other_alarminfo if alarm.other_alarminfo else ''
} }
return render_json( return render_json(
{ {
...@@ -2395,6 +2401,8 @@ def edit_alarm(request): ...@@ -2395,6 +2401,8 @@ def edit_alarm(request):
cant_auto_info = data['cantautoinfo'] cant_auto_info = data['cantautoinfo']
not_auto_yet = data['notautoyetinfo'] not_auto_yet = data['notautoyetinfo']
if_icube = data['if_icube'] if_icube = data['if_icube']
other_alarminfo = data['other_alarminfo']
icube_alarminfo = data['icube_alarminfo']
alarm_time = alarm_time.replace('T', ' ') alarm_time = alarm_time.replace('T', ' ')
# alarm_time = alarm_time[0:-5] # alarm_time = alarm_time[0:-5]
alarm_time = datetime.datetime.strptime(alarm_time, "%Y-%m-%d %H:%M:%S") alarm_time = datetime.datetime.strptime(alarm_time, "%Y-%m-%d %H:%M:%S")
...@@ -2422,6 +2430,8 @@ def edit_alarm(request): ...@@ -2422,6 +2430,8 @@ def edit_alarm(request):
alarm.if_icube = if_icube alarm.if_icube = if_icube
alarm.cant_auto_info = cant_auto_info alarm.cant_auto_info = cant_auto_info
alarm.not_auto_yet = not_auto_yet alarm.not_auto_yet = not_auto_yet
alarm.icube_alarminfo = icube_alarminfo
alarm.other_alarminfo = other_alarminfo
alarm.save() alarm.save()
return render_json( return render_json(
{"result": True, {"result": True,
...@@ -2500,7 +2510,7 @@ def create_alarm_by_icube(request): ...@@ -2500,7 +2510,7 @@ def create_alarm_by_icube(request):
alarm_system = [system.systemname] alarm_system = [system.systemname]
error_alarm = Error_alarm.objects.create( error_alarm = Error_alarm.objects.create(
alarm_number=alarm_number, alarm_number=alarm_number,
alarm_summary=i['alarm_info'], alarm_summary='',
alarm_level='', alarm_level='',
alarm_system=alarm_system, alarm_system=alarm_system,
alarm_happen_time=alarm_time, alarm_happen_time=alarm_time,
...@@ -2513,8 +2523,9 @@ def create_alarm_by_icube(request): ...@@ -2513,8 +2523,9 @@ def create_alarm_by_icube(request):
auto_name='', auto_name='',
other_autoname='', other_autoname='',
monitor_name='', monitor_name='',
if_icube='8', if_icube='1',
user=login_person user=login_person,
icube_alarminfo=i['alarm_info'],
) )
error_alarm.save() error_alarm.save()
return render_json( return render_json(
......
...@@ -150,18 +150,18 @@ ...@@ -150,18 +150,18 @@
<el-form-item label="监控类别:" label-width="200px" class="normal"> <el-form-item label="监控类别:" label-width="200px" class="normal">
<el-select v-model="formLine.monitor_name" clearable filterable style="width:200px;" <el-select v-model="formLine.monitor_name" clearable filterable style="width:200px;"
:disabled="editStatus"> :disabled="editStatus">
<el-option v-for="item in monitor_info" <el-option v-for="item in alarmType"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.label"> :value="item.label">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="告警是否来自一体化平台:" class="normal" label-width="200px"> <el-form-item label="一体化平台告警信息" label-width="140px" class="normal" v-if="icube_show">
<el-radio-group style="margin-left: 5px;" v-model="formLine.if_icube" > <el-input v-model="formLine.icube_alarminfo" :disabled="flag"></el-input>
<el-radio :label="8"></el-radio> </el-form-item>
<el-radio :label="9"></el-radio> <el-form-item label="其他告警/监控信息" label-width="140px" class="normal" v-if="other_show">
</el-radio-group> <el-input v-model="formLine.other_alarminfo" ></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-row style="margin-top: 10px"> <el-row style="margin-top: 10px">
...@@ -196,12 +196,12 @@ ...@@ -196,12 +196,12 @@
{label: '', value: '2'}, {label: '', value: '2'},
{label: '', value: '3'} {label: '', value: '3'}
], ],
//事件类型
eventType: [ eventType: [
{label: '严重', value: '1'}, {label: '严重', value: '1'},
{label: '主要', value: '2'}, {label: '主要', value: '2'},
{label: '次要', value: '2'}, {label: '次要', value: '2'},
] ]
}; };
var formatToId = function (item, itemArray) { var formatToId = function (item, itemArray) {
for (let i of itemArray) { for (let i of itemArray) {
...@@ -231,7 +231,14 @@ ...@@ -231,7 +231,14 @@
options: [], options: [],
tabelshowData: [] tabelshowData: []
}, },
alarmType: [
{label: '基础监控', value: '1'},
{label: '自定义监控', value: '2'},
{label: '智能运维监控', value: '3'},
],
systemListCmdb:[], systemListCmdb:[],
icube_show:false,
other_show:true,
errorMachine: [], errorMachine: [],
machineBiz: "", machineBiz: "",
machineListFlag: 1, machineListFlag: 1,
...@@ -283,6 +290,7 @@ ...@@ -283,6 +290,7 @@
selectData: [], selectData: [],
gridData: [], gridData: [],
alarmDisplay: [], alarmDisplay: [],
flag:true,
formLine: { formLine: {
alarm_type:'', alarm_type:'',
alarm_system:[], alarm_system:[],
...@@ -300,6 +308,8 @@ ...@@ -300,6 +308,8 @@
notautoyetinfo: '', notautoyetinfo: '',
monitor_name:'', monitor_name:'',
if_icube:'', if_icube:'',
icube_alarminfo:'',
other_alarminfo:''
}, },
editStatus: false, editStatus: false,
dealerStatus: true, dealerStatus: true,
...@@ -321,6 +331,13 @@ ...@@ -321,6 +331,13 @@
} else { } else {
this.showStatus = true this.showStatus = true
} }
if (data.if_icube == 1) {
this.icube_show = true
this.other_show = false
} else {
this.icube_show = false
this.other_show = true
}
//data.urgency_degree = formatToId(data.urgency_degree, keyArray.influenceLevel) //data.urgency_degree = formatToId(data.urgency_degree, keyArray.influenceLevel)
//data.priority = formatToId(data.priority, keyArray.priority) //data.priority = formatToId(data.priority, keyArray.priority)
//data.event_type = formatToId(data.event_type, keyArray.eventType) //data.event_type = formatToId(data.event_type, keyArray.eventType)
......
No preview for this file type
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment