index.vue 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <template>
  2. <el-scrollbar wrap-class="scrollbar-wrapper">
  3. <div class="admin-title" @click="goBigScreen">
  4. <div class="con">
  5. <img src="../../../../../static/logo-dp.png" width="50" />
  6. <span class="version">V0.9.8.5</span>
  7. </div>
  8. </div>
  9. <el-menu
  10. :show-timeout="200"
  11. :default-active="$route.path"
  12. :collapse="isCollapse"
  13. mode="vertical"
  14. >
  15. <sidebar-item
  16. v-for="route in routes"
  17. :key="route.path"
  18. :item="route"
  19. :base-path="route.path"
  20. />
  21. </el-menu>
  22. </el-scrollbar>
  23. </template>
  24. <script>
  25. import { mapGetters } from "vuex";
  26. import SidebarItem from "./SidebarItem";
  27. export default {
  28. components: { SidebarItem },
  29. computed: {
  30. ...mapGetters(["sidebar"]),
  31. routes() {
  32. return this.$router.options.routes;
  33. },
  34. isCollapse() {
  35. return !this.sidebar.opened;
  36. }
  37. },
  38. methods: {
  39. goBigScreen() {
  40. let routeUrl = this.$router.resolve({
  41. path: "/report/bigScreen"
  42. });
  43. window.open(routeUrl.href, "_blank");
  44. }
  45. }
  46. };
  47. </script>
  48. <style lang="scss" scoped>
  49. .admin-title {
  50. // height: 60px;
  51. // line-height: 60px;
  52. text-align: center;
  53. width: 100%;
  54. font-weight: 500;
  55. color: #333;
  56. font-size: 14px;
  57. background: #fff;
  58. .con {
  59. margin: auto;
  60. img {
  61. margin-top: 10px;
  62. }
  63. .version {
  64. display: inline-block;
  65. font-size: 12px;
  66. color: #fff;
  67. background: #4FADFD;
  68. padding: 2px;
  69. border-radius: 10px;
  70. }
  71. }
  72. }
  73. .admin-title:hover {
  74. cursor: pointer;
  75. }
  76. </style>