shenwu il y a 11 mois
Parent
commit
0e5f6a6a76

+ 23 - 5
src/pages/gameDataStatistics/roleOperate/roleRechargeRanking/roleCz.tsx

@@ -1,8 +1,9 @@
 import { useAjax } from "@/Hook/useAjax"
+import { getRoleUserListApi } from "@/services/gameData"
 // import { getSubUserWithSelfListApi } from "@/services/gameData"
 import { modifyRoleDataApi } from "@/services/gameData/roleOperate"
 import { Col, Form, Input, Modal, Radio, Row, Select, Space, message } from "antd"
-import React, { useEffect } from "react"
+import React, { useEffect, useState } from "react"
 
 interface Props {
     data: any[]
@@ -19,11 +20,19 @@ const RoleCz: React.FC<Props> = ({ data = [], visible, onClose, onChange }) => {
     /**************************/
     const [form] = Form.useForm()
     // const [userIdList, setUserIdList] = useState<any[]>([])
-
+    const [gsList, setGsList] = useState<any[]>([])
     // const getSubUserWithSelfList = useAjax(() => getSubUserWithSelfListApi())
     const modifyRoleData = useAjax((params) => modifyRoleDataApi(params))
+    const getRoleUserList = useAjax((params) => getRoleUserListApi(params))
     /**************************/
-
+    useEffect(() => {
+        getRoleUserList.run({ authType: 'GS' }).then((res:any) => {
+            if (res) {
+                let arr = Object.keys(res).map(key => ({ value: Number(key), label: res[key] }))
+                setGsList(arr)
+            }
+        })
+    }, [])
     useEffect(() => {
         if (data?.length === 1) {
             const { user_wechat, user_phone, is_remove_game, is_wake_up, remark, add_corp_user_id, is_add_corp_wechat, is_change_game_type, gsAccount, corpId, external_user_id } = data[0]
@@ -70,7 +79,8 @@ const RoleCz: React.FC<Props> = ({ data = [], visible, onClose, onChange }) => {
             }
         })
     }
-
+    const filterOption = (input: string, option?: { label: string; value: string }) =>
+    (option?.label ?? '').toLowerCase().includes(input.toLowerCase());
     return <Modal
         title={<Space>
             <strong>角色操作</strong>
@@ -107,7 +117,15 @@ const RoleCz: React.FC<Props> = ({ data = [], visible, onClose, onChange }) => {
                 </Col>
                 <Col span={12}>
                     <Form.Item label="GS账号" name="gsAccount">
-                        <Input placeholder="请输入GS账号" />
+                        <Select
+                            maxTagCount={1}
+                            showSearch
+                            style={{ width: '100%' }}
+                            allowClear
+                            placeholder={'请选择游戏GS'}
+                            filterOption={filterOption}
+                            options={gsList}
+                        />
                     </Form.Item>
                 </Col>
                 <Col span={12}>