index.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <template>
  2. <div id="index">
  3. <el-row>
  4. <el-col :span="24" class="info">
  5. <el-col :span="24" class="top">
  6. <heads></heads>
  7. </el-col>
  8. <el-col :span="24" class="main">
  9. <div class="w_1200">
  10. <el-col :span="4" class="mainMenu">
  11. <menus @setRight="setRight"></menus>
  12. </el-col>
  13. <el-col :span="19" class="mainMess">
  14. <top :title="topTitle"></top>
  15. <div style="padding:10px">
  16. <component :is="cpt"></component>
  17. </div>
  18. </el-col>
  19. </div>
  20. </el-col>
  21. <el-col :span="24" class="foot">
  22. <foot></foot>
  23. </el-col>
  24. </el-col>
  25. </el-row>
  26. </div>
  27. </template>
  28. <script>
  29. /* eslint-disable vue/no-unused-components */
  30. import menus from './menuInfo.vue';
  31. import top from './lefttop.vue';
  32. import role from './role/index.vue';
  33. import permission from './permission/index.vue';
  34. import adminUser from './adminUser/index.vue';
  35. import heads from '@/layout/userCenter/heads.vue';
  36. import foot from '@/layout/live/foot.vue';
  37. import { mapState, createNamespacedHelpers } from 'vuex';
  38. export default {
  39. name: 'index',
  40. props: {},
  41. components: {
  42. heads,
  43. foot,
  44. role,
  45. permission,
  46. adminUser,
  47. menus,
  48. top,
  49. },
  50. data: function() {
  51. return {
  52. cpt: 'role',
  53. topTitle: '',
  54. };
  55. },
  56. created() {},
  57. methods: {
  58. setRight(menu) {
  59. let { name, cpt } = menu;
  60. this.$set(this, `topTitle`, name);
  61. // this.$set(this, `cpt`, cpt);
  62. },
  63. },
  64. computed: {
  65. ...mapState(['user']),
  66. pageTitle() {
  67. return `${this.$route.meta.title}`;
  68. },
  69. },
  70. metaInfo() {
  71. return { title: this.$route.meta.title };
  72. },
  73. };
  74. </script>
  75. <style lang="less" scoped>
  76. .w_1200 {
  77. width: 80%;
  78. margin: 0 auto;
  79. }
  80. .info {
  81. background-color: #e9edf6;
  82. }
  83. .main {
  84. min-height: 666px;
  85. margin: 15px 0;
  86. }
  87. .mainMenu {
  88. width: 20%;
  89. min-height: 666px;
  90. background-color: #fff;
  91. }
  92. .mainMess {
  93. float: right;
  94. min-height: 666px;
  95. background-color: #fff;
  96. }
  97. </style>