<template>
    <div>
        <div class="channelMenuTitle_skin5" v-if="componentStyle == 1 || componentStyle == 2 || componentStyle == 3">
            {{ title }}
        </div>
        <!--样式1-->
        <div class="channelMenuList" v-if="componentStyle == 1">
            <div v-for="item in navigateData">
                <NuxtLink :to="{ path: `/${targetSegment}/${item.aLIas_pinyin}/list-1.html` }"
                    :class="{ active: targetSegment2 == item.aLIas_pinyin }">{{ item.alias }}</NuxtLink>
            </div>
        </div>
        <!--样式2-->
        <div class="channelMenuList menuListStyle2" v-if="componentStyle == 2">
            <div v-for="item in navigateData">
                <NuxtLink :to="{ path: `/${targetSegment}/${item.aLIas_pinyin}/list-1.html` }"
                    :class="{ active: targetSegment2 == item.aLIas_pinyin }">{{ item.alias }}</NuxtLink>
            </div>
        </div>
        <!-- 样式3 -->
        <div class="channelMenuList menuListStyle3" v-if="componentStyle == 3">
            <div v-for="item in navigateData">
                <NuxtLink :to="{ path: `/${targetSegment}/${item.aLIas_pinyin}/list-1.html` }"
                    :class="{ active: targetSegment2 == item.aLIas_pinyin }">{{ item.alias }}</NuxtLink>
            </div>
        </div>
        <!-- 样式4 -->
        <div class="channelMenuList menuListStyle4" v-if="componentStyle == 4">
            <div class="menuTitle">{{ title }}</div>
            <div class="menulist" v-for="item in navigateData">
                <NuxtLink :to="{ path: `/${targetSegment}/${item.aLIas_pinyin}/list-1.html` }"
                    :class="{ active: targetSegment2 == item.aLIas_pinyin }">
                    <span class="title">{{ item.alias }}</span>
                    <span class="line" v-if="item.alias != navigateData[navigateData.length - 1].alias">/</span>
                </NuxtLink>
            </div>
        </div>
        <!-- 样式5 -->
        <div class="channelMenuList menuListStyle4 menuListStyle5" v-if="componentStyle == 5">
            <div class="menuTitle">{{ title }}</div>
            <div class="menulist" v-for="item in navigateData">
                <NuxtLink :to="{ path: `/${targetSegment}/${item.aLIas_pinyin}/list-1.html` }"
                    :class="{ active: targetSegment2 == item.aLIas_pinyin }">
                    <span class="title">{{ item.alias }}</span>
                    <span class="line" v-if="item.alias != navigateData[navigateData.length - 1].alias">/</span>
                </NuxtLink>
            </div>
        </div>
        <!-- 样式6 -->
        <div class="channelMenuList menuListStyle4 menuListStyle6" v-if="componentStyle == 6">
            <div class="menuTitle">{{ title }}</div>
            <div class="menulist" v-for="item in navigateData">
                <NuxtLink :to="{ path: `/${targetSegment}/${item.aLIas_pinyin}/list-1.html` }"
                    :class="{ active: targetSegment2 == item.aLIas_pinyin }">
                    <span class="title">{{ item.alias }}</span>
                    <span class="line" v-if="item.alias != navigateData[navigateData.length - 1].alias">/</span>
                </NuxtLink>
            </div>
        </div>
        <!--样式7-->
        <div class="menuListStyle7" v-if="componentStyle == 7">
            <div class="channelMenuListTitle">{{ title }}</div>
            <div class="hannelMenuListFloatMenu">
                <div v-for="item in navigateData">
                    <NuxtLink :to="{ path: `/${targetSegment}/${item.aLIas_pinyin}/list-1.html` }"
                        :class="{ active: targetSegment2 == item.aLIas_pinyin }">
                        <span class="title">{{ item.alias }}</span>
                    </NuxtLink>
                </div>
            </div>
        </div>
        <!--样式8-->
        <div class="menuListStyle7 menuListStyle8" v-if="componentStyle == 8">
            <div class="channelMenuListTitle">{{ title }}</div>
            <div class="hannelMenuListFloatMenu">
                <div v-for="item in navigateData">
                    <NuxtLink :to="{ path: `/${targetSegment}/${item.aLIas_pinyin}/list-1.html` }"
                        :class="{ active: targetSegment2 == item.aLIas_pinyin }">
                        <span class="title">{{ item.alias }}</span>
                    </NuxtLink>
                </div>
            </div>
        </div>
        <!--样式9-->
        <div class="menuListStyle7 menuListStyle9" v-if="componentStyle == 9">
            <div class="channelMenuListTitle">{{ title }}</div>
            <div class="hannelMenuListFloatMenu">
                <div v-for="item in navigateData">
                    <NuxtLink :to="{ path: `/${targetSegment}/${item.aLIas_pinyin}/list-1.html` }"
                        :class="{ active: targetSegment2 == item.aLIas_pinyin }">
                        <span class="title">{{ item.alias }}</span>
                    </NuxtLink>
                </div>
            </div>
        </div>
        <!--样式10-->
        <div class="menuListStyle7 menuListStyle9 menuListStyle8" v-if="componentStyle == 10">
            <div class="channelMenuListTitle">{{ title }}</div>
            <div class="hannelMenuListFloatMenu">
                <div v-for="item in navigateData">
                    <NuxtLink :to="{ path: `/${targetSegment}/${item.aLIas_pinyin}/list-1.html` }"
                        :class="{ active: targetSegment2 == item.aLIas_pinyin }">
                        <span class="title">{{ item.alias }}</span>
                    </NuxtLink>
                </div>
            </div>
        </div>
        <!--样式11-->
        <div class="menuListStyle11" v-if="componentStyle == 11">
            <div class="style11">
                <div class="channelMenuListTitle">
                    <span>{{ title }}</span>
                </div>
                <div class="hannelMenuListFloatMenu">
                    <div v-for="item in navigateData">
                        <NuxtLink :to="{ path: `/${targetSegment}/${item.aLIas_pinyin}/list-1.html` }"
                            :class="{ active: targetSegment2 == item.aLIas_pinyin }">
                            <span class="title">{{ item.alias }}</span>
                        </NuxtLink>
                    </div>
                </div>
            </div>
        </div>
        <!--样式12-->
        <div class="menuListStyle12" v-if="componentStyle == 12">
            <div class="channelMenuListTitle">
                <span>{{ title }}</span>
            </div>
            <div class="hannelMenuListFloatMenu">
                <div v-for="item in navigateData">
                    <NuxtLink :to="{ path: `/${targetSegment}/${item.aLIas_pinyin}/list-1.html` }"
                        :class="{ active: targetSegment2 == item.aLIas_pinyin }">
                        <span class="title">{{ item.alias }}</span>
                    </NuxtLink>
                </div>
            </div>
        </div>
        <!--样式13-->
        <div class="menuListStyle13" v-if="componentStyle == 13">
            <div class="channelMenuListTitle">
                <span>{{ title }}</span>
            </div>
            <div class="hannelMenuListFloatMenu">
                <div v-for="item in navigateData">
                    <NuxtLink :to="{ path: `/${targetSegment}/${item.aLIas_pinyin}/list-1.html` }"
                        :class="{ active: targetSegment2 == item.aLIas_pinyin }">
                        <span class="title">{{ item.alias }}</span>
                    </NuxtLink>
                </div>
            </div>
        </div>
        <!--样式14-->
        <div class="menuListStyle14" v-if="componentStyle == 14">
            <div class="channelMenuListTitle">
                <span>{{ title }}</span>
            </div>
            <div class="hannelMenuListFloatMenu">
                <div v-for="item in navigateData">
                    <NuxtLink :to="{ path: `/${targetSegment}/${item.aLIas_pinyin}/list-1.html` }"
                        :class="{ active: targetSegment2 == item.aLIas_pinyin }">
                        <span class="title">{{ item.alias }}</span>
                    </NuxtLink>
                </div>
            </div>
        </div>
        <!--样式15-->
        <div class="menuListStyle15" v-if="componentStyle == 15">
            <div class="channelMenuListTitle">
                <span>{{ title }}</span>
            </div>
            <div class="hannelMenuListFloatMenu">
                <div v-for="item in navigateData">
                    <NuxtLink :to="{ path: `/${targetSegment}/${item.aLIas_pinyin}/list-1.html` }"
                        :class="{ active: targetSegment2 == item.aLIas_pinyin }">
                        <span class="title">{{ item.alias }}</span>
                    </NuxtLink>
                </div>
            </div>
        </div>
        <!--样式16-->
        <div class="menuListStyle16" v-if="componentStyle == 16">
            <div class="channelMenuListTitle">
                <span>{{ title }}</span>
            </div>
            <div class="hannelMenuListFloatMenu">
                <div v-for="item in navigateData">
                    <NuxtLink :to="{ path: `/${targetSegment}/${item.aLIas_pinyin}/list-1.html` }"
                        :class="{ active: targetSegment2 == item.aLIas_pinyin }">
                        <span class="title">{{ item.alias }}</span>
                    </NuxtLink>
                </div>
            </div>
        </div>
        <!--样式17-->
        <div class="menuListStyle17" v-if="componentStyle == 17">
            <div class="channelMenuListTitle">
                <span>{{ title }}</span>
            </div>
            <div class="hannelMenuListFloatMenu">
                <div v-for="item in navigateData">
                    <NuxtLink :to="{ path: `/${targetSegment}/${item.aLIas_pinyin}/list-1.html` }"
                        :class="{ active: targetSegment2 == item.aLIas_pinyin }">
                        <span class="title">{{ item.alias }}</span>
                    </NuxtLink>
                </div>
            </div>
        </div>
    </div>
</template>

<script setup>
//引入vue
import { ref } from 'vue';
//获得新闻数据
const props = defineProps({
    componentStyle: Number,//样式编号
    navigateData: Array,//子导航数据
    routeId: Number//导航对应的cid
});
//获得导航名称
const title = ref("")
const mkdata = await requestDataPromise('/web/getOneWebsiteCategory', {
    method: 'GET',
    query: {
        'catid': props.routeId,
    },
});
if (mkdata.code == 200) {
    if(mkdata.data.parent_name){
        title.value = mkdata.data.parent_name;
    }else{
        title.value = mkdata.data.alias;
    }
}
//获取当前url路径
const route = useRoute();
//获得当前的完整路径
const fullPath = route.path;
const segments = fullPath.split('/');
const targetSegment = segments[1];
const targetSegment2 = segments[2];

//判断当前为第几层的列表页
// const routeLevel = ref(0);
// if(route.name == "dir-list-id"){
//     routeLevel.value = 1;
//     console.log("当前的路由层级为：" + routeLevel.value);
// }
// if(route.name == "dir-dir-list-id"){
//     routeLevel.value = 2;
//     console.log("当前的路由层级为：" + routeLevel.value);
// }
</script>

<style lang="less" scoped>
//基本样式 start ---------------------------------------->
.channelMenuTitle_skin5 {
    width: 1200px;
    height: 32px;
    line-height: 32px;
    font-size: 24px;
    color: #3848a0;
    font-weight: bold;
    text-align: center;
    background: url('https://img.bjzxtw.org.cn/pre/image/png/20251111/1762826865714668.png') no-repeat center center;
    margin-bottom: 25px;
}

.channelMenuList {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    color: #333;
    border-bottom: 2px solid #3848a0;
    padding-bottom: 15px;

    div {
        font-size: 16px;
        font-weight: bold;
        width: 150px;
        height: 22px;
        line-height: 22px;

        a {
            color: #333;
            display: block;
            text-align: center;

            &:hover {
                color: #3848a0;
            }
        }

        a.active {
            color: #3848a0;
        }

        &:first-child {
            color: #3848a0;
        }
    }
}

//基本样式 end ---------------------------------------->

//样式2 start ---------------------------------------->
.menuListStyle2 {
    border-bottom: 0;
}

//样式2 end ---------------------------------------->
//样式3
.menuListStyle3 {
    border-bottom: 0;

    div {
        text-align: center;
        height: 36px;

        &:hover {
            color: #3848a0;
            padding-bottom: 15px;
            border-bottom: 2px solid #3848a0;
            box-sizing: border-box;
        }
    }
}

//样式4
.menuListStyle4 {
    height: 54px;
    padding-top: 23px;
    padding-bottom: 0px;

    .menuTitle {
        width: 140px;
        font-size: 26px;
        font-weight: bold;
        color: #3848a0;
        margin-right: 80px;
    }

    .menulist {
        display: flex;
        justify-content: flex-start;
        align-items: center;
        font-size: 16px;
        font-weight: bold;
        color: #333;
        padding: 15px 0;

        a {
            display: flex;
            justify-content: flex-start;
            align-items: center;

            .title {
                width: 120px;
                height: 16px;
                text-align: center;

                &:hover {
                    color: #3848a0;
                }
            }

            .line {
                color: #3848a0;
                padding-top: 5px;
            }
        }
    }
}

//样式5
.menuListStyle5 {
    border-bottom: none;
}

//样式6
.menuListStyle6 {
    border-bottom: none;
    position: relative;
}

.menuListStyle6::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 8%;
    height: 2px;
    background-color: #3848a0;
}

//样式7
.menuListStyle7 {
    margin-top: 30px;
    position: relative;
    padding-top: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #E4E4E4;

    .channelMenuListTitle {
        background: url(https://img.bjzxtw.org.cn/pre/image/png/20251111/1762827425535634.png) no-repeat center center;
        width: 200px;
        height: 40px;
        line-height: 40px;
        color: #ffffff;
        font-size: 24px;
        padding-left: 30px;
        box-sizing: border-box;
    }

    .hannelMenuListFloatMenu {
        position: absolute;
        display: flex;
        flex-wrap: wrap;
        font-size: 12px;
        color: #333333;
        font-weight: bold;
        top: 33px;
        left: 210px;

        div {
            width: 123px;
            font-size: 16px;
            text-align: center;
            font-weight: bold;

            &:last-child {
                background: none;
            }

            &.active {
                color: #3848a0
            }

            a {
                color: #333333;
            }

            a:hover {
                color: #3848a0;
            }

        }
    }
}

//样式8
.menuListStyle8 {
    border-bottom: none;
}

//样式9
.menuListStyle9 {
    .hannelMenuListFloatMenu {
        div {
            width: 123px;
            font-size: 16px;
            text-align: center;
            font-weight: bold;
            height: 43px;

            &:last-child {
                background: none;
            }

            &.active {
                color: #3848a0;
                border-bottom: 2px solid #3848a0;
            }

            &:hover {
                color: #3848a0;
                border-bottom: 2px solid #3848a0;
            }
        }
    }
}

//样式11
.menuListStyle11 {
    padding-top: 1px;

    .style11 {
        width: 1200px;
        height: 61px;
        display: flex;
        background-color: #3848a0;
        color: #fff;
        margin-top: 20px;

        .channelMenuListTitle {
            width: 144px;
            height: 51px;
            text-align: center;
            background-color: #fff;
            color: #3848a0;
            margin-top: 10px;
            margin-left: 35px;
            border-top-left-radius: 4px;
            border-top-right-radius: 4px;

            span {
                display: inline-block;
                font-size: 16px;
                font-weight: bold;
                padding: 10px 0;
                box-sizing: border-box;
                border-bottom: 2px solid #3848a0;
            }
        }

        .hannelMenuListFloatMenu {
            width: 925px;
            height: 21px;
            margin-top: 23px;
            padding: 0 50px 0 45px;
            display: flex;
            justify-content: flex-start;
            font-size: 16px;
            font-weight: bold;

            div {
                width: 122px;
                height: 20px;
                line-height: 16px;
                text-align: center;
                background: url(https://img.bjzxtw.org.cn/pre/image/png/20251111/1762839905257434.png) no-repeat right 2px;

                &:last-child {
                    background: none;
                }

                &.active {
                    color: #3848a0
                }

                a {
                    color: #fff;
                }
            }
        }
    }

}

//样式12
.menuListStyle12 {
    margin-top: 12px;
    position: relative;
    padding-bottom: 20px;
    border-bottom: 1px solid #d9d9d9;
    display: flex;

    .channelMenuListTitle {
        width: 153px;
        height: 52px;
        line-height: 52px;
        text-align: center;
        font-size: 18px;
        font-weight: bold;
        color: #fff;
        background: url(https://img.bjzxtw.org.cn/pre/image/png/20251111/1762828352859091.png) no-repeat left -4px;
    }

    .hannelMenuListFloatMenu {
        margin-left: 15px;
        width: 1030px;
        display: flex;
        justify-content: flex-start;
        flex-wrap: wrap;
        font-size: 16px;
        color: #333333;
        font-weight: bold;
        height: 52px;
        line-height: 60px;

        div {
            width: 96px;
            padding: 0 15px;
            padding-bottom: 9px;
            text-align: center;
            background: url(https://img.bjzxtw.org.cn/pre/image/png/20251111/1762839905257434.png) no-repeat right 22px;

            &:last-child {
                background: none;
            }

            &.active {
                color: #3848a0;
                border-bottom: 2px solid #3848a0;
            }

            a {
                color: #333333;

                span {
                    display: inline-block;
                    height: 70px;

                    &:hover {
                        color: #3848a0;
                        border-bottom: 2px solid #3848a0;
                    }
                }
            }
        }
    }
}

//样式13
.menuListStyle13 {
    margin-top: 12px;
    position: relative;
    padding-bottom: 20px;
    display: flex;

    .channelMenuListTitle {
        width: 160px;
        height: 50px;
        line-height: 50px;
        text-align: center;
        font-size: 18px;
        font-weight: bold;
        color: #fff;
        background: url(https://img.bjzxtw.org.cn/pre/image/png/20251111/176282941298854.png) no-repeat left 5px;
    }

    .hannelMenuListFloatMenu {
        margin-left: 30px;
        width: 1030px;
        display: flex;
        justify-content: flex-start;
        flex-wrap: wrap;
        font-size: 16px;
        color: #333333;
        font-weight: bold;
        height: 52px;
        line-height: 60px;

        div {
            width: 96px;
            padding: 0 15px;
            padding-bottom: 9px;
            text-align: center;
            box-sizing: border-box;

            &:last-child {
                background: none;
            }

            a {
                color: #333333;

                span {
                    display: inline-block;

                    &:hover {
                        color: #3848a0;
                    }
                }
            }
        }
    }
}

//样式14
.menuListStyle14 {
    margin-top: 12px;
    position: relative;
    padding-bottom: 20px;
    display: flex;

    .channelMenuListTitle {
        position: absolute;
        top: 0;
        left: 0;
        width: 182px;
        height: 67px;
        line-height: 67px;
        text-align: center;
        font-size: 22px;
        font-weight: bold;
        color: #fff;
        background: url(https://img.bjzxtw.org.cn/pre/image/png/20251111/1762829430424708.png) no-repeat left 5px;
    }

    .hannelMenuListFloatMenu {
        margin-top: 15px;
        width: 1200px;
        height: 52px;
        line-height: 52px;
        padding-left: 180px;
        box-sizing: border-box;
        display: flex;
        justify-content: flex-start;
        flex-wrap: wrap;
        font-size: 16px;
        color: #333333;
        background-color: #fafafa;


        div {
            width: 96px;
            padding: 0 15px;
            text-align: center;
            background: url(https://img.bjzxtw.org.cn/pre/image/png/20251111/1762837676175916.png) no-repeat right 22px;

            &:last-child {
                background: none;
            }

            a {
                color: #333333;

                span {
                    display: inline-block;

                    &:hover {
                        color: #3848a0;
                    }
                }
            }
        }
    }
}

//样式15
.menuListStyle15 {
    width: 1200px;
    height: 60px;
    margin-top: 12px;
    position: relative;
    padding-bottom: 20px;
    display: flex;
    background: url(https://img.bjzxtw.org.cn/pre/image/png/20251111/1762829458643041.png) no-repeat left 5px;


    .channelMenuListTitle {
        width: 210px;
        height: 67px;
        line-height: 67px;
        text-align: center;
        font-size: 22px;
        font-weight: bold;
        color: #fff;
    }

    .hannelMenuListFloatMenu {
        width: 1200px;
        height: 60px;
        line-height: 70px;
        padding-left: 15px;
        display: flex;
        justify-content: flex-start;
        flex-wrap: wrap;
        font-size: 16px;
        color: #3848a0;
        font-weight: bold;


        div {
            width: 96px;
            padding: 0 15px;
            text-align: center;

            &:last-child {
                background: none;
            }

            a {
                color: #3848a0;

                span {
                    display: inline-block;

                    &:hover {
                        color: #3848a0;
                    }
                }
            }
        }
    }
}

//样式16
.menuListStyle16 {
    width: 1200px;
    height: 44px;
    padding-top: 20px;
    position: relative;
    display: flex;
    border-bottom: 2px solid #3848a0;

    .channelMenuListTitle {
        width: 220px;
        height: 44px;
        line-height: 44px;
        text-align: center;
        font-size: 22px;
        font-weight: bold;
        color: #fff;
        background: url(https://img.bjzxtw.org.cn/pre/image/png/20251111/1762829473365366.png) no-repeat left 5px;
    }

    .hannelMenuListFloatMenu {
        width: 1200px;
        height: 45px;
        line-height: 47px;
        padding-left: 7px;
        display: flex;
        justify-content: flex-start;
        flex-wrap: wrap;
        font-size: 16px;
        color: #333333;
        font-weight: bold;

        div {
            width: 96px;
            padding: 0 15px;
            text-align: center;

            &:last-child {
                background: none;
            }

            a {
                color: #333333;

                span {
                    display: inline-block;

                    &:hover {
                        color: #3848a0;
                    }
                }
            }
        }
    }
}
//样式17
.menuListStyle17 {
    width: 1200px;
    height: 44px;
    padding-top: 20px;
    position: relative;
    display: flex;
    border-bottom: 2px solid #3848a0;

    .channelMenuListTitle {
        width: 120px;
        height: 46px;
        line-height: 46px;
        text-align: center;
        font-size: 18px;
        font-weight: bold;
        color: #fff;
        background-color: #3848a0;
        border-top-left-radius: 4px;
        border-top-right-radius: 4px;
    }

    .hannelMenuListFloatMenu {
        width: 1080px;
        height: 46px;
        line-height: 46px;
        padding-left: 7px;
        display: flex;
        justify-content: space-between;
        flex-wrap: wrap;
        font-size: 16px;
        color: #333333;
        border-top: 1px solid #d9d9d9;
        border-right: 1px solid #d9d9d9;

        div {
            width: 96px;
            padding: 0 15px;
            text-align: center;
            background: url(https://img.bjzxtw.org.cn/pre/image/png/20251111/1762839905257434.png) no-repeat right 17px;


            &:last-child {
                background: none;
            }

            a {
                color: #333333;

                span {
                    display: inline-block;

                    &:hover {
                        color: #3848a0;
                    }
                }
            }
        }
    }
}
</style>