index.tsx 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873
  1. import { Button, Col, DatePicker, Form, Input, Radio, Row, Select, Space } from "antd"
  2. import React, { useEffect, useState } from "react"
  3. import moment from "moment"
  4. import { useAjax } from "@/Hook/useAjax"
  5. import { getAllOfOwnerUserApi, getChannelChoiceListApi, getGameChoiceListApi, getGameChoiceParentListType1Api, getPayListApi, getSubUserWithSelfListApi, getTtAllUserListApi, getUserSystemTypeChoiceListApi } from "@/services/gameData"
  6. import { ActiveEnum, PayStatus, TYPE, gameClassifyEnum } from "./const"
  7. import { ADSTATUSEnum as ADSTTTATUSEnum } from "@/pages/gameDataStatistics/adlist/monitor/const"
  8. import { ADSTATUSEnum } from "@/pages/gameDataStatistics/adlist/tencentMonitor/const"
  9. import IntervalTime from "./intervalTime"
  10. interface Props {
  11. onChange?: (data: any) => void
  12. /** 默认值 */
  13. initialValues?: any
  14. /** 开启数据源搜索 */
  15. isSource?: boolean,
  16. /** 是否开启 广告账号 搜索 */
  17. isAccount?: boolean
  18. /** 是否开启 广告账户ID 搜索 */
  19. isAccountId?: boolean
  20. /** 是否开启 公司ID 搜索 */
  21. isCompanyId?: boolean
  22. /** 是否开启 CPID 搜索 */
  23. isCpId?: boolean
  24. /** 是否开启 cp名 搜索 */
  25. isCpName?: boolean
  26. /** 是否开启 CP方订单ID 搜索 */
  27. isCpOrderId?: boolean
  28. /** 是否开启 CP通知状态 搜索 */
  29. isCpStatus?: boolean
  30. /** 是否开启 订单创建日期 搜索 */
  31. isCreateDay?: {
  32. ranges?: any
  33. }
  34. /** 是否开启 操作设备 搜索 */
  35. isDevice?: boolean
  36. /** 是否开启 注册游戏名 搜索 */
  37. isRechargeGameName?: boolean
  38. /** 是否开启 游戏名 搜索 */
  39. isGameName?: boolean
  40. /** 是否开启 游戏ID 搜索 */
  41. isGameId?: boolean
  42. isGameIds?: boolean
  43. /** 是否开启 充值游戏ID 搜索 */
  44. isOrderGameId?: boolean
  45. /** 是否开启 父游戏ID 搜索 */
  46. isParentId?: boolean
  47. /** 是否开启 游戏应用类型 搜索 */
  48. isGameType?: boolean
  49. /** 是否开启 游戏角色名 搜索 */
  50. isGameRoleName?: boolean
  51. /** 是否开启 游戏角色名ID 搜索 */
  52. isGameRoleId?: boolean
  53. /** 是否开启 是否首充 搜索 */
  54. isFirstRecharge?: boolean
  55. /** 是否开启 是否切量 搜索 */
  56. isSwitch?: boolean
  57. /** 是否开启 收款商户号 搜索 */
  58. isMerchantNo?: boolean
  59. /** 是否开启 商户订单ID 搜索 */
  60. isOrderId?: boolean
  61. /** 是否开启 商户订单号 搜索 */
  62. isMerchantOrderNo?: boolean
  63. /** 是否开启 支付状态 搜索 */
  64. isPayStatus?: boolean
  65. /** 是否开启 支付方式 搜索 */
  66. isPayWay?: boolean
  67. /** 是否开启 产品名称 搜索 */
  68. isProductName?: boolean
  69. /** 是否开启 注册渠道名 搜索 */
  70. isRegAgent?: boolean
  71. /** 是否开启 渠道名称 搜索 */
  72. isAgentName?: boolean
  73. /** 是否开启 注册渠道ID 搜索 */
  74. isAgentId?: boolean
  75. /** 是否开启 渠道标识 搜索 */
  76. isAgentKey?: boolean
  77. /** 是否开启 投放渠道名 搜索 */
  78. isPutAgent?: boolean
  79. /** 是否开启 用户注册日期 搜索 */
  80. isRegDay?: {
  81. ranges?: any
  82. }
  83. /** 是否开启 投手名称 搜索 */
  84. isSysUserName?: boolean
  85. /** 是否开启 投手ID 搜索 */
  86. isSysUserId?: boolean
  87. /** 是否开启 玩家账号 搜索 */
  88. isUserName?: boolean
  89. /** 是否开启 用户ID 搜索 */
  90. isUserId?: boolean
  91. /** 是否开启 不同排行榜选择 搜索 */
  92. isSelectRanking?: boolean
  93. /** 是否开启 消耗日期 搜索 */
  94. isConsumeDay?: {
  95. ranges?: any
  96. }
  97. /** 是否开启 充值日期 搜索 */
  98. rechargeDay?: {
  99. ranges?: any
  100. }
  101. /** 是否开启 支付时间 搜索 */
  102. payTimeDay?: {
  103. ranges?: any
  104. }
  105. /** 是否开启 下单时间 搜索 */
  106. placeAnOrderDay?: {
  107. ranges?: any
  108. }
  109. /** 是否开启布谷 游戏类型 筛选 */
  110. isBGGameClassify?: boolean,
  111. /** 是否开启 单个充值日期 选择 */
  112. isRechargeDate?: boolean,
  113. /** 是否开启 开始时间 结束时间 搜索 */
  114. isBeginDay?: boolean
  115. /** 是否开启 玩家ID 搜索 */
  116. isGameUserId?: boolean
  117. /** 是否开启 操作系统 选择 */
  118. isOs?: boolean
  119. /** 是否开启 推广媒体 选择 */
  120. isType?: boolean
  121. /** 是否开启 计划ID 搜索 */
  122. isProjectId?: boolean
  123. /** 是否开启 计划名称 搜索 */
  124. isProjectName?: boolean
  125. /** 是否开启 广告ID 搜索 */
  126. isPromotionId?: boolean
  127. /** 是否开启 广告名称 搜索 */
  128. isPromotionName?: boolean
  129. /** 是否开启 头条广告状态 搜索 */
  130. isAdTTStatus?: boolean
  131. /** 是否开启 腾讯广告状态 搜索 */
  132. isAdTXStatus?: boolean
  133. /** 是否开启 展示数据类型(买量,自然,总) 搜索 */
  134. isUserEnterType?: boolean
  135. /** 是否开启 区服名称 搜索 */
  136. isServerName?: boolean
  137. /** 是否开启区服ID 搜索 */
  138. isServerId?: boolean
  139. /** 是否开启 开服时间 搜索 */
  140. isServerDay?: {
  141. ranges?: any
  142. }
  143. /** 是否开启 充值到支付的间隔时间 搜索 */
  144. isPayIntervalTime?: {
  145. tips?: string
  146. }
  147. /** 是否开启 留存数据的类型 搜索 */
  148. isActiveTypes?: boolean
  149. }
  150. /**
  151. * 游戏数据系统 请求参数
  152. * @returns
  153. */
  154. const QueryForm: React.FC<Props> = (props) => {
  155. /**************************/
  156. const {
  157. onChange, initialValues, isSource, isAccount, isAccountId, isCompanyId, isAgentKey, isAgentName, isCpId, isCpName, isCpOrderId, isCpStatus, isCreateDay, isDevice, isGameName, isRechargeGameName, isGameId, isGameIds, isOrderGameId, isGameRoleId,
  158. isGameRoleName, isFirstRecharge, isSwitch, isMerchantNo, isOrderId, isMerchantOrderNo, isPayStatus, isPayWay, isProductName, isRegAgent, isAgentId, isPutAgent, isRegDay, isOs, isParentId, isProjectId, isProjectName, isPromotionId, isPromotionName,
  159. isSysUserName, isRechargeDate, isBGGameClassify, isGameUserId, isSysUserId, isUserName, isUserId, isSelectRanking, isGameType, isConsumeDay, rechargeDay, isBeginDay, isType, isAdTTStatus, isUserEnterType, isServerName, isServerId, isServerDay, isAdTXStatus,
  160. payTimeDay, placeAnOrderDay, isPayIntervalTime, isActiveTypes
  161. } = props
  162. const [form] = Form.useForm()
  163. const [accountList, setAccountList] = useState<any[]>([])
  164. const [userIdList, setUserIdList] = useState<any[]>([])
  165. const getAllOfOwnerUser = useAjax(() => getAllOfOwnerUserApi())
  166. const getTtAllUserList = useAjax(() => getTtAllUserListApi())
  167. const getGameChoiceList = useAjax(() => getGameChoiceListApi())
  168. const getSubUserWithSelfList = useAjax(() => getSubUserWithSelfListApi())
  169. const getChannelChoiceList = useAjax(() => getChannelChoiceListApi())
  170. const getGameChoiceParentListType1 = useAjax(() => getGameChoiceParentListType1Api())
  171. const getUserSystemTypeChoiceList = useAjax(() => getUserSystemTypeChoiceListApi())
  172. const getPayList = useAjax(() => getPayListApi())
  173. /**************************/
  174. useEffect(() => {
  175. if (isAccountId) {
  176. // 请求广告账号列表
  177. async function getAccount() {
  178. let data: any[] = []
  179. let res1 = await getAllOfOwnerUser.run()
  180. let data1 = []
  181. if (res1) {
  182. data1 = res1?.map((item: any) => ({ label: item.accountId, value: item.accountId, corporationName: item.corporationName }))
  183. }
  184. let res2 = await getTtAllUserList.run()
  185. let data2 = []
  186. if (res2) {
  187. data2 = res2?.map((item: any) => ({ label: item.accountId, value: item.accountId, corporationName: item.accountName }))
  188. }
  189. data = [...data1, ...data2]
  190. setAccountList(data)
  191. }
  192. getAccount()
  193. }
  194. }, [isAccountId])
  195. /** 游戏列表 */
  196. useEffect(() => {
  197. if (isGameId || isOrderGameId || isParentId || isGameIds) {
  198. getGameChoiceList.run()
  199. }
  200. }, [isGameId, isGameIds, isOrderGameId, isParentId])
  201. /** 投手列表 */
  202. useEffect(() => {
  203. if (isSysUserId) {
  204. getSubUserWithSelfList.run().then(res => {
  205. // let loginUserId = localStorage.getItem('userId')
  206. // let nameList = ['杨安明', '曹春林', '杨泽健', '金勇旭', '杨雨霏', '毛斌峰', '董平']
  207. // if (loginUserId && ['158', '120', '119', '289', '399'].includes(loginUserId)) {
  208. // setUserIdList(res.filter((item: any) => nameList.includes(item.nickname)))
  209. // } else {
  210. // setUserIdList(res)
  211. // }
  212. setUserIdList(res ? Object.keys(res)?.map(key => ({ userId: key, nickname: res[key] })) : [])
  213. })
  214. }
  215. }, [isSysUserId])
  216. /** 推广渠道 */
  217. useEffect(() => {
  218. if (isAgentId) {
  219. getChannelChoiceList.run()
  220. }
  221. }, [isAgentId])
  222. /** 游戏应用类型 */
  223. useEffect(() => {
  224. if (isGameType) {
  225. getGameChoiceParentListType1.run()
  226. }
  227. }, [isGameType])
  228. /** 操作系统 */
  229. useEffect(() => {
  230. if (isOs) {
  231. getUserSystemTypeChoiceList.run()
  232. }
  233. }, [isOs])
  234. /** 支付方式 */
  235. useEffect(() => {
  236. if (isPayWay) {
  237. getPayList.run()
  238. }
  239. }, [isPayWay])
  240. const onFinish = (data: any) => {
  241. // 处理订单创建日期
  242. if (isCreateDay) {
  243. if (data?.createDay && data?.createDay?.length > 0) {
  244. data.beginOrderTime = moment(data?.createDay[0]).format('YYYY-MM-DD')
  245. data.endOrderTime = moment(data?.createDay[1]).format('YYYY-MM-DD')
  246. } else {
  247. data.beginOrderTime = ''
  248. data.endOrderTime = ''
  249. }
  250. delete data.createDay
  251. }
  252. // 处理 用户注册日期
  253. if (isRegDay) {
  254. if (data?.regDay && data?.regDay?.length > 0) {
  255. data.regStartDay = moment(data?.regDay[0]).format('YYYY-MM-DD')
  256. data.regEndDay = moment(data?.regDay[1]).format('YYYY-MM-DD')
  257. } else {
  258. data.regStartDay = ''
  259. data.regEndDay = ''
  260. }
  261. delete data.regDay
  262. }
  263. // 处理 消耗日期
  264. if (isConsumeDay) {
  265. if (data?.consumeDay && data?.consumeDay?.length > 0) {
  266. data.costBeginDay = moment(data?.consumeDay[0]).format('YYYY-MM-DD')
  267. data.costEndDay = moment(data?.consumeDay[1]).format('YYYY-MM-DD')
  268. } else {
  269. data.costBeginDay = ''
  270. data.costEndDay = ''
  271. }
  272. delete data.consumeDay
  273. }
  274. // 处理 不同排行榜 选择
  275. if (isSelectRanking) {
  276. switch (data?.dateType) {
  277. case 'all':
  278. data.beginDay = ''
  279. data.endDay = ''
  280. break;
  281. case 'today':
  282. data.beginDay = moment().format('YYYY-MM-DD')
  283. data.endDay = moment().format('YYYY-MM-DD')
  284. break
  285. case 'yesterday':
  286. data.beginDay = moment().subtract(1, 'd').format('YYYY-MM-DD')
  287. data.endDay = moment().subtract(1, 'd').format('YYYY-MM-DD')
  288. break
  289. case '7days':
  290. data.beginDay = moment().subtract(7, 'd').format('YYYY-MM-DD')
  291. data.endDay = moment().format('YYYY-MM-DD')
  292. break
  293. case '30days':
  294. data.beginDay = moment().subtract(30, 'd').format('YYYY-MM-DD')
  295. data.endDay = moment().format('YYYY-MM-DD')
  296. break
  297. }
  298. delete data?.dateType
  299. }
  300. console.log('更新了字段---->', data);
  301. onChange && onChange(data)
  302. }
  303. return <Form layout="inline" className='queryForm' initialValues={initialValues} name="basic" form={form} onFinish={onFinish}>
  304. <Row gutter={[0, 6]}>
  305. {/* 数据源搜索 */}
  306. {isSource && <Col><Form.Item name='sourceSystem'>
  307. <Select
  308. showSearch
  309. style={{ width: 100 }}
  310. allowClear
  311. placeholder={'数据源选择'}
  312. filterOption={(input, option) =>
  313. (option?.children as any)?.toLowerCase().indexOf(input.toLowerCase()) >= 0
  314. }
  315. >
  316. <Select.Option value="BG_OLD">布谷-old</Select.Option>
  317. <Select.Option value="BG_NEW">布谷-new</Select.Option>
  318. <Select.Option value="ZX_SDK">布谷-zx</Select.Option>
  319. <Select.Option value="ZX_ONE">赞象</Select.Option>
  320. </Select>
  321. </Form.Item></Col>}
  322. {/* 展示数据类型 */}
  323. {isUserEnterType && <Col><Form.Item name='tableTypes'>
  324. <Select
  325. showSearch
  326. style={{ width: 130 }}
  327. allowClear
  328. placeholder={'展示数据类型'}
  329. filterOption={(input, option) =>
  330. (option?.children as any)?.toLowerCase().indexOf(input.toLowerCase()) >= 0
  331. }
  332. >
  333. <Select.Option value="buy">买量</Select.Option>
  334. <Select.Option value="nature">自然量</Select.Option>
  335. <Select.Option value="total">总量</Select.Option>
  336. </Select>
  337. </Form.Item></Col>}
  338. {isActiveTypes && <Col><Form.Item name='activeTypes'>
  339. <Select
  340. showSearch
  341. style={{ width: 130 }}
  342. placeholder={'留存数据的类型'}
  343. filterOption={(input, option) =>
  344. (option?.children as any)?.toLowerCase().indexOf(input.toLowerCase()) >= 0
  345. }
  346. >
  347. {Object.keys(ActiveEnum).map(key => <Select.Option value={key} key={key}>{ActiveEnum[key]}</Select.Option>)}
  348. </Select>
  349. </Form.Item></Col>}
  350. {/* 不同排行榜选择 */}
  351. {isSelectRanking && <Col><Form.Item name='dateType'>
  352. <Radio.Group>
  353. <Radio.Button value="all">总排行</Radio.Button>
  354. <Radio.Button value="today">今日排行</Radio.Button>
  355. <Radio.Button value="yesterday">昨日排行</Radio.Button>
  356. <Radio.Button value="7days">7日排行</Radio.Button>
  357. <Radio.Button value="30days">30日排行</Radio.Button>
  358. </Radio.Group>
  359. </Form.Item></Col>}
  360. {/* 广告区服名称 */}
  361. {isServerName && <Col><Form.Item name='serverName'>
  362. <Input placeholder="区服名称" allowClear style={{ width: 140 }} />
  363. </Form.Item></Col>}
  364. {/* 广告区服ID */}
  365. {isServerId && <Col><Form.Item name='serverId'>
  366. <Input placeholder="区服ID" allowClear style={{ width: 140 }} />
  367. </Form.Item></Col>}
  368. {/* 广告账户名称 */}
  369. {isAccount && <Col><Form.Item name='accountName'>
  370. <Input placeholder="广告账号名称" allowClear style={{ width: 140 }} />
  371. </Form.Item></Col>}
  372. {/* 广告账号ID */}
  373. {isAccountId && <Col><Form.Item name='accountId'>
  374. <Select
  375. maxTagCount={1}
  376. showSearch
  377. style={{ width: 140 }}
  378. allowClear
  379. placeholder={'广告账号'}
  380. dropdownMatchSelectWidth={false}
  381. filterOption={(input, option) =>
  382. (option?.children as any)?.toLowerCase().indexOf(input.toLowerCase()) >= 0
  383. }
  384. >
  385. {accountList.map(item => <Select.Option key={item.value} value={item.value}>{item.label.toString() + '_' + item.corporationName}</Select.Option>)}
  386. </Select>
  387. </Form.Item></Col>}
  388. {/* 公司ID */}
  389. {isCompanyId && <Col><Form.Item name='companyId'>
  390. <Select
  391. maxTagCount={1}
  392. showSearch
  393. style={{ minWidth: 140 }}
  394. allowClear
  395. placeholder={'请选择公司'}
  396. filterOption={(input, option) =>
  397. (option?.children as any)?.toLowerCase().indexOf(input.toLowerCase()) >= 0
  398. }
  399. >
  400. <Select.Option value={'1'}>公司001</Select.Option>
  401. <Select.Option value={'2'}>公司002</Select.Option>
  402. </Select>
  403. </Form.Item></Col>}
  404. {/* cp名 */}
  405. {isCpName && <Col><Form.Item name='cpName'>
  406. <Input placeholder="CP名称" allowClear style={{ width: 140 }} />
  407. </Form.Item></Col>}
  408. {/* CPID */}
  409. {isCpId && <Col><Form.Item name='cpId'>
  410. <Select
  411. maxTagCount={1}
  412. showSearch
  413. style={{ minWidth: 140 }}
  414. allowClear
  415. placeholder={'请选择CP'}
  416. filterOption={(input, option) =>
  417. (option?.children as any)?.toLowerCase().indexOf(input.toLowerCase()) >= 0
  418. }
  419. >
  420. <Select.Option value={'1'}>CP001</Select.Option>
  421. <Select.Option value={'2'}>CP002</Select.Option>
  422. </Select>
  423. </Form.Item></Col>}
  424. {/* CP方订单ID */}
  425. {isCpOrderId && <Col><Form.Item name='cpOrderId'>
  426. <Input placeholder="CP订单号" style={{ width: 140 }} />
  427. </Form.Item></Col>}
  428. {/* CP通知状态 */}
  429. {isCpStatus && <Col><Form.Item name='cpStatus'>
  430. <Select
  431. maxTagCount={1}
  432. showSearch
  433. style={{ minWidth: 140 }}
  434. allowClear
  435. placeholder={'CP通知状态'}
  436. filterOption={(input, option) =>
  437. (option?.children as any)?.toLowerCase().indexOf(input.toLowerCase()) >= 0
  438. }
  439. >
  440. <Select.Option value={'1'}>待处理</Select.Option>
  441. <Select.Option value={'2'}>成功</Select.Option>
  442. <Select.Option value={'3'}>失败</Select.Option>
  443. </Select>
  444. </Form.Item></Col>}
  445. {/* 计划名称 */}
  446. {isProjectName && <Col><Form.Item name='projectName'>
  447. <Input placeholder="项目名称" allowClear style={{ width: 140 }} />
  448. </Form.Item></Col>}
  449. {/* 计划ID */}
  450. {isProjectId && <Col><Form.Item name='projectId'>
  451. <Input placeholder="项目ID" allowClear style={{ width: 140 }} />
  452. </Form.Item></Col>}
  453. {/* 广告名称 */}
  454. {isPromotionName && <Col><Form.Item name='promotionName'>
  455. <Input placeholder="广告名称" allowClear style={{ width: 140 }} />
  456. </Form.Item></Col>}
  457. {/* 广告ID */}
  458. {isPromotionId && <Col><Form.Item name='promotionId'>
  459. <Input placeholder="广告ID" allowClear style={{ width: 140 }} />
  460. </Form.Item></Col>}
  461. {/* 广告状态 */}
  462. {isAdTTStatus && <Col><Form.Item name='status'>
  463. <Select
  464. maxTagCount={1}
  465. showSearch
  466. style={{ minWidth: 140 }}
  467. allowClear
  468. dropdownMatchSelectWidth={false}
  469. placeholder={'请选择广告状态'}
  470. filterOption={(input, option) =>
  471. (option?.children as any)?.toLowerCase().indexOf(input.toLowerCase()) >= 0
  472. }
  473. >
  474. {Object.keys(ADSTTTATUSEnum).map(key => <Select.Option value={key} key={key}>{ADSTTTATUSEnum[key]}</Select.Option>)}
  475. </Select>
  476. </Form.Item></Col>}
  477. {isAdTXStatus && <Col><Form.Item name='status'>
  478. <Select
  479. maxTagCount={1}
  480. showSearch
  481. style={{ minWidth: 140 }}
  482. allowClear
  483. dropdownMatchSelectWidth={false}
  484. placeholder={'请选择广告状态'}
  485. filterOption={(input, option) =>
  486. (option?.children as any)?.toLowerCase().indexOf(input.toLowerCase()) >= 0
  487. }
  488. >
  489. {Object.keys(ADSTATUSEnum).map(key => <Select.Option value={key} key={key}>{ADSTATUSEnum[key]}</Select.Option>)}
  490. </Select>
  491. </Form.Item></Col>}
  492. {/* 操作设备 */}
  493. {isDevice && <Col><Form.Item name='device'>
  494. <Input placeholder="操作设备" allowClear style={{ width: 140 }} />
  495. </Form.Item></Col>}
  496. {/* 游戏名 */}
  497. {isRechargeGameName && <Col><Form.Item name='rechargeGameName'>
  498. <Input placeholder="游戏名" allowClear style={{ width: 140 }} />
  499. </Form.Item></Col>}
  500. {/* 玩家ID */}
  501. {isGameUserId && <Col><Form.Item name='gameUserId'>
  502. <Input placeholder="玩家ID" allowClear style={{ width: 140 }} />
  503. </Form.Item></Col>}
  504. {/* 游戏名 */}
  505. {isGameName && <Col><Form.Item name='gameName'>
  506. <Input placeholder="游戏名" allowClear style={{ width: 140 }} />
  507. </Form.Item></Col>}
  508. {/* 游戏ID搜索 */}
  509. {isGameId && <Col><Form.Item name='gameId'>
  510. <Select
  511. maxTagCount={1}
  512. showSearch
  513. style={{ minWidth: 140 }}
  514. allowClear
  515. placeholder={'请选择游戏'}
  516. filterOption={(input, option) =>
  517. (option?.children as any)?.toLowerCase().indexOf(input.toLowerCase()) >= 0
  518. }
  519. >
  520. {getGameChoiceList?.data?.map((item: any) => <Select.Option value={item.id} key={item.id}>{item.name}</Select.Option>)}
  521. </Select>
  522. </Form.Item></Col>}
  523. {isGameIds && <Col><Form.Item name='gameId'>
  524. <Select
  525. maxTagCount={1}
  526. mode="multiple"
  527. showSearch
  528. style={{ minWidth: 140 }}
  529. allowClear
  530. placeholder={'请选择游戏'}
  531. filterOption={(input, option) =>
  532. (option?.children as any)?.toLowerCase().indexOf(input.toLowerCase()) >= 0
  533. }
  534. >
  535. {getGameChoiceList?.data?.map((item: any) => <Select.Option value={item.id} key={item.id}>{item.name}</Select.Option>)}
  536. </Select>
  537. </Form.Item></Col>}
  538. {/* 充值游戏ID */}
  539. {isOrderGameId && <Col><Form.Item name='orderGameId'>
  540. <Select
  541. maxTagCount={1}
  542. showSearch
  543. style={{ minWidth: 140 }}
  544. allowClear
  545. placeholder={'请选择充值游戏'}
  546. filterOption={(input, option) =>
  547. (option?.children as any)?.toLowerCase().indexOf(input.toLowerCase()) >= 0
  548. }
  549. >
  550. {getGameChoiceList?.data?.map((item: any) => <Select.Option value={item.id} key={item.id}>{item.name}</Select.Option>)}
  551. </Select>
  552. </Form.Item></Col>}
  553. {/* 父游戏ID */}
  554. {isParentId && <Col><Form.Item name='parentId'>
  555. <Select
  556. maxTagCount={1}
  557. showSearch
  558. style={{ minWidth: 140 }}
  559. allowClear
  560. placeholder={'请选择父游戏'}
  561. filterOption={(input, option) =>
  562. (option?.children as any)?.toLowerCase().indexOf(input.toLowerCase()) >= 0
  563. }
  564. >
  565. {getGameChoiceList?.data?.map((item: any) => <Select.Option value={item.id} key={item.id}>{item.name}</Select.Option>)}
  566. </Select>
  567. </Form.Item></Col>}
  568. {/* 游戏应用类型搜索 */}
  569. {isGameType && <Col><Form.Item name='gameType'>
  570. <Select
  571. maxTagCount={1}
  572. showSearch
  573. style={{ minWidth: 140 }}
  574. allowClear
  575. placeholder={'请选择游戏应用类型'}
  576. filterOption={(input, option) =>
  577. (option?.children as any)?.toLowerCase().indexOf(input.toLowerCase()) >= 0
  578. }
  579. >
  580. {getGameChoiceParentListType1?.data?.map((item: any) => <Select.Option value={item.id} key={item.id}>{item.name}</Select.Option>)}
  581. </Select>
  582. </Form.Item></Col>}
  583. {/* 布谷游戏应用类型搜索 */}
  584. {isBGGameClassify && <Col><Form.Item name='gameClassify'>
  585. <Select
  586. maxTagCount={1}
  587. showSearch
  588. style={{ width: 140 }}
  589. allowClear
  590. placeholder={'游戏应用类型'}
  591. filterOption={(input, option) =>
  592. (option?.children as any)?.toLowerCase().indexOf(input.toLowerCase()) >= 0
  593. }
  594. >
  595. {Object.keys(gameClassifyEnum).map(key => <Select.Option value={key} key={key}>{gameClassifyEnum[key]}</Select.Option>)}
  596. </Select>
  597. </Form.Item></Col>}
  598. {/* 游戏角色名 */}
  599. {isGameRoleName && <Col><Form.Item name='roleName'>
  600. <Input placeholder="游戏角色名" allowClear style={{ width: 140 }} />
  601. </Form.Item></Col>}
  602. {/* 游戏角色名id搜索 */}
  603. {isGameRoleId && <Col><Form.Item name='roleId'>
  604. <Input placeholder="角色ID" allowClear style={{ width: 140 }} />
  605. </Form.Item></Col>}
  606. {/* 是否首充 */}
  607. {isFirstRecharge && <Col><Form.Item name='isFirstRecharge'>
  608. <Select
  609. maxTagCount={1}
  610. showSearch
  611. style={{ width: 100 }}
  612. allowClear
  613. placeholder={'是否首充'}
  614. filterOption={(input, option) =>
  615. (option?.children as any)?.toLowerCase().indexOf(input.toLowerCase()) >= 0
  616. }
  617. >
  618. <Select.Option value={'0'}>否</Select.Option>
  619. <Select.Option value={'1'}>是</Select.Option>
  620. </Select>
  621. </Form.Item></Col>}
  622. {/* 是否切量 */}
  623. {isSwitch && <Col><Form.Item name='isSwitch'>
  624. <Select
  625. maxTagCount={1}
  626. showSearch
  627. style={{ minWidth: 140 }}
  628. allowClear
  629. placeholder={'请选择是否切量'}
  630. filterOption={(input, option) =>
  631. (option?.children as any)?.toLowerCase().indexOf(input.toLowerCase()) >= 0
  632. }
  633. >
  634. <Select.Option value={'0'}>否</Select.Option>
  635. <Select.Option value={'1'}>是</Select.Option>
  636. </Select>
  637. </Form.Item></Col>}
  638. {/* 收款商户号 */}
  639. {isMerchantNo && <Col><Form.Item name='merchantNo'>
  640. <Input placeholder="收款商户号" allowClear style={{ width: 140 }} />
  641. </Form.Item></Col>}
  642. {/* 收款商户号 */}
  643. {isMerchantOrderNo && <Col><Form.Item name='merchantOrderNo'>
  644. <Input placeholder="第三方支付订单号" allowClear style={{ width: 140 }} />
  645. </Form.Item></Col>}
  646. {/* 收款商户号 */}
  647. {isOrderId && <Col><Form.Item name='orderId'>
  648. <Input placeholder="商户订单号" allowClear style={{ width: 140 }} />
  649. </Form.Item></Col>}
  650. {/* 支付状态 */}
  651. {isPayStatus && <Col><Form.Item name='orderStatus'>
  652. <Select
  653. showSearch
  654. style={{ width: 100 }}
  655. allowClear
  656. placeholder={'支付状态'}
  657. filterOption={(input, option) =>
  658. (option?.children as any)?.toLowerCase().indexOf(input.toLowerCase()) >= 0
  659. }
  660. >
  661. {Object.keys(PayStatus).map(key => <Select.Option value={key} key={key}>{PayStatus[key]}</Select.Option>)}
  662. </Select>
  663. </Form.Item></Col>}
  664. {/* 支付方式 */}
  665. {isPayWay && <Col><Form.Item name='payWay'>
  666. <Select
  667. showSearch
  668. style={{ width: 100 }}
  669. allowClear
  670. placeholder={'支付方式'}
  671. filterOption={(input, option) =>
  672. (option?.children as any)?.toLowerCase().indexOf(input.toLowerCase()) >= 0
  673. }
  674. >
  675. {getPayList?.data?.map((item: any) => <Select.Option value={item.id} key={item.id}>{item.payName}</Select.Option>)}
  676. </Select>
  677. </Form.Item></Col>}
  678. {/* 推广媒体 */}
  679. {isType && <Col><Form.Item name='type'>
  680. <Select
  681. showSearch
  682. style={{ width: 100 }}
  683. allowClear
  684. placeholder={'推广媒体'}
  685. filterOption={(input, option) =>
  686. (option?.children as any)?.toLowerCase().indexOf(input.toLowerCase()) >= 0
  687. }
  688. >
  689. {Object.keys(TYPE).map(key => <Select.Option value={key} key={key}>{TYPE[key]}</Select.Option>)}
  690. </Select>
  691. </Form.Item></Col>}
  692. {/* 产品名称 */}
  693. {isProductName && <Col><Form.Item name='productName'>
  694. <Input placeholder="产品名称" allowClear style={{ width: 140 }} />
  695. </Form.Item></Col>}
  696. {/* 注册渠道名 */}
  697. {isRegAgent && <Col><Form.Item name='regAgent'>
  698. <Input placeholder="注册渠道名" allowClear style={{ width: 140 }} />
  699. </Form.Item></Col>}
  700. {/* 渠道标识 */}
  701. {isAgentKey && <Col><Form.Item name='agentKey'>
  702. <Input placeholder="渠道标识" allowClear style={{ width: 140 }} />
  703. </Form.Item></Col>}
  704. {/* 渠道名称 */}
  705. {isAgentName && <Col><Form.Item name='agentName'>
  706. <Input placeholder="渠道名称" allowClear style={{ width: 140 }} />
  707. </Form.Item></Col>}
  708. {/* 推广渠道id */}
  709. {isAgentId && <Col><Form.Item name='agentId'>
  710. <Select
  711. maxTagCount={1}
  712. mode="multiple"
  713. showSearch
  714. style={{ minWidth: 140 }}
  715. allowClear
  716. dropdownMatchSelectWidth={false}
  717. placeholder={'请选择渠道'}
  718. filterOption={(input, option) =>
  719. (option?.children as any)?.toLowerCase().indexOf(input.toLowerCase()) >= 0
  720. }
  721. >
  722. {getChannelChoiceList?.data?.map((item: any) => <Select.Option value={item.id} key={item.id}>{item.agentName}</Select.Option>)}
  723. </Select>
  724. </Form.Item></Col>}
  725. {/* 投放渠道名 */}
  726. {isPutAgent && <Col><Form.Item name='putAgent'>
  727. <Input placeholder="投放渠道名" allowClear style={{ width: 140 }} />
  728. </Form.Item></Col>}
  729. {/* 投手名 */}
  730. {isSysUserName && <Col><Form.Item name='sysUserName'>
  731. <Input placeholder="投手名" allowClear style={{ width: 140 }} />
  732. </Form.Item></Col>}
  733. {/* 投手ID */}
  734. {isSysUserId && <Col><Form.Item name='pitcherId'>
  735. <Select
  736. maxTagCount={1}
  737. showSearch
  738. style={{ width: 120 }}
  739. allowClear
  740. placeholder={'请选择投手'}
  741. filterOption={(input, option) =>
  742. (option?.children as any)?.toLowerCase().indexOf(input.toLowerCase()) >= 0
  743. }
  744. >
  745. {userIdList.map((item: any) => <Select.Option value={item.userId} key={item.userId}>{item.nickname}</Select.Option>)}
  746. </Select>
  747. </Form.Item></Col>}
  748. {/* 玩家账号 */}
  749. {isUserName && <Col><Form.Item name='username'>
  750. <Input placeholder="玩家账号" allowClear style={{ width: 140 }} />
  751. </Form.Item></Col>}
  752. {/* 用户id */}
  753. {isUserId && <Col><Form.Item name='userId'>
  754. <Select
  755. maxTagCount={1}
  756. showSearch
  757. style={{ minWidth: 140 }}
  758. allowClear
  759. placeholder={'请选择用户'}
  760. filterOption={(input, option) =>
  761. (option?.children as any)?.toLowerCase().indexOf(input.toLowerCase()) >= 0
  762. }
  763. >
  764. <Select.Option value={'1'}>用户001</Select.Option>
  765. <Select.Option value={'2'}>用户002</Select.Option>
  766. <Select.Option value={'3'}>用户003</Select.Option>
  767. </Select>
  768. </Form.Item></Col>}
  769. {/* 用户id */}
  770. {isOs && <Col><Form.Item name='os'>
  771. <Select
  772. maxTagCount={1}
  773. showSearch
  774. style={{ width: 110 }}
  775. allowClear
  776. placeholder={'操作系统'}
  777. filterOption={(input, option) =>
  778. (option?.children as any)?.toLowerCase().indexOf(input.toLowerCase()) >= 0
  779. }
  780. >
  781. {getUserSystemTypeChoiceList?.data?.map((item: any) => <Select.Option value={item.os} key={item.os}>{item.os}</Select.Option>)}
  782. </Select>
  783. </Form.Item></Col>}
  784. {/* 用户注册日期搜索 */}
  785. {isRegDay && <Col><Form.Item name='regDay'>
  786. <DatePicker.RangePicker placeholder={['用户注册开始日期', '用户注册结束日期']} {...isRegDay} />
  787. </Form.Item></Col>}
  788. {/* 消耗日期 搜索 */}
  789. {isConsumeDay && <Col><Form.Item name='consumeDay'>
  790. <DatePicker.RangePicker placeholder={['消耗开始日期', '消耗结束日期']} {...isConsumeDay} />
  791. </Form.Item></Col>}
  792. {/* 消耗日期 搜索 */}
  793. {isBeginDay && <Col><Form.Item name='beginDay'>
  794. <DatePicker.RangePicker placeholder={['开始日期', '结束日期']} />
  795. </Form.Item></Col>}
  796. {/* 订单创建日期搜索 */}
  797. {isCreateDay && <Col><Form.Item name='createDay'>
  798. <DatePicker.RangePicker placeholder={['订单创建开始日期', '订单创建结束日期']} {...isCreateDay} />
  799. </Form.Item></Col>}
  800. {/* 充值日期搜索 */}
  801. {rechargeDay && <Col><Form.Item name='rechargeDay'>
  802. <DatePicker.RangePicker placeholder={['充值开始日期', '充值结束日期']} {...rechargeDay} />
  803. </Form.Item></Col>}
  804. {/* 单个充值日期搜索 */}
  805. {payTimeDay && <Col><Form.Item name='payTime'>
  806. <DatePicker.RangePicker placeholder={['支付开始日期', '支付结束日期']} {...payTimeDay} />
  807. </Form.Item></Col>}
  808. {/* 单个充值日期搜索 */}
  809. {placeAnOrderDay && <Col><Form.Item name='placeAnOrderTime'>
  810. <DatePicker.RangePicker placeholder={['下单开始日期', '下单结束日期']} {...placeAnOrderDay} />
  811. </Form.Item></Col>}
  812. {/* 开服日期搜索 */}
  813. {isServerDay && <Col><Form.Item name='serverDay'>
  814. <DatePicker.RangePicker placeholder={['开服开始日期', '开服结束日期']} {...isServerDay} />
  815. </Form.Item></Col>}
  816. {/* 单个充值日期搜索 */}
  817. {isRechargeDate && <Col><Form.Item name='rechargeDate'>
  818. <DatePicker placeholder={'充值日期'} />
  819. </Form.Item></Col>}
  820. {/* 单个充值日期搜索 */}
  821. {isPayIntervalTime && <Col><Form.Item name='regPayIntervalTime'>
  822. <IntervalTime {...isPayIntervalTime} />
  823. </Form.Item></Col>}
  824. <Col>
  825. <Space>
  826. <Button type="primary" htmlType="submit">搜索</Button>
  827. <Button onClick={() => form.resetFields()}>重置</Button>
  828. </Space>
  829. </Col>
  830. </Row>
  831. </Form>
  832. }
  833. export default React.memo(QueryForm)