Commit 70f6a4e7 by zhaochengxiang

热力图优化

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