Commit a9f0e2ca by zhaochengxiang

热力图还原功能

parent babe5f83
......@@ -43,9 +43,7 @@ const RelationContainer = (props) => {
}
} else {
if ((nodeParams?.centerId||'')!=='' && (dirs||[]).length>0) {
if (!thermodynamicData || (thermodynamicData.length>0&& thermodynamicData[0].nodeId!==nodeParams?.centerId)) {
generateThermodynamicData();
}
generateThermodynamicData();
} else {
setThermodynamicData(null);
}
......@@ -256,7 +254,7 @@ const RelationContainer = (props) => {
}
const onThermodynamicClick = (id) => {
onChange && onChange({...nodeParams, expandId: id});
onChange && onChange({centerId: id, expandId: ''});
}
const onTypeChange = (e) => {
......
......@@ -20,12 +20,8 @@ class Thermodynamic extends React.Component {
const { data, onClick, resize } = this.props;
if (data !== prevProps.data) {
if (!data || (data.length>0&&(data[0].children||[]).length===0)) {
this.graph?.clear();
} else {
this.graph?.dispose();
this.graph = init(this)(this.elem, data, onClick);
}
this.graph?.dispose();
this.graph = init(this)(this.elem, data, onClick);
} else if (resize !== prevProps.resize) {
this.graph?.resize();
}
......@@ -39,9 +35,6 @@ class Thermodynamic extends React.Component {
return (
<div ref={ref => this.elem = ref} style={{ position: 'relative', width: '100%', height: '100%' }}>
{
data && data.length>0 && (data[0].children||[]).length===0 && <Empty image={<img src={emptyImg} />} imageStyle={{ width: 100, height: 100, marginBottom: 0 }} description='当前已是最底层' style={{ position: 'absolute', top: 0, display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', width: '100%', height: '100%' }} />
}
</div>
);
}
......@@ -56,7 +49,7 @@ const init = (ctx) => function (container, data, onClick) {
return [
{
itemStyle: {
borderColor: '#777',
borderColor: ((data||[]).length>0)&&(data[0].dataAssetAndSubDirCount===0||(data[0].children||[]).length===0) ? '#5e7dd6' : '#777',
borderWidth: 0,
gapWidth: 1
},
......@@ -88,14 +81,14 @@ const init = (ctx) => function (container, data, onClick) {
}
var option = {
// title: {
// text: ((data||[]).length>0) ? `${data[0]?.text||''} (${data[0]?.dataAssetAndSubDirCount})` : '',
// left: 'center',
// bottom: 10,
// textStyle: {
// fontSize: 16
// }
// },
title: {
text: ((data||[]).length>0) ? `${data[0]?.text||''} (${data[0]?.dataAssetAndSubDirCount})` : '',
left: 'center',
bottom: 10,
textStyle: {
fontSize: 16
}
},
tooltip: {
formatter: function (info) {
var treePathInfo = info.treePathInfo;
......@@ -129,8 +122,7 @@ const init = (ctx) => function (container, data, onClick) {
borderColor: '#555'
},
breadcrumb: {
show: true,
top: '95%',
show: false,
},
levels: getLevelOption(),
data: ((data||[]).length>0) ? (data[0].children||[]) : [],
......
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