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

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

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

    const formItems = reactive([
        { type: 'input', label: '仓库联系人', prop: 'contactsName' },
        { type: 'input', label: '联系人电话', prop: 'phoneNum' },
        {
            type: 'dictSelect',
            label: '图书审核提示状态',
            prop: 'checkTips',
            props: { code: 'is_open_close' }
        },
        {
            type: 'dictSelect',
            label: '绑定审核员状态',
            prop: 'bindChecker',
            props: { code: 'is_open_close' }
        },
        {
            type: 'dictSelect',
            label: '异常签收状态',
            prop: 'abnormalSign',
            props: { code: 'is_open_close' }
        },
        { type: 'input', label: '仓库名称', prop: 'godownName' }
    ]);

    const initKeys = reactive({
        schoolName: '',
        provinceId: '',
        cityId: '',
        schoolLevel: '',
        departmentName: '',
        shcoolTag: ''
    });

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