<template>
    <div class="centerChartTop">
        <div class="centerChartTopall" @click="fangda">
            <i class="gongyu gy-quanping1"></i>
        </div>
        <div class="centerChartTophome" @click="gotohome">
            <i class="gongyu gy-zhuye"></i>
        </div>
    </div>
</template>

<script>
import router from '../../router';

export default {
    name: 'centerChartTop',
    data() {
        return {

        }
    },
    methods: {
        gotohome() {
            router.push({
                path: '/home'
            })
        },
        fangda() {
            if (router.currentRoute.fullPath == '/Datascreen') {
                router.push({
                    path: '/screen'
                })
            } else if (router.currentRoute.fullPath == '/screen') {
                router.push({
                    path: '/Datascreen'
                })
            }

            // let full = document.fullscreenElement;
            // //切换为全屏模式
            // if (!full) {
            //     //文档根节点的方法requestFullscreen,实现全屏模式
            //     document.documentElement.requestFullscreen();
            // }
            // window.onresize = () => {
            //     return (() => {
            //         if (document.documentElement.clientWidth < 1080) {
            //             this.colNumOne = 26
            //             this.colNum = 24
            //         } else {
            //             this.colNumOne = 12
            //             this.colNum = 8
            //         }
            //     })()
            // }
        }
    },
    mounted() {
        console.log(router.currentRoute.fullPath)
    }
}
</script>

<style scoped>
.centerChartTop {
    margin-top: 10px;
    /* background-color: pink; */
    position: relative;
    background: url('../../assets/img/beijingtu01.png') no-repeat center;
    background-size: cover;
}

.centerChartTopall {
    position: absolute;
    top: 10px;
    left: 10px;
}

.gy-quanping1 {
    font-size: 30px;
    color: #00BFFF;
}

.centerChartTophome {
    position: absolute;
    top: 10px;
    right: 10px;
}

.gy-zhuye {
    font-size: 30px;
    color: #00BFFF;
}
</style>