<template>
    <div class="warn-table" ref="tableRef" :style="{ height: typeof height === 'string' ? height : height + 'px' }">
        <div class="tableData_tit">
            <p :style="theme? 'color:#5473E8':'color:#979797'">{{tableName}}</p>
            <el-divider />
            <img :src="CSV_C" alt="">
            <!-- <el-button size="small" type="primary" @click="funExport" :disabled="!tableId">数据导出</el-button> -->
        </div>
        <el-table :data="data" size="small" v-loading="loading" :max-height="tableHeight" :style="{ width: '100%'}">
            <el-table-column align="center" show-overflow-tooltip v-for="(item,index) in column" :key="index"
                :prop="item.prop" :label="item.label" sortable resizable :min-width="item.width? item.width : 80" />
        </el-table>
    </div>
</template>
<script>
    import CSV_C from '@/assets/menuImg/CSV_C.png'
    export default {
        props: {
            data: {
                type: Array,
                default: () => {
                    return [];
                },
            },
            column: {
                type: Array,
                default: () => {
                    return [];
                },
            },
            height: {
                type: String,
                default: () => {
                    return '';
                },
            },
            loading: {
                type: Boolean,
                default: () => {
                    return false;
                },
            },
            tableId: {
                type: String,
                default: () => {
                    return '';
                },
            },
            tableName: {
                type: String,
                default: () => {
                    return '';
                },
            },
            theme: {
                type: Boolean,
                default: () => {
                    return false;
                },
            },
        },
        data() {
            return {
                CSV_C: CSV_C,
                tableHeight: window.innerHeight - 250 + 'px'
            }
        },
    }
</script>
<style lang="less" scoped>
    .warn-table {

        .tableData_tit {
            display: flex;

            p {
                font-size: 16px;
                font-weight: bold;
                margin: 10px;
            }

            .el-divider {
                position: relative;
                top: -3px;
            }

            img {
                width: 30px;
                height: 30px;
                position: relative;
                top: 5px;
            }
        }
    }
</style>