feat: update

This commit is contained in:
Fine 2023-07-11 21:56:30 +08:00
parent a3b040d495
commit 7a2d024bb7
4 changed files with 53 additions and 12 deletions

View File

@ -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<RouteRecordRaw> = [...routesMarketplace, ...routesLayers, ...routesDashboard, ...routesAlarm];
const routes: Array<RouteRecordRaw> = [
...routesMarketplace,
...routesLayers,
...routesDashboard,
...routesAlarm,
...routesSettings,
];
const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL),

View File

@ -38,15 +38,6 @@ export const routesMarketplace: Array<RouteRecordRaw> = [
},
component: () => import("@/views/marketplace/Menus.vue"),
},
{
path: "/marketplace/settings",
name: "Settings",
meta: {
title: "Settings",
activate: true,
},
component: () => import("@/views/marketplace/Settings.vue"),
},
],
},
];

43
src/router/settings.ts Normal file
View File

@ -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<RouteRecordRaw> = [
{
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"),
},
],
},
];

View File

@ -23,7 +23,7 @@ limitations under the License. -->
@click="handleItems(menu)"
:class="currentItems.name === menu.name ? 'active' : ''"
>
<router-link :to="menu.hasGroup || !menu.activate ? '' : menu.path || ''">
<router-link :to="menu.hasGroup ? '' : menu.path || ''">
<div class="title" :class="menu.activate ? (menu.hasGroup ? '' : 'actived-font') : 'disabled'">
{{ menu.title }}</div
>
@ -36,7 +36,7 @@ limitations under the License. -->
</div>
<div class="mt-10 cards">
<el-card shadow="hover" v-for="(item, index) in currentItems.subItems || []" :key="index" class="card">
<router-link :to="item.activate ? item.path || '' : ''">
<router-link :to="item.path || ''">
<div class="title" :class="item.activate ? 'actived-font' : 'disabled'"> {{ item.title }}</div>
</router-link>
<div class="mt-10"> {{ item.description }} </div>