achievementsIndex.vue 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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: "budget",
  21. userNo: JSON.parse(window.sessionStorage.userInfo).loginNo,
  22. showList: [],
  23. routerList: [{
  24. label: "集团绩效",
  25. path: "/recallJt",
  26. name: "recallJt"
  27. },
  28. {
  29. label: "部门绩效",
  30. path: "/recallBm",
  31. name: "recallBm"
  32. },
  33. {
  34. label: "副总GS",
  35. path: "/recallGs",
  36. name: "recallGs"
  37. },
  38. {
  39. label: "绩效回复列表",
  40. path: "/kpiRecall",
  41. name: "kpiRecall"
  42. },
  43. {
  44. label: "绩效模板管理",
  45. path: "/kpiMuban",
  46. name: "kpiMuban"
  47. },
  48. ],
  49. };
  50. },
  51. computed: {
  52. menuList: function() {
  53. let arr = [];
  54. this.routerList.map((item) => {
  55. this.showList.map((row) => {
  56. if (item.path == row) {
  57. arr.push(item);
  58. }
  59. });
  60. });
  61. return arr;
  62. },
  63. },
  64. methods: {
  65. handleClick(val) {
  66. if (this.$route.path != this.activeName) {
  67. this.$router.push(this.activeName);
  68. }
  69. },
  70. },
  71. mounted() {
  72. this.activeName = this.$route.path;
  73. },
  74. created() {
  75. JSON.parse(sessionStorage.childrenMenus).map((item) => {
  76. this.showList.push(item.jspUrl);
  77. });
  78. },
  79. watch: {
  80. $route(to, from) {
  81. this.activeName = this.$route.path;
  82. },
  83. },
  84. };
  85. </script>
  86. <style>
  87. .el-tabs__content {
  88. display: none;
  89. }
  90. </style>