fix dashboard id

This commit is contained in:
Qiuxia Fan 2022-03-22 16:55:59 +08:00
parent 83496dc4b5
commit 3aa77fee66

View File

@ -406,16 +406,14 @@ export const dashboardStore = defineStore({
this.currentDashboard.entity, this.currentDashboard.entity,
this.currentDashboard.name, this.currentDashboard.name,
].join("_"); ].join("_");
this.currentDashboard.id = json.id;
if (this.currentDashboard.id) { if (this.currentDashboard.id) {
sessionStorage.removeItem(key); sessionStorage.removeItem(key);
this.dashboards = this.dashboards.filter( this.dashboards = this.dashboards.filter(
(d: DashboardItem) => d.id !== this.currentDashboard.id (d: DashboardItem) => d.id !== this.currentDashboard.id
); );
} }
this.dashboards.push({ this.dashboards.push(this.currentDashboard);
...this.currentDashboard,
id: json.id,
});
const l = { id: json.id, configuration: c }; const l = { id: json.id, configuration: c };
sessionStorage.setItem(key, JSON.stringify(l)); sessionStorage.setItem(key, JSON.stringify(l));