budgetIndex.vue 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <template>
  2. <div class="inner-container">
  3. <el-col :span="3">
  4. <el-tabs tab-position="left" v-model="activeName" @tab-click="handleClick">
  5. <el-tab-pane v-for="(item, index) in menuList" :key="index" :name="item.path" :label="item.label">
  6. </el-tab-pane>
  7. </el-tabs>
  8. </el-col>
  9. <el-col :span="21">
  10. <div style="height: 100%">
  11. <router-view />
  12. </div>
  13. </el-col>
  14. </div>
  15. </template>
  16. <script>
  17. export default {
  18. data() {
  19. return {
  20. activeName: "",
  21. showList: [],
  22. routerList: [{
  23. label: "月度部门预算",
  24. path: "/monthExcel",
  25. name: "monthExcel"
  26. },
  27. {
  28. label: "季度部门预算",
  29. path: "/quarterExcel",
  30. name: "quarterExcel"
  31. },
  32. {
  33. label: "年度部门预算",
  34. path: "/yearExcel",
  35. name: "yearExcel"
  36. },
  37. {
  38. label: "采购部门预算",
  39. path: "/projectExcel",
  40. name: "projectExcel",
  41. },
  42. {
  43. label: "预算回复",
  44. path: "/recallAdmin",
  45. name: "recallAdmin"
  46. },
  47. {
  48. label: "预算模板管理",
  49. path: "/budgetList",
  50. name: "budgetList"
  51. },
  52. ],
  53. };
  54. },
  55. computed: {
  56. menuList: function() {
  57. let arr = [];
  58. this.routerList.map((item) => {
  59. this.showList.map((row) => {
  60. if (item.path == row.jspUrl && row.systemflag == '1') {
  61. arr.push(item);
  62. }
  63. });
  64. });
  65. return arr;
  66. },
  67. },
  68. methods: {
  69. handleClick(val) {
  70. if (this.$route.path != this.activeName) {
  71. this.$router.push(this.activeName);
  72. }
  73. },
  74. },
  75. mounted() {
  76. this.activeName = this.$route.path;
  77. },
  78. created() {
  79. JSON.parse(sessionStorage.childrenMenus).map((item) => {
  80. this.showList.push(item);
  81. });
  82. },
  83. watch: {
  84. $route(to, from) {
  85. this.activeName = this.$route.path;
  86. },
  87. },
  88. };
  89. </script>
  90. <style>
  91. .el-tabs__content {
  92. display: none;
  93. }
  94. </style>