import { useEffect } from 'react'
import {Button, Col, Form, Input, Row, DatePicker, Select} from 'antd'
import {DownOutlined, RedoOutlined, SearchOutlined} from '@ant-design/icons'
import style from '@/global.less'
import dayjs from 'dayjs'
const { Item: FormItem } = Form

const StaffSheetRenderSimpleForm = (props) => {
    const [form] = Form.useForm()
    const { handleSearch, handleFormReset, toggleForm, params } = props

    useEffect(() => {
        form.setFieldsValue({
            user_name: params?.user_name,
            user_name_cn: params?.user_name_cn,
        })
    }, [params])

    const onFinish = values => {
        handleSearch(values)
    }

    const myHandleFormReset = () => {
        form.resetFields()
        handleFormReset()
    }

    return (
        <Form form={form} onFinish={onFinish} layout='inline'>
            <Row gutter={{ md: 8, lg: 24, xl: 48 }} className={style.searchInput}>
                <Col md={4} sm={24}>
                    <FormItem label='我的查询条件' name='wdcxtj'>
						<Select
						  placeholder='请选择'
						  options={[]}
						/>
                    </FormItem>
                </Col>
				
				<Col md={4} sm={24}>
				    <FormItem label='日期' name='rq' rules={[{ required: true, message: '请选择日期!' }]}>
				        <DatePicker defaultValue={dayjs('2025-04-10', 'YYYY-MM-DD')} format='YYYY-MM-DD' />
				    </FormItem>
				</Col>
				
                <Col md={4} sm={24}>
                    <FormItem label='工作地点' name='gzdd'>
                        <Input placeholder='请输入' />
                    </FormItem>
                </Col>
			
				
				<Col md={4} sm={24}>
				    <FormItem label='工号' name='gh'>
				        <Input placeholder='请输入' defaultValue="123456"/>
				    </FormItem>
				</Col>
				
				<Col md={4} sm={24}>
				    <FormItem label='名称' name='gh'>
				        <Input placeholder='请输入'/>
				    </FormItem>
				</Col>

                <Col md={4} sm={24}>
                    <div className={style.searchBtn}>
                        <Button type='primary' htmlType='submit'>
                            查询
                        </Button>

                        <Button onClick={myHandleFormReset}>
                            重置
                        </Button>
                    </div>
                </Col>
            </Row>
        </Form>
    )
}

export default StaffSheetRenderSimpleForm
