<template>
    <div class="container">
        <div class="header">
            <el-form label-width="120px">
                <div style="display: flex; padding:10px;">
                    <el-form-item :model="form.templateList" label="报表模板名称：">
                        <el-input ref="search" v-model="input" suffix-icon="el-icon-search" placeholder="请输入"></el-input>
                    </el-form-item>
                    <el-form-item :model="form.templateForm" label="报表模板格式：">
                        <el-select placeholder="全部">
                            <el-option label=""></el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item :model="form.reportType" label="报告类型：">
                        <el-select placeholder="报告">
                            <el-option label=""></el-option>
                        </el-select>
                    </el-form-item>
                    <el-button style="padding: 5px;width: 80px;margin-left: 160px;margin-right: 20px;">重置</el-button>
                    <el-button style="padding: 5px;width: 80px; background-color: #409EFF;color: #FFF;">查询</el-button>
                </div>
            </el-form>
        </div>
        <div class="content">
            <div>
                <p class="info">模板列表</p>
                <el-button class="new_button">添加模板</el-button>
            </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 prop="templateName" label="模板名称">
                </el-table-column>
                <el-table-column prop="templateForm" label="模板格式">
                </el-table-column>
                <el-table-column prop="createUser" label="创建用户">
                </el-table-column>
                <el-table-column prop="createTime" label="创建时间">
                </el-table-column>
                <el-table-column prop="alterTime" label="修改时间">
                </el-table-column>
                <el-table-column prop="operation" label="操作">
                    <template slot-scope="scope">
                        <el-button v-show="scope.row.templateName == null ? false : true" size="mini"
                            type="text">查看</el-button>
                        <el-button v-show="scope.row.templateName == null ? false : true" size="mini"
                            type="text">编辑</el-button>
                        <el-button v-show="scope.row.templateName == null ? false : true" size="mini"
                            type="text">删除</el-button>
                    </template>
                </el-table-column>
            </el-table>
        </div>
        <div class="bottom">
            <div>
                <checkbox class="checkbox" :total="total"></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>
                <el-button class="disabled" type="text">批量激活</el-button>
                <el-button class="export" 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 {
            total: 0,
            input: '',
            show: true,
            form: {
            },
            tableData: [
                {
                    templateName: '模板1',
                    templateForm: 'txt',
                    createUser: 'test',
                    createTime: '2023-01-01 00:00',
                    alterTime: '2023-01-01 00:00',
                },
                {
                    templateName: '模板1',
                    templateForm: 'txt',
                    createUser: 'test',
                    createTime: '2023-01-01 00:00',
                    alterTime: '2023-01-01 00:00',
                },
                {
                    templateName: '模板1',
                    templateForm: 'txt',
                    createUser: 'test',
                    createTime: '2023-01-01 00:00',
                    alterTime: '2023-01-01 00:00',
                },
            ],
            defaultProps: {
                children: 'children',
                label: 'label'
            }
        }
    },
    watch: {
        filterText(val) {
            this.$refs.search.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: 150px;
    right: 16px;
    bottom: 20px;
    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);

    .header {
        margin: 2.5%;
        height: 60px;
        background-color: rgb(221, 220, 219);

        .el-form-item {
            margin-bottom:0 !important;
            margin-right: 60px !important;
            /deep/.el-form-item {
                margin-right: 50px;
                margin-bottom: 0;
            }
            /deep/.el-form-item__content {
                margin-left: 120px;
            }
        }
    }

    .content {
        width: 95%;
        position: absolute;
        margin-left: 2.5%;
        margin-right: 2.5%;

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

        .new_button {
            padding: 5px;
            width: 80px;
            position: relative;
            left: 760px;
            background-color: #409EFF;
            color: #FFF;
        }

        .el-table {
            margin-top: 10px;
        }

        .el-select {
            width: 80px;
            margin-right: 20px;
        }
    }

    .bottom {
        position: absolute;
        top: 700px;
        left: 50px;
        height: 50px;
        width: 95%;
        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;
            }
        }
    }
}
</style>