Commit 70f6a4e7 by zhaochengxiang

热力图优化

parent 246a2bb2
......@@ -42,8 +42,10 @@ const RelationContainer = (props) => {
setRelationData(null);
}
} else {
if ((nodeParams?.centerId||'')!== '' && (dirs||[]).length>0) {
generateThermodynamicData();
if ((nodeParams?.centerId||'')!=='' && (dirs||[]).length>0) {
if (!thermodynamicData || (thermodynamicData.length>0&& thermodynamicData[0].nodeId!==nodeParams?.centerId)) {
generateThermodynamicData();
}
} else {
setThermodynamicData(null);
}
......@@ -254,7 +256,7 @@ const RelationContainer = (props) => {
}
const onThermodynamicClick = (id) => {
onChange && onChange({centerId: id, expandId: ''});
onChange && onChange({...nodeParams, expandId: id});
}
const onTypeChange = (e) => {
......
......@@ -111,6 +111,7 @@ const init = (ctx) => function (container, data, onClick) {
},
series: [
{
// name: ((data||[]).length>0) ? `${data[0]?.text||''} (${data[0]?.dataAssetAndSubDirCount})` : '',
type: 'treemap',
height: '85%',
visibleMin: 0,
......@@ -138,7 +139,6 @@ const init = (ctx) => function (container, data, onClick) {
myChart.setOption(option);
myChart.on('click', function (params) {
console.log(params);
const { data } = params;
if (onClick && data && data.nodeId) {
......
......@@ -19,19 +19,14 @@ const TagColumn = (props) => {
} else {
setOwnTags([]);
}
//eslint-disable-next-line react-hooks/exhaustive-deps
}, [id])
useEffect(() => {
window?.addEventListener("storage", tagEventChange);
return () => {
window?.removeEventListener("storage", tagEventChange);
}
//eslint-disable-next-line react-hooks/exhaustive-deps
}, [])
}, [id])
const tagEventChange = (e) => {
if (e.key === 'tagChange' && (id||'') !== '') {
......
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