Commit 4644642f authored by 陈龙's avatar 陈龙

feat: 修复切换也会下载图片的问题

parent 68077bd4
......@@ -84,9 +84,10 @@ const SingleChart = memo((props) => {
a.href = chart.getDataURL('image/png');
a.download = '曲线图片.png'
a.click();
a.remove()
a.remove();
exportCanvas.setExportFlag(null);
}
}, [exportCanvas]);
}, [exportCanvas.exportFlag]);
useEffect(() => {
chartRef.current?.resize?.();
const chart = chartRef.current?.getEchartsInstance?.();
......
......@@ -1395,7 +1395,7 @@ const HistoryView = (props) => {
/>
) : (
<SingleChart
exportCanvas={exportFlag}
exportCanvas={{exportFlag, setExportFlag}}
emptyOrError={emptyOrError.current}
dateRange={dateRange}
showBoxOption={showBoxOption}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment