import { Apis } from '@/gen/Apis';
import { ProFormSelect, QueryFilter } from '@ant-design/pro-components';
import { Form } from 'antd';
type Props = {
  onChange?: (value: any) => void;
};
export default function Search(props: Props) {
  const [form] = Form.useForm();
  return (
    <QueryFilter
      style={{ backgroundColor: '#fff' }}
      defaultCollapsed
      split
      form={form}
      onFinish={props?.onChange}
      onReset={() => {
        props?.onChange?.(form?.getFieldsValue() || {});
      }}
    >
      <ProFormSelect
        name="asset_houses_id"
        label="房屋"
        valueEnum={{
          open: '未解决',
          closed: '已解决',
        }}
        request={async (params) => {
          let res = await Apis.Asset.AssetProjects.Select({
            keywords: params?.keyWords,
            ...params,
          });
          return res?.data;
        }}
        placeholder="请选择房屋"
      />
    </QueryFilter>
  );
}
