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

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

parent 68077bd4
...@@ -84,9 +84,10 @@ const SingleChart = memo((props) => { ...@@ -84,9 +84,10 @@ const SingleChart = memo((props) => {
a.href = chart.getDataURL('image/png'); a.href = chart.getDataURL('image/png');
a.download = '曲线图片.png' a.download = '曲线图片.png'
a.click(); a.click();
a.remove() a.remove();
exportCanvas.setExportFlag(null);
} }
}, [exportCanvas]); }, [exportCanvas.exportFlag]);
useEffect(() => { useEffect(() => {
chartRef.current?.resize?.(); chartRef.current?.resize?.();
const chart = chartRef.current?.getEchartsInstance?.(); const chart = chartRef.current?.getEchartsInstance?.();
......
...@@ -1395,7 +1395,7 @@ const HistoryView = (props) => { ...@@ -1395,7 +1395,7 @@ const HistoryView = (props) => {
/> />
) : ( ) : (
<SingleChart <SingleChart
exportCanvas={exportFlag} exportCanvas={{exportFlag, setExportFlag}}
emptyOrError={emptyOrError.current} emptyOrError={emptyOrError.current}
dateRange={dateRange} dateRange={dateRange}
showBoxOption={showBoxOption} 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