SecondaryDevelopment.vue 2.2 KB

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