<template>
  <!-- 订单交易 -->
  <div class="topTableHeight40">
    <router-view></router-view>
    <ThridMenu :list="tabList"
               :selectedKey="index"
               @selectMenu="changeTab" />
  </div>
</template>

<script lang="ts">
import { defineComponent, ref } from 'vue';
import ThridMenu from '@/common/components/thirdMenu/index.vue';
import { EnumRouterName } from '@/common/constants/enumRouterName';
import { handleMartketThirdRouter } from '@/common/setup/matket/router';
import { sessionStorageUtil } from '@/utils/storage';

export default defineComponent({
    name: EnumRouterName.spot_trade_order_transaction,
    components: {
        ThridMenu,
    },
    setup() {
        const { index, tabList, changeTab } = handleMartketThirdRouter(EnumRouterName.spot_trade_order_transaction);

        const swap = sessionStorageUtil.getItem('transaction_swap');
        if (!swap) {
            index.value = '2';
            changeTab(0, { lable: '商品掉期', code: 'spot_trade_order_transaction_swap' });
            sessionStorageUtil.setItem('transaction_swap', '2');
        }

        return { index, tabList, changeTab };
    },
});
</script>
<style lang="less">
</style>