<template>
    <!-- nav---隐患 -->
    <div class="hiddendanger">
      <div class="table">
            <el-table :data="tableData">
                <el-table-column
                    type="index"
                    label="序号"
                    align="center"
                    width="80">
                </el-table-column>
                <el-table-column
                    prop="riskPointName"
                    label="风险点名称"
                >
                </el-table-column>
                <el-table-column
                    prop="riskPointLevel"
                    label="风险等级"
                >
                <template  slot-scope="scope">
                    <span>{{filterLevel(scope.row.riskPointLevel)}}</span>
                </template>                
                </el-table-column>
                <el-table-column
                    prop="createdTime"
                    label="创建时间"
                >
                <template  slot-scope="scope">
                    <span>{{formateDate(scope.row.createdTime)}}</span>
                </template>
                </el-table-column>

                <el-table-column
                    prop="causeDesc"
                    label="描述"
                >
                </el-table-column>
            </el-table>
        </div>
    </div>
</template>
<script>
  import '../../../static/js/lrz.bundle.js'
  export default {
    name: "riskWarning-table",
    data() {
        return {
            tableData:[]
        }
    },
    created(){
        this.getRiskPointControlRecord()
    },
    methods:{
        filterLevel(status){
            var name="--"
            if(status==1){name="重大"}else if(status==2){name="较大"}
            else if(status==3){name="一般"}else if(status==4){name="较低"}  
            return name 
        },         
        formateDate(date){
            if(date){
                date=new Date(date);
                var y=date.getFullYear();
                var M=date.getMonth()+1;
                var d=date.getDate()
                var H=date.getHours()
                var min=date.getMinutes()>9?date.getMinutes():'0'+date.getMinutes();
                var s=date.getSeconds()>9?date.getSeconds():'0'+date.getSeconds();
                return `${y}-${M}-${d} ${H}:${min}:${s}`
            }
        },
        getRiskPointControlRecord(){
            let that = this
            let obj = {
                gId:this.$route.query.gId,
                cId:this.$route.query.cId,
                path: 'riskPointControlRecord'
            }
            this.$axios.AxiosMethods("get","3rd/bigScreenData/bigScreenMessage",obj,function (res) {
                console.log({"riskWarning-table":JSON.parse(res.data)})
                that.tableData = JSON.parse(res.data).riskPointControlRecord[0];

            });
        },       

    }
}


</script>
<style lang="less" scoped>
    .hiddendanger{
        font-size: 0.1rem;
        .table{
            margin-top: 10px;
        }
    }

</style>
<style >
    .hiddendanger .el-table{
      background: #022528;
    }
    .hiddendanger{
        padding: 20px 15px;
        box-sizing: border-box;
        margin: 20px 16px 0 16px;
        height: 80%;
        overflow-x: auto;
    }
    .hiddendanger>div{
        border: none;
    }
    .hiddendanger .el-table tr th {
        background-color: #022528;
    }
    .hiddendanger .el-table th,
    .hiddendanger .el-table tr td{
        background-color: #02353d;
        color: #fff;
    }
    .hiddendanger .el-table tr:nth-child(even) td{
        background-color: #022528;
        color: #fff;
    }
    .hiddendanger .el-table td,
    .hiddendanger .el-table th.is-leaf {
        border-bottom: 0 !important;
    }
    .hiddendanger .el-table--enable-row-hover .el-table__body tr:hover>td {
        background-color: #126670 !important;
    }
    .hiddendanger .el-table__footer-wrapper thead div, .hiddendanger .el-table__header-wrapper thead div {
        background-color: #022528;
        color: #fff;
    }
    .hiddendanger .el-table__empty-block{
        min-height: 130px;
        background-color: #126670;
    }
    .hiddendanger .el-table__empty-text{
        font-size: 16px;
        color:#fff;
    }
    .hiddendanger .el-table::after,.hiddendanger .el-table::before {
        background-color: transparent;
    }
</style>
