<template>
    <div>
        <div class="header">
            <el-form label-width="120px">
                <div style="display: flex; padding:10px;">
                    <el-form-item label="任务名称：">
                        <el-input v-model="form.taskName" placeholder="请输入"></el-input>
                    </el-form-item>
                    <el-form-item label="任务组名：">
                        <el-select v-model="form.taskGroupName" placeholder="全部">
                            <el-option value="" label=""></el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item label="任务状态：">
                        <el-select v-model="form.taskStatus" placeholder="全部">
                            <el-option value="" label=""></el-option>
                        </el-select>
                    </el-form-item>
                    <el-button style="padding: 5px;width: 80px; height: 30px; margin: 6px 20px 0 600px;">重置</el-button>
                    <el-button
                        style="padding: 5px;width: 80px;height: 30px; margin-top:6px; background-color: #409EFF;color: #FFF;">查询</el-button>
                </div>
            </el-form>
        </div>
        <div class="content">
            <div style="margin: 10px; float: left;">
                <el-button
                    style="padding: 5px;width: 80px;position: relative;background-color: #409EFF;color: #FFF;">新增</el-button>
                <el-button style="padding: 5px;width: 80px;position: relative;background-color: #409EFF;color: #FFF;"
                    @click="alterTask()">修改</el-button>
                <el-button
                    style="padding: 5px;width: 80px;position: relative;background-color: #409EFF;color: #FFF;">导出</el-button>
                <el-button
                    style="padding: 5px;width: 80px;position: relative;background-color: #409EFF;color: #FFF;">日志</el-button>
                <el-button style="padding: 5px;width: 80px;position: relative;background-color: #FFF;">删除</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="taskID" label="任务编号">
                </el-table-column>
                <el-table-column prop="taskName" label="任务名称">
                </el-table-column>
                <el-table-column prop="taskGroupName" label="任务组名">
                </el-table-column>
                <el-table-column prop="taskString" label="使用目标字符串">
                </el-table-column>
                <el-table-column prop="cron" label="cron 执行表达式">
                </el-table-column>
                <el-table-column prop="status" label="状态">
                    <template slot-scope="scope">
                        <el-switch v-model="scope.row.status" active-color="#13ce66" inactive-color="#ff4949"></el-switch>
                    </template>
                </el-table-column>
                <el-table-column prop="operation" label="操作">
                    <template slot-scope="scope">
                        <el-button v-show="scope.row.taskID == null ? false : true" size="mini" type="text">查看</el-button>
                        <el-button v-show="scope.row.taskID == null ? false : true" size="mini" type="text">编辑</el-button>
                        <el-button v-show="scope.row.taskID == 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 type="text">批量删除</el-button>
                <el-divider direction="vertical"></el-divider>
                <el-button type="text">批量激活</el-button>
                <el-divider direction="vertical"></el-divider>
                <el-button type="text">导出数据</el-button>
            </div>
            <page></page>
        </div>
        <alterTask ref="altertask"></alterTask>
    </div>
</template>

<script>
import checkbox from '@/components/Checkbox/index'
import page from '@/components/pagination/index'
import alterTask from '../messageDialog/alterTask'
export default {
    components: { checkbox, page, alterTask },
    data() {
        return {
            total: 0,
            input: '',
            show: true,
            form: {
                taskName: '',
                taskGroupName: '',
                taskStatus: ''
            },
            tableData: [
                {
                    taskID: '1',
                    taskName: '采集视频云平台',
                    taskGroupName: '系统',
                    taskString: 'xxx.xxx.xxx.xxx',
                    cron: '001***?',
                    status: 'true'
                },
                {
                    taskID: '1',
                    taskName: '采集视频云平台',
                    taskGroupName: '系统',
                    taskString: 'xxx.xxx.xxx.xxx',
                    cron: '001***?',
                    status: 'true'
                },
                {
                    taskID: '1',
                    taskName: '采集视频云平台',
                    taskGroupName: '系统',
                    taskString: 'xxx.xxx.xxx.xxx',
                    cron: '001***?',
                    status: 'false'
                },
            ],
        }
    },

    methods: {
        handleSelectionChange() {

        },
        cancleChecked() {

        },
        alterTask() {
            this.$refs.altertask.dialogVisible = true;
        }
    }
}
</script>

<style lang="less" scoped>
.header {
    margin: 0 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%;

}

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

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


.bottom {
    position: absolute;
    left: 30px;
    right: 16px;
    bottom: 20px;
    height: 50px;
    line-height: 20px;
    background-color: rgba(255, 255, 255, 1);
    display: flex;
    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 {
        margin: 5px 0 0 200px;
    }
}
</style>