123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310 |
- <script setup>
- import { useRouter } from 'vue-router'
- import { useLayoutState } from '../hooks/index'
- // import {apiSystemRole} from '@/api/system'
- const router = useRouter()
- const { menuClose } = useLayoutState()
- const navList = ref([
- {
- name: '客户管理',
- path: '/customer',
- IsLevel: 2,
- Children: [
- {
- name: '商家管理',
- path: '/business'
- },
- {
- name: '用户管理',
- path: '/customer/userList'
- }
- ]
- },
- {
- name: 'ETA客户行为统计',
- path: '/',
- IsLevel: 1,
- Children: [
- {
- name: 'ETA客户行为统计',
- path: '/',
- }
- ]
- },
- {
- name: 'ETA试用管理',
- path: '/',
- IsLevel: 1,
- Children: [
- {
- name: 'ETA试用管理',
- path: '/',
- }
- ]
- },
- {
- name: 'ETA社区管理',
- path: '/etaChart',
- IsLevel: 1,
- Children: [
- {
- name: 'ETA社区管理',
- path: '/etaChart/index',
- }
- ]
- },
- {
- name: 'ETA菜单配置',
- path: '/',
- IsLevel: 1,
- Children: [
- {
- name: 'ETA菜单配置',
- path: '/',
- }
- ]
- },
- {
- name: '培训管理',
- path: '/',
- IsLevel: 2,
- Children: [
- {
- name: '视频管理',
- path: '/',
- },
- {
- name: '标签管理',
- path: '/',
- },
- {
- name: '分类管理',
- path: '/',
- }
- ]
- },
- {
- name: '个性化设置',
- path: '/',
- IsLevel: 1,
- Children: [
- {
- name: '个性化设置',
- path: '/',
- }
- ]
- },
- {
- name: '权限配置',
- path: '/',
- IsLevel: 1,
- Children: [
- {
- name: '权限配置',
- path: '/',
- }
- ]
- },
- {
- name: '系统设置',
- path: '/',
- IsLevel: 2,
- Children: [
- {
- name: '更新日志配置',
- path: '/',
- },
- {
- name: '帮助中心配置',
- path: '/',
- }
- ]
- },
- ])
- function getNavList() {
- //mock navList
- /* navList.value = [
- {
- Path:'/customer',
- Name:'客户管理',
- Children:[
- {
- Path:'/customer/tempUserList',
- Name:'临时用户列表',
- }
- ]
- },
- {
- Path:'/authorMgt/authorList',
- Name:'研究员管理',
- Children:[]
- },
- {
- Path:'/mediaMgt',
- Name:'音视频管理',
- Children:[
- {
- Path:'/mediaMgt/audioList',
- Name:'音频管理',
- },
- {
- Path:'/mediaMgt/videoList',
- Name:'视频管理',
- }
- ]
- },
- {
- Path:'/customer/notification',
- Name:'消息推送管理',
- Children:[]
- },
- {
- Path:'/mediaMgt/pictureLib',
- Name:'图片资源库',
- Children:[]
- },
- {
- Path:'/customer/feedbackList',
- Name:'客户反馈',
- Children:[]
- },
- {
- Path:'/system',
- Name:'系统设置',
- Children:[
- {
- Path:'/system/userList',
- Name:'用户列表',
- },
- {
- Path:'/system/roleList',
- Name:'角色管理',
- },
- {
- Path:'/system/authSet',
- Name:'权限管理',
- }
- ]
- },
- ] */
- // apiSystemRole.menuData().then(res=>{
- // if(res.Ret===200){
- // navList.value=res.Data||[]
- // }
- // })
- }
- getNavList()
- function getMenuIcon(item) {
- const iconMap = {
- '/customer': 'menu/customer',
- }
- return iconMap[item] || 'menu/setting'
- }
- </script>
- <template>
- <div :class="['left-wrap', menuClose ? 'left-wrap__close' : '']">
- <t-menu
- class="menu-wrap"
- :value="$route.path"
- :collapsed="menuClose"
- :width="['200px', '80px']"
- >
- <template v-for="level1 in navList" :key="level1.SysMenuId">
- <t-menu-item :value="level1.path" v-if="level1.IsLevel === 1">
- <svg-icon
- :name="getMenuIcon(level1.path)"
- :color="$route.path === level1.path ? '#086CE0' : '#333'"
- style="font-size: 16px"
- ></svg-icon>
- <span style="margin-left: 5px">{{ level1.name }}</span>
- </t-menu-item>
- <t-submenu :value="level1.path" v-if="level1.IsLevel === 2">
- <template #title>
- <svg-icon
- :name="getMenuIcon(level1.path)"
- :color="$route.path === level1.path ? '#086CE0' : '#333'"
- style="font-size: 16px"
- ></svg-icon>
- <span style="margin-left: 5px">{{ level1.name }}</span>
- </template>
- <t-menu-item
- v-for="child in level1.Children"
- :value="child.path"
- :key="child.path"
- >
- <span style="margin-left: 5px">{{ child.name }}</span>
- </t-menu-item>
- </t-submenu>
- </template>
- </t-menu>
- </div>
- </template>
- <style lang="scss" scoped>
- .left-wrap {
- width: 200px;
- z-index: 50;
- position: fixed;
- top: 67px;
- left: 0;
- bottom: 0;
- padding: 8px 0;
- background-color: #fff;
- display: flex;
- flex-direction: column;
- padding-bottom: 111px;
- transition: all 0.5s;
- .menu-wrap {
- flex: 1;
- height: 100%;
- border: none;
- .t-submenu {
- :deep(.t-menu-item) {
- padding-left: var(--t-menu-base-level-padding);
- }
- :deep(.t-submenu__icon-arrow) {
- transform: rotateZ(-90deg) !important;
- }
- &.is-opened {
- :deep(.t-submenu__icon-arrow) {
- transform: rotateZ(0deg) !important;
- border-radius: 4px;
- }
- }
- }
- :deep(.t-menu-item.is-active) {
- background-color: #f3f9ff;
- }
- }
- .user-box {
- background-color: var(--t-menu-hover-bg-color);
- color: #333;
- text-align: center;
- padding: 20px;
- .name-box {
- display: flex;
- justify-content: center;
- align-items: center;
- gap: 0 5px;
- }
- .opt {
- margin: 10px 0;
- cursor: pointer;
- }
- }
- }
- .left-wrap__close {
- width: 80px;
- }
- </style>
|