qianlishi 3 years ago
parent f6364315fc
commit 5d531557c7

@ -3,36 +3,47 @@
<div class="admin-title" @click="goBigScreen"> <div class="admin-title" @click="goBigScreen">
<img src="../../../../../static/logo-dp.png" width="50" class="mt10" /> <img src="../../../../../static/logo-dp.png" width="50" class="mt10" />
</div> </div>
<el-menu :show-timeout="200" :default-active="$route.path" :collapse="isCollapse" mode="vertical"> <el-menu
<sidebar-item v-for="route in routes" :key="route.path" :item="route" :base-path="route.path" /> :show-timeout="200"
:default-active="$route.path"
:collapse="isCollapse"
mode="vertical"
>
<sidebar-item
v-for="route in routes"
:key="route.path"
:item="route"
:base-path="route.path"
/>
</el-menu> </el-menu>
<div class="version">V0.9.5</div>
</el-scrollbar> </el-scrollbar>
</template> </template>
<script> <script>
import { mapGetters } from 'vuex' import { mapGetters } from "vuex";
import SidebarItem from './SidebarItem' import SidebarItem from "./SidebarItem";
export default { export default {
components: { SidebarItem }, components: { SidebarItem },
computed: { computed: {
...mapGetters(['sidebar']), ...mapGetters(["sidebar"]),
routes() { routes() {
return this.$router.options.routes return this.$router.options.routes;
}, },
isCollapse() { isCollapse() {
return !this.sidebar.opened return !this.sidebar.opened;
}, }
}, },
methods: { methods: {
goBigScreen() { goBigScreen() {
let routeUrl = this.$router.resolve({ let routeUrl = this.$router.resolve({
path: '/report/bigScreen', path: "/report/bigScreen"
}) });
window.open(routeUrl.href, '_blank') window.open(routeUrl.href, "_blank");
}, }
}, }
} };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@ -49,4 +60,11 @@ export default {
.admin-title:hover { .admin-title:hover {
cursor: pointer; cursor: pointer;
} }
.version {
color: #999;
position: absolute;
bottom: 10px;
font-size: 16px;
margin-left: 10px;
}
</style> </style>

Loading…
Cancel
Save