| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- <template>
- <div class="lakala-container">
- <el-header height="60px">
- <el-menu
- :default-active="activeMenu"
- mode="horizontal"
- @select="handleMenuSelect"
- class="el-menu-horizontal"
- >
- <el-menu-item index="profitShareReceiver">
- <span>分账接收方申请</span>
- </el-menu-item>
- <el-menu-item index="profitShareOrder">
- <span>分帐申请</span>
- </el-menu-item>
- <el-menu-item index="tradeOrder">
- <span>拉卡拉交易记录</span>
- </el-menu-item>
- </el-menu>
- </el-header>
- <el-main>
- <component :is="currentComponent" />
- </el-main>
- </div>
- </template>
- <script>
- import ProfitShareReceiver from './views/ProfitShareReceiver.vue'
- import ProfitShareOrder from './views/ProfitShareOrder.vue'
- import TradeOrder from './views/TradeOrder.vue'
- const componentMap = {
- profitShareReceiver: ProfitShareReceiver,
- profitShareOrder: ProfitShareOrder,
- tradeOrder: TradeOrder
- }
- export default {
- name: 'LakalaIndex',
- components: {
- ProfitShareReceiver,
- ProfitShareOrder,
- TradeOrder
- },
- data() {
- return {
- activeMenu: this.$route.query.tab || 'profitShareReceiver'
- }
- },
- computed: {
- currentComponent() {
- return componentMap[this.activeMenu] || ProfitShareReceiver
- }
- },
- watch: {
- '$route.query.tab'(val) {
- if (val && componentMap[val]) {
- this.activeMenu = val
- }
- }
- },
- methods: {
- handleMenuSelect(index) {
- this.activeMenu = index
- this.$router.replace({ query: { tab: index } })
- }
- }
- }
- </script>
- <style scoped>
- .lakala-container {
- padding: 0;
- height: calc(100vh - 120px);
- }
- .el-header {
- padding: 0;
- background-color: #fff;
- box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
- }
- .el-menu-horizontal {
- height: 60px;
- font-size: 16px;
- }
- .el-main {
- padding: 30px;
- background: #fff;
- margin: 20px;
- border-radius: 8px;
- box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
- flex: 1;
- }
- </style>
|