import { Button, Card, Col, DatePicker, Form, Input, InputNumber, Row, Select, Space } from "antd" import React, { useEffect } from "react" import { getUserAllApi } from "@/services/operating/account"; import { useAjax } from "@/Hook/useAjax"; import { SearchOutlined } from "@ant-design/icons"; import moment from "moment"; interface Props { onSearch?: (value: Partial) => void } // 选择素材搜索 const SelectSearch: React.FC = ({ onSearch }) => { /**********************************/ const [form] = Form.useForm(); const getUserAll = useAjax(() => getUserAllApi()) /**********************************/ useEffect(() => { getUserAll.run() }, []) const handleOk = (values: any) => { console.log(values) let params: any = [] Object.keys(values).forEach(key => { let value = values[key] if (['accountIds', 'adgroupIds', 'dynamicCreativeIds', 'tencentMaterialId'].includes(key) && value !== undefined && value !== null) { let value1 = value.replace(/[,,\s]/g, ',') params[key] = value1.split(',').filter((a: any) => a) } else if ('uploadTime' === key && value?.length === 2) { params.uploadTimeMin = moment(value?.[0]).format('YYYY-MM-DD') params.uploadTimeMax = moment(value?.[1]).format('YYYY-MM-DD') } else if ('dataTime' === key && value?.length === 2) { params.dataTimeMin = moment(value?.[0]).format('YYYY-MM-DD') params.dataTimeMax = moment(value?.[1]).format('YYYY-MM-DD') } else { params[key] = value } }) onSearch?.(params) } return
((option?.label ?? '') as any).toLowerCase().includes(input.toLowerCase()) } style={{ width: 190 }} maxTagCount={1} mode="multiple" allowClear options={getUserAll?.data?.map((item: { nickname: any; userId: any }) => ({ label: item.nickname, value: item.userId }))} />