Ver código fonte

Merge branch 'feature/cmn-dashboard' of cmy/data-marketing-platform into master

cmy 3 semanas atrás
pai
commit
d6cc0f3871

+ 6 - 1
src/views/home/echarts/traffic-sources.vue

@@ -123,8 +123,13 @@ const initChart = () => {
   chartInstance.setOption(option);
   chartInstance.setOption(option);
 };
 };
 
 
+const handleResize = ()=>{
+  chartInstance?.resize();
+}
+
 defineExpose({
 defineExpose({
-  initChart
+  handleResize,
+  initChart,
 });
 });
 
 
 onMounted(async () => {
 onMounted(async () => {

+ 8 - 3
src/views/home/echarts/visitor-trend.vue

@@ -204,13 +204,18 @@ const initChart = () => {
   chartInstance.setOption(option);
   chartInstance.setOption(option);
 }
 }
 
 
+const handleResize = ()=>{
+  chartInstance?.resize();
+}
+
 defineExpose({
 defineExpose({
-  initChart
+  handleResize,
+  initChart,
 });
 });
 
 
-onMounted(async () => {
+onMounted(() => {
   initChart();
   initChart();
-});
+})
 </script>
 </script>
 
 
 <style>
 <style>

+ 2 - 2
src/views/home/index.vue

@@ -55,10 +55,10 @@ const handlePanelRefresh = (value: string) => {
 
 
 const resize = debounce(() => {
 const resize = debounce(() => {
   if (visitorTrendRef.value) {
   if (visitorTrendRef.value) {
-    visitorTrendRef.value.initChart();
+    visitorTrendRef.value.handleResize();
   }
   }
   if (trafficSourcesRef.value) {
   if (trafficSourcesRef.value) {
-    trafficSourcesRef.value.initChart();
+    trafficSourcesRef.value.handleResize();
   }
   }
 }, 200); // 200ms防抖间隔
 }, 200); // 200ms防抖间隔