<template>
    <!-- 面包屑导航 -->
    <div class="breadcrumb">
        <div class="inner">
            <span class="location">当前位置:</span>
            <el-breadcrumb :separator-icon="ArrowRight">
                <el-breadcrumb-item>
                    <NuxtLink to="/">首页</NuxtLink>
                </el-breadcrumb-item>
                <el-breadcrumb-item to="/about/benwangzhaopin/list-1.html" v-if="routeLevel == 1">
                    本网招聘
                </el-breadcrumb-item>
                <el-breadcrumb-item>
                    {{ routeName }}
                </el-breadcrumb-item>
            </el-breadcrumb>
        </div>
    </div>
    <div class="newsDetail">
        <div class="inner">
            <div class="innerDetail">
                <div class="headImg"></div>
                <div class="innerDetail1">
                    <mainStyle :skinId="skinId" :newsDetail="newsDetail" />
                </div>
                <div class="footImg"></div>
            </div>
            <!--菜单皮肤1-->
            <div v-if="skinId==1">
                <div class="innerLeft">
                    <menu1Style :componentStyle="templateData[0].component_style" :bottomMenu="bottomMenu" :pageId="pageId" />
                </div>
            </div>
            <!--菜单皮肤2-->
            <div v-if="skinId==2">
                <div class="innerLeft">
                    <menu2Style :componentStyle="templateData[0].component_style" :bottomMenu="bottomMenu" :pageId="pageId" />
                </div>
            </div>
            <!--菜单皮肤3-->
            <div v-if="skinId==3">
                <div class="innerLeft">
                    <menu3Style :componentStyle="templateData[0].component_style" :bottomMenu="bottomMenu" :pageId="pageId" />
                </div>
            </div>
            <!--菜单皮肤4-->
            <div v-if="skinId==4">
                <div class="innerLeft">
                    <menu4Style :componentStyle="templateData[0].component_style" :bottomMenu="bottomMenu" :pageId="pageId" />
                </div>
            </div>
            <!--菜单皮肤5-->
            <div v-if="skinId==5">
                <div class="innerLeft">
                    <menu5Style :componentStyle="templateData[0].component_style" :bottomMenu="bottomMenu" :pageId="pageId" />
                </div>
            </div>
            <div style="clear: both;"></div>
        </div>
    </div>
</template>

<script setup lang="ts">
//0.页面依赖 start ---------------------------------------->
import { ElBreadcrumb, ElBreadcrumbItem } from 'element-plus'
import { ArrowRight } from '@element-plus/icons-vue'
import type { INewsDetail, IBottomMenu } from '@/utils/dataInterface'
//菜单组件皮肤1
import menu1Style from '@/components/template/component/menu/144x365/1.vue'
//菜单组件皮肤2
import menu2Style from '@/components/template/component/menu/144x365/2.vue'
//菜单组件皮肤3
import menu3Style from '@/components/template/component/menu/144x365/3.vue'
//菜单组件皮肤4
import menu4Style from '@/components/template/component/menu/144x365/4.vue'
// 菜单组件皮肤5
import menu5Style from '@/components/template/component/menu/144x365/5.vue'
//详情
import mainStyle from '@/components/template/component/main/1200x1120/1.vue'
interface Props {
    templateData:any,
    skinId: number,
}
const props = defineProps<Props>();
//0.页面依赖 end ---------------------------------------->

//1.页面数据 start ---------------------------------------->
//必备参数
const route = useRoute();
const fullPath:string = route.path;
const segments:string[] = fullPath.split('/'); 
const targetSegment:string = segments[2]; 
//判断路由深度
const routeLevel = ref<number>(0);
if(route.name == 'about-dir-dir-id'){
    routeLevel.value = 1;
}
let articleId:number;
let pageId:number;
//反向查询导航id
const getRouteId = await requestDataPromise('/web/getWebsiteRoute', {
    method: 'GET',
    query: {
        'foot_pinyin': targetSegment,
    },
});
if(getRouteId.code == 200){
    articleId = getRouteId.data.id;
    pageId = getRouteId.data.id;
}
//中央招聘详情
const newsDetail = ref<INewsDetail>({
    con_title:"",
    content:"",
    type_id:0
})
async function getPageData() {
    const mkdata:any = await requestDataPromise('/web/getWebsiteFooterCategoryInfo', {
        method: 'GET',
        query: {
            'fcat_id': articleId,
            'type': '0'
        },
    });
    newsDetail.value = mkdata.data;
    routeName.value = mkdata.data.con_title;
    getPageMenu();
}
getPageData();
//左侧悬浮菜单
const bottomMenu = ref<IBottomMenu[]>([]);
const routeName = ref<string>("");
async function getPageMenu() {
    const mkdata:any = await requestDataPromise('/web/getWebsiteFooterCategory', {
        method: 'GET',
        query: {},
    });
    bottomMenu.value = mkdata.data;

    for(let item of bottomMenu.value){
        if(item.name_pinyin == segments[2]){
            routeName.value = item.name;
        }
    }
}

//1.页面数据 end---------------------------------------->
</script>

<style lang="less" scoped>
//导航条样式 start ---------------------------------------->
.breadcrumb {
    width: 1200px;
    margin: 0 auto;
    height: 22px;
    padding-bottom: 30px;
    margin-top: 30px;
    margin-bottom: 30px;
    border-bottom: 1px solid #d9d9d9;
    font-family: Microsoft YaHei, Microsoft YaHei;
    font-weight: 400;
    font-size: 20px;
    color: #666666;
    line-height: 23px;
    text-align: left;
    font-style: normal;
    text-transform: none;
    .el-breadcrumb::v-deep {
        display: inline-block;
        vertical-align: -4px;
    }
    :deep(.el-breadcrumb__inner a),
    :deep(.el-breadcrumb__inner.is-link) {
        color: #666666;
        font-weight: 400;
        text-decoration: none;
        transition: var(--el-transition-color);
    }
    span {
        font-family: Microsoft YaHei, Microsoft YaHei;
        font-weight: 400;
        font-size: 20px;
        color: #666666;
        line-height: 23px;
        text-align: left;
        font-style: normal;
        text-transform: none;
    }
    span:hover {
        color: #666666;
    }
    .location {
        margin-right: 20px;
        width: 100px;
        height: 22px;
        font-family: Microsoft YaHei, Microsoft YaHei;
        font-weight: 400;
        font-size: 20px;
        color: #666666;
        line-height: 23px;
        text-align: left;
        font-style: normal;
        text-transform: none;
    }
}
//导航条样式 end ---------------------------------------->

//列表容器 start ---------------------------------------->
.newsDetail {
    width: 100%;
    .inner {
        width: 1200px;
        font-size: 16px;
        position: relative;
        .innerDetail {
            margin: 0 auto;
            margin-bottom: 30px;
            //min-height: 1370px;
            .innerDetail1 {
                //min-height: 1370px;
                margin: 0 auto;
                box-sizing: border-box;
            }
        }
    }
}
.innerLeft {
    width: 144px;
    position: absolute;
    top: 15px;
    left: -165px;
}
//列表容器 end ---------------------------------------->
</style>