From 7a2d024bb7614bc2ceea643fc64ff2ec15ad993f Mon Sep 17 00:00:00 2001 From: Fine Date: Tue, 11 Jul 2023 21:56:30 +0800 Subject: [PATCH] feat: update --- src/router/index.ts | 9 ++++++- src/router/marketplace.ts | 9 ------- src/router/settings.ts | 43 +++++++++++++++++++++++++++++++++ src/views/marketplace/Menus.vue | 4 +-- 4 files changed, 53 insertions(+), 12 deletions(-) create mode 100644 src/router/settings.ts diff --git a/src/router/index.ts b/src/router/index.ts index 4fb334a8..d58dd753 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -20,8 +20,15 @@ import { routesDashboard } from "./dashboard"; import { routesMarketplace } from "./marketplace"; import { routesAlarm } from "./alarm"; import routesLayers from "./layer"; +import { routesSettings } from "./settings"; -const routes: Array = [...routesMarketplace, ...routesLayers, ...routesDashboard, ...routesAlarm]; +const routes: Array = [ + ...routesMarketplace, + ...routesLayers, + ...routesDashboard, + ...routesAlarm, + ...routesSettings, +]; const router = createRouter({ history: createWebHistory(import.meta.env.BASE_URL), diff --git a/src/router/marketplace.ts b/src/router/marketplace.ts index d5f75078..1d362e8f 100644 --- a/src/router/marketplace.ts +++ b/src/router/marketplace.ts @@ -38,15 +38,6 @@ export const routesMarketplace: Array = [ }, component: () => import("@/views/marketplace/Menus.vue"), }, - { - path: "/marketplace/settings", - name: "Settings", - meta: { - title: "Settings", - activate: true, - }, - component: () => import("@/views/marketplace/Settings.vue"), - }, ], }, ]; diff --git a/src/router/settings.ts b/src/router/settings.ts new file mode 100644 index 00000000..3387814d --- /dev/null +++ b/src/router/settings.ts @@ -0,0 +1,43 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * 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. + */ +import type { RouteRecordRaw } from "vue-router"; +import Layout from "@/layout/Index.vue"; + +export const routesSettings: Array = [ + { + path: "", + name: "Settings", + meta: { + title: "Settings", + icon: "settings", + hasGroup: false, + activate: true, + }, + component: Layout, + children: [ + { + path: "/settings", + name: "Settings", + meta: { + title: "Settings", + activate: true, + }, + component: () => import("@/views/marketplace/Settings.vue"), + }, + ], + }, +]; diff --git a/src/views/marketplace/Menus.vue b/src/views/marketplace/Menus.vue index 01e90ab9..c2fc459e 100644 --- a/src/views/marketplace/Menus.vue +++ b/src/views/marketplace/Menus.vue @@ -23,7 +23,7 @@ limitations under the License. --> @click="handleItems(menu)" :class="currentItems.name === menu.name ? 'active' : ''" > - +
{{ menu.title }}
@@ -36,7 +36,7 @@ limitations under the License. -->
- +
{{ item.title }}
{{ item.description }}