<!-- 搜索表单 -->
<template>
    <ele-card :body-style="{ padding: '0px' }">
        <ProSearch
            :offset="1"
            :items="formItems"
            ref="searchRef"
            @search="search"
            :initKeys="initKeys"
        />
    </ele-card>
</template>

<script setup>
    import { reactive, ref, defineEmits, getCurrentInstance } from 'vue';
    import ProSearch from '@/components/CommonPage/ProSearch2.vue';

    let { proxy } = getCurrentInstance();
    const emit = defineEmits(['search']);

    const formItems = reactive([
        {
            type: 'date',
            label: '选择时间',
            prop: 'time',
            props: {
                format: 'YYYY-MM-DD',
                valueFormat: 'YYYY-MM-DD',
                placeholder: '请选择时间'
            }
        }
    ]);

    const initKeys = reactive({
        time: ''
    });

    const searchRef = ref(null);
    /** 搜索 */
    const search = (data) => {
        emit('search', { ...data });
    };
</script>
