Commit 144a1fb5 by zhaochengxiang

资产浏览关系图

parent 30e926f1
...@@ -268,7 +268,7 @@ const RelationContainer = (props) => { ...@@ -268,7 +268,7 @@ const RelationContainer = (props) => {
return ( return (
<div style={{ width: '100%', height: '100%', position: 'relative' }}> <div style={{ width: '100%', height: '100%', position: 'relative' }}>
{ {
(type==='relation') && <DataAtlas data={dirs} did={nodeParams?.centerId} /> (type==='relation' && (dirs??[]).length>0 && nodeParams?.centerId) && <DataAtlas data={dirs} did={nodeParams?.centerId} />
} }
{ {
(type==='thermodynamic') && <Thermodynamic data={thermodynamicData} resize={resize} onClick={onThermodynamicClick} /> (type==='thermodynamic') && <Thermodynamic data={thermodynamicData} resize={resize} onClick={onThermodynamicClick} />
......
...@@ -17,7 +17,7 @@ const App= (props)=> { ...@@ -17,7 +17,7 @@ const App= (props)=> {
useEffect(() => { useEffect(() => {
if (!!containerRef.current) { if (!!containerRef.current) {
microApp.current = loadMicroApp( microApp.current = loadMicroApp(
{ name: 'data-atlas', entry: `/data-atlas?time=${time}`, container: containerRef.current, props: { grpah: 1 } }, { name: 'data-atlas', entry: `/data-atlas?time=${time}`, container: containerRef.current, props: { graph: 1, data, did }},
); );
} }
...@@ -30,7 +30,9 @@ const App= (props)=> { ...@@ -30,7 +30,9 @@ const App= (props)=> {
function updateMicroApp() { function updateMicroApp() {
if (microApp.current?.update) { if (microApp.current?.update) {
microApp.current?.update?.({ data, did }); setTimeout(() => {
microApp.current?.update?.({ did })
},100)
} else { } else {
setTimeout(() => { setTimeout(() => {
updateMicroApp(); updateMicroApp();
...@@ -38,15 +40,13 @@ const App= (props)=> { ...@@ -38,15 +40,13 @@ const App= (props)=> {
} }
} }
if ((data??[]).length>0 && did) { if (did) {
updateMicroApp(); updateMicroApp();
} }
}, [data, did]) }, [did])
return ( return (
<>
<div ref={containerRef} style={{ width: '100%', height: '100%' }} /> <div ref={containerRef} style={{ width: '100%', height: '100%' }} />
</>
); );
} }
......
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