|
|
@@ -1,36 +1,52 @@
|
|
|
<template>
|
|
|
<div class="side-wp">
|
|
|
<lay-menu class="menu-wp" v-model:selected-key="selectedKey" theme="light" v-model:openKeys="openKeys4" :tree="true">
|
|
|
- <lay-menu-item id="1">
|
|
|
- <template #title>
|
|
|
- <lay-icon type="layui-icon-console" />
|
|
|
- 控制中心
|
|
|
- </template>
|
|
|
- </lay-menu-item>
|
|
|
- <lay-sub-menu id="2">
|
|
|
- <template #title>
|
|
|
- <lay-icon type="layui-icon-set" />
|
|
|
- 系统管理
|
|
|
- </template>
|
|
|
- <lay-menu-item id="3">
|
|
|
- <span class="child-menu">页面管理</span>
|
|
|
+ <template v-for="item in menu_list">
|
|
|
+ <lay-menu-item :id="item.path" v-if="item.childMenu.length == 0" @click="jumpPage(item.path)">
|
|
|
+ <template #title>
|
|
|
+ <lay-icon :type="item.icon" />
|
|
|
+ {{ item.name }}
|
|
|
+ </template>
|
|
|
</lay-menu-item>
|
|
|
- <lay-menu-item id="4">
|
|
|
- <span class="child-menu">用户管理</span>
|
|
|
- </lay-menu-item>
|
|
|
- <lay-menu-item id="5">
|
|
|
- <span class="child-menu">组织管理</span>
|
|
|
- </lay-menu-item>
|
|
|
- </lay-sub-menu>
|
|
|
+ <lay-sub-menu :id="item.path" v-else>
|
|
|
+ <template #title>
|
|
|
+ <lay-icon :type="item.icon" />
|
|
|
+ {{ item.name }}
|
|
|
+ </template>
|
|
|
+ <lay-menu-item :id="items.path" v-for="items in item.childMenu" @click="jumpPage(items.path)">
|
|
|
+ <span class="child-menu">{{ items.name }}</span>
|
|
|
+ </lay-menu-item>
|
|
|
+ </lay-sub-menu>
|
|
|
+ </template>
|
|
|
</lay-menu>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
-import { ref } from "vue";
|
|
|
+import { ref, reactive } from "vue";
|
|
|
+import { useRouter } from "vue-router";
|
|
|
+
|
|
|
+const router = useRouter();
|
|
|
+
|
|
|
+const menu_list = reactive([
|
|
|
+ { name: "控制中心", path: "/dashboard", icon: "layui-icon-console", childMenu: [] },
|
|
|
+ {
|
|
|
+ name: "系统管理",
|
|
|
+ path: "/system",
|
|
|
+ icon: "layui-icon-set",
|
|
|
+ childMenu: [
|
|
|
+ { name: "用户管理", path: "/system/user", icon: "layui-icon-set" },
|
|
|
+ { name: "页面管理", path: "/system/webpage", icon: "layui-icon-set" },
|
|
|
+ { name: "组织管理", path: "/system/organization", icon: "layui-icon-set" },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+]);
|
|
|
+const openKeys4 = ref([]);
|
|
|
+const selectedKey = ref("/dashboard");
|
|
|
|
|
|
-const openKeys4 = ref(["2"]);
|
|
|
-const selectedKey = ref("1");
|
|
|
+const jumpPage = (path: string) => {
|
|
|
+ router.push(path);
|
|
|
+};
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
|
.side-wp {
|
|
|
@@ -49,7 +65,7 @@ const selectedKey = ref("1");
|
|
|
position: relative;
|
|
|
a {
|
|
|
background-color: rgb(232, 252, 247) !important;
|
|
|
- border-right: 2px solid rgb(28, 175, 131) !important;
|
|
|
+ border-right: 2px solid var(--color-theme) !important;
|
|
|
&::after {
|
|
|
content: "";
|
|
|
position: absolute;
|
|
|
@@ -58,14 +74,14 @@ const selectedKey = ref("1");
|
|
|
z-index: 1;
|
|
|
transform: rotate(45deg) translateY(-50%);
|
|
|
transform-origin: center;
|
|
|
- border-top: 1px solid rgb(28, 175, 131) !important;
|
|
|
- border-right: 1px solid rgb(28, 175, 131) !important;
|
|
|
+ border-top: 1px solid var(--color-theme) !important;
|
|
|
+ border-right: 1px solid var(--color-theme) !important;
|
|
|
right: 20px;
|
|
|
top: 50%;
|
|
|
}
|
|
|
span,
|
|
|
i {
|
|
|
- color: rgb(28, 175, 131) !important;
|
|
|
+ color: var(--color-theme) !important;
|
|
|
}
|
|
|
}
|
|
|
}
|