import { Button, Card, Col, 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"; import '../../tencentAdPutIn/index.less' interface Props { onSearch?: (value: Partial) => void } /** * 远程素材库 * @param param0 * @returns */ const Search: 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) { 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 ('sizeQueries' === key) { params[key] = [value] } 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 }))} /> */}
} export default React.memo(Search)