<template>
    <div class="listNewsBox">
        <div class="listNewsTitle_skin3">
            <span>
                <NuxtLink
                    v-if="titleLink.cid"
                    :href="getLinkPath(titleLink)"
                    :title="titleLink.alias"
                >
                    {{titleLink.alias}}
                </NuxtLink>
            </span>
        </div>
        <!--样式1-->
        <div class="listNewsContent" v-if="componentStyle==1">
            <div class="listNewsContentLeft">
                <div class="listNewsContentItem" v-for="item in component_style1_News1Array">
                    <NuxtLink 
                        :href="getLinkPathDetail(item)" 
                        :title="item.title"
                        :target="item.islink == 1 ? '_blank' : '_self'"
                    >
                        <img :src="item.imgurl" />
                        <div class="listNewsContentItemTitle">{{ item.title }}</div>
                    </NuxtLink>
                </div>
            </div>
            <div class="listNewsContentRight">
                <div v-for="item in component_style1_News2Array">
                    <NuxtLink 
                        :href="getLinkPathDetail(item)" 
                        :title="item.title"
                        :target="item.islink == 1 ? '_blank' : '_self'"
                    >
                        {{ item.title }}
                    </NuxtLink>
                </div>
            </div>
        </div>
        <!--样式2-->
        <div class="listNewsContent" v-if="componentStyle==2">
            <div class="listNewsContentRight">
                <div v-for="item in component_style1_News2Array">
                    <NuxtLink 
                        :href="getLinkPathDetail(item)" 
                        :title="item.title"
                        :target="item.islink == 1 ? '_blank' : '_self'"
                    >
                        {{ item.title }}
                    </NuxtLink>
                </div>
            </div>
            <div class="listNewsContentLeft">
                <div class="listNewsContentItem" v-for="item in component_style1_News1Array">
                    <NuxtLink 
                        :href="getLinkPathDetail(item)" 
                        :title="item.title"
                        :target="item.islink == 1 ? '_blank' : '_self'"
                    >
                        <img :src="item.imgurl" />
                        <div class="listNewsContentItemTitle">{{ item.title }}</div>
                    </NuxtLink>
                </div>
            </div>
        </div>
        <!--样式3-->
        <div class="listNewsContent" v-if="componentStyle == 3">
            <div class="listNewsContentLeft">
                <div class="listNewsContentItem" v-for="item in component_style1_News1Array">
                    <NuxtLink 
                        :href="getLinkPathDetail(item)" 
                        :title="item.title"
                        :target="item.islink == 1 ? '_blank' : '_self'"
                    >
                        <img :src="item.imgurl" />
                        <div class="listNewsContentItemTitle">{{ item.title }}</div>
                    </NuxtLink>
                </div>
            </div>
            <div class="listNewsContentRight listNewsContent_themeColor">
                <div v-for="item in component_style1_News2Array">
                    <NuxtLink 
                        :href="getLinkPathDetail(item)" 
                        :title="item.title"
                        :target="item.islink == 1 ? '_blank' : '_self'"
                    >
                        {{ item.title }}
                    </NuxtLink>
                </div>
            </div>
        </div>
        <!--样式4-->
        <div class="listNewsContent" v-if="componentStyle == 4">
            <div class="listNewsContentRight listNewsContent_themeColor">
                <div v-for="item in component_style1_News2Array">
                    <NuxtLink 
                        :href="getLinkPathDetail(item)" 
                        :title="item.title"
                        :target="item.islink == 1 ? '_blank' : '_self'"
                    >
                        {{ item.title }}
                    </NuxtLink>
                </div>
            </div>
            <div class="listNewsContentLeft">
                <div class="listNewsContentItem" v-for="item in component_style1_News1Array">
                    <NuxtLink 
                        :href="getLinkPathDetail(item)" 
                        :title="item.title"
                        :target="item.islink == 1 ? '_blank' : '_self'"
                    >
                        <img :src="item.imgurl" />
                        <div class="listNewsContentItemTitle">{{ item.title }}</div>
                    </NuxtLink>
                </div>
            </div>
        </div>
        <!--样式5-->
        <div class="listNewsContent" v-if="componentStyle == 5">
            <div class="listNewsContentLeft">
                <div class="listNewsContentItem" v-for="item in component_style1_News1Array">
                    <NuxtLink 
                        :href="getLinkPathDetail(item)" 
                        :title="item.title"
                        :target="item.islink == 1 ? '_blank' : '_self'"
                    >
                        <img :src="item.imgurl" />
                        <div class="listNewsContentItemTitle">{{ item.title }}</div>
                    </NuxtLink>
                </div>
            </div>
            <div class="listNewsContentRight listNewsContent_blackColor">
                <div v-for="item in component_style1_News2Array">
                    <NuxtLink 
                        :href="getLinkPathDetail(item)" 
                        :title="item.title"
                        :target="item.islink == 1 ? '_blank' : '_self'"
                    >
                        {{ item.title }}
                    </NuxtLink>
                </div>
            </div>
        </div>
        <!--样式6-->
        <div class="listNewsContent" v-if="componentStyle == 6">
            <div class="listNewsContentRight listNewsContent_blackColor">
                <div v-for="item in component_style1_News2Array">
                    <NuxtLink 
                        :href="getLinkPathDetail(item)" 
                        :title="item.title"
                        :target="item.islink == 1 ? '_blank' : '_self'"
                    >
                        {{ item.title }}
                    </NuxtLink>
                </div>
            </div>
            <div class="listNewsContentLeft">
                <div class="listNewsContentItem" v-for="item in component_style1_News1Array">
                    <NuxtLink 
                        :href="getLinkPathDetail(item)" 
                        :title="item.title"
                        :target="item.islink == 1 ? '_blank' : '_self'"
                    >
                        <img :src="item.imgurl" />
                        <div class="listNewsContentItemTitle">{{ item.title }}</div>
                    </NuxtLink>
                </div>
            </div>
        </div>
        <!--样式7-->
        <div class="listNewsContent" v-if="componentStyle == 7">
            <div class="listNewsContentLeft">
                <div class="listNewsContentItem" v-for="item in component_style1_News1Array">
                    <NuxtLink 
                        :href="getLinkPathDetail(item)" 
                        :title="item.title"
                        :target="item.islink == 1 ? '_blank' : '_self'"
                    >
                        <img :src="item.imgurl" />
                        <div class="listNewsContentItemTitle">{{ item.title }}</div>
                    </NuxtLink>
                </div>
            </div>
            <div class="listNewsContentRight listNewsContent_nonePoint">
                <div v-for="item in component_style1_News2Array">
                    <NuxtLink 
                        :href="getLinkPathDetail(item)" 
                        :title="item.title"
                        :target="item.islink == 1 ? '_blank' : '_self'"
                    >
                        {{ item.title }}
                    </NuxtLink>
                </div>
            </div>
        </div>
        <!--样式8-->
        <div class="listNewsContent" v-if="componentStyle == 8">
            <div class="listNewsContentRight listNewsContent_nonePoint">
                <div v-for="item in component_style1_News2Array">
                    <NuxtLink 
                        :href="getLinkPathDetail(item)" 
                        :title="item.title"
                        :target="item.islink == 1 ? '_blank' : '_self'"
                    >
                        {{ item.title }}
                    </NuxtLink>
                </div>
            </div>
            <div class="listNewsContentLeft">
                <div class="listNewsContentItem" v-for="item in component_style1_News1Array">
                    <NuxtLink 
                        :href="getLinkPathDetail(item)" 
                        :title="item.title"
                        :target="item.islink == 1 ? '_blank' : '_self'"
                    >
                        <img :src="item.imgurl" />
                        <div class="listNewsContentItemTitle">{{ item.title }}</div>
                    </NuxtLink>
                </div>
            </div>
        </div>
        <!--样式9-->
        <div class="listNewsContent_other" v-if="componentStyle == 9">
            <div class="listNewsContent_top">
                <div class="listNewsContent_right">
                    <div v-for="item in component_style1_News2Array_1">
                        <NuxtLink 
                            :href="getLinkPathDetail(item)" 
                            :title="item.title"
                            :target="item.islink == 1 ? '_blank' : '_self'"
                        >
                            {{ item.title }}
                        </NuxtLink>
                    </div>
                </div>
                <div class="listNewsContent_left">
                    <div class="listNewsContentItem">
                        <NuxtLink 
                            :href="getLinkPathDetail(item)" 
                            :title="item.title"
                            :target="item.islink == 1 ? '_blank' : '_self'"
                            v-for="item in component_style1_News1Array_1"
                        >
                            <img :src="item.imgurl" />
                            <div class="listNewsContentItemTitle">{{ item.title }}</div>
                        </NuxtLink>
                    </div>
                </div>
            </div>
            <div class="listNewsContent_bottom">
                <div class="listNewsContent_left">
                    <div class="listNewsContentItem">
                        <NuxtLink 
                            :href="getLinkPathDetail(item)" 
                            :title="item.title"
                            :target="item.islink == 1 ? '_blank' : '_self'"
                            v-for="item in component_style1_News1Array_2"
                        >
                            <img :src="item.imgurl" />
                            <div class="listNewsContentItemTitle">{{ item.title }}</div>
                        </NuxtLink>
                    </div>
                </div>
                <div class="listNewsContent_right">
                    <div v-for="item in component_style1_News2Array_2">
                        <NuxtLink 
                            :href="getLinkPathDetail(item)" 
                            :title="item.title"
                            :target="item.islink == 1 ? '_blank' : '_self'"
                        >
                            {{ item.title }}
                        </NuxtLink>
                    </div>
                </div>
            </div>
            <div class="listNewsContent_bottom">
                <div class="listNewsContent_left">
                    <div class="listNewsContentItem">
                        <NuxtLink 
                            :href="getLinkPathDetail(item)" 
                            :title="item.title"
                            :target="item.islink == 1 ? '_blank' : '_self'"
                            v-for="item in component_style1_News1Array_3"
                        >
                            <img :src="item.imgurl" />
                            <div class="listNewsContentItemTitle">{{ item.title }}</div>
                        </NuxtLink>
                    </div>
                </div>
                <div class="listNewsContent_right">
                    <div v-for="item in component_style1_News2Array_3">
                        <NuxtLink 
                            :href="getLinkPathDetail(item)" 
                            :title="item.title"
                            :target="item.islink == 1 ? '_blank' : '_self'"
                        >
                            {{ item.title }}
                        </NuxtLink>
                    </div>
                </div>
            </div>
        </div>
        <!--样式10-->
        <div class="listNewsContent_other" v-if="componentStyle == 10">
            <div class="listNewsContent_top">
                <div class="listNewsContent_right">
                    <div v-for="item in component_style1_News2Array_1">
                        <NuxtLink 
                            :href="getLinkPathDetail(item)" 
                            :title="item.title"
                            :target="item.islink == 1 ? '_blank' : '_self'"
                        >
                            {{ item.title }}
                        </NuxtLink>
                    </div>
                </div>
                <div class="listNewsContent_left">
                    <div class="listNewsContentItem">
                        <NuxtLink 
                            :href="getLinkPathDetail(item)" 
                            :title="item.title"
                            :target="item.islink == 1 ? '_blank' : '_self'"
                            v-for="item in component_style1_News1Array_1"
                        >
                            <img :src="item.imgurl" />
                            <div class="listNewsContentItemTitle">{{ item.title }}</div>
                        </NuxtLink>
                    </div>
                </div>
            </div>
            <div class="listNewsContent_bottom">
                <div class="listNewsContent_left">
                    <div class="listNewsContentItem">
                        <NuxtLink 
                            :href="getLinkPathDetail(item)" 
                            :title="item.title"
                            :target="item.islink == 1 ? '_blank' : '_self'"
                            v-for="item in component_style1_News1Array_2"
                        >
                            <img :src="item.imgurl" />
                            <div class="listNewsContentItemTitle">{{ item.title }}</div>
                        </NuxtLink>
                    </div>
                </div>
                <div class="listNewsContent_right">
                    <div v-for="item in component_style1_News2Array_2">
                        <NuxtLink 
                            :href="getLinkPathDetail(item)" 
                            :title="item.title"
                            :target="item.islink == 1 ? '_blank' : '_self'"
                        >
                            {{ item.title }}
                        </NuxtLink>
                    </div>
                </div>
            </div>
            <div class="listNewsContent_top">
                <div class="listNewsContent_right">
                    <div v-for="item in component_style1_News2Array_3">
                        <NuxtLink 
                            :href="getLinkPathDetail(item)" 
                            :title="item.title"
                            :target="item.islink == 1 ? '_blank' : '_self'"
                        >
                            {{ item.title }}
                        </NuxtLink>
                    </div>
                </div>
                <div class="listNewsContent_left">
                    <div class="listNewsContentItem">
                        <NuxtLink 
                            :href="getLinkPathDetail(item)" 
                            :title="item.title"
                            :target="item.islink == 1 ? '_blank' : '_self'"
                            v-for="item in component_style1_News1Array_3"
                        >
                            <img :src="item.imgurl" />
                            <div class="listNewsContentItemTitle">{{ item.title }}</div>
                        </NuxtLink>
                    </div>
                </div>
            </div>
        </div>
        <!--样式11-->
        <div class="listNewsContent_other" v-if="componentStyle == 11">
            <div class="listNewsContent_bottom">
                <div class="listNewsContent_left">
                    <div class="listNewsContentItem">
                        <NuxtLink 
                            :href="getLinkPathDetail(item)" 
                            :title="item.title"
                            :target="item.islink == 1 ? '_blank' : '_self'"
                            v-for="item in component_style1_News1Array_1"
                        >
                            <img :src="item.imgurl" />
                            <div class="listNewsContentItemTitle">{{ item.title }}</div>
                        </NuxtLink>
                    </div>
                </div>
                <div class="listNewsContent_right">
                    <div v-for="item in component_style1_News2Array_1">
                        <NuxtLink 
                            :href="getLinkPathDetail(item)" 
                            :title="item.title"
                            :target="item.islink == 1 ? '_blank' : '_self'"
                        >
                            {{ item.title }}
                        </NuxtLink>
                    </div>
                </div>
            </div>
            <div class="listNewsContent_top">
                <div class="listNewsContent_right">
                    <div v-for="item in component_style1_News2Array_2">
                        <NuxtLink 
                            :href="getLinkPathDetail(item)" 
                            :title="item.title"
                            :target="item.islink == 1 ? '_blank' : '_self'"
                        >
                            {{ item.title }}
                        </NuxtLink>
                    </div>
                </div>
                <div class="listNewsContent_left">
                    <div class="listNewsContentItem">
                        <NuxtLink 
                            :href="getLinkPathDetail(item)" 
                            :title="item.title"
                            :target="item.islink == 1 ? '_blank' : '_self'"
                            v-for="item in component_style1_News1Array_2"
                        >
                            <img :src="item.imgurl" />
                            <div class="listNewsContentItemTitle">{{ item.title }}</div>
                        </NuxtLink>
                    </div>
                </div>
            </div>
            <div class="listNewsContent_bottom">
                <div class="listNewsContent_left">
                    <div class="listNewsContentItem">
                        <NuxtLink 
                            :href="getLinkPathDetail(item)" 
                            :title="item.title"
                            :target="item.islink == 1 ? '_blank' : '_self'"
                            v-for="item in component_style1_News1Array_3"
                        >
                            <img :src="item.imgurl" />
                            <div class="listNewsContentItemTitle">{{ item.title }}</div>
                        </NuxtLink>
                    </div>
                </div>
                <div class="listNewsContent_right">
                    <div v-for="item in component_style1_News2Array_3">
                        <NuxtLink 
                            :href="getLinkPathDetail(item)" 
                            :title="item.title"
                            :target="item.islink == 1 ? '_blank' : '_self'"
                        >
                            {{ item.title }}
                        </NuxtLink>
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>

<script setup>
//引入vue
import {ref} from 'vue';
//获得新闻数据
const props = defineProps({
    titleLink:Object,//板块名称
    templateData:Array,//新闻数据
    componentStyle:Number,//样式编号
});
const component_style1_News1Array = ref([]);
const component_style1_News1Array_1 = ref([]);
const component_style1_News1Array_2 = ref([]);
const component_style1_News1Array_3 = ref([]);
const component_style1_News2Array = ref([]);
const component_style1_News2Array_1 = ref([]);
const component_style1_News2Array_2 = ref([]);
const component_style1_News2Array_3 = ref([]);
component_style1_News1Array.value = props.templateData.imgnum.slice(0,3);
component_style1_News1Array_1.value = props.templateData.imgnum.slice(0,1);
component_style1_News1Array_2.value = props.templateData.imgnum.slice(1,2);
component_style1_News1Array_3.value = props.templateData.imgnum.slice(2,3);
component_style1_News2Array.value = props.templateData.textnum.slice(0,6);
component_style1_News2Array_1.value = props.templateData.textnum.slice(0,2);
component_style1_News2Array_2.value = props.templateData.textnum.slice(2,4);
component_style1_News2Array_3.value = props.templateData.textnum.slice(4,6);
</script>

<style lang="less" scoped>
//基本样式 start ---------------------------------------->
.listNewsBox {
    position: relative;
    .listNewsTitle_skin3 {
        font-size:22px;
        font-weight:bold;
        height: 40px;
        line-height: 40px;
        background-color: #fdf8f7;
        margin-bottom: 20px;
        box-sizing: border-box;
        span {
            display: inline-block;
            width: 112px;
            height: 40px;
            line-height: 40px;
            background: #c82200;
            color:#fff;
            text-align: center;
            a{
                color: #fff;
                background-color: #c82200;
            }
        }
    }
    .listNewsContent {
        display: flex;
        align-items: center;
        justify-content: space-between;
        .listNewsContentLeft {
            margin-right: 15px;
            height: 380px;
            .listNewsContentItem {
                position: relative;
                margin-bottom: 20px;
                &:last-child {
                    margin-bottom: 0;
                }
                img {
                    display: block;
                    width: 170px;
                    height: 110px;
                }
                .listNewsContentItemTitle {
                    position: absolute;
                    bottom:0;
                    z-index:1;
                    width: 100%;
                    color:#fff;
                    height: 50px;
                    background: linear-gradient(0deg, rgba(0, 0, 0, 0.5) 33%, rgba(0, 0, 0, 0) 100%);
                    box-sizing: border-box;
                    padding:0 8px;
                    overflow: hidden;
                    text-overflow: ellipsis;
                    white-space: nowrap;
                    line-height: 65px;
                }
            }
        }
        .listNewsContentRight {
            height: 380px;
            div{
                padding-left: 16px;
                box-sizing: border-box;
                background: url('http://img.bjzxtw.org.cn/pre/image/png/20250605/1749100871349444.png') no-repeat left 9px;
                font-size:18px;
                color:#333333;
                line-height: 24px;
                height: 48px;
                overflow: hidden;
                text-overflow: ellipsis;
                display: -webkit-box;
                -webkit-line-clamp: 2;
                -webkit-box-orient: vertical;
                margin-bottom: 10px;
                &:nth-child(2),&:nth-child(4) {
                    margin-bottom: 26px;
                }
                a {
                    color:#333333;
                }
            }
        }
    }  
}
//基本样式 end ---------------------------------------->
//样式3
.listNewsBox {
    .listNewsContent {
        .listNewsContent_themeColor {
            div {
                background: url('https://img.bjzxtw.org.cn/pre/image/png/20250909/1757379542529609.png') no-repeat left center;
            }
        }
    }

}

//样式5
.listNewsBox {
    .listNewsContent {
        .listNewsContent_blackColor {
            div {
                background: url('https://img.bjzxtw.org.cn/pre/image/png/20250909/1757386056889702.png') no-repeat left center;
            }
        }
    }
}

//样式7
.listNewsBox {
    .listNewsContent {
        .listNewsContent_nonePoint {
            div {
                padding-left: 0;
                background: none;
            }
        }
    }
}

//样式9
.listNewsBox {
    .listNewsContent_other {
        .listNewsContent_top {
            display: flex;
            width: 450px;
            height: 110px;
            margin-bottom: 22px;

            .listNewsContent_left {
                width: 170px;
                height: 110px;
                margin-left: 15px;

                .listNewsContentItem {
                    position: relative;
                    margin-bottom: 20px;

                    &:last-child {
                        margin-bottom: 0;
                    }

                    img {
                        display: block;
                        width: 170px;
                        height: 110px;
                    }

                    .listNewsContentItemTitle {
                        position: absolute;
                        bottom: 0;
                        z-index: 1;
                        width: 100%;
                        color: #fff;
                        height: 50px;
                        background: linear-gradient(0deg, rgba(0, 0, 0, 0.5) 33%, rgba(0, 0, 0, 0) 100%);
                        box-sizing: border-box;
                        padding: 0 8px;
                        overflow: hidden;
                        text-overflow: ellipsis;
                        white-space: nowrap;
                        line-height: 65px;
                    }
                }
            }

            .listNewsContent_right {
                width: 265px;
                height: 110px;

                div {
                    box-sizing: border-box;
                    font-size: 18px;
                    color: #333333;
                    line-height: 24px;
                    overflow: hidden;
                    text-overflow: ellipsis;
                    display: -webkit-box;
                    -webkit-line-clamp: 2;
                    -webkit-box-orient: vertical;
                    margin-bottom: 10px;
                    min-height: 48px;

                    a{
                        color: #333333;
                    }
                }
            }
        }

        .listNewsContent_bottom {
            display: flex;
            width: 450px;
            height: 110px;
            margin-bottom: 22px;

            .listNewsContent_left {
                width: 170px;
                height: 110px;
                margin-right: 15px;

                .listNewsContentItem {
                    position: relative;
                    margin-bottom: 20px;

                    &:last-child {
                        margin-bottom: 0;
                    }

                    img {
                        display: block;
                        width: 170px;
                        height: 110px;
                    } 

                    .listNewsContentItemTitle {
                        position: absolute;
                        bottom: 0;
                        z-index: 1;
                        width: 100%;
                        color: #fff;
                        height: 50px;
                        background: linear-gradient(0deg, rgba(0, 0, 0, 0.5) 33%, rgba(0, 0, 0, 0) 100%);
                        box-sizing: border-box;
                        padding: 0 8px;
                        overflow: hidden;
                        text-overflow: ellipsis;
                        white-space: nowrap;
                        line-height: 65px;
                    }
                }
            }

            .listNewsContent_right {
                width: 265px;
                height: 110px;

                div {
                    box-sizing: border-box;
                    font-size: 18px;
                    color: #333333;
                    line-height: 24px;
                    overflow: hidden;
                    text-overflow: ellipsis;
                    display: -webkit-box;
                    -webkit-line-clamp: 2;
                    -webkit-box-orient: vertical;
                    margin-bottom: 10px;
                    min-height: 48px;
                    
                    a{
                        color: #333333;
                    }
                }
            }
        }

        .listNewsContent_bottom:last-child {
            margin-bottom: 0;
        }
    }
}
</style>