Commit a9f0e2ca by zhaochengxiang

热力图还原功能

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