|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<div class="white pa-3 content">
|
|
|
<el-menu :default-active="activeIndex" unique-opened class="el-menu-demo" mode="horizontal" @select="onSelect">
|
|
|
- <template v-for="_menu in menuList">
|
|
|
+ <template v-for="_menu in menuList">
|
|
|
<PanoramaDetailsMenu :key="_menu.id" :item="_menu"></PanoramaDetailsMenu>
|
|
|
</template>
|
|
|
</el-menu>
|
|
@@ -31,6 +31,9 @@ import {
|
|
|
findPath
|
|
|
} from '@/utils/panorama'
|
|
|
import qs from 'qs'
|
|
|
+const DEFAULT_COMPONENT = {
|
|
|
+ 基础信息: 'humanResources/panorama/dynamic/panoramaDetailsBaseInfo'
|
|
|
+}
|
|
|
export default {
|
|
|
name: 'panorama-details',
|
|
|
components: { PanoramaDetailsMenu },
|
|
@@ -38,13 +41,17 @@ export default {
|
|
|
return {
|
|
|
activeIndex: '',
|
|
|
breadcrumbs: [],
|
|
|
- componentsPath: null
|
|
|
+ componentsPath: null,
|
|
|
+ defaultItems: []
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
...mapGetters(['routes', 'organizationTree']),
|
|
|
menuList () {
|
|
|
- return this.filterRoute(JSON.parse(JSON.stringify(this.routes)))
|
|
|
+ return [
|
|
|
+ ...this.defaultItems,
|
|
|
+ ...this.filterRoute(JSON.parse(JSON.stringify(this.routes)))
|
|
|
+ ]
|
|
|
},
|
|
|
menuPath () {
|
|
|
return findPath(this.menuList, this.activeIndex, [], {
|
|
@@ -60,7 +67,13 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
created () {
|
|
|
- this.activeIndex = this.$route.query.path || 'humanResources/roster'
|
|
|
+ this.defaultItems = Object.keys(DEFAULT_COMPONENT).map(key => {
|
|
|
+ return {
|
|
|
+ label: key,
|
|
|
+ component: DEFAULT_COMPONENT[key]
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.activeIndex = this.$route.query.path || this.defaultItems[0].component
|
|
|
this.getDept()
|
|
|
this.runPanorama()
|
|
|
},
|
|
@@ -116,7 +129,13 @@ export default {
|
|
|
flex: 1;
|
|
|
}
|
|
|
}
|
|
|
-::v-deep .el-menu-demo>.el-submenu {
|
|
|
- overflow: hidden;
|
|
|
+::v-deep .el-menu-demo {
|
|
|
+ &>.el-submenu {
|
|
|
+ overflow: hidden;
|
|
|
+ }
|
|
|
+ &>.is-active {
|
|
|
+ background-color: unset !important;
|
|
|
+ color: #303133 !important;
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|