<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">
            <p class="info">角色总览</p>
            <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 prop="rolename" label="角色名称">
                </el-table-column>
                <el-table-column prop="role_desc" label="角色描述">
                </el-table-column>
                <el-table-column prop="role_members" label="角色成员">
                </el-table-column>
                <el-table-column prop="associated_ORN" 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>
        <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>
</template>

<script>
import checkbox from '@/components/Checkbox/index'
import page from '@/components/pagination/index'
export default {
    components: { checkbox, page },
    data() {
        return {
            filterText: '',
            data: [{
                label: '决策组',
                children: [{
                    label: '决策组',
                }, {
                    label: '管理员组'
                }, {
                    label: '普通用户组'
                }]
            }],
            defaultProps: {
                children: 'children',
                label: 'label'
            },
            tableData: [{
                rolename: '决策组',
                role_desc: '描述',
                role_members: '300人',
                associated_ORN: '3家',
            }, {
                rolename: '决策组-1',
                role_desc: '描述',
                role_members: '300人',
                associated_ORN: '3家',
            }, {
                rolename: '决策组-2',
                role_desc: '描述',
                role_members: '300人',
                associated_ORN: '3家',
            }],
            multipleSelection: [],
            show: true
        }
    },
    watch: {
        filterText(val) {
            this.$refs.tree.filter(val);
        }
    },

    methods: {
        cancleChecked() {
            //
        },
        filterNode(value, data) {
            if (!value) return true;
            return data.label.indexOf(value) !== -1;
        },
        handleClick() {
            //
        },
        handleNodeClick() {

        },
        handleSelectionChange() {

        }
    }
}
</script>
<style lang="less" scoped>
.container {
    position: relative;
    height: 100%;
    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;
    }
}

.info {
    text-align: left;
    padding: 20px;
    font-size: 25px;
}

.bottom {
    position: absolute;
    left: 330px;
    right: 16px;
    bottom: 20px;
    height: 50px;
    line-height: 20px;
    background-color: rgba(255, 255, 255, 1);
    text-align: center;

    .checkbox {
        position: absolute;
        left: 30px;
        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;
        }
    }
}
</style>