<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>本网招聘</el-breadcrumb-item>
            </el-breadcrumb>
        </div>
    </div>
    <div class="newsDetail">
        <div class="inner">
            <div class="innerDetail">
                <div class="innerDetail1">
                    <div v-if="templateData[0].component_style.toString()=='1'">
                        <list1Style :skinId="skinId" :newsList="newsList" />
                    </div>
                    <div v-if="templateData[0].component_style.toString()=='2'">
                        <list2Style :skinId="skinId" :newsList="newsList" />
                    </div>
                </div>
            </div>
            <div v-if="templateData[1].component_style.toString()=='1'">
                <menu1Style :skinId="skinId" :bottomMenu="bottomMenu" :pageId="pageId" />
            </div>
            <div v-if="templateData[1].component_style.toString()=='2'">
                <menu2Style :skinId="skinId" :bottomMenu="bottomMenu" :pageId="pageId" />
            </div>
            <div style="clear: both;"></div>
        </div>
    </div>
</template>

<script setup lang="ts">
//0.页面依赖 start ---------------------------------------->
import type { INewsDetail, IBottomMenu } from '@/utils/dataInterface'
import { ElBreadcrumb, ElBreadcrumbItem } from 'element-plus'
import { ArrowRight } from '@element-plus/icons-vue'
//列表
import list1Style from '@/components/template/component/list/1200x1220/1.vue'
import list2Style from '@/components/template/component/list/1200x1220/2.vue'
//菜单
import menu1Style from '@/components/template/component/menu/144x365/1.vue'
import menu2Style from '@/components/template/component/menu/144x365/2.vue'
interface Props {
    templateData:any,
    skinId: number,
}
const props = defineProps<Props>();
//0.页面依赖 end ---------------------------------------->

//1.页面数据 start ---------------------------------------->
//1.1 获得导航池id
const route = useRoute();
//获得当前的完整路径
const fullPath = route.path;
const segments = fullPath.split('/'); 
const targetSegment = segments[2]; 
let pageId:number;
//通过导航路径反向查询导航id
const getRouteId = await requestDataPromise('/web/getWebsiteRoute', {
    method: 'GET',
    query: {
        'foot_pinyin': targetSegment,
    },
});
if(getRouteId.code == 200){
    pageId = getRouteId.data.id;
}
//1.2获得左侧导航
const bottomMenu = ref([]);
async function getPageMenu() {
    const mkdata =  await requestDataPromise('/web/getWebsiteFooterCategory', {
        method: 'GET',
        query: {},
    });
    bottomMenu.value = mkdata.data;
}
getPageMenu();
//1.3获得数据列表
const newsList = ref<IListData[]>([]);
let newslists = async () => {
    const listData =  await requestDataPromise('/web/getWebsiteFooterCategoryList', {
        method: 'GET',
        query: {
            'fcat_id':pageId,
        },
    });
    newsList.value = listData.data;
}
newslists();
//1.页面数据 end---------------------------------------->
</script>

<style lang="less" scoped>
//导航条
.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;
    }
}
//列表容器
.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;
            }
        }
    }
}
</style>