wjx hai 1 ano
pai
achega
f8676db095

+ 5 - 5
src/components/QueryForm/index.tsx

@@ -358,7 +358,7 @@ const QueryForm: React.FC<Props> = (props) => {
     /** 游戏列表 */
     useEffect(() => {
         if (isGameId || isOrderGameId || isParentId || isParentIds || isGameIds || isSuperParentGameId) {
-            getGameListNew.run({ sourceSystem }).then(res => {
+            getGameListNew.run({ sourceSystem }).then((res: { gameList: any; parentGameList: any; superGameList: any }) => {
                 const { gameList, parentGameList, superGameList } = res
                 // 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 })) || [])
@@ -391,11 +391,11 @@ const QueryForm: React.FC<Props> = (props) => {
     useEffect(() => {
         if (isSysUserId || isSysUserIds) {
             if (['BG_OLD', 'BG_NEW', 'ZX_SDK'].includes(sourceSystem)) {
-                getPitcherListNew.run({ sourceSystem }).then(res => {
+                getPitcherListNew.run({ sourceSystem }).then((res: { pitcherId: any; pitcherName: any }[]) => {
                     setUserIdList(res?.map((item: { pitcherId: any; pitcherName: any }) => ({ userId: item.pitcherId, nickname: item.pitcherName })))
                 })
             } else {
-                getSubUserWithSelfList.run().then(res => {
+                getSubUserWithSelfList.run().then((res: { [x: string]: any }) => {
                     setUserIdList(res ? Object.keys(res)?.map(key => ({ userId: key, nickname: res[key] })) : [])
                 })
             }
@@ -406,11 +406,11 @@ const QueryForm: React.FC<Props> = (props) => {
     useEffect(() => {
         if (isAgentId || isUserLastRegAgentId) {
             if (['BG_OLD', 'BG_NEW', 'ZX_SDK'].includes(sourceSystem)) {
-                getAgentListNew.run({ sourceSystem }).then(res => {
+                getAgentListNew.run({ sourceSystem }).then((res: { agentName: any; agentId: any }[]) => {
                     setAgentData(res?.map((item: { agentName: any; agentId: any }) => ({ label: item.agentName, value: item.agentId })))
                 })
             } else {
-                getChannelChoiceList.run().then(res => {
+                getChannelChoiceList.run().then((res: { agentName: any; id: any }[]) => {
                     console.log(res)
                     setAgentData(res?.map((item: { agentName: any; id: any }) => ({ label: item.agentName, value: item.id })))
                 })

+ 12 - 6
src/pages/gameDataStatistics/roleOperate/createRoleConfig/index.tsx

@@ -1,6 +1,6 @@
 import { useAjax } from "@/Hook/useAjax"
 import Tables from "@/components/Tables"
-import { getGameChoiceListApi } from "@/services/gameData"
+import { getGameChoiceListApi, getGameListNewApi } from "@/services/gameData"
 import { CreateRoleConfigProps, delGameUserConfigApi, getCreateRoleConfigListApi } from "@/services/gameData/roleOperate"
 import { PlusOutlined } from "@ant-design/icons"
 import { Button, Card, Col, Form, Row, Select, Space, message } from "antd"
@@ -20,7 +20,9 @@ const CreateRoleConfig: React.FC = () => {
     const [initialValues, setInitialValues] = useState<any>({})
     const [queryFrom, setQueryForm] = useState<CreateRoleConfigProps>({ pageNum: 1, pageSize: 20 })
     const [visible, setVisible] = useState<boolean>(false)
-    const getGameChoiceList = useAjax(() => getGameChoiceListApi())
+    const [gameList, setGameList] = useState<any[]>([])
+
+    const getGameChoiceList = useAjax((params) => getGameListNewApi(params))
     const getCreateRoleConfigList = useAjax((params) => getCreateRoleConfigListApi(params))
     const delGameUserConfig = useAjax((params) => delGameUserConfigApi(params))
     /**************************/
@@ -29,7 +31,10 @@ const CreateRoleConfig: React.FC = () => {
     }, [queryFrom])
 
     useEffect(() => {
-        getGameChoiceList.run()
+        getGameChoiceList.run({ sourceSystem: 'ZX_ONE' }).then((res: { gameList: any; parentGameList: any; superGameList: any }) => {
+            const { gameList } = res
+            setGameList(gameList?.map((item: { id: any; game_name: any }) => ({ id: item.id, name: item.game_name })) || [])
+        })
     }, [])
 
     const onFinish = (data: any) => {
@@ -44,7 +49,7 @@ const CreateRoleConfig: React.FC = () => {
     }
 
     const del = (id: number) => {
-        delGameUserConfig.run({ id }).then(res => {
+        delGameUserConfig.run({ id }).then((res: any) => {
             if (res) {
                 message.success('删除成功')
                 getCreateRoleConfigList.refresh()
@@ -74,8 +79,9 @@ const CreateRoleConfig: React.FC = () => {
                             filterOption={(input, option) =>
                                 (option?.children as any)?.toLowerCase().indexOf(input.toLowerCase()) >= 0
                             }
+                            loading={getGameChoiceList.loading}
                         >
-                            {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>
                     </Form.Item></Col>
 
@@ -124,7 +130,7 @@ const CreateRoleConfig: React.FC = () => {
         {visible && <EditModal
             visible={visible}
             initialValues={initialValues}
-            gameList={getGameChoiceList?.data}
+            gameList={gameList}
             onClose={() => { setVisible(false); }}
             onChange={() => {
                 getCreateRoleConfigList.refresh()