fix: update

This commit is contained in:
Fine 2023-03-20 19:41:28 +08:00
parent 68be30402a
commit d0a46730c3

View File

@ -192,6 +192,8 @@ limitations under the License. -->
freshNodes(); freshNodes();
} }
async function freshNodes() { async function freshNodes() {
topologyStore.setNode(null);
topologyStore.setLink(null);
const resp = await getTopology(); const resp = await getTopology();
loading.value = false; loading.value = false;
@ -411,8 +413,6 @@ limitations under the License. -->
ElMessage.error(resp.errors); ElMessage.error(resp.errors);
} }
update(); update();
topologyStore.setNode(null);
topologyStore.setLink(null);
} }
function handleGoEndpoint(name: string) { function handleGoEndpoint(name: string) {
const path = `/dashboard/${dashboardStore.layerId}/${EntityType[2].value}/${topologyStore.node.id}/${name}`; const path = `/dashboard/${dashboardStore.layerId}/${EntityType[2].value}/${topologyStore.node.id}/${name}`;
@ -519,7 +519,13 @@ limitations under the License. -->
}); });
watch( watch(
() => [selectorStore.currentService, selectorStore.currentDestService], () => [selectorStore.currentService, selectorStore.currentDestService],
() => { (newVal, oldVal) => {
if (oldVal[0].id === newVal[0].id && !oldVal[1]) {
return;
}
if (oldVal[0].id === newVal[0].id && oldVal[1].id === newVal[1].id) {
return;
}
freshNodes(); freshNodes();
}, },
); );