chengmw
9 days ago 529af79115af1e72bcd4d9a0dce63bb89cc4a5ab
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
import React from 'react';
import { Form, Input, Select, DatePicker, Button, Row, Col } from 'antd';
import { SearchOutlined, ReloadOutlined } from '@ant-design/icons';
 
const { RangePicker } = DatePicker;
const { Option } = Select;
 
/**
 * 案例搜索表单组件
 */
const CaseSearchForm = ({ onSearch, loading }) => {
  const [form] = Form.useForm();
 
  const handleFinish = (values) => {
    const { dateRange, ...rest } = values;
    const params = {
      ...rest,
      dateFrom: dateRange?.[0]?.format('YYYY-MM-DD'),
      dateTo: dateRange?.[1]?.format('YYYY-MM-DD'),
    };
    onSearch(params);
  };
 
  const handleReset = () => {
    form.resetFields();
  };
 
  return (
    <Form
      form={form}
      layout="vertical"
      onFinish={handleFinish}
      initialValues={{
        keyword: '',
        disputeType: undefined,
        caseType: undefined,
        region: undefined,
      }}
    >
      <Row gutter={16}>
        <Col span={12}>
          <Form.Item label="关键字" name="keyword">
            <Input
              placeholder="请输入案例关键字、案号、当事人等"
              allowClear
            />
          </Form.Item>
        </Col>
        <Col span={12}>
          <Form.Item label="纠纷类型" name="disputeType">
            <Select placeholder="请选择纠纷类型" allowClear>
              <Option value="欠薪">欠薪纠纷</Option>
              <Option value="解除合同">解除劳动合同</Option>
              <Option value="工伤赔偿">工伤赔偿</Option>
              <Option value="加班费">加班费争议</Option>
              <Option value="社保">社保公积金</Option>
              <Option value="其他">其他</Option>
            </Select>
          </Form.Item>
        </Col>
      </Row>
 
      <Row gutter={16}>
        <Col span={12}>
          <Form.Item label="案件类型" name="caseType">
            <Select placeholder="请选择案件类型" allowClear>
              <Option value="判决">判决</Option>
              <Option value="调解">调解</Option>
              <Option value="仲裁">仲裁</Option>
            </Select>
          </Form.Item>
        </Col>
        <Col span={12}>
          <Form.Item label="地区" name="region">
            <Input placeholder="请输入省市地区,如:北京市" allowClear />
          </Form.Item>
        </Col>
      </Row>
 
      <Row gutter={16}>
        <Col span={12}>
          <Form.Item label="裁判/调解日期" name="dateRange">
            <RangePicker style={{ width: '100%' }} />
          </Form.Item>
        </Col>
      </Row>
 
      <Row>
        <Col span={24} style={{ textAlign: 'right' }}>
          <Button
            type="primary"
            htmlType="submit"
            icon={<SearchOutlined />}
            loading={loading}
            style={{ marginRight: 8 }}
          >
            查询
          </Button>
          <Button icon={<ReloadOutlined />} onClick={handleReset}>
            重置
          </Button>
        </Col>
      </Row>
    </Form>
  );
};
 
export default CaseSearchForm;