Commit 546c3fc1 by zhaochengxiang

bug fix

parent fc95434e
...@@ -39,6 +39,8 @@ class Relation extends React.Component { ...@@ -39,6 +39,8 @@ class Relation extends React.Component {
} }
} }
} }
} else {
this.graph?.destroy();
} }
if (resize !== prevProps.resize && prevProps.resize!==null) { if (resize !== prevProps.resize && prevProps.resize!==null) {
......
...@@ -17,7 +17,9 @@ class Thermodynamic extends React.Component { ...@@ -17,7 +17,9 @@ class Thermodynamic extends React.Component {
if (data !== prevProps.data) { if (data !== prevProps.data) {
this.graph?.dispose(); this.graph?.dispose();
this.graph = init(this)(this.elem, data, onClick); if (data) {
this.graph = init(this)(this.elem, data, onClick);
}
} else if (resize !== prevProps.resize) { } else if (resize !== prevProps.resize) {
this.graph?.resize(); this.graph?.resize();
} }
......
...@@ -297,6 +297,8 @@ const AssetManageTree = (props) => { ...@@ -297,6 +297,8 @@ const AssetManageTree = (props) => {
setCurrentDirType(defaultItem.type||''); setCurrentDirType(defaultItem.type||'');
setCurrentDir(defaultItem); setCurrentDir(defaultItem);
onSelect && onSelect(defaultItem.nodeId, defaultItem.type||'', defaultItem.level, defaultItem.allowdLoadDataAsset); onSelect && onSelect(defaultItem.nodeId, defaultItem.type||'', defaultItem.level, defaultItem.allowdLoadDataAsset);
} else {
onSelect && onSelect('', '');
} }
} }
} }
......
...@@ -265,11 +265,10 @@ const AssetTable = (props) => { ...@@ -265,11 +265,10 @@ const AssetTable = (props) => {
}, []) }, [])
useEffect(() => { useEffect(() => {
if (nodeId !== null && nodeId !== undefined) { setSelectItem({});
setSelectItem({}); setCheckedKeys([]);
setCheckedKeys([]); setSelectedRows([]);
setSelectedRows([]); if (nodeId) {
if (shouldScrollRef.current === true) { if (shouldScrollRef.current === true) {
if (remoteRelationRef.current) { if (remoteRelationRef.current) {
getDataAssetLocationByRelation(); getDataAssetLocationByRelation();
...@@ -280,6 +279,9 @@ const AssetTable = (props) => { ...@@ -280,6 +279,9 @@ const AssetTable = (props) => {
} else { } else {
setPagination({ ...pagination, pageNum: 1 }); setPagination({ ...pagination, pageNum: 1 });
} }
} else {
setAssets([])
setPagination({ ...pagination, pageNum: 1 });
} }
//eslint-disable-next-line react-hooks/exhaustive-deps //eslint-disable-next-line react-hooks/exhaustive-deps
}, [ nodeId ]) }, [ nodeId ])
......
...@@ -272,6 +272,8 @@ const AssetTree = (props) => { ...@@ -272,6 +272,8 @@ const AssetTree = (props) => {
defaultItem = newData[0] defaultItem = newData[0]
setCurrentDirId(defaultItem.nodeId); setCurrentDirId(defaultItem.nodeId);
onSelect && onSelect(defaultItem.nodeId, defaultItem.type||'', defaultItem.level, defaultItem.allowdLoadDataAsset); onSelect && onSelect(defaultItem.nodeId, defaultItem.type||'', defaultItem.level, defaultItem.allowdLoadDataAsset);
} else {
onSelect && onSelect('', '')
} }
} }
}, },
......
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