|
@@ -1,45 +1,107 @@
|
|
|
<script setup lang="ts">
|
|
|
+import type { BaseMenu } from '@/types/Promotion/Menu'
|
|
|
+
|
|
|
+import router from '@/router'
|
|
|
+import Menu from '@/components/navigation/Menu.vue'
|
|
|
+
|
|
|
import { ref } from 'vue'
|
|
|
|
|
|
+// <el-menu
|
|
|
+// :default-active="defaultActive"
|
|
|
+// class="promotionMenu"
|
|
|
+// :collapse="isCollapse"
|
|
|
+// style="min-width: 180px"
|
|
|
+// router
|
|
|
+// >
|
|
|
+// <template v-for="menuItem in menu" :key="menuItem.name">
|
|
|
+// <!-- 有子菜单 -->
|
|
|
+// <el-sub-menu v-if="menuItem.children" :index="menuItem.name">
|
|
|
+// <template #title>
|
|
|
+// <el-icon><location /></el-icon>
|
|
|
+// <span>{{ menuItem.title }}</span>
|
|
|
+// </template>
|
|
|
+// <el-menu-item v-for="item in menuItem.children" :index="item.path">
|
|
|
+// <el-icon><document /></el-icon>
|
|
|
+// <span>{{ item.title }}</span>
|
|
|
+// </el-menu-item>
|
|
|
+// </el-sub-menu>
|
|
|
+// <!-- 无子菜单 -->
|
|
|
+// <el-menu-item :index="menuItem.path" v-else>
|
|
|
+// <el-icon><document /></el-icon>
|
|
|
+// <span>{{ menuItem.title }}</span>
|
|
|
+// </el-menu-item>
|
|
|
+// </template>
|
|
|
+// </el-menu>
|
|
|
+// <div class="sideBarFold" @click="isCollapse = !isCollapse">
|
|
|
+// <el-icon :size="20"><Fold /></el-icon>
|
|
|
+// </div>
|
|
|
+
|
|
|
+// 侧边菜单的展示控制
|
|
|
const isCollapse = ref(false)
|
|
|
+
|
|
|
+// 菜单默认选中
|
|
|
+const defaultActive = ref<string>(router.currentRoute.value.path)
|
|
|
+
|
|
|
+const menu: Array<BaseMenu> = [
|
|
|
+ {
|
|
|
+ name: 'adManage',
|
|
|
+ title: '广告管理',
|
|
|
+ iconDefault: '/img/promotion/ad-manage-default.svg',
|
|
|
+ iconActive: '/img/promotion/ad-manage-active.svg',
|
|
|
+ path: '/promotion/ttAd',
|
|
|
+ children: [
|
|
|
+ {
|
|
|
+ name: 'TtAd',
|
|
|
+ title: '巨量广告',
|
|
|
+ iconDefault: '/img/promotion/ad-tt.svg',
|
|
|
+ path: '/promotion/ttAd',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: 'TencentAd',
|
|
|
+ title: '腾讯广告',
|
|
|
+ iconDefault: '/img/promotion/ad-tencent.svg',
|
|
|
+ path: '/promotion/tencentAd',
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: 'accManage',
|
|
|
+ title: '账号管理',
|
|
|
+ iconDefault: '/img/promotion/acc-manage-default.svg',
|
|
|
+ iconActive: '/img/promotion/acc-manage-active.svg',
|
|
|
+ path: '/promotion/accTtAd',
|
|
|
+ children: [
|
|
|
+ {
|
|
|
+ name: 'AccTtAd',
|
|
|
+ title: '巨量广告',
|
|
|
+ iconDefault: '/img/promotion/ad-tt.svg',
|
|
|
+ path: '/promotion/accTtAd',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: 'AccTencentAd',
|
|
|
+ title: '腾讯广告',
|
|
|
+ iconDefault: '/img/promotion/ad-tencent.svg',
|
|
|
+ path: '/promotion/accTencentAd',
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+]
|
|
|
</script>
|
|
|
|
|
|
<template>
|
|
|
<div class="promotionContainer">
|
|
|
<div class="promotionSiderBar">
|
|
|
- <el-menu default-active="2" class="promotionMenu" :collapse="isCollapse">
|
|
|
- <el-sub-menu index="1">
|
|
|
- <template #title>
|
|
|
- <el-icon><location /></el-icon>
|
|
|
- <span>Navigator One</span>
|
|
|
- </template>
|
|
|
- <el-menu-item-group title="Group One">
|
|
|
- <el-menu-item index="1-1">item one</el-menu-item>
|
|
|
- <el-menu-item index="1-2">item two</el-menu-item>
|
|
|
- </el-menu-item-group>
|
|
|
- <el-menu-item-group title="Group Two">
|
|
|
- <el-menu-item index="1-3">item three</el-menu-item>
|
|
|
- </el-menu-item-group>
|
|
|
- <el-sub-menu index="1-4">
|
|
|
- <template #title>item four</template>
|
|
|
- <el-menu-item index="1-4-1">item one</el-menu-item>
|
|
|
- </el-sub-menu>
|
|
|
- </el-sub-menu>
|
|
|
- <el-menu-item index="2">
|
|
|
- <el-icon><icon-menu /></el-icon>
|
|
|
- <span>Navigator Two</span>
|
|
|
- </el-menu-item>
|
|
|
- <el-menu-item index="3" disabled>
|
|
|
- <el-icon><document /></el-icon>
|
|
|
- <span>Navigator Three</span>
|
|
|
- </el-menu-item>
|
|
|
- <el-menu-item index="4">
|
|
|
- <el-icon><setting /></el-icon>
|
|
|
- <span>Navigator Four</span>
|
|
|
- </el-menu-item>
|
|
|
- </el-menu>
|
|
|
+ <Menu
|
|
|
+ mode="vertical"
|
|
|
+ :menu-list="menu"
|
|
|
+ :default-active="defaultActive"
|
|
|
+ :router="true"
|
|
|
+ :menu-style="'min-width: 180px'"
|
|
|
+ ></Menu>
|
|
|
+ </div>
|
|
|
+ <div class="promotionContent">
|
|
|
+ <router-view></router-view>
|
|
|
</div>
|
|
|
- <div class="promotionContent"></div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -48,4 +110,26 @@ const isCollapse = ref(false)
|
|
|
width: 100%;
|
|
|
display: flex;
|
|
|
}
|
|
|
+
|
|
|
+.promotionSiderBar {
|
|
|
+ width: 180px;
|
|
|
+ position: relative;
|
|
|
+}
|
|
|
+
|
|
|
+.promotionMenu {
|
|
|
+ height: 93vh;
|
|
|
+}
|
|
|
+
|
|
|
+.sideBarFold {
|
|
|
+ position: absolute;
|
|
|
+ right: 20px;
|
|
|
+ bottom: 20px;
|
|
|
+ cursor: pointer;
|
|
|
+}
|
|
|
+
|
|
|
+.promotionContent {
|
|
|
+ width: calc(100% - 180px);
|
|
|
+
|
|
|
+ /* padding: 20px; */
|
|
|
+}
|
|
|
</style>
|