This commit is contained in:
Qiuxia Fan 2022-03-19 11:47:11 +08:00
parent eea641d8ce
commit 81041891fa
2 changed files with 31 additions and 28 deletions

View File

@ -73,6 +73,8 @@ function setLayer(n: string) {
layer.value = "GENERAL";
break;
}
dashboardStore.setLayer(layer.value);
dashboardStore.setEntity(EntityType[1].value);
// appStore.setPageTitle(layer.value);
}
watch(

View File

@ -122,6 +122,7 @@ import router from "@/router";
import { DashboardItem } from "@/types/dashboard";
import { saveFile, readFile } from "@/utils/file";
import { EntityType } from "./data";
import { findLastKey } from "lodash";
/*global Nullable*/
const { t } = useI18n();
@ -241,13 +242,12 @@ async function setRoot(row: DashboardItem) {
})
);
}
}
} else {
if (
d.layer === row.layer &&
d.entity === row.entity &&
d.id !== row.id &&
!row.isRoot &&
d.isRoot
row.isRoot === false &&
d.isRoot === true
) {
d.isRoot = false;
const key = [d.layer, d.entity, d.name.split(" ").join("-")].join("_");
@ -271,6 +271,7 @@ async function setRoot(row: DashboardItem) {
);
}
}
}
items.push(d);
}
dashboardStore.resetDashboards(items);