bottomNav.vue 3.14 KB
// 底部导航 组件
<template>
    <div class="container">
        <div class="wrapper">
            <div class="nav-box" :class="[isYZT?'selected':'no-selected']" @click="jumpNav('isYZT', '一张图')">
                <span>一张图</span>
            </div>
            <div class="nav-box" :class="[isCGSC?'selected':'no-selected']" @click="jumpNav('isCGSC', '1')">
                <span>规划成果审查</span>
            </div>
            <div class="nav-box" :class="[isSSJD?'selected':'no-selected']" @click="jumpNav('isSSJD', '2')">
                <span>实施监督预警</span>
            </div>
            <div class="nav-box" :class="[isPGJG?'selected':'no-selected']" @click="jumpNav('isPGJG', '3')">
                <span>批后监管</span>
            </div>
        </div>
    </div>
</template>

<script>
    export default {
        name: 'bottomNav',
        components: {},
        data() {
            return {
                isYZT: true, // 一张图
                isCGSC: false, // 成果审查管理
                isSSJD: false, // 实施监督预警
                isPGJG: false, // 批后监管
                flagArr: ['isYZT', 'isCGSC', 'isSSJD', 'isPGJG']
            }
        },
        mounted() {},
        methods: {
            jumpNav(val, label) {
                // this.flagArr.forEach(ele => {
                //     if (ele == val) this[val] = true;
                //     else this[ele] = false;
                // });
                if(val != 'isYZT') {
                    this.login(val, label);
                };
            },
            login(val, label) {
                $.ajax({
                    type:"POST", 
                    url: this.config.loginUrl + '/api/v1/user/login',
                    dataType:"json",
                    async:false, 
                    data:{username:'案件查处',password:'123'},
                    success:(res) => {
                        window.open(`http://10.6.144.88:10001/frontweb/index.jsp?type=${label}`)
                    },
                    fail: () => {

                    }
                })
            }
        }
    }
</script>

<style scoped>
    .container {
        width: 100%;
    }

    .wrapper {
        width: 50%;
        margin: 0 auto;
        display: flex;
        justify-content: space-around;
        font-size: 24px;
        color: #FFFFFF;
        cursor: pointer;
    }

    .nav-box {
        width: 306px !important;
        text-align: center;
        cursor: pointer;
    }

    .selected {
        background-image: url('../assets/一张图/bg-选中.png');
        background-size: 100% 100%;
        background-repeat: no-repeat;
        height: 39.2px;
    }

    .selected span {
        display: inline-block;
        transform: translateY(-15.2px);
        font-size: 30px;
    }

    .no-selected {
        background-image: url('../assets/一张图/bg-未选中.png');
        background-size: 100% 100%;
        background-repeat: no-repeat;
        height: 24px;
        transform: translateY(16px);
    }

    .no-selected span {
        display: inline-block;
        transform: translateY(-17.2px);
        font-size: 24px;
    }
</style>