<!-- 搜索表单 -->
<template>
    <ProSearch
        :items="formItems"
        ref="searchRef"
        @search="search"
        :initKeys="initKeys"
    />
</template>

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

    const emit = defineEmits(['search']);

    const formItems = reactive([
        {
            type: 'input',
            label: 'ISBN',
            prop: 'isbn',
            placeholder: '请输入ISBN',
            colProps: {
                span: 14
            }
        }
    ]);

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

    const searchRef = ref(null);

    /** 搜索 */
    const search = (data) => {
        emit('search', { ...data });
    };

    defineExpose({
        search
    });
</script>
<style lang="scss" scoped>
    :deep(.el-form-item) {
        width: 100%;
        margin-bottom: 0;
        .el-input {
            width: 300px !important;
        }
    }
</style>
