|
@@ -1,6 +1,12 @@
|
|
|
<script setup lang="ts">
|
|
|
-import { ref, computed, type Ref } from "vue";
|
|
|
-import { useDark, useECharts, type EchartOptions } from "@pureadmin/utils";
|
|
|
+import { ref, computed, watch, type Ref } from "vue";
|
|
|
+import { useAppStoreHook } from "@/store/modules/app";
|
|
|
+import {
|
|
|
+ delay,
|
|
|
+ useDark,
|
|
|
+ useECharts,
|
|
|
+ type EchartOptions
|
|
|
+} from "@pureadmin/utils";
|
|
|
|
|
|
const { isDark } = useDark();
|
|
|
|
|
@@ -9,7 +15,7 @@ const theme: EchartOptions["theme"] = computed(() => {
|
|
|
});
|
|
|
|
|
|
const lineChartRef = ref<HTMLDivElement | null>(null);
|
|
|
-const { setOptions } = useECharts(lineChartRef as Ref<HTMLDivElement>, {
|
|
|
+const { setOptions, resize } = useECharts(lineChartRef as Ref<HTMLDivElement>, {
|
|
|
theme
|
|
|
});
|
|
|
|
|
@@ -53,6 +59,13 @@ setOptions(
|
|
|
}
|
|
|
}
|
|
|
);
|
|
|
+
|
|
|
+watch(
|
|
|
+ () => useAppStoreHook().getSidebarStatus,
|
|
|
+ () => {
|
|
|
+ delay(360).then(() => resize());
|
|
|
+ }
|
|
|
+);
|
|
|
</script>
|
|
|
|
|
|
<template>
|