import { SearchOutlined } from "@ant-design/icons"
import React from "react"
import { FormConfig } from '@/components/Formitem/type'

let config = (backISP: (bookName: string) => void, backAdvertisers: (platformId: string) => void, backPitcher:(platformId: string) => void, backState: (platformId: string) => void, backPlanName: (plan: string) => void, fnc: () => void, platform: any[], searchValue: any[]): FormConfig[] => [
    {
        tag: 'select',
        name: 'bookName',
        children: [{ value: '1', text: '服务商1' }, { value: '2', text: '服务商2' }],
        change: true,
        width: 200,
        // mode:"multiple",
        placeholder: "选择服务商",
        callback: backISP
    },
    {
        tag: 'select',
        name: 'platformId',
        children: platform,
        change: true,
        width: 200,
        placeholder: "选择广告主名称",
        callback: backAdvertisers  // 
    },
    {
        tag: 'select',
        name: 'pitcher',
        children: searchValue,
        change: true,
        width: 200,
        placeholder: "选择投手",
        callback: backPitcher
    },
    {
        tag: 'select',
        name: 'state',
        children: [{text: '创建成功', value: '创建成功'}, {text: '创建中', value: '创建中'}, {text: '创建失败', value: '创建失败'}],
        change: true,
        width: 200,
        placeholder: "选择状态",
        callback: backState
    },
    {
        tag: 'input',
        name: 'layout_name',
        change: true,
        width: 200,
        placeholder: "输入计划名称搜索/ID",
        callback: (e)=>{backPlanName(e.target.value)}
    },
    {
        label: '查询',
        icon: <SearchOutlined />,
        tag: 'button',
        htmlType: 'button',
        btnType: 'primary',
        name: 'zx',
        callback: fnc
    }
]

export default config