|
@@ -12,20 +12,8 @@
|
|
|
:active-text-color="variables.menuActiveText"
|
|
|
:collapse-transition="false"
|
|
|
mode="vertical"
|
|
|
- @select="handleSelect"
|
|
|
>
|
|
|
<sidebar-item v-for="route in routes" :key="route.path" :item="route" :base-path="route.path" />
|
|
|
- <el-submenu index="100">
|
|
|
- <template slot="title">
|
|
|
- <svg-icon icon-class="data" />
|
|
|
- <span slot="title" @mouseover="getGlobalInterface">数据中心</span>
|
|
|
- </template>
|
|
|
- <el-menu-item index="/data/upload-file">jar包管理</el-menu-item>
|
|
|
- <el-submenu v-for="(myMenu,index) in menu" :key="myMenu.menuName" :index="'100-' + index">
|
|
|
- <template slot="title">{{ myMenu.menuName }}</template>
|
|
|
- <el-menu-item v-for="(subMenu,index2) in myMenu.subMenus" :key="'1000-' + index2" :index="getIndex(index,index2)" @click="handleClick(subMenu)">{{ subMenu.subMenuName }}</el-menu-item>
|
|
|
- </el-submenu>
|
|
|
- </el-submenu>
|
|
|
</el-menu>
|
|
|
</el-scrollbar>
|
|
|
</el-main>
|
|
@@ -41,7 +29,6 @@ import { mapGetters } from 'vuex'
|
|
|
import Logo from './Logo'
|
|
|
import SidebarItem from './SidebarItem'
|
|
|
import variables from '@/styles/variables.scss'
|
|
|
-import { getGlobalInterface } from '@/api/data.js'
|
|
|
import { logoutUrl } from '@/apiConfig/requestIP.js'
|
|
|
import Hamburger from '@/components/Hamburger'
|
|
|
|
|
@@ -50,11 +37,11 @@ export default {
|
|
|
computed: {
|
|
|
...mapGetters([
|
|
|
'sidebar',
|
|
|
- 'menu'
|
|
|
+ 'routes'
|
|
|
]),
|
|
|
- routes() {
|
|
|
- return this.$router.options.routes
|
|
|
- },
|
|
|
+ // routes() {
|
|
|
+ // return this.$router.options.routes
|
|
|
+ // },
|
|
|
activeMenu() {
|
|
|
const route = this.$route
|
|
|
const { meta, path } = route
|
|
@@ -74,37 +61,10 @@ export default {
|
|
|
return !this.sidebar.opened
|
|
|
}
|
|
|
},
|
|
|
- mounted() {
|
|
|
- this.getGlobalInterface()
|
|
|
- },
|
|
|
methods: {
|
|
|
toggleSideBar() {
|
|
|
this.$store.dispatch('app/toggleSideBar')
|
|
|
},
|
|
|
- handleSelect(key, keypath) {
|
|
|
- switch (key) {
|
|
|
- case '/data/upload-file':
|
|
|
- this.$router.push({ name: 'jar包管理' })
|
|
|
- break
|
|
|
- }
|
|
|
- },
|
|
|
- handleClick(subMenu) {
|
|
|
- this.$store.dispatch('data/setSubMenu', subMenu)
|
|
|
- this.$router.push({ name: '动态数据' })
|
|
|
- },
|
|
|
- getGlobalInterface() {
|
|
|
- getGlobalInterface()
|
|
|
- .then(res => {
|
|
|
- this.$store.dispatch('data/setMenu', res.data)
|
|
|
- this.$store.dispatch('data/setSubMenu', res.data[0].subMenus[0])
|
|
|
- })
|
|
|
- },
|
|
|
- getIndex(index, index2) {
|
|
|
- if (index + index2 === 0) {
|
|
|
- return '/data/item'
|
|
|
- }
|
|
|
- return '100-' + index + '-' + index2
|
|
|
- },
|
|
|
Logout() {
|
|
|
location.href = logoutUrl
|
|
|
}
|