diff --git a/src/components/Max/CenterBottom.vue b/src/components/Max/CenterBottom.vue
index c0f7efe..6698887 100644
--- a/src/components/Max/CenterBottom.vue
+++ b/src/components/Max/CenterBottom.vue
@@ -1,6 +1,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+.el-tabs__active-bar {
+ background-color: transparent !important;
+}
+
+
+::v-deep .el-tabs__nav-wrap::after {
+ /* width: 15vw; */
+ position: static !important;
+}
+
\ No newline at end of file
diff --git a/src/components/Max/LeftMiddle.vue b/src/components/Max/LeftMiddle.vue
index 65d8a48..43f8b47 100644
--- a/src/components/Max/LeftMiddle.vue
+++ b/src/components/Max/LeftMiddle.vue
@@ -13,7 +13,9 @@ import { ref, onMounted, onBeforeUnmount } from 'vue';
import * as echarts from 'echarts';
import { BoxApi } from '@/utils/boxApi.ts';
import { DCaret } from '@element-plus/icons-vue';
+import { useGlobalTimerStore } from '@/stores/globalTimerStore';
+const globalTimerStore = useGlobalTimerStore();
const chartContainer = ref(null);
let myChart = null;
const cameras = ref([]);
@@ -98,7 +100,7 @@ const option = ref({
data: [], // 动态填充告警数量
type: "bar",
barWidth: 10,
- padding:[0],
+ padding: [0],
showBackground: true,
barBorderRadius: [30, 0, 0, 30],
backgroundStyle: { color: 'rgba(9, 68, 131, .2)' },
@@ -236,18 +238,14 @@ const fetchCameras = async () => {
}
};
-// 清理轮播和事件监听
-onBeforeUnmount(() => {
- if (dataZoomMoveTimer) {
- clearInterval(dataZoomMoveTimer);
- dataZoomMoveTimer = null; // 确保计时器被清空
+const resizeChart = () => {
+ if (myChart && !myChart.isDisposed()) {
+ myChart.resize();
+ } else {
+ console.warn('Attempted to resize a disposed ECharts instance.');
}
- if (myChart) {
- window.removeEventListener('resize', resizeChart); // 确保事件监听器被移除
- myChart.dispose();
- myChart = null;
- }
-});
+};
+
@@ -259,16 +257,26 @@ onMounted(async () => {
// 监听窗口变化事件,调整图表大小
window.addEventListener('resize', resizeChart);
+
+ globalTimerStore.registerCallback(fetchCameras);
+ globalTimerStore.startTimer();
+
});
-
-const resizeChart = () => {
- if (myChart && !myChart.isDisposed()) {
- myChart.resize();
- } else {
- console.warn('Attempted to resize a disposed ECharts instance.');
+// 清理轮播和事件监听
+onBeforeUnmount(() => {
+ if (dataZoomMoveTimer) {
+ clearInterval(dataZoomMoveTimer);
+ dataZoomMoveTimer = null; // 确保计时器被清空
}
-};
+ if (myChart) {
+ window.removeEventListener('resize', resizeChart); // 确保事件监听器被移除
+ myChart.dispose();
+ myChart = null;
+ }
+ globalTimerStore.unregisterCallback(fetchCameras);
+ globalTimerStore.stopTimer();
+});
// const resizeChart = () => {
@@ -283,23 +291,25 @@ const resizeChart = () => {