定时刷新5分

This commit is contained in:
龚皓
2024-11-26 16:25:47 +08:00
parent 7551409394
commit 056c1c95bf
5 changed files with 461 additions and 293 deletions

View File

@@ -18,7 +18,7 @@
<!-- 右侧分为两行 -->
<el-col :sm="24" :md="16">
<el-row>
<el-col :sm="24" :md="24">
<el-col :sm="24" :md="24" class="inner-title-text">
通道总数
</el-col>
</el-row>
@@ -41,7 +41,7 @@
<!-- 右侧分为两行 -->
<el-col :sm="24" :md="16">
<el-row>
<el-col :sm="24" :md="24">
<el-col :sm="24" :md="24" class="inner-title-text">
在线
</el-col>
</el-row>
@@ -64,7 +64,7 @@
<!-- 右侧分为两行 -->
<el-col :sm="24" :md="16">
<el-row>
<el-col :sm="24" :md="24">
<el-col :sm="24" :md="24" class="inner-title-text">
离线:
</el-col>
</el-row>
@@ -89,7 +89,7 @@
<!-- 右侧分为两行 -->
<el-col :sm="24" :md="16">
<el-row>
<el-col :sm="24" :md="24">
<el-col :sm="24" :md="24" class="inner-title-text">
事件总数
</el-col>
</el-row>
@@ -112,7 +112,7 @@
<!-- 右侧分为两行 -->
<el-col :sm="24" :md="16">
<el-row>
<el-col :sm="24" :md="24">
<el-col :sm="24" :md="24" class="inner-title-text">
已处理:
</el-col>
</el-row>
@@ -135,7 +135,7 @@
<!-- 右侧分为两行 -->
<el-col :sm="24" :md="16">
<el-row>
<el-col :sm="24" :md="24">
<el-col :sm="24" :md="24" class="inner-title-text">
未处理:
</el-col>
</el-row>
@@ -163,6 +163,7 @@ import CameraOffline from '@/icons/CameraOffline.vue';
import EventAll from '@/icons/EventAll.vue';
import EventClosed from '@/icons/EventClosed.vue';
import EventPending from '@/icons/EventPending.vue';
import { useGlobalTimerStore } from '@/stores/globalTimerStore';
const apiInstance = new BoxApi();
const cameraCount = ref(0);
@@ -320,8 +321,19 @@ onMounted(() => {
// getMonthData();
fetchCameras();
fetchEvents();
const globalTimerStore = useGlobalTimerStore();
globalTimerStore.registerCallback(fetchCameras);
globalTimerStore.registerCallback(fetchEvents);
globalTimerStore.startTimer();
});
onBeforeUnmount(() => {
const globalTimerStore = useGlobalTimerStore();
// 注销回调
globalTimerStore.unregisterCallback(fetchCameras);
globalTimerStore.unregisterCallback(fetchEvents);
});
@@ -333,7 +345,11 @@ onMounted(() => {
height: 100%;
margin: 1vh;
padding: 2vh 0;
overflow-y: scroll;
scrollbar-width:none;
}
.count-container::-webkit-scrollbar {
display: none;
}
@@ -341,14 +357,19 @@ onMounted(() => {
.bottom-row {
background-color: #001529;
color: aliceblue;
padding: 0;
padding: 0.5vh;
margin: 0;
}
.inner-title-text{
font-size: 0.9rem;
}
.inner-count-text {
color: rgb(91, 224, 241);
font-size: 1rem;
}
.tab-div {
@@ -357,7 +378,7 @@ onMounted(() => {
::v-deep .el-tabs__item {
color: #fff;
font-size: 13px;
font-size: 0.8rem;
padding: 0;
margin-left: 1vh;
height: 20px;