import { useEffect } from 'react'
import {Button, Col, Form, Input, Row, DatePicker, Select, Checkbox} from 'antd'
import {DownOutlined, RedoOutlined, SearchOutlined, SettingOutlined} from '@ant-design/icons'
import styles from '../StaffUPHList.less'
import dayjs from 'dayjs'
const { Item: FormItem } = Form
const CheckboxGroup = Checkbox.Group;
const plainOptions = ['Apple', 'Pear', 'Orange','Apple1', 'Pear1', 'Orange1'];
const defaultCheckedList = ['Apple', 'Orange'];
const StaffUPHRenderSimpleForm = (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={styles.searchInput}>
			        <Col md={2} sm={24}>
			            <FormItem label='' name='alldata'>
							<Select
							  placeholder='请选择'
							  defaultValue="1"
							  className={styles.searchSelectFirst}
							  options={[
								  { value: '1', label: '全部数据' },
							  ]}
							/>
			            </FormItem>
			        </Col>
					
					<Col md={20} sm={24}>
					    <FormItem label='' name='rq'>
					        <Select
					          placeholder='请选择'
							  mode="multiple"
							  defaultValue={['1', '2']}
							  className={styles.searchSelectSecond}
					          options={[
					        	  { value: '1', label: '日历方式: 日'},
								  { value: '2', label: '日期方式: 考勤方式'},
								  { value: '3', label: '全部数据2'},
					          ]}
					        />
					    </FormItem>
					</Col>
			
			        <Col md={1} sm={24}>
			            <div className={styles.searchBtn}>
			                <Button onClick={myHandleFormReset}>
								保存条件
			                </Button>
			            </div>
			        </Col>
			    </Row>
				<div className={styles.searchCondition}>
					<div className={styles.searchConditionFirst}>
						<div>
							<DownOutlined />
							<div className={styles.searchConditionLeft}>筛选</div>
							<SettingOutlined />
						</div>
						<div>清空</div>
					</div>
					<div className={styles.searchConditionSecond}>
						<FormItem label='' name='1'>
						    <Checkbox defaultChecked={true}><span style={{color: "red"}}>*</span> 日历方式</Checkbox>
						</FormItem>
						<FormItem label='' name='2'>
						    <Checkbox defaultChecked={true}><span style={{color: "red"}}>*</span> 日期方式</Checkbox>
						</FormItem>
						<FormItem label='' name='3'>
						    <Checkbox defaultChecked={true}><span style={{color: "red"}}>*</span> 日期</Checkbox>
						</FormItem>
						<FormItem label='' name='4'>
						    <Checkbox defaultChecked={true}><span style={{color: "red"}}>*</span> 行业</Checkbox>
						</FormItem>
						<FormItem label='' name='5'>
						    <Checkbox defaultChecked={true}><span style={{color: "red"}}>*</span> 子行业</Checkbox>
						</FormItem>
						<FormItem label='' name='6'>
						    <Checkbox defaultChecked={true}><span style={{color: "red"}}>*</span> 工作点</Checkbox>
						</FormItem>
						<FormItem label='' name='7'>
						    <Checkbox>劳动力工号</Checkbox>
						</FormItem>
						<FormItem label='' name='8'>
						    <Checkbox>工序</Checkbox>
						</FormItem>
						<FormItem label='' name='9'>
						    <Checkbox defaultChecked={true}><span style={{color: "red"}}>*</span> 日期维度</Checkbox>
						</FormItem>
						<FormItem label='' name='10'>
						    <Checkbox defaultChecked={true}><span style={{color: "red"}}>*</span> 组织层级</Checkbox>
						</FormItem>
						<FormItem label='' name='11'>
						    <Checkbox defaultChecked={true}><span style={{color: "red"}}>*</span> 工作方式</Checkbox>
						</FormItem>
						<FormItem label='' name='12'>
						    <Checkbox defaultChecked={true}><span style={{color: "red"}}>*</span> 工作性质</Checkbox>
						</FormItem>
						<FormItem label='' name='13'>
						    <Checkbox defaultChecked={true}><span style={{color: "red"}}>*</span> 多仓汇总</Checkbox>
						</FormItem>
						<FormItem label='' name='14'>
						    <Checkbox>工作组</Checkbox>
						</FormItem>
					</div>
				</div>
			</Form>
		</>
    )
}

export default StaffUPHRenderSimpleForm
