|
|
@ -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%;
|
|
|
|