<template>
    <div class="container">
        <div class="left-pane">
            <el-input placeholder="告警类别" suffix-icon="el-icon-search" v-model="filterText"></el-input>
            <el-tree ref="tree" :data="data" :props="defaultProps" node-key="id" default-expand-all
                :filter-node-method="filterNode" @node-click="handleNodeClick">
            </el-tree>
            <el-button><i class="el-icon-s-order"></i>新建告警类别</el-button>
        </div>
        <div class="right-pane">
            <div style="margin:20px 1100px 20px 0 ;">
                <el-input class="search" v-model="input" placeholder="请输入" suffix-icon="el-icon-search"></el-input>
            </div>
            <el-table ref="multipleTable" border :data="tableData" tooltip-effect="dark"
                :header-cell-style="{ textAlign: 'center' }" :cell-style="{ textAlign: 'center' }" style="width: 100%"
                @selection-change="handleSelectionChange">
                <el-table-column type="selection" width="50">
                </el-table-column>
                <el-table-column type="index" width="50" label="序号">
                </el-table-column>
                <el-table-column prop="deviceType" label="设备类别">
                </el-table-column>
                <el-table-column prop="devicewarningType" label="涵盖设备警告类别">
                </el-table-column>
                <el-table-column prop="Respon" label="责任人">
                </el-table-column>
                <el-table-column prop="operation" label="操作">
                    <el-button size="mini" type="text">查看</el-button>
                    <el-button size="mini" type="text">编辑</el-button>
                    <el-button size="mini" type="text">删除</el-button>
                </el-table-column>
            </el-table>
            <div class="bottom">
                <div>
                    <checkbox class="checkbox"></checkbox>
                    <el-button class="check-cancel" size="mini" type="text" @click="cancleChecked">取消</el-button>
                </div>
                <div class="bottom_button" v-show="show">
                    <el-button class="delete" type="text">批量删除</el-button>
                </div>
                <page class="page"></page>
            </div>
        </div>
    </div>
</template>

<script>
import checkbox from '@/components/Checkbox/index'
import page from '@/components/pagination/index'
export default {
    components: { checkbox, page },
    data() {
        return {
            filterText: '',
            input: '',
            data: [{
                label: '紧急告警',
                children: [
                ]
            }, {
                label: '重要告警'
            }, {
                label: '一般告警'
            }],
            defaultProps: {
                children: 'children',
                label: 'label'
            },
            tableData: [{
                deviceType: '摄像头',
                devicewarningType: '[设备离线][设备xxx]',
                Respon: '张三',
            }, {
                deviceType: '摄像头',
                devicewarningType: '[设备离线][设备xxx]',
                Respon: '张三',
            }, {
                deviceType: '摄像头',
                devicewarningType: '[设备离线][设备xxx]',
                Respon: '张三',
            }],
            multipleSelection: [],
            show: true
        }
    },
    watch: {
        filterText(val) {
            this.$refs.tree.filter(val);
        }
    },
    methods: {
        cancleChecked() {
            //
        },
        handleClick() {
            //
        },
        filterNode(value, data) {
            if (!value) return true;
            return data.label.indexOf(value) !== -1;
        },
        handleNodeClick(){
            //
        },
        handleSelectionChange(){
            //
        }
    }
}
</script>
<style lang="less" scoped>
.container {
    position: absolute;
    left: 218px;
    top: 140px;
    right: 16px;
    //height: 800px;
    line-height: 20px;
    background-color: rgba(255, 255, 255, 1);
    color: rgba(16, 16, 16, 1);
    font-size: 14px;
    text-align: center;
    box-shadow: 0px 0px 4px 0px rgba(0, 0, 0, 0.15);

    .left-pane {
        width: 300px;
        padding: 15px;

        .el-tree {
            height: 700px;
            margin-top: 15px;
            background-color: rgb(247, 245, 243);
        }

        .el-button {
            position: absolute;
            left: 35px;
            bottom: 40px;
            width: 250px;
            background-color: rgb(131, 208, 243);
            text-align: center;
            font-size: 16px;
        }
    }

    .right-pane {
        width: 1340px;
        position: absolute;
        margin-left: 330px;
        top: 0;
        margin-right: 20px;

        .el-table{
            top:60px;
        }
    }
}

.bottom {
    position: absolute;
    top: 700px;
    height: 50px;
    width: 1340px;
    line-height: 20px;
    background-color: rgba(255, 255, 255, 1);
    text-align: center;

    .checkbox {
        position: absolute;
        left: 29px;
        top: 15px;
        font-size: 14px;
    }

    .check-cancel {
        position: absolute;
        // line-height: 20px;
        font-size: 14px;
        text-align: center;
        left: 140px;
        top: 10px;
    }

    .bottom_button {
        position: absolute;
        left: 200px;
        margin-top: 15px;

        .delete {
            font-size: 14px;
            text-align: center;
            padding: 1px;
        }

        .disabled {
            font-size: 14px;
            text-align: center;
            padding: 1px;
        }

        .export {
            font-size: 14px;
            text-align: center;
            padding: 1px;
        }
    }
}

.search {
    position: absolute;
    width: 300px;
    top: 20px;
    right: 20px;
}
</style>