diff --git a/src/store/modules/dashboard.ts b/src/store/modules/dashboard.ts index aef7aa96..a57e61a2 100644 --- a/src/store/modules/dashboard.ts +++ b/src/store/modules/dashboard.ts @@ -80,6 +80,7 @@ export const dashboardStore = defineStore({ const newItem: LayoutConfig = { ...NewControl, i: index, + id: index, type, metricTypes: [""], metrics: [""], @@ -152,9 +153,11 @@ export const dashboardStore = defineStore({ if (!children.length) { index = "0"; } + const id = `${activedGridItem}-${tabIndex}-${index}`; const newItem: LayoutConfig = { ...NewControl, i: index, + id, type, metricTypes: [""], metrics: [""], diff --git a/src/views/dashboard/List.vue b/src/views/dashboard/List.vue index c2d15e62..f8cb43ef 100644 --- a/src/views/dashboard/List.vue +++ b/src/views/dashboard/List.vue @@ -235,7 +235,6 @@ function optimizeTemplate( children: (LayoutConfig & { moved?: boolean; standard?: unknown; - id?: string; })[] ) { for (const child of children || []) { @@ -407,6 +406,7 @@ async function updateName(d: DashboardItem, value: string) { name: value, }; delete c.id; + delete c.filters; const setting = { id: d.id, configuration: JSON.stringify(c),