|
@@ -2,7 +2,7 @@ import { Button, Checkbox, Col, DatePicker, Form, Input, InputNumber, Radio, Row
|
|
import React, { useEffect, useState } from "react"
|
|
import React, { useEffect, useState } from "react"
|
|
import moment from "moment"
|
|
import moment from "moment"
|
|
import { useAjax } from "@/Hook/useAjax"
|
|
import { useAjax } from "@/Hook/useAjax"
|
|
-import { getAllOfOwnerUserApi, getChannelChoiceListApi, getGameChoiceListApi, getCpChoiceListApi, getGameChoiceParentListType1Api, getPayListApi, getSubUserWithSelfListApi, getTtAllUserListApi, getUserSystemTypeChoiceListApi, getUserVipLevelChoiceListApi, getRoleUserListApi, getGameServerListApi, getGameListApi, getGameServerUnListApi } from "@/services/gameData"
|
|
|
|
|
|
+import { getAllOfOwnerUserApi, getChannelChoiceListApi, getGameChoiceListApi, getCpChoiceListApi, getGameChoiceParentListType1Api, getPayListApi, getSubUserWithSelfListApi, getTtAllUserListApi, getUserSystemTypeChoiceListApi, getUserVipLevelChoiceListApi, getRoleUserListApi, getGameServerListApi, getGameListApi, getGameServerUnListApi, getAccountListNewApi, getAgentListNewApi, getPitcherListNewApi, getGameListNewApi } from "@/services/gameData"
|
|
import { ActiveEnum, DeviceType, LoginType, PayStatus, TYPE, gameClassifyEnum } from "./const"
|
|
import { ActiveEnum, DeviceType, LoginType, PayStatus, TYPE, gameClassifyEnum } from "./const"
|
|
import { ADSTATUSEnum as ADSTTTATUSEnum } from "@/pages/gameDataStatistics/adlist/monitor/const"
|
|
import { ADSTATUSEnum as ADSTTTATUSEnum } from "@/pages/gameDataStatistics/adlist/monitor/const"
|
|
import { ADSTATUSEnum } from "@/pages/gameDataStatistics/adlist/tencentMonitor/const"
|
|
import { ADSTATUSEnum } from "@/pages/gameDataStatistics/adlist/tencentMonitor/const"
|
|
@@ -237,6 +237,7 @@ const QueryForm: React.FC<Props> = (props) => {
|
|
const isMergeServer = Form.useWatch('isMergeServer', form)
|
|
const isMergeServer = Form.useWatch('isMergeServer', form)
|
|
const serverName = Form.useWatch('serverName', form)
|
|
const serverName = Form.useWatch('serverName', form)
|
|
const serverIds = Form.useWatch('serverIds', form)
|
|
const serverIds = Form.useWatch('serverIds', form)
|
|
|
|
+ const sourceSystem = Form.useWatch('sourceSystem', form)
|
|
const [accountList, setAccountList] = useState<any[]>([])
|
|
const [accountList, setAccountList] = useState<any[]>([])
|
|
const [userIdList, setUserIdList] = useState<any[]>([])
|
|
const [userIdList, setUserIdList] = useState<any[]>([])
|
|
const [gsList, setGsList] = useState<any[]>([])
|
|
const [gsList, setGsList] = useState<any[]>([])
|
|
@@ -245,6 +246,7 @@ const QueryForm: React.FC<Props> = (props) => {
|
|
const [gameList, setGameList] = useState<any[]>([])
|
|
const [gameList, setGameList] = useState<any[]>([])
|
|
const [parentGameList, setParentGameList] = useState<any[]>([])
|
|
const [parentGameList, setParentGameList] = useState<any[]>([])
|
|
const [superGameList, setSuperGameList] = useState<any[]>([])
|
|
const [superGameList, setSuperGameList] = useState<any[]>([])
|
|
|
|
+ const [agentData, setAgentData] = useState<{ label: string, value: string }[]>([])
|
|
|
|
|
|
|
|
|
|
const getAllOfOwnerUser = useAjax(() => getAllOfOwnerUserApi())
|
|
const getAllOfOwnerUser = useAjax(() => getAllOfOwnerUserApi())
|
|
@@ -261,6 +263,10 @@ const QueryForm: React.FC<Props> = (props) => {
|
|
const getRoleUserList = useAjax((params) => getRoleUserListApi(params))
|
|
const getRoleUserList = useAjax((params) => getRoleUserListApi(params))
|
|
const getGameServerList = useAjax((params) => getGameServerListApi(params))
|
|
const getGameServerList = useAjax((params) => getGameServerListApi(params))
|
|
const getGameServerUnList = useAjax((params) => getGameServerUnListApi(params))
|
|
const getGameServerUnList = useAjax((params) => getGameServerUnListApi(params))
|
|
|
|
+ const getAccountListNew = useAjax((params) => getAccountListNewApi(params))
|
|
|
|
+ const getAgentListNew = useAjax((params) => getAgentListNewApi(params))
|
|
|
|
+ const getPitcherListNew = useAjax((params) => getPitcherListNewApi(params))
|
|
|
|
+ const getGameListNew = useAjax((params) => getGameListNewApi(params))
|
|
/**************************/
|
|
/**************************/
|
|
|
|
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
@@ -284,36 +290,48 @@ const QueryForm: React.FC<Props> = (props) => {
|
|
if (isAccountId) {
|
|
if (isAccountId) {
|
|
// 请求广告账号列表
|
|
// 请求广告账号列表
|
|
async function getAccount() {
|
|
async function getAccount() {
|
|
- let data: any[] = []
|
|
|
|
- let res1 = await getAllOfOwnerUser.run()
|
|
|
|
- let data1 = []
|
|
|
|
- if (res1) {
|
|
|
|
- data1 = res1?.map((item: any) => ({ label: item.accountId, value: item.accountId, corporationName: item.corporationName }))
|
|
|
|
- }
|
|
|
|
- let res2 = await getTtAllUserList.run()
|
|
|
|
- let data2 = []
|
|
|
|
- if (res2) {
|
|
|
|
- data2 = res2?.map((item: any) => ({ label: item.accountId, value: item.accountId, corporationName: item.accountName }))
|
|
|
|
|
|
+ if (sourceSystem === 'ZX_ONE') {
|
|
|
|
+ let data: any[] = []
|
|
|
|
+ let res1 = await getAllOfOwnerUser.run()
|
|
|
|
+ let data1 = []
|
|
|
|
+ if (res1) {
|
|
|
|
+ data1 = res1?.map((item: any) => ({ label: item.accountId, value: item.accountId, corporationName: item.corporationName }))
|
|
|
|
+ }
|
|
|
|
+ let res2 = await getTtAllUserList.run()
|
|
|
|
+ let data2 = []
|
|
|
|
+ if (res2) {
|
|
|
|
+ data2 = res2?.map((item: any) => ({ label: item.accountId, value: item.accountId, corporationName: item.accountName }))
|
|
|
|
+ }
|
|
|
|
+ data = [...data1, ...data2]
|
|
|
|
+ setAccountList(data)
|
|
|
|
+ } else if (['BG_OLD', 'BG_NEW', 'ZX_SDK'].includes(sourceSystem)) {
|
|
|
|
+ let res1 = await getAccountListNew.run({ sourceSystem })
|
|
|
|
+ setAccountList(res1?.map((item: any) => ({ label: item.accountId, value: item.accountId, corporationName: '' })))
|
|
}
|
|
}
|
|
- data = [...data1, ...data2]
|
|
|
|
- setAccountList(data)
|
|
|
|
}
|
|
}
|
|
getAccount()
|
|
getAccount()
|
|
}
|
|
}
|
|
- }, [isAccountId])
|
|
|
|
|
|
+ }, [isAccountId, sourceSystem])
|
|
|
|
|
|
/** 游戏列表 */
|
|
/** 游戏列表 */
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
if (isGameId || isOrderGameId || isParentId || isGameIds || isSuperParentGameId) {
|
|
if (isGameId || isOrderGameId || isParentId || isGameIds || isSuperParentGameId) {
|
|
- getGameList.run().then(res => {
|
|
|
|
|
|
+ getGameListNew.run({ sourceSystem }).then(res => {
|
|
const { gameList, parentGameList, superGameList } = res
|
|
const { gameList, parentGameList, superGameList } = res
|
|
- setGameList(gameList)
|
|
|
|
|
|
+ if (['BG_OLD', 'BG_NEW', 'ZX_SDK'].includes(sourceSystem)) {
|
|
|
|
+ setGameList(gameList?.map((item: { id: any; game_name: any }) => ({ id: item.id, name: item.game_name })) || [])
|
|
|
|
+ }
|
|
setParentGameList(parentGameList)
|
|
setParentGameList(parentGameList)
|
|
setSuperGameList(superGameList)
|
|
setSuperGameList(superGameList)
|
|
})
|
|
})
|
|
- getGameChoiceList.run()
|
|
|
|
|
|
+
|
|
|
|
+ if (sourceSystem === 'ZX_ONE') {
|
|
|
|
+ getGameChoiceList.run().then(res => {
|
|
|
|
+ setGameList(res || [])
|
|
|
|
+ })
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- }, [isGameId, isGameIds, isOrderGameId, isParentId, isSuperParentGameId])
|
|
|
|
|
|
+ }, [isGameId, isGameIds, isOrderGameId, isParentId, isSuperParentGameId, sourceSystem])
|
|
|
|
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
if (isCpId) {
|
|
if (isCpId) {
|
|
@@ -330,18 +348,34 @@ const QueryForm: React.FC<Props> = (props) => {
|
|
/** 投手列表 */
|
|
/** 投手列表 */
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
if (isSysUserId) {
|
|
if (isSysUserId) {
|
|
- getSubUserWithSelfList.run().then(res => {
|
|
|
|
- setUserIdList(res ? Object.keys(res)?.map(key => ({ userId: key, nickname: res[key] })) : [])
|
|
|
|
- })
|
|
|
|
|
|
+ if (['BG_OLD', 'BG_NEW', 'ZX_SDK'].includes(sourceSystem)) {
|
|
|
|
+ getPitcherListNew.run({ sourceSystem }).then(res => {
|
|
|
|
+ setUserIdList(res?.map((item: { pitcherId: any; pitcherName: any }) => ({ userId: item.pitcherId, nickname: item.pitcherName })))
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ getSubUserWithSelfList.run().then(res => {
|
|
|
|
+ setUserIdList(res ? Object.keys(res)?.map(key => ({ userId: key, nickname: res[key] })) : [])
|
|
|
|
+ })
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- }, [isSysUserId])
|
|
|
|
|
|
+ }, [isSysUserId, sourceSystem])
|
|
|
|
|
|
/** 推广渠道 */
|
|
/** 推广渠道 */
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
if (isAgentId) {
|
|
if (isAgentId) {
|
|
- getChannelChoiceList.run()
|
|
|
|
|
|
+ if (['BG_OLD', 'BG_NEW', 'ZX_SDK'].includes(sourceSystem)) {
|
|
|
|
+ getAgentListNew.run({ sourceSystem }).then(res => {
|
|
|
|
+ setAgentData(res?.map((item: { agentName: any; agentId: any }) => ({ label: item.agentName, value: item.agentId })))
|
|
|
|
+ })
|
|
|
|
+ } else {
|
|
|
|
+ getChannelChoiceList.run().then(res => {
|
|
|
|
+ console.log(res)
|
|
|
|
+ setAgentData(res?.map((item: { agentName: any; id: any }) => ({ label: item.agentName, value: item.id })))
|
|
|
|
+ })
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- }, [isAgentId])
|
|
|
|
|
|
+ }, [isAgentId, sourceSystem])
|
|
|
|
+ console.log('agentData--->', agentData)
|
|
|
|
|
|
/** 游戏应用类型 */
|
|
/** 游戏应用类型 */
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
@@ -510,11 +544,12 @@ const QueryForm: React.FC<Props> = (props) => {
|
|
style={{ width: 140 }}
|
|
style={{ width: 140 }}
|
|
allowClear
|
|
allowClear
|
|
placeholder={'广告账号'}
|
|
placeholder={'广告账号'}
|
|
|
|
+ loading={getAccountListNew.loading || getAllOfOwnerUser.loading}
|
|
filterOption={(input, option) =>
|
|
filterOption={(input, option) =>
|
|
(option?.children as any)?.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
|
(option?.children as any)?.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
|
}
|
|
}
|
|
>
|
|
>
|
|
- {accountList.map(item => <Select.Option key={item.value} value={item.value}>{item.label.toString() + '_' + item.corporationName}</Select.Option>)}
|
|
|
|
|
|
+ {accountList.map(item => <Select.Option key={item.value} value={item.value}>{item.label.toString() + (item.corporationName ? `_${item.corporationName}` : '')}</Select.Option>)}
|
|
</Select>
|
|
</Select>
|
|
</Form.Item></Col>}
|
|
</Form.Item></Col>}
|
|
{/* 公司ID */}
|
|
{/* 公司ID */}
|
|
@@ -688,12 +723,13 @@ const QueryForm: React.FC<Props> = (props) => {
|
|
showSearch
|
|
showSearch
|
|
style={{ minWidth: 140 }}
|
|
style={{ minWidth: 140 }}
|
|
allowClear
|
|
allowClear
|
|
|
|
+ loading={getGameListNew.loading || getGameChoiceList.loading}
|
|
placeholder={'请选择游戏'}
|
|
placeholder={'请选择游戏'}
|
|
filterOption={(input, option) =>
|
|
filterOption={(input, option) =>
|
|
(option?.children as any)?.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
|
(option?.children as any)?.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
|
}
|
|
}
|
|
>
|
|
>
|
|
- {getGameChoiceList?.data?.map((item: any) => <Select.Option value={item.id} key={item.id}>{item.name}</Select.Option>)}
|
|
|
|
|
|
+ {gameList?.map((item: any) => <Select.Option value={item.id} key={item.id}>{item.name}</Select.Option>)}
|
|
</Select>
|
|
</Select>
|
|
</Form.Item></Col>}
|
|
</Form.Item></Col>}
|
|
{isGameIds && <Col><Form.Item name='gameId'>
|
|
{isGameIds && <Col><Form.Item name='gameId'>
|
|
@@ -1006,11 +1042,12 @@ const QueryForm: React.FC<Props> = (props) => {
|
|
allowClear
|
|
allowClear
|
|
dropdownMatchSelectWidth={false}
|
|
dropdownMatchSelectWidth={false}
|
|
placeholder={'请选择渠道'}
|
|
placeholder={'请选择渠道'}
|
|
|
|
+ loading={getChannelChoiceList.loading || getAgentListNew.loading}
|
|
filterOption={(input, option) =>
|
|
filterOption={(input, option) =>
|
|
(option?.children as any)?.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
|
(option?.children as any)?.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
|
}
|
|
}
|
|
>
|
|
>
|
|
- {getChannelChoiceList?.data?.map((item: any) => <Select.Option value={item.id} key={item.id}>{item.agentName}</Select.Option>)}
|
|
|
|
|
|
+ {agentData?.map((item: any) => <Select.Option value={item.value} key={item.value}>{item.label}</Select.Option>)}
|
|
</Select>
|
|
</Select>
|
|
</Form.Item></Col>}
|
|
</Form.Item></Col>}
|
|
|
|
|
|
@@ -1031,6 +1068,7 @@ const QueryForm: React.FC<Props> = (props) => {
|
|
showSearch
|
|
showSearch
|
|
style={{ width: 120 }}
|
|
style={{ width: 120 }}
|
|
allowClear
|
|
allowClear
|
|
|
|
+ loading={getSubUserWithSelfList.loading || getPitcherListNew.loading}
|
|
placeholder={'请选择投手'}
|
|
placeholder={'请选择投手'}
|
|
filterOption={(input, option) =>
|
|
filterOption={(input, option) =>
|
|
(option?.children as any)?.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
|
(option?.children as any)?.toLowerCase().indexOf(input.toLowerCase()) >= 0
|