diff --git a/src/store/modules/dashboard.ts b/src/store/modules/dashboard.ts index 48392963..c77af644 100644 --- a/src/store/modules/dashboard.ts +++ b/src/store/modules/dashboard.ts @@ -41,6 +41,7 @@ interface DashboardState { currentTabItems: LayoutConfig[]; dashboards: DashboardItem[]; currentDashboard: Nullable; + editMode: boolean; } export const dashboardStore = defineStore({ @@ -58,11 +59,15 @@ export const dashboardStore = defineStore({ currentTabItems: [], dashboards: [], currentDashboard: null, + editMode: true, }), actions: { setLayout(data: LayoutConfig[]) { this.layout = data; }, + setMode(mode: boolean) { + this.editMode = mode; + }, resetDashboards(list: DashboardItem[]) { this.dashboards = list; sessionStorage.setItem("dashboards", JSON.stringify(list)); diff --git a/src/views/Layer.vue b/src/views/Layer.vue index c8323349..08e4c84a 100644 --- a/src/views/Layer.vue +++ b/src/views/Layer.vue @@ -46,6 +46,7 @@ const layer = ref("GENERAL"); getDashboard(); async function getDashboard() { + dashboardStore.setMode(false); dashboardStore.setCurrentDashboard(null); setLayer(String(route.name)); await dashboardStore.setDashboards(); diff --git a/src/views/dashboard/Edit.vue b/src/views/dashboard/Edit.vue index 99a7faed..ab33ad15 100644 --- a/src/views/dashboard/Edit.vue +++ b/src/views/dashboard/Edit.vue @@ -13,11 +13,11 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -->