<template>
  <div class="entity-list">
    <div class="header">
        <div class="header-title">
            <img :src="headerTitle.img" alt="">
            <div>
                <div class="title">
                    {{ headerTitle.title }}
                    <span>{{ headerTitle.titleEn }}</span>
                </div>
                <div class="department">
                    {{ headerTitle.department }}
                </div>
            </div>
            <div class="btn">
                <img :src="icon01" alt="">切换
            </div>
        </div>
        <div class="header-nav">
            <div 
                class="nav-item" 
                v-for="(item, index) in headerNavList" 
                :key="index"
                :class="{ active: activeIndex === index }"
                @click="activeIndex = index"
            >
                <img :src="activeIndex === index ? item.imgActive : item.img" alt="">
                <span>{{ item.title }}</span>
                <div class="active-line" v-if="activeIndex === index"></div>
            </div>
            <div class="original-text-btn">
                <img :src="icon1" alt="">
                <span>实体清单原文</span>
            </div>
        </div>
    </div>
    <div class="main">
        <sanctions-overview v-if="activeIndex === 0"></sanctions-overview>
        <data-statistics v-if="activeIndex === 1"></data-statistics>
        <deep-mining v-if="activeIndex === 2"></deep-mining>
        <impact-analysis v-if="activeIndex === 3"></impact-analysis>
    </div>
  </div>
</template>

<script setup>
import { ref } from 'vue'

import sanctionsOverview from "./components/sanctionsOverview/index.vue"
import dataStatistics from "./components/dataStatistics/index.vue"
import deepMining from "./components/deepMining/index.vue"
import impactAnalysis from "./components/impactAnalysis/index.vue"

import title from "./assets/title.png"
import icon01 from "./assets/icon01.png"
import icon1 from "../assets/icons/icon1.png";
import icon1Active from "../assets/icons/icon1_active.png";
import icon5 from "../assets/icons/icon5.png";
import icon5Active from "../assets/icons/icon5_active.png";
import icon2 from "../assets/icons/icon2.png";
import icon2Active from "../assets/icons/icon2_active.png";
import icon3 from "../assets/icons/icon3.png";
import icon3Active from "../assets/icons/icon3_active.png";


const headerTitle = ref({
    img: title,
    title: "2025年9月12日《对实体清单的添加和修订 》",
    titleEn: "",
    department: "2025-17893(90 FR 44496)"
})

const activeIndex = ref(0)

const headerNavList = ref([
    {
        img: icon1,
        imgActive: icon1Active,
        title: "制裁概况"
    },
    {
        img: icon5,
        imgActive: icon5Active,
        title: "数据统计"
    },
    {
        img: icon2,
        imgActive: icon2Active,
        title: "深度挖掘"
    },
    {
        img: icon3,
        imgActive: icon3Active,
        title: "影响分析"
    }
])



</script>

<style scoped lang="scss">
*{
    margin: 0;
    padding: 0;
}
.entity-list{
    width: 100%;
    height: 100%;
    .header{
        width: 100%;
        height: 148px;
        background-color: #fff;
        padding-top: 16px;
        .header-title{
            width: 1601px;
            height: 72px;
            background-color: rgba(246, 250, 255, 1);
            margin: 0 auto;
            border-radius: 10px;
            border: 2px solid rgba(174, 214, 255, 1);
            display: flex;
            align-items: center;
            margin-bottom: 12px;
            position: relative;
            img {
                width: 54px;
                height: 54px;
                margin-left: 15px;
                margin-right: 11px;
            }
            .title {
                font-size: 20px;
                font-weight: 700;
                font-family: "Microsoft YaHei";
                line-height: 26px;
                color: rgb(59, 65, 75);
                span {
                    font-size: 16px;
                    font-weight: 400;
                    font-family: "Microsoft YaHei";
                    line-height: 24px;
                    color: rgb(95, 101, 108);
                    margin-left: 11px;
                }
            }
            .department {
                font-size: 16px;
                font-weight: 400;
                font-family: "Microsoft YaHei";
                line-height: 24px;
                color: rgb(95, 101, 108);
            }
            .btn {
                cursor: pointer;
                display: flex;
                align-items: center;
                position: absolute;
                right: 16px;
                top: 25px;
                font-size: 18px;
                font-weight: 700;
                font-family: "Microsoft YaHei";
                line-height: 24px;
                color: rgb(5, 95, 194);
                img {
                    width: 20px;
                    height: 20px;
                    margin-right: 7px;
                }
            }
        }
        .header-nav {
            width: 1601px;
            margin: 0 auto;
            height: 48px;
            display: flex;
            align-items: center;
            
            .nav-item {
                display: flex;
                align-items: center;
                height: 100%;
                margin-right: 32px;
                cursor: pointer;
                position: relative;
                font-size: 18px;
                font-weight: 400;
                font-family: "Microsoft YaHei";
                color: rgb(59, 65, 75);
                
                &:last-child {
                    margin-right: 0;
                }

                img {
                    width: 16px;
                    height: 16px;
                    margin-right: 4px;
                }

                &.active {
                    color: rgb(5, 95, 194);
                    font-weight: 700;
                }

                .active-line {
                    position: absolute;
                    bottom: 0;
                    left: 0;
                    width: 100%;
                    height: 3px;
                    background-color: #055fc2;
                    border-radius: 1.5px;
                }
            }

            .original-text-btn {
                margin-left: auto;
                width: 152px;
                height: 36px;
                background: #FFFFFF;
                border-radius: 4px;
                border: 1px solid rgba(230, 231, 232, 1);
                display: flex;
                align-items: center;
                justify-content: center;
                cursor: pointer;
                
                img {
                    width: 16px;
                    height: 16px;
                    margin-right: 8px;
                }
                
                span {
                    font-size: 16px;
                    font-weight: 400;
                    color: rgb(95, 101, 108);
                    font-family: "Microsoft YaHei";
                    line-height: 24px;
                }
            }
        }
    }
    .main{
        width: 100%;
        height: calc(100% - 148px);
        background-color: #F7F8F9;
    }
}
</style>
