<!-- engEnvironmentData/index.vue -->
<template>
    <div class="eng-environment-data">
        <div class="title">监测数据接入情况</div>

        <div class="data-list">
            <div class="data-item" v-for="item in dataList" :key="item.label">
                <div class="item-content">
                    <span class="color-bar" :style="{ backgroundColor: item.color }"></span>
                    <span class="label">{{ item.label }}</span>
                    <span class="value" style=" color: #2f6b98 ">{{ item.value }}</span>
                </div>
            </div>
        </div>
    </div>
</template>

<script lang="ts" setup>
import { ref, onMounted } from 'vue';

// 定义组件名
defineOptions({
    name: 'EngEnvironmentData'
});

// 数据列表
const dataList = ref([
    {
        label: '大中型已建在建电站',
        value: '707',
        color: '#00b894'
    },
    {
        label: '已接入电站运行数据',
        value: '452',
        color: '#0984e3'
    },
    {
        label: '已开展全过程监测工作',
        value: '42',
        color: '#6c5ce7'
    }
]);

// 页面加载时执行的逻辑
onMounted(() => {

});
</script>

<style lang="scss" scoped>
.eng-environment-data {
    padding: 0px 5px;
    background: #fff;
    border-radius: 4px;

    .title {
        font-size: 14px;
        font-weight: 500;
        color: #333;
        text-align: center;
    }

    .data-list {
        .data-item {
            border: 1px solid #edf2f8;
            margin-bottom: 3px;
            cursor: pointer;

            .item-content {
                display: flex;
                align-items: center;
                padding: 6px 4px;

                .color-bar {
                    width: 1.6px;
                    height: 14px;
                    margin-right: 6px;
                    border-radius: 2px;
                }

                .label {
                    flex: 1;
                }
            }
        }
    }
}
</style>