<template>
    <el-card shadow="always" class="search_header_top_row1">

        <el-form :inline="true" :model="filterForm" class="demo-form-inline">
            <el-form-item label="企业名称">
                <el-input v-model.trim="filterForm.companyName" placeholder="请输入企业名称" clearable />
            </el-form-item>
            <el-form-item label="统一社会信用代码">
                <el-input v-model.trim="filterForm.creditCode" placeholder="请输入统一社会信用代码" clearable />
            </el-form-item>
            <el-form-item label="用户名">
                <el-input v-model.trim="filterForm.userName" placeholder="请输入用户名" clearable />
            </el-form-item>
            <el-form-item label="发布时间">
                <el-date-picker v-model.trim="filterForm.dataRange" type="daterange" range-separator="To"
                    start-placeholder="Start date" end-placeholder="End date" />
            </el-form-item>
            <el-form-item>
                <el-button type="primary" @click="serachFn">查询</el-button>
                <el-button type="plain" @click="resetFn">重置</el-button>
            </el-form-item>
        </el-form>
        <div>
            <el-button type="primary" @click="exportFn">导出</el-button>
        </div>
    </el-card>
</template>

<script lang="ts" setup>
const emits = defineEmits(['search', 'reset', 'export'])
import { getdatatime } from "utils/time"
const filterForm: any = reactive({
    keyword: '',
    companyName: '',
    creditCode: '',
    dataRange: [


    ],
    userName: ''
})
/* 
 "beginTime": "string",
  "companyName": "string",
  "creditCode": "string",
  "endTime": "string",
  "isAsc": "string",
  "orderByColumn": "string",
  "pageNum": 0,
  "pageSize": 0,
  "reasonable": true,
  "userName": "string"


*/
const serachFn = () => {
    emits('search', filterForm)
}

const resetFn = () => {
    filterForm.keyword = ''
    filterForm.companyName = ''
    filterForm.creditCode = ''
    filterForm.dataRange =  getdatatime()
    filterForm.userName = ''
    emits('reset',filterForm)
}

const exportFn = () => {
    emits('export')
}

onMounted(() => {
    filterForm.dataRange = getdatatime()
})

</script>

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