SystemManagement.vue 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <template>
  2. <div class="system_management">
  3. <el-container>
  4. <Aside
  5. v-bind="{
  6. showMenuIndex: showMenuIndex,
  7. menuList: menuList,
  8. handleMenuSelect: handleMenuSelect,
  9. }"
  10. ></Aside>
  11. <el-main>
  12. <UserManagement v-if="showIndex == '1'"></UserManagement>
  13. <AuthorityManagement v-if="showIndex == '2'"></AuthorityManagement>
  14. </el-main>
  15. </el-container>
  16. </div>
  17. </template>
  18. <script>
  19. export default {
  20. props: {
  21. index: {
  22. type: Number,
  23. },
  24. },
  25. data() {
  26. return {
  27. menuList: null,
  28. showIndex: "1",
  29. showMenuIndex: "1",
  30. };
  31. },
  32. components: {
  33. Aside: () => import("@/components/Currency/Aside.vue"),
  34. UserManagement: () =>
  35. import("@/components/SystemManagement/UserManagement.vue"),
  36. AuthorityManagement: () =>
  37. import("@/components/SystemManagement/AuthorityManagement.vue"),
  38. },
  39. created() {
  40. let that = this;
  41. this.menuList =
  42. this.$store.getters.getMenuListTotal[this.index - 1].children;
  43. t("", this.menuList);
  44. function t(beforeindex, arr) {
  45. if (beforeindex == "") {
  46. beforeindex = arr[0].index;
  47. } else {
  48. beforeindex = beforeindex + "-" + arr[0].index;
  49. }
  50. if (arr[0].children) {
  51. t(beforeindex, arr[0].children);
  52. } else {
  53. that.showIndex = beforeindex;
  54. that.showMenuIndex = beforeindex;
  55. }
  56. }
  57. },
  58. methods: {
  59. handleMenuSelect(index) {
  60. this.showIndex = index;
  61. },
  62. },
  63. };
  64. </script>
  65. <style lang="less" scoped>
  66. .system_management {
  67. height: 100%;
  68. width: 100%;
  69. .el-container {
  70. height: 100%;
  71. .el-main {
  72. padding: 0 0;
  73. }
  74. }
  75. }
  76. </style>