Commit 144a1fb5 by zhaochengxiang

资产浏览关系图

parent 30e926f1
......@@ -268,7 +268,7 @@ const RelationContainer = (props) => {
return (
<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} />
......
......@@ -17,7 +17,7 @@ const App= (props)=> {
useEffect(() => {
if (!!containerRef.current) {
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)=> {
function updateMicroApp() {
if (microApp.current?.update) {
microApp.current?.update?.({ data, did });
setTimeout(() => {
microApp.current?.update?.({ did })
},100)
} else {
setTimeout(() => {
updateMicroApp();
......@@ -38,15 +40,13 @@ const App= (props)=> {
}
}
if ((data??[]).length>0 && did) {
if (did) {
updateMicroApp();
}
}, [data, did])
}, [did])
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