<template>
    <div>
        <div class="search-form">
            <el-form
            :inline="true">
                <el-form-item label="主题:">
                    <el-input v-model="form.title"></el-input>
                </el-form-item>
                <el-form-item label="日期:">
                    <el-date-picker
                        type="date"
                        v-model="form.date"
                        placeholder="日期"
                        value-format="yyyy-MM-dd">
                    </el-date-picker>
                </el-form-item>
                <el-form-item>
                    <el-button type="primary" @click="handleSearchClick">搜索</el-button>
                </el-form-item>
            </el-form>
        </div>
        <div class="btn-wrapper">
            <el-button type="primary" @click="handleAddClick"><i class="iconfont icon-btn">&#xe616;</i>新增</el-button>
            <el-button type="primary" @click="handleBatchDeleteClick"><i class="iconfont icon-btn">&#xe617;</i>批量删除</el-button>
            <el-button type="primary" @click="handleExportClick"><i class="iconfont icon-btn">&#xe615;</i>导出</el-button>
            <el-button type="primary" @click="handleImportClick"><i class="iconfont icon-btn">&#xe614;</i>导入</el-button>
            <el-button type="primary" @click="handleCloneClick"><i class="iconfont icon-btn">&#xe62c;</i>复制</el-button>
        </div>
    </div>
</template>
<script>
export default {
    name: 'VFilter',
    data () {
        return {
            form: {
                title: '',
                date: ''
            }
        }
    },
    methods: {
        handleAddClick () {
            this.$emit('add')
        },
        handleBatchDeleteClick () {
            this.$emit('batchDelete')
        },
        handleExportClick () {
            this.$emit('export')
        },
        handleImportClick () {
            this.$emit('import')
        },
        handleSearchClick () {
            let { form } = this
            this.$emit('search', form)
        }

    },
    created () {
    }
}
</script>
<style lang="less" scoped>
.btn-wrapper{
    padding: 0 15px 15px;
}
.search-form {
    padding: 15px 15px 0;
}
</style>
