DataDisplay.vue 1.7 KB

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