index.vue 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <template>
  2. <div class="lakala-container">
  3. <el-container>
  4. <el-header height="60px">
  5. <el-menu
  6. :default-active="activeMenu"
  7. mode="horizontal"
  8. @select="handleMenuSelect"
  9. class="el-menu-horizontal"
  10. >
  11. <el-menu-item index="profitShareReceiver">
  12. <span>分账接收方申请</span>
  13. </el-menu-item>
  14. <el-menu-item index="profitShareApply">
  15. <span>分帐申请</span>
  16. </el-menu-item>
  17. </el-menu>
  18. </el-header>
  19. <el-main>
  20. <component
  21. :is="currentComponent"
  22. :axios-instance="axiosInstance"
  23. />
  24. </el-main>
  25. </el-container>
  26. </div>
  27. </template>
  28. <script>
  29. import ProfitShareReceiver from './ProfitShareReceiver.vue'
  30. import ProfitShareApply from './ProfitShareApply.vue'
  31. export default {
  32. name: 'LakalaAdmin',
  33. components: {
  34. ProfitShareReceiver,
  35. ProfitShareApply
  36. },
  37. props: {
  38. axiosInstance: {
  39. type: Object,
  40. default: null
  41. }
  42. },
  43. data() {
  44. return {
  45. activeMenu: 'profitShareReceiver'
  46. }
  47. },
  48. computed: {
  49. currentComponent() {
  50. if (this.activeMenu === 'profitShareReceiver') {
  51. return 'ProfitShareReceiver'
  52. } else if (this.activeMenu === 'profitShareApply') {
  53. return 'ProfitShareApply'
  54. }
  55. return 'ProfitShareReceiver'
  56. }
  57. },
  58. methods: {
  59. handleMenuSelect(key) {
  60. this.activeMenu = key
  61. }
  62. }
  63. }
  64. </script>
  65. <style scoped>
  66. .lakala-container {
  67. padding: 0;
  68. height: calc(100vh - 120px);
  69. }
  70. .el-menu-horizontal {
  71. height: 60px;
  72. font-size: 16px;
  73. }
  74. .el-header {
  75. padding: 0;
  76. background-color: #fff;
  77. box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  78. }
  79. .el-main {
  80. padding: 30px;
  81. background: #fff;
  82. margin: 20px;
  83. border-radius: 8px;
  84. box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  85. flex: 1;
  86. }
  87. </style>