diff --git a/src/views/backOfficeSystem/JudgmentHome/ResearchHome/components/AnalysisReport/components/histogram.vue b/src/views/backOfficeSystem/JudgmentHome/ResearchHome/components/AnalysisReport/components/histogram.vue index c2040b5..f1fe4db 100644 --- a/src/views/backOfficeSystem/JudgmentHome/ResearchHome/components/AnalysisReport/components/histogram.vue +++ b/src/views/backOfficeSystem/JudgmentHome/ResearchHome/components/AnalysisReport/components/histogram.vue @@ -161,6 +161,25 @@ const initChart = () => { } }, 100); }; + +// 暴露方法给父组件,用于获取图表图片数据 +defineExpose({ + getChartImage: () => { + if (myChart.value) { + return myChart.value.getDataURL({ + type: 'png', + pixelRatio: 2, + backgroundColor: '#fff' + }); + } + return null; + }, + resizeChart: () => { + if (myChart.value) { + myChart.value.resize(); + } + } +});