<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 class="newInfo_button"><i class="el-icon-s-order"></i>新建消息模块</el-button>
        </div>
        <div class="right-pane">
            <div style="width: 100%; height: 100px;margin-top: 10px;">
                <el-tag>{{ label }}</el-tag>
                <el-button type="text">历史记录</el-button>
            </div>
            <div style="height: 600px;width: 100%; margin-top: 10px;">
                <el-image style="height: 100%;" :src="testUrl" :fit="contain" :preview-src-list="srcList"></el-image>
            </div>
            <el-button>删除</el-button>
            <el-button>更新</el-button>
        </div>
    </div>
</template>

<script>
export default {
    data() {
        return {
            label: "1F",
            testUrl: "https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png",
            srcList: [
                "https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png",
            ],
            filterText: '',
            data: [{
                label: '楼层地图信息配置',
                children: [{
                    label: '1F',
                }, {
                    label: '20F'
                }, {
                    label: 'B1'
                }]
            },
            {
                label: '安保人员信息',
                children: [{
                    label: '前台人员排班信息',
                }, {
                    label: '安防人员排班信息'
                }]
            }],
            defaultProps: {
                children: 'children',
                label: 'label'
            }
        }
    },
    watch: {
        filterText(val) {
            this.$refs.tree.filter(val);
        }
    },
    methods: {
        filterNode(value, data) {
            if (!value) return true;
            return data.label.indexOf(value) !== -1;
        }
    }
}
</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);
        }

        .newInfo_button {
            //position: absolute;
            width: 250px;
            background-color: rgb(131, 208, 243);
            text-align: center;
            font-size: 16px;
            padding: 10px;
        }
    }

    .right-pane {
        width: 1340px;
        position: absolute;
        margin-left: 330px;
        top: 0;
        margin-right: 20px;
    }
}
.el-tag {
    position: absolute;
    background-color: transparent;
    border-color: transparent;
    font-size: 25px;
    color: #000;
    top: 20px;
    left: 20px;

}

.el-button--text {
    position: absolute;
    top: 70px;
    right: 20px;
}

.el-button {
    height: 30px;
    width: 100px;
    margin-top: 20px;
    margin-inline: 40px;
    padding: 5px;
}
</style>