fix: reset current dashboard due to pages forwarding (#34)

This commit is contained in:
Fine0830
2022-03-23 13:28:47 +08:00
committed by GitHub
parent 049f46a4cf
commit 93161b6ec9
9 changed files with 86 additions and 141 deletions

View File

@@ -167,8 +167,6 @@ function clickEndpoint(scope: any) {
ElMessage.error("No this dashboard");
return;
}
dashboardStore.setEntity(EntityType[2].value);
dashboardStore.setCurrentDashboard(d);
router.push(
`/dashboard/${d.layer}/${d.entity}/${selectorStore.currentService.id}/${scope.row.id}/${d.name}`
);

View File

@@ -168,24 +168,16 @@ function clickInstance(scope: any) {
layer: dashboardStore.layerId,
entity: EntityType[3].value,
});
if (!d) {
ElMessage.error("No this dashboard");
return;
}
dashboardStore.setCurrentDashboard(d);
dashboardStore.setEntity(d.entity);
router.push(
`/dashboard/${d.layer}/${d.entity}/${selectorStore.currentService.id}/${scope.row.id}/${d.name}`
`/dashboard/${d.layer}/${d.entity}/${selectorStore.currentService.id}/${
scope.row.id
}/${d.name.split(" ").join("-")}`
);
}
function changePage(pageIndex: number) {
instances.value = searchInstances.value.splice(
(pageIndex - 1 || 0) * pageSize,
pageSize * (pageIndex || 1)
);
instances.value = searchInstances.value.splice(pageIndex - 1, pageSize);
}
function searchList() {
searchInstances.value = selectorStore.pods.filter((d: { label: string }) =>
d.label.includes(searchText.value)
@@ -201,12 +193,6 @@ watch(
}
}
);
watch(
() => [selectorStore.currentService],
() => {
queryInstance();
}
);
</script>
<style lang="scss" scoped>
@import "./style.scss";

View File

@@ -183,8 +183,6 @@ function clickService(scope: any) {
ElMessage.error("No this dashboard");
return;
}
dashboardStore.setCurrentDashboard(d);
dashboardStore.setEntity(d.entity);
const path = `/dashboard/${d.layer}/${d.entity}/${scope.row.id}/${d.name}`;
router.push(path);