<template>
    <div class="homeTopLink" @click="jumpLink(advertisement.link,advertisement)">
        <span >{{advertisement.title}}</span>
    </div>
</template>

<script>
    const R3 = window.R3;

    export default {
        data () {
            return {
                advertisement: {
                    title: '',
                    linkType: '',
                    link:'https://burgeon.yuque.com/oqpbqh/aw8pa5/kurbdzums74ot1oq?singleDoc#'
                }
            }
        },
        methods: {
            jumpLink(str,item){
                const { fullPath } = this.$route;
                const {
                    keepAliveModuleName, tableName
                } = this.$store.state.global.activeTab;
                if(tableName=='EMS物流监控'){
                    this.$store.commit('global/tabCloseAppoint', {
                        tableName,
                        routeFullPath: fullPath,
                        keepAliveModuleName,
                    });
                }
                // this.tabClose('EMS物流监控')
                if(item.linkType){
                    R3.store.commit('global/tabOpen', {
                        type: 'tableDetailAction' || 'C',
                        label: 'EMS物流监控',
                        url: `/LINK/EMS物流监控/3556`,
                    });
                }else {
                    window.open(str)
                }
            }
        }
    }
</script>

<style lang="less" scoped>
    .homeTopLink {
        display: flex;
        align-items: center;
        justify-content: center;
        height: 48px;
        // margin: 10px;
        // margin-bottom: 0px;
        // background: #86C6FF;
        text-align: center;
        font-size: 18px;
        font-family: PingFangSC-Medium, PingFang SC;
        font-weight: 500;
        // color: #FFFFFF;
        background: url('../../assets/image/adv.png') no-repeat;
        background-size: cover;
        background-position: center center;
        cursor: pointer;
        // border-bottom: 10px solid #fff;
    }
</style>
