<template>
    <div class="region">
        <div class="other-people">
            <div class="other-people-title">
                <div class="image-border image-border1"></div>
                <div class="image-border image-border2"></div>
                <div class="image-border image-border3"></div>
                <div class="image-border image-border4"></div>
                监控区域列表
            </div>
            </div>
            <div class="regionList">
                <ul>
                    <el-row :gutter="21">
                        <el-col :span="8" v-for="(region,i) in regionList">
                            <div :class="[{'regionItem':true},{'active':loftIndex == i }]" @click="handleSelect(region.Id,i,region.Name)">
                                <div class="grid-content bg-purple"> {{region.Name}}</div>
                            </div>
                        </el-col>
                        <h5 v-if="regionList == ''">尚未添加监控区域</h5>
                    </el-row>
                </ul>
            </div>
        </div>
</template>

<script>
    export default {
        data() {
            return {
                loftIndex: 0,
                navs: [],
            }
        },
        props: ['regionList'],
        methods: {
            handleSelect(Id,i,Name) {
                this.loftIndex = parseInt(i);
                this.$emit('GetInfoClick', Id,Name);//触发事件
            },
        }
    }
</script>

<style scoped>
    .region {
        width: 100%;
        overflow: hidden;
        display: block;
        margin: 0 auto;
        margin-top: 20px;
    }

    ul {
        width: 90%;
        overflow: hidden;
        display: block;
        margin: 0 auto;
        margin-top: 20px;
    }
    .regionItem {
        border: 1px solid #005EA2;
        background: rgba(27,86,200,0.14);
        color: #fff;
        padding-top: 5px;
        padding-bottom: 5px;
        margin-bottom: 8px;
        border-radius: 0px;
        cursor: pointer;
        font-size: 14px;
    }
    .regionItem.active {
        background: #005EA2;
    }
    .regionList {
        width: 100%;
        overflow: hidden;
        display: block;
        margin: 0 auto;
        min-height: 100px;
    }
    .regionList h5 {
        color: #fff;
        font-weight: normal;
    }
</style>
