Commit 16f4706f authored by Kerwin_Cui's avatar Kerwin_Cui

123

parent 412cc534
...@@ -2259,6 +2259,7 @@ def del_alarm(request): ...@@ -2259,6 +2259,7 @@ def del_alarm(request):
) )
def search_alarm(request): def search_alarm(request):
try: try:
req = json.loads(request.body) req = json.loads(request.body)
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
<el-col align="left"> <el-col align="left">
<span style="font-weight:600;font-size:15.6px;">预警新建:</span> <span style="font-weight:600;font-size:15.6px;">预警新建:</span>
<el-button type="primary" size="medium" style="float:right" <el-button type="primary" size="medium" style="float:right"
@click="createNewTask()">批量新建 @click="createNewTask()">通过告警新建
</el-button> </el-button>
<el-button type="primary" size="medium" <el-button type="primary" size="medium"
@click="createNewAlarm()" style=" float:right;margin-right:12px">新建 @click="createNewAlarm()" style=" float:right;margin-right:12px">新建
...@@ -219,7 +219,7 @@ ...@@ -219,7 +219,7 @@
<el-form-item style="display:inline-block" label="" <el-form-item style="display:inline-block" label=""
label-width="325px"> label-width="325px">
<el-row> <el-row>
<el-button type="primary">查 询</el-button> <el-button type="primary" @click="searchAlarm()">查 询</el-button>
</el-row> </el-row>
</el-form-item> </el-form-item>
<el-form-item label="" label-width="30px" <el-form-item label="" label-width="30px"
...@@ -236,16 +236,14 @@ ...@@ -236,16 +236,14 @@
<el-row> <el-row>
<div style="line-height: 50px ;"> <div style="line-height: 50px ;">
<template> <template>
<el-table :data="alarmDisplay" style="width:100%" <el-table :data="gridData" style="width:100%"
max-height="300"> max-height="300">
<el-table-column fixed prop="alarm_title" label="告警标题" <el-table-column type="selection" width="30"></el-table-column>
width="300" <el-table-column fixed prop="alarm_title" label="告警标题" width="300"
align="center"></el-table-column> align="center"></el-table-column>
<el-table-column fixed prop="alarm_info" label="告警内容" <el-table-column fixed prop="alarm_info" label="告警内容" width="300"
width="300"
align="center"></el-table-column> align="center"></el-table-column>
<el-table-column fixed prop="alarm_time" label="告警时间" <el-table-column fixed prop="alarm_time" label="告警时间" width="300"
width="300"
align="center"></el-table-column> align="center"></el-table-column>
</el-table> </el-table>
</template> </template>
...@@ -253,7 +251,7 @@ ...@@ -253,7 +251,7 @@
</el-row> </el-row>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="batchNewVisible = false">取 消</el-button> <el-button @click="batchNewVisible = false">取 消</el-button>
<el-button type="primary" @click="batchNewVisible = false">确 定</el-button> <el-button type="primary" @click="batchNewVisible = false" >确 定</el-button>
</span> </span>
</el-dialog> </el-dialog>
</div> </div>
...@@ -310,6 +308,11 @@ ...@@ -310,6 +308,11 @@
{label: '主要', value: '2',}, {label: '主要', value: '2',},
{label: '次要', value: '3',}, {label: '次要', value: '3',},
], ],
alarmType: [
{label: '日志告警', value: '2'},
{label: '指标告警', value: '1'},
{label: '日志和指标告警', value: '0'},
],
}; };
var formatToId = function (item, itemArray) { var formatToId = function (item, itemArray) {
for (let i of itemArray) { for (let i of itemArray) {
...@@ -335,6 +338,7 @@ ...@@ -335,6 +338,7 @@
dateoutflag: false, dateoutflag: false,
dateoutinfo: "", dateoutinfo: "",
user: '', user: '',
gridData: [],
priorityOp: keyArray.priority, priorityOp: keyArray.priority,
eventStateOp: keyArray.eventState, eventStateOp: keyArray.eventState,
relateOp: keyArray.relateJudge, relateOp: keyArray.relateJudge,
...@@ -394,9 +398,43 @@ ...@@ -394,9 +398,43 @@
this.systemList = res this.systemList = res
}) })
}, },
searchAlarm(){
if (this.formLine.failure_analysis.alarm_type && this.formLine.failure_analysis.start_time
&& this.formLine.failure_analysis.end_time) {
let vm = this;
let data = this.formLine;
vm.popshow = true;
axios.post('${SITE_URL}search/', data).then(res => {
vm.gridData = [];
vm.gridData = res.data;
if (res.result) {
this.$message({
type: "success",
message: '查询成功'
});
} else {
this.$message({
type: "error",
message: '查询失败' + res.message
});
this.formLine = data
}
})
} else {
vm.$message({
type: 'error',
message: '查询失败,请完善必填项'
});
}
},
createNewAlarm(){ createNewAlarm(){
window.location.href = "${SITE_URL}alarm_edit" window.location.href = "${SITE_URL}alarm_edit"
}, },
createNewTask() {
// window.localStorage.removeItem("event_number")
// window.location.href = "${SITE_URL}event_edit"
this.batchNewVisible = true
},
delAlarm(){ delAlarm(){
this.$confirm('此操作将永久删除该记录, 是否继续?', '提示', { this.$confirm('此操作将永久删除该记录, 是否继续?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
......
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