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. -->
-
Configurations
+
+ Configurations +
diff --git a/src/views/dashboard/panel/Layout.vue b/src/views/dashboard/panel/Layout.vue index d15b4774..ad175775 100644 --- a/src/views/dashboard/panel/Layout.vue +++ b/src/views/dashboard/panel/Layout.vue @@ -16,12 +16,9 @@ limitations under the License. --> ") - no-repeat; - background-position: bottom right; - padding: 0 8px 8px 0; - background-repeat: no-repeat; - background-origin: content-box; - box-sizing: border-box; - cursor: pointer; -} diff --git a/src/views/dashboard/panel/Widget.vue b/src/views/dashboard/panel/Widget.vue index 01e4e67b..f1fe184a 100644 --- a/src/views/dashboard/panel/Widget.vue +++ b/src/views/dashboard/panel/Widget.vue @@ -17,7 +17,12 @@ limitations under the License. -->
title
- +
@@ -37,6 +42,9 @@ const dashboardStore = useDashboardStore(); function removeWidget() { dashboardStore.removeWidget(props.item); } +function setConfig() { + dashboardStore.setConfigPanel(true); +}