<template>
    <div id="scroll-board">
        <dv-scroll-board :config="config" />
        <div v-if="isData" class="nodata">暂无数据</div>
    </div>
</template>

<script>
export default {
    name: 'ScrollBoard',
    props: {
        listdata: {
            Type: Object,
            default: () => { }
        }
    },
    data() {
        return {
            config: {
                header: [],
                data: [],
                rowNum: 6,
                columnWidth: [],
                headerBGC: 'rgba(101, 161, 214, 0.4)',
                headerHeight: 30,
                oddRowBGC: 'transparent',
                evenRowBGC: 'transparent'
            },
            isData: false
        }
    },
    watch: {
        listdata(newValue, oldValue) {
            this.initdata()
        }
    },
    created() {
        this.initdata()
    },
    methods: {
        initdata() {
            if (this.listdata) {
                const { title, titleList, columnWidth } = this.listdata
                this.isData = titleList.length === 0 ? true : false
                this.config = {
                    ...this.config,
                    header: title,
                    data: titleList,
                    columnWidth: columnWidth
                }
            }
        }
        // mouseoverBoard(row) {
        //    console.log('row',row)
        // }
    }
}
</script>

<style lang="scss" scoped>
#scroll-board {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: SourceHanSansCNRegular, sans-serif;
    font-size: 12px;
    color: #badeff;
    box-sizing: border-box;
}

.header-item {
    color: #45fefa;
}

::v-deep(.dv-scroll-board .rows .row-item ){
    color: #badeff;
    border-bottom: 1px solid rgba(0, 132, 251, 0.4);
}

::v-deep(.dv-scroll-board .rows .row-item .ceil) {
    font-size: 12px;
    text-align: center;
}

.nodata {
    position: absolute;
    top: 45px;
    width: 100%;
    height: 70px;
    line-height: 70px;
    text-align: center;
    background-color: #114066;
}

::v-deep(.dv-scroll-board .header) {
    display: flex;
    height: 3.2407407407vh;
    padding: 3px;
    line-height: 3.2407407407vh;
    background-color: rgba(101, 161, 214, 0.4) !important;
    justify-content: space-between;

    .header-item {
        font-size: 12px;
        color: #badeff;
        text-align: center;
    }

}
</style>
