mirror of
https://gitee.com/nocobase/nocobase.git
synced 2024-12-05 05:38:23 +08:00
fix: graph collection postions data missing (#3627)
This commit is contained in:
parent
0d327bb539
commit
f9d1e9f0bc
@ -432,13 +432,6 @@ export const GraphDrawPage = React.memo(() => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const dataSource = useDataSource();
|
const dataSource = useDataSource();
|
||||||
useEffect(() => {
|
|
||||||
dataSource.addReloadCallback(reloadCallback);
|
|
||||||
|
|
||||||
return () => {
|
|
||||||
dataSource.removeReloadCallback(reloadCallback);
|
|
||||||
};
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
const initGraphCollections = () => {
|
const initGraphCollections = () => {
|
||||||
targetGraph = new Graph({
|
targetGraph = new Graph({
|
||||||
@ -1081,20 +1074,17 @@ export const GraphDrawPage = React.memo(() => {
|
|||||||
};
|
};
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
dataSource.addReloadCallback(reloadCallback);
|
||||||
|
|
||||||
|
return () => {
|
||||||
|
dataSource.removeReloadCallback(reloadCallback);
|
||||||
|
};
|
||||||
|
}, []);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
refreshPositions()
|
refreshPositions()
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
await reloadCallback();
|
|
||||||
setLoading(false);
|
|
||||||
})
|
|
||||||
.catch((err) => {
|
|
||||||
setLoading(false);
|
|
||||||
throw err;
|
|
||||||
});
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (selectedCollections && collectionList.length) {
|
if (selectedCollections && collectionList.length) {
|
||||||
const selectKeys = selectedCollections?.split(',');
|
const selectKeys = selectedCollections?.split(',');
|
||||||
const data = collectionList.filter((v) => selectKeys.includes(v.name));
|
const data = collectionList.filter((v) => selectKeys.includes(v.name));
|
||||||
@ -1104,6 +1094,12 @@ export const GraphDrawPage = React.memo(() => {
|
|||||||
} else {
|
} else {
|
||||||
!selectedCollections && reloadCallback(true);
|
!selectedCollections && reloadCallback(true);
|
||||||
}
|
}
|
||||||
|
setLoading(false);
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
setLoading(false);
|
||||||
|
throw err;
|
||||||
|
});
|
||||||
return () => {
|
return () => {
|
||||||
cleanGraphContainer();
|
cleanGraphContainer();
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user