统计报表页面 时间范围切换 echarts图表更新修改

This commit is contained in:
2026-09-30 16:49:44 +08:00
parent 2a78a35286
commit 3a08d062ad
2 changed files with 12 additions and 2 deletions
+6 -1
View File
@@ -1,5 +1,5 @@
<script setup lang="ts">
import { ref } from 'vue';
import { nextTick, ref, watch } from 'vue';
import { useEcharts } from '@/hooks/common/echarts';
defineOptions({
@@ -7,6 +7,11 @@ defineOptions({
});
const props = defineProps<{ data: { org_name: string; count: number; }[]; }>();
watch(() => [props.data], () => {
nextTick(() => {
init();
});
},{immediate: true,deep: true});
const { domRef, updateOptions } = useEcharts(() => ({
tooltip: {
+6 -1
View File
@@ -1,5 +1,5 @@
<script setup lang="ts">
import { ref } from 'vue';
import { nextTick, ref, watch } from 'vue';
import { useEcharts } from '@/hooks/common/echarts';
defineOptions({
@@ -7,6 +7,11 @@ defineOptions({
});
const props = defineProps<{ data?: { name: string; value: number }[]; }>();
watch(() => [props.data], () => {
nextTick(() => {
init();
});
},{immediate: true,deep: true});
const chartData = ref<{ name: string; value: number; }[]>([]);
const { domRef, updateOptions } = useEcharts(() => ({