<template>
    <el-card shadow="never" class="!border-none">
        <el-form ref="formRef" class="mb-[-16px]" :model="modelValue" :inline="true">
            <el-form-item label="模板名称">
                <el-input class="w-[280px]" placeholder="请输入" v-model="modelValue.name" clearable @keyup.enter="$emit('resetPage')" />
            </el-form-item>
            <el-form-item label="模板类型">
                <el-select class="w-[280px]" v-model="modelValue.postId">
                    <el-option v-for="option in templateTypeOptions" :key="option.value" :label="option.label" :value="option.value" />
                </el-select>
            </el-form-item>
            <el-form-item>
                <el-button type="primary" @click="$emit('resetPage')">查询</el-button>
                <el-button @click="$emit('resetParams')">重置</el-button>
            </el-form-item>
        </el-form>
    </el-card>
</template>

<script setup lang="ts">
import { templateTypeOptions } from '@/enums'
defineProps({
    modelValue: {
        type: Object,
        default: () => ({
            name: '',
            postId: ''
        })
    }
})
defineEmits(['resetPage', 'resetParams'])
</script>

<style scoped lang="scss"></style>
