提交告警信息处理

newCac1.0
fanluyan 8 months ago
parent fc02dca087
commit f32c25012b

@ -773,6 +773,15 @@ export function warningListApi(data) {
},
});
}
//点击变成已处理 /warning/updateState
export function updateStateApi(data) {
return request({
url: "/warning/updateState",
method: "post",
data,
});
}
//I2配置
//字段映射列表

@ -98,6 +98,17 @@
</span>
</template>
</el-table-column>
<el-table-column label="操作" min-width="95" fixed="right">
<template slot-scope="scope">
<span
v-if="scope.row.state == 1"
class="readbox"
@click="handleReadClick(scope.row)"
>[未处理]</span
>
<span v-if="scope.row.state == 0">[]</span>
</template>
</el-table-column>
</el-table>
<div class="pageNation">
<el-pagination
@ -117,7 +128,7 @@
</template>
<script>
import { warningListApi } from "@/utils/api/index";
import { warningListApi, updateStateApi } from "@/utils/api/index";
export default {
name: "warnDialog",
components: {},
@ -169,6 +180,7 @@ export default {
.then((res) => {
console.log(res);
this.tableData = res.data.content;
this.total = res.data.totalElements;
})
.catch((err) => {
console.log(err); //
@ -252,6 +264,7 @@ export default {
},
handleClose() {
this.dialogVisible = false;
this.$parent.getwarnList();
},
//
exportWarn() {
@ -268,6 +281,24 @@ export default {
"&endTime=" +
this.formdata.endtime;
},
//
handleReadClick(row) {
console.log(row);
setTimeout(function () {
updateStateApi({
id: row.id,
state: 0,
})
.then((res) => {
console.log(res);
row.state = 0;
// this.tableData = res.data.content;
})
.catch((err) => {
console.log(err); //
});
}, 300);
},
},
};
</script>
@ -321,6 +352,13 @@ export default {
padding: 16px;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
height: calc(100% - 114px);
.readbox {
color: #f56c6c;
cursor: pointer;
&:hover {
text-decoration: underline;
}
}
}
.pageNation {
margin-top: 6px;

@ -74,7 +74,7 @@
<span>{{ item.zsbName }}</span>
<span>{{ item.warnDesc }}</span>
<span>{{ item.warnValue }}</span>
<span>{{ item.triggerDesc }}</span>
<span :title="item.triggerDesc">{{ item.triggerDesc }}</span>
<span>{{ item.threshold }}</span>
<span>
<span v-if="item.warnLevel == 2"> </span>
@ -108,6 +108,7 @@ export default {
params: {},
isMoving: true,
isDuplicated: true, //
intervalId: null, // setInterval ID
};
},
created() {
@ -122,16 +123,21 @@ export default {
currentDate.setMinutes(59); // 59
currentDate.setSeconds(59); // 59
this.endtime = currentDate;
},
mounted() {
this.getwarnList();
//
this.startIntervalIfNeeded();
},
created() {},
methods: {
lookMore() {
delete this.params.state; // state
this.params.startTime = this.starttime;
this.params.endTime = this.endtime;
this.params.pageSize = 20;
this.params.pageNum = 1;
console.log(this.params);
this.$refs.warnRef.display(this.params);
},
getwarnList() {
@ -144,6 +150,7 @@ export default {
this.params.endTime = this.endtime;
this.params.pageSize = 20;
this.params.pageNum = 1;
this.params.state = 1;
warningListApi(this.params)
.then((res) => {
console.log(res);
@ -153,6 +160,23 @@ export default {
console.log(err); //
});
},
startIntervalIfNeeded() {
//
if (this.intervalId === null) {
this.intervalId = setInterval(this.getwarnList, 10000);
}
},
stopInterval() {
//
if (this.intervalId !== null) {
clearInterval(this.intervalId);
this.intervalId = null;
}
},
},
beforeDestroy() {
//
this.stopInterval();
},
};
</script>
@ -212,7 +236,7 @@ export default {
font-size: 12px;
text-align: center;
&:first-child {
width: 12%;
width: 11%;
}
&:nth-child(2) {
width: 15%;
@ -224,7 +248,7 @@ export default {
width: 10%;
}
&:nth-child(5) {
width: 8%;
width: 9%;
}
&:nth-child(6) {
width: 8%;
@ -257,7 +281,7 @@ export default {
width: 100%;
span {
&:first-child {
width: 12%;
width: 11%;
}
&:nth-child(2) {
width: 15%;
@ -269,7 +293,10 @@ export default {
width: 10%;
}
&:nth-child(5) {
width: 8%;
width: 9%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
&:nth-child(6) {
width: 8%;

Loading…
Cancel
Save