<template>
    <div class="event-list">
        <Model title="事件列表">
            <div class="list">
                <div class="scroll-container" :class="{ 'scroll-container-new': tqFlag }">
                    <div class="table-item table-title">
                        <div v-for="(item, index) in cums">{{ item }}</div>
                    </div>
                    <vue-seamless-scroll class="under-container" ref="seamlessScroll" :data="tqFlag">
                        <div class="table-item-box">
                            <div class="table-item" :class="{ 'table-item-active': index % 2 == 0 }"
                                v-for="(item, index) in tqFlag" :key="index" :data-index="index">
                                <div>{{ item.listNum }}</div>
                                <div>{{ item.infor }}</div>
                                <div>{{ item.type }}</div>
                                <div>{{ item.status }}</div>
                            </div>

                        </div>
                    </vue-seamless-scroll>
                </div>
            </div>
        </Model>
    </div>
</template>

<script>
import vueSeamlessScroll from "vue-seamless-scroll";
import Model from '../model.vue'

export default {
    name: 'list',
    components: { Model, vueSeamlessScroll },
    data() {
        return {                     
            cums: ['编号', '位置', '说明', '发现时间'],
            tqFlag: [
                {
                    listNum:"XJYM001",
                    infor: '姚庙村三组',
                    type: '撂荒',
                    status: '2023-10-06'
                },
                {
                    listNum:"XJYM002",
                    infor: '姚庙村五组',
                    type: '建设占用',
                    status: '2023-10-07'
                },
                {
                    listNum:"XJYM002",
                    infor: '姚庙村五组',
                    type: '撂荒',
                    status: '2023-10-08'
                },
                {
                    listNum:"XJYM004",
                    infor: '姚庙村五组',
                    type: '撂荒',
                    status: '2023-10-10'
                },
                {
                    listNum:"XJYM005",
                    infor: '姚庙村六组',
                    type: '建设占用',
                    status: '2023-10-12'
                },
                {
                    listNum:"XJYM006",
                    infor: '姚庙村三组',
                    type: '撂荒',
                    status: '2023-10-11'
                }
            ]
        }
    }
}
</script>

<style lang="less" scoped>
.event-list {
    margin-top: 10px;

    .scroll-container {
        overflow: hidden;
        text-align: center;

        .under-container {
            overflow: hidden;
        }
    }
.list{
    width: 95%;
    margin: 0 auto;
}
    .scroll-container-new {
        margin-top: 0;

        .under-container {
            height: 212px;
        }
    }

    .table-item {
        >div {
            width: 25%;
            overflow: hidden;
            -o-text-overflow: ellipsis;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        height: 34px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: 16px;
        cursor: pointer;
    }

    .table-title {
        color: #02FEFF;
        background-color: rgba(37, 224, 224, 0.2);
        border: none;
    }

    .table-item-active {

        // background: rgba(2, 254, 255, 0.2);
        color: white;
        background: repeating-linear-gradient(132deg, rgba(10, 32, 67, 0), rgba(10, 32, 67, 0) 6px, rgba(61, 91, 139, 0.7) 1px, rgba(61, 91, 139, 0.7) 10px);

    }
}
</style>