<template>
    <div class="chartArea">
        <div class="selectDateArea">
            <div class="selectDate">
                <div class='dateDiv' v-for="(i, index) in DateList" :key="index"
                    :class="{ 'active': selectedDate === index }" @click="selectDate(index)">{{ i.date }}</div>
            </div>
        </div>
        <div class="BaseData">
            <div class="BaseDataArea1">
                <div class="DataDiv">
                    <div class="DataTitle">教师活跃度</div>
                    <div class="imgArea">
                        <img src="../../../assets/img/BaseData1.png" alt="">
                    </div>

                </div>

                <div class="DataDiv">
                    <div class="DataTitle">活跃度环比增长率</div>
                    <div class="imgArea">
                        <img src="../../../assets/img/BaseData2.png" alt="">
                    </div>
                </div>
            </div>
            <div class="BaseDataArea2">
                <div class="DataDiv">
                    <div class="DataTitle">应用使用分类</div>
                    <div class="useCount">
                        <div class="useItem">
                            <div class="useColor" style="background-color: #3681fc;"></div>
                            <div>高频</div>
                            <div>45%</div>
                            <div>(40-80人)</div>
                        </div>
                        <div class="useItem">
                            <div class="useColor" style="background-color:#1f94ff;"></div>
                            <div>中高频</div>
                            <div>30%</div>
                            <div>(0-25人)</div>
                        </div>
                        <div class="useItem">
                            <div class="useColor" style="background-color:#8979ff;"></div>
                            <div>中频</div>
                            <div>45%</div>
                            <div>(0-25人)</div>
                        </div>
                        <div class="useItem">
                            <div class="useColor" style="background-color:#f4cf3b;"></div>
                            <div>低频</div>
                            <div>45%</div>
                            <div>(0-25人)</div>
                        </div>

                    </div>
                    <div class="imgArea" style="padding: 41px 82px;">
                        <img src="../../../assets/img/BaseData3.png" alt="">
                    </div>
                </div>
                <div class="DataDiv">
                    <div class="DataTitle">使用时长</div>
                    <div class="imgArea">
                        <img src="../../../assets/img/BaseData4.png" alt="">
                    </div>
                </div>
            </div>
        </div>

    </div>
</template>
<script>
export default {
    name: 'BasicData',
    data() {
        return {
            DateList: [
                { date: '年' },
                { date: '月' },
                { date: '日' },
            ],
            selectedDate: 0
        }
    },
    methods: {
        selectDate(index) {
            this.selectedDate = index;
        }
    }
}
</script>
<style scoped>
.chartArea {
    background-color: #eaeaea;
    border-radius: 20px;
}


.selectDateArea {
    display: flex;
    justify-content: flex-end;
    padding: 30px 35px;
}

.selectDate {
    display: flex;
    justify-content: center;
    height: 30px;
    background-color: #fff;
    border-radius: 20px;
    gap: 17px;
    box-shadow: 0px 4px 29px rgba(0, 0, 0, 0.1);
}

.dateDiv {
    width: 63px;
    line-height: 30px;
    text-align: center;
    border-radius: 15px;
    cursor: pointer;
    font-weight: bold;
    font-size: 17px;
}

.dateDiv.active {
    background-color: black;
    color: #fff;
}

.BaseData {
    display: flex;
    flex-wrap: wrap;
    padding-bottom: 30px;
    margin: 10px 38px;
    gap: 29px;
}
.BaseDataArea1{
    display: grid;
    gap: 20px;
    /* grid-template-columns: repeat(2, 1fr); */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); 
    width: 100%;
}
.BaseDataArea2{
    display: grid;
    gap: 20px;
    grid-template-columns: 470px auto;
    width: 100%;
}
.DataDiv {
    background-color: #fff;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0px 4px 29px rgba(0, 0, 0, 0.1);
}

.DataDiv img {
    width: 100%;
    height: 100%;
}

.DataTitle {
    font-weight: bold;
    font-size: 17px;
}

.imgArea {
    padding: 41px;
}

.useCount {
    display: grid;
    justify-content: end;
    gap: 5px;
}

.useItem {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.useColor {
    width: 11px;
    border-radius: 10px;
    height: 11px;
}
</style>