点击2,推出,再次进入调2,所有要销毁
<Tabs onChange={(key) => {
localStorage.setItem('tabsActiveKey', key)
}}>
<TabPane tab="原始日志" key="1">
<Spin style={{height: '100%'}} spinning={tableLoading}>
useEffect(() => {
return () => {
localStorage.removeItem('tabsActiveKey')
}
}, [])
点击事件:
getZr()可以点击任意的点
onChartReady={(echarts) => {
echarts.getZr().on('click', (e) => {
let pointInPixel = [e.offsetX, e.offsetY];
let pointInGrid = echarts.convertFromPixel({seriesIndex: 0},pointInPixel);
let xIndex = pointInGrid[0]; //索引
let handleIndex = Number(xIndex); //对应的x轴的值,也就是时间戳
!!itemOnClick && itemOnClick(handleIndex);
});
}}
itemOnClick={(timestamp) => {
nodeClickFun(timestamp)
}}