<template>
    <div class="listNewsBox">
        <div class="listNewsTitle_skin5">
            <span>
                <NuxtLink v-if="titleLink.cid" :href="getLinkPath(titleLink)" :title="titleLink.alias">
                    <div>{{ titleLink.alias }}</div>
                </NuxtLink>
            </span>
        </div>
        <!--样式1-->
        <div class="listNewsContent" v-if="componentStyle == 1">
            <div class="listNewsContentItemTop">
                <div v-for="item in component_style1_News1Array">
                    <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
                        :target="item.islink == 1 ? '_blank' : '_self'">
                        <img :src="item.imgurl" alt="">
                        {{ item.title }}
                    </NuxtLink>
                </div>
            </div>
            <div class="listNewsContentItemBottom">
                <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 style2" v-if="componentStyle == 2">
            <div class="listNewsContentItemTop">
                <div v-for="item in component_style1_News1Array">
                    <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
                        :target="item.islink == 1 ? '_blank' : '_self'">
                        <img :src="item.imgurl" alt="">
                        {{ item.title }}
                    </NuxtLink>
                </div>
            </div>
            <div class="listNewsContentItemBottom">
                <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>
        <!--样式3-->
        <div class="listNewsContent style3" v-if="componentStyle == 3">
            <div class="listNewsContentItemBottom">
                <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="listNewsContentItemTop">
                <div v-for="item in component_style1_News1Array">
                    <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
                        :target="item.islink == 1 ? '_blank' : '_self'">
                        <img :src="item.imgurl" alt="">
                        {{ item.title }}
                    </NuxtLink>
                </div>
            </div>
        </div>
        <!--样式4-->
        <div class="listNewsContent style4" v-if="componentStyle == 4">
            <div class="listNewsContentItemBottom">
                <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="listNewsContentItemTop">
                <div v-for="item in component_style1_News1Array">
                    <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
                        :target="item.islink == 1 ? '_blank' : '_self'">
                        <img :src="item.imgurl" alt="">
                        {{ item.title }}
                    </NuxtLink>
                </div>
            </div>
        </div>
        <!--样式5-->
        <div class="listNewsContent" v-if="componentStyle == 5">
            <div class="listNewsContentItemTop">
                <div v-for="item in component_style1_News1Array">
                    <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
                        :target="item.islink == 1 ? '_blank' : '_self'">
                        <img :src="item.imgurl" alt="">
                        {{ item.title }}
                    </NuxtLink>
                </div>
            </div>
            <div class="listNewsContentItemBottom bg_blue">
                <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 style6" v-if="componentStyle == 6">
            <div class="listNewsContentItemTop">
                <div v-for="item in component_style1_News1Array">
                    <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
                        :target="item.islink == 1 ? '_blank' : '_self'">
                        <img :src="item.imgurl" alt="">
                        {{ item.title }}
                    </NuxtLink>
                </div>
            </div>
            <div class="listNewsContentItemBottom bg_blue">
                <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>
        <!--样式7-->
        <div class="listNewsContent style7" v-if="componentStyle == 7">
            <div class="listNewsContentItemBottom bg_blue">
                <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="listNewsContentItemTop">
                <div v-for="item in component_style1_News1Array">
                    <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
                        :target="item.islink == 1 ? '_blank' : '_self'">
                        <img :src="item.imgurl" alt="">
                        {{ item.title }}
                    </NuxtLink>
                </div>
            </div>
        </div>
        <!--样式8-->
        <div class="listNewsContent style8" v-if="componentStyle == 8">
            <div class="listNewsContentItemBottom bg_blue">
                <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="listNewsContentItemTop">
                <div v-for="item in component_style1_News1Array">
                    <NuxtLink :href="getLinkPathDetail(item)" :title="item.title"
                        :target="item.islink == 1 ? '_blank' : '_self'">
                        <img :src="item.imgurl" alt="">
                        {{ item.title }}
                    </NuxtLink>
                </div>
            </div>
        </div>
    </div>
</template>

<script setup>
//引入vue
import { ref } from 'vue';
//获得新闻数据
const props = defineProps({
    titleLink: Object,//板块名称
    templateData: Array,//新闻数据
    componentStyle: Number,//样式编号
});
//定义变量 start ---------------------------------------->
const active = ref(0);
const component_style1_News1Array = ref({});
const component_style1_News2Array = ref([]);
component_style1_News1Array.value = props.templateData.imgnum;
component_style1_News2Array.value = props.templateData.textnum;
//定义变量 end ---------------------------------------->

</script>

<style lang="less" scoped>
//基本样式 start ---------------------------------------->
.listNewsBox {
    position: relative;

    .listNewsTitle_skin5 {
        display: flex;
        align-items: flex-start;
        justify-content: flex-start;
        border-bottom: 1px solid #999999;
        height: 38px;
        margin-bottom: 20px;

        div {
            height: 35px;
            width: 138px;
            line-height: 32px;
            font-size: 22px;
            font-weight: bold;
            color: #333333;
            cursor: pointer;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            color: #3848A0;
            background: url("https://img.bjzxtw.org.cn/pre/image/png/20251104/1762224944805589.png") bottom left no-repeat;
        }
    }

}

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

//样式1 start ---------------------------------------->
.listNewsBox {
    .listNewsContent {
        margin-bottom: 20px;

        .listNewsContentItemTop {
            width: 100%;
            height: 190px;
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            margin-bottom: 25px;

            div {
                width: 285px;
                height: 190px;
                color: #333333;
                font-size: 18px;
                margin-bottom: 23px;
                cursor: pointer;
                overflow: hidden;

                a {
                    img {
                        width: 285px;
                        height: 190px;
                    }
                }

            }
        }

        .listNewsContentItemBottom {
            width: 100%;
            height: 196px;

            div {
                width: 585px;
                white-space: nowrap;
                overflow: hidden;
                text-overflow: ellipsis;
                height: 24px;
                line-height: 24px;
                font-size: 18px;
                color: #333333;
                margin-bottom: 19px;
                padding-left: 16px;
                background: url("https://img.bjzxtw.org.cn/pre/image/png/20251111/1762854924444085.png") no-repeat left center;

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

                &:first-child {
                    font-weight: bold;
                }

                a {
                    color: #333333;
                }
            }
        }

        //文字前缀为主题色蓝色
        .bg_blue {
            div {
                background: url("https://img.bjzxtw.org.cn/pre/image/png/20251112/1762909332941464.png") no-repeat left center;
            }
        }
    }

    // //样式2
    .style2,
    .style6 {
        .listNewsContentItemBottom {
            div {
                &:first-child {
                    font-weight: 400;
                }
            }
        }
    }

    // 样式3
    .style3,
    .style7 {
        .listNewsContentItemTop {
            margin-bottom: 0;
        }

        .listNewsContentItemBottom {
            margin-bottom: 25px;

            div {
                &:first-child {
                    font-weight: 400;
                }
            }
        }
    }

    .style4,
    .style8 {
        .listNewsContentItemTop {
            margin-bottom: 0;
        }

        .listNewsContentItemBottom {
            margin-bottom: 25px;

            div {
                &:first-child {
                    font-weight: bold;
                }
            }
        }
    }
}
</style>