Blame view

src/pages/contract/AuthorizationSetting/components/Filter/index.tsx 1.18 KB
fcdb5f0d   谢忠泽   add:合同授权
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
  import React, { useCallback, useState } from "react";
  import { Row, Col, Select } from "antd";
  import * as common from "@/typing/common";
  import _ from "lodash";
  import * as API from '../../api';
  
  interface Props{
      contractTypesList?:any[],
      setParams:any,
      innerParams?:any,
  }
  
  function Filter({ contractTypesList, innerParams, setParams }:Props) {
      const onChange = _.debounce((contractTypeName: string) => {
          setParams({...innerParams, contractTypeName}, true);
      }, 350);
      return (
        <Row
          style={{ display: 'flex', flex: 1 }}
        >
          <Col span={12}>
            <Select
              placeholder="请选择合同类型"
              showSearch
              optionFilterProp="children"
              allowClear
              style={{ width: 200 }}
              onChange={(contractTypeName) => onChange(contractTypeName)}
            >
              {
                  contractTypesList && contractTypesList.map((item:any) => (
                    <Select.Option value={item.name} key={item.id}>
                      {item.name}
                    </Select.Option>
                  ))
              }
            </Select>
          </Col> 
        </Row>
      );
  }
  
  export default Filter;