diff --git a/src/store/modules/dashboard.ts b/src/store/modules/dashboard.ts index df3a75f9..0e362ffe 100644 --- a/src/store/modules/dashboard.ts +++ b/src/store/modules/dashboard.ts @@ -19,6 +19,7 @@ import { store } from "@/store"; import { GridItemData } from "@/types/dashboard"; interface DashboardState { + showConfig: boolean; layout: GridItemData[]; } @@ -26,6 +27,7 @@ export const dashboardStore = defineStore({ id: "dashboard", state: (): DashboardState => ({ layout: [], + showConfig: false, }), actions: { setLayout(data: GridItemData[]) { @@ -36,11 +38,11 @@ export const dashboardStore = defineStore({ x: 0, y: 0, w: 12, - h: 3, + h: 12, i: String(this.layout.length), }; this.layout = this.layout.map((d: GridItemData) => { - d.y = d.y + 3; + d.y = d.y + newWidget.h; return d; }); this.layout.push(newWidget); @@ -48,6 +50,9 @@ export const dashboardStore = defineStore({ removeWidget(item: GridItemData) { this.layout = this.layout.filter((d: GridItemData) => d.i !== item.i); }, + setConfigPanel(show: boolean) { + this.showConfig = show; + }, }, }); diff --git a/src/views/dashboard/Edit.vue b/src/views/dashboard/Edit.vue index 6713d409..ebcfe97a 100644 --- a/src/views/dashboard/Edit.vue +++ b/src/views/dashboard/Edit.vue @@ -24,39 +24,48 @@ limitations under the License. -->