index.vue 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <template>
  2. <div class="app-container">
  3. <div class="layout-content">
  4. <keep-alive v-if="$route.meta.keepAlive">
  5. <router-view></router-view>
  6. </keep-alive>
  7. <router-view v-else></router-view>
  8. </div>
  9. <div class="layout-footer" v-if="true">
  10. <TabBar :data="tabbars" @change="handleChange" />
  11. </div>
  12. </div>
  13. </template>
  14. <script>
  15. import TabBar from '@/components/TabBar'
  16. import { mapGetters } from 'vuex'
  17. export default {
  18. name: 'AppLayout',
  19. data() {
  20. return {
  21. tabbars: [
  22. {
  23. title: '学习中心',
  24. to: {
  25. path: '/home'
  26. },
  27. icon: 'home-o'
  28. }
  29. ],
  30. orgArray:["45facc0a-1211-11ec-80ad-005056b86db5","414f2361-ad04-11ed-b13d-005056b86db5"]
  31. }
  32. },
  33. components: {
  34. TabBar
  35. },
  36. computed: {
  37. ...mapGetters(['userinfo'])
  38. },
  39. methods: {
  40. handleChange(v) {
  41. console.log('tab value:', v)
  42. }
  43. },
  44. mounted() {
  45. if (this.userinfo.type == 1) {
  46. this.tabbars.push(
  47. {
  48. title: '学生评价',
  49. to: {
  50. path: '/eva'
  51. },
  52. activeIcon: require('../../assets/images/course/commmt-active1.png'),
  53. normalIcon: require('../../assets/images/course/comment1.png')
  54. },
  55. {
  56. title: '教师中心',
  57. to: {
  58. path: '/test'
  59. },
  60. activeIcon: require('../../assets/images/course/commmt-active1.png'),
  61. normalIcon: require('../../assets/images/course/comment1.png')
  62. },
  63. )
  64. // if(this.orgArray.includes(this.$store.state.user.userinfo.organizeid)){
  65. // this.tabbars.push( {
  66. // title: '课堂观察',
  67. // to: {
  68. // path: '/classObserve'
  69. // },
  70. // activeIcon: require('../../assets/images/course/commmt-active1.png'),
  71. // normalIcon: require('../../assets/images/course/comment1.png')
  72. // })
  73. // }
  74. }
  75. }
  76. }
  77. </script>
  78. <style lang="scss" scoped>
  79. .app-container {
  80. height: 100vh;
  81. .layout-content {
  82. height: calc(100% - 50px);
  83. // height: calc(100%);
  84. }
  85. .layout-footer {
  86. display: block;
  87. height: 50px;
  88. }
  89. }
  90. </style>