<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="skinId==1">
                        <list1Style :componentStyle="templateData[1].component_style" :newsList="newsList" />
                    </div>
                    <div v-if="skinId==2">
                        <list2Style :componentStyle="templateData[1].component_style" :newsList="newsList" />
                    </div>
                    <div v-if="skinId==3">
                        <list3Style :componentStyle="templateData[1].component_style" :newsList="newsList" />
                    </div>
                    <div v-if="skinId==4">
                        <list4Style :componentStyle="templateData[1].component_style" :newsList="newsList" />
                    </div>
                    <div v-if="skinId==5">
                        <list5Style :componentStyle="templateData[1].component_style" :newsList="newsList" />
                    </div>
                </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 type { INewsDetail, IBottomMenu } from '@/utils/dataInterface'
import { ElBreadcrumb, ElBreadcrumbItem } from 'element-plus'
import { ArrowRight } from '@element-plus/icons-vue'
//列表组件样式1
import list1Style from '@/components/template/component/list/1200x1220/1.vue'
//列表组件样式2
import list2Style from '@/components/template/component/list/1200x1220/2.vue'
//列表组件样式3
import list3Style from '@/components/template/component/list/1200x1220/3.vue'
//列表组件样式4
import list4Style from '@/components/template/component/list/1200x1220/4.vue'
//列表组件样式5
import list5Style from '@/components/template/component/list/1200x1220/5.vue'

//菜单组件皮肤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'
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>
//导航条样式 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;
    :deep(.el-breadcrumb) {
        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: 600px;
            .innerDetail1 {
                min-height: 600px;
                margin: 0 auto;
                box-sizing: border-box;
            }
        }
    }
}
.innerLeft {
    width: 144px;
    position: absolute;
    top: 15px;
    left: -165px;
}
//列表容器 end ---------------------------------------->
</style>