提交告警信息处理

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配置 //I2配置
//字段映射列表 //字段映射列表

@ -98,6 +98,17 @@
</span> </span>
</template> </template>
</el-table-column> </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> </el-table>
<div class="pageNation"> <div class="pageNation">
<el-pagination <el-pagination
@ -117,7 +128,7 @@
</template> </template>
<script> <script>
import { warningListApi } from "@/utils/api/index"; import { warningListApi, updateStateApi } from "@/utils/api/index";
export default { export default {
name: "warnDialog", name: "warnDialog",
components: {}, components: {},
@ -169,6 +180,7 @@ export default {
.then((res) => { .then((res) => {
console.log(res); console.log(res);
this.tableData = res.data.content; this.tableData = res.data.content;
this.total = res.data.totalElements;
}) })
.catch((err) => { .catch((err) => {
console.log(err); // console.log(err); //
@ -252,6 +264,7 @@ export default {
}, },
handleClose() { handleClose() {
this.dialogVisible = false; this.dialogVisible = false;
this.$parent.getwarnList();
}, },
// //
exportWarn() { exportWarn() {
@ -268,6 +281,24 @@ export default {
"&endTime=" + "&endTime=" +
this.formdata.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> </script>
@ -321,6 +352,13 @@ export default {
padding: 16px; padding: 16px;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1); box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
height: calc(100% - 114px); height: calc(100% - 114px);
.readbox {
color: #f56c6c;
cursor: pointer;
&:hover {
text-decoration: underline;
}
}
} }
.pageNation { .pageNation {
margin-top: 6px; margin-top: 6px;

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

Loading…
Cancel
Save