暫無描述

com.vue 2.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <template>
  2. <div class="app-wrapper" :class="classObj">
  3. <div v-if="device==='mobile'&&sidebar.opened" class="drawer-bg" @click="handleClickOutside"></div>
  4. <TopNavbar></TopNavbar>
  5. <sidebar class="sidebar-container"></sidebar>
  6. <div class="main-container">
  7. <nava></nava>
  8. <app-main></app-main>
  9. </div>
  10. <div class="main-footer">
  11. <div style="margin:0 auto;line-height:20px;color:#939393; padding:12px 0;overflow: hidden;width:380px">
  12. <a style="margin: 0 5px 0 0;float:left">京ICP备16026450号-2 |</a>
  13. <a target="_blank" href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=11010802027571" style="display:inline-block;text-decoration:none;float:left">
  14. <img src="./img/beian.png" width="18" style="float:left;" />
  15. <p style="float:left;margin: 0 0 0 5px;">京公网安备 11010802027571号</p>
  16. </a>
  17. </div>
  18. </div>
  19. </div>
  20. </template>
  21. <script>
  22. import { mapGetters } from 'vuex'
  23. import { TopNavbar, nava, Sidebar, AppMain } from './components'
  24. import ResizeMixin from './mixin/ResizeHandler'
  25. export default {
  26. name: 'com',
  27. components: {
  28. TopNavbar,
  29. nava,
  30. Sidebar,
  31. AppMain
  32. },
  33. mixins: [ResizeMixin],
  34. computed: {
  35. ...mapGetters([
  36. 'roles'
  37. ]),
  38. sidebar() {
  39. return this.$store.state.app.sidebar
  40. },
  41. device() {
  42. return this.$store.state.app.device
  43. },
  44. classObj() {
  45. return {
  46. hideSidebar: !this.sidebar.opened,
  47. openSidebar: this.sidebar.opened,
  48. withoutAnimation: this.sidebar.withoutAnimation,
  49. mobile: this.device === 'mobile'
  50. }
  51. }
  52. },
  53. methods: {
  54. handleClickOutside() {
  55. this.$store.dispatch('CloseSideBar', { withoutAnimation: false })
  56. }
  57. }
  58. }
  59. </script>
  60. <style rel="stylesheet/scss" lang="scss" scoped>
  61. @import "src/styles/mixin.scss";
  62. .app-wrapper {
  63. @include clearfix;
  64. position: relative;
  65. height: 100%;
  66. width: 100%;
  67. &.mobile.openSidebar {
  68. position: fixed;
  69. top: 0;
  70. }
  71. }
  72. .drawer-bg {
  73. background: #000;
  74. opacity: 0.3;
  75. width: 100%;
  76. top: 0;
  77. height: 100%;
  78. position: absolute;
  79. z-index: 999;
  80. }
  81. .main-footer {
  82. z-index: 2002;
  83. position: fixed;
  84. background: rgba(48, 65, 86, 1);
  85. border-top: 1px solid #e6e6e6;
  86. bottom: 0;
  87. left: 0;
  88. right: 0;
  89. font-size: 14px;
  90. text-align: center;
  91. color: #333;
  92. }
  93. </style>