wjx 5 months ago
parent
commit
6360e3b76f

+ 7 - 6
src/pages/launchSystemNew/account/components/qqAuto.tsx

@@ -1,7 +1,7 @@
 import { useCallback, useState } from "react"
 import { useCallback, useState } from "react"
 import React from 'react'
 import React from 'react'
 import { Col, Row, Radio, Input, Button, message, Space, Image, Modal, Popconfirm } from "antd";
 import { Col, Row, Radio, Input, Button, message, Space, Image, Modal, Popconfirm } from "antd";
-let name = {
+let name: any = {
     0: '小说账号失败列表:',
     0: '小说账号失败列表:',
     1: '游戏账号失败列表:',
     1: '游戏账号失败列表:',
 }
 }
@@ -13,7 +13,7 @@ function QQAuth(props: { qqVisible: boolean, callBack: () => void, adAppType: 0
     let [visible, setVisible] = useState(false)
     let [visible, setVisible] = useState(false)
     let [loading, setLoading] = useState(false)
     let [loading, setLoading] = useState(false)
     let [codeUrl, setCodeUrl] = useState('')
     let [codeUrl, setCodeUrl] = useState('')
-    let [err, setErr] = useState({})
+    let [err, setErr] = useState<any>({})
     let [outTime, setOutTime] = useState(0)
     let [outTime, setOutTime] = useState(0)
     let [data, setData] = useState({
     let [data, setData] = useState({
         userId: localStorage.getItem('userId'),
         userId: localStorage.getItem('userId'),
@@ -25,12 +25,12 @@ function QQAuth(props: { qqVisible: boolean, callBack: () => void, adAppType: 0
         smType: smType ? "WX" : "QQ",
         smType: smType ? "WX" : "QQ",
         isOld
         isOld
     })
     })
-    let adAppIdonChange = useCallback((checkedValue) => {
+    let adAppIdonChange = useCallback((checkedValue: any) => {
         let v = checkedValue.target.value
         let v = checkedValue.target.value
         console.log("checkedValue===>", v)
         console.log("checkedValue===>", v)
         setData({ ...data, adAppType: v })
         setData({ ...data, adAppType: v })
     }, [data])
     }, [data])
-    let adUnitTypeChange = useCallback((adUnitType) => {
+    let adUnitTypeChange = useCallback((adUnitType: any) => {
         let v = adUnitType.target.value
         let v = adUnitType.target.value
         console.log("checkedValue===>", v)
         console.log("checkedValue===>", v)
         setData({ ...data, adUnitType: v })
         setData({ ...data, adUnitType: v })
@@ -102,7 +102,7 @@ function QQAuth(props: { qqVisible: boolean, callBack: () => void, adAppType: 0
             message.success('清理成功!!!!请重新扫码授权登录!!!')
             message.success('清理成功!!!!请重新扫码授权登录!!!')
         })
         })
     }
     }
-    let userIdChange = useCallback((e) => {
+    let userIdChange = useCallback((e: any) => {
         let value = e.target.value
         let value = e.target.value
         let arr = value.split(/,|,/)
         let arr = value.split(/,|,/)
         let newArr = arr?.map((str: string) => Number(str.replace(/\s/ig, '')))
         let newArr = arr?.map((str: string) => Number(str.replace(/\s/ig, '')))
@@ -136,7 +136,8 @@ function QQAuth(props: { qqVisible: boolean, callBack: () => void, adAppType: 0
                         <Col span={3}><h3>平台选择:</h3></Col>
                         <Col span={3}><h3>平台选择:</h3></Col>
                         <Col span={20}>
                         <Col span={20}>
                             <Radio.Group style={{ width: '100%' }} onChange={adAppIdonChange} defaultValue={data.adAppType}>
                             <Radio.Group style={{ width: '100%' }} onChange={adAppIdonChange} defaultValue={data.adAppType}>
-                                {adAppType === 0 ? <Radio value={0}>小说</Radio> : <Radio value={1}>游戏</Radio>}
+                                <Radio value={0}>小说</Radio> 
+                                <Radio value={1}>游戏</Radio>
                             </Radio.Group>
                             </Radio.Group>
                         </Col>
                         </Col>
                     </Row>
                     </Row>

+ 5 - 3
src/pages/launchSystemV3/account/index.tsx

@@ -8,7 +8,6 @@ import { getAdAccountListApi, GetAdAccountParams, putAdAccountApi } from '@/serv
 import style from './index.less'
 import style from './index.less'
 import TableData from '@/pages/launchSystemNew/components/TableData'
 import TableData from '@/pages/launchSystemNew/components/TableData'
 import GroupLeft from './groupLeft'
 import GroupLeft from './groupLeft'
-import QQAuth from './qqAuto'
 import { MenuFoldOutlined, MenuUnfoldOutlined, PlusOutlined, SwapOutlined } from '@ant-design/icons'
 import { MenuFoldOutlined, MenuUnfoldOutlined, PlusOutlined, SwapOutlined } from '@ant-design/icons'
 import { getAdAccountAllOfMember, getErpUserAll, getServiceProviderAll, putConfigServiceProvider, putRefreshTokenApi } from '@/services/launchAdq/adq'
 import { getAdAccountAllOfMember, getErpUserAll, getServiceProviderAll, putConfigServiceProvider, putRefreshTokenApi } from '@/services/launchAdq/adq'
 import AddAccountToGroup from './addAccountToGroup'
 import AddAccountToGroup from './addAccountToGroup'
@@ -20,10 +19,12 @@ import AppointPut from './appointPut'
 import SetEarlyWarningsAccount from '@/components/EarlyWarning/setEarlyWarningsAccount'
 import SetEarlyWarningsAccount from '@/components/EarlyWarning/setEarlyWarningsAccount'
 import { AdUnitType_Enum } from './const'
 import { AdUnitType_Enum } from './const'
 import TeamMembers from '@/pages/launchSystemNew/components/teamMembers'
 import TeamMembers from '@/pages/launchSystemNew/components/teamMembers'
+import QQAuth from '@/pages/launchSystemNew/account/components/qqAuto'
 
 
 /** 投放管理 */
 /** 投放管理 */
 const AdAuthorize: React.FC = () => {
 const AdAuthorize: React.FC = () => {
     let [visible, setVisible] = useState(false)
     let [visible, setVisible] = useState(false)
+    let [newVisible, setNewVisible] = useState(false)
     /*************************/
     /*************************/
     const { groupListInit } = useModel('useLaunchAdq.useAdAuthorize')
     const { groupListInit } = useModel('useLaunchAdq.useAdAuthorize')
     const userInfo = useModel('@@initialState', model => model.initialState?.currentUser)
     const userInfo = useModel('@@initialState', model => model.initialState?.currentUser)
@@ -268,6 +269,7 @@ const AdAuthorize: React.FC = () => {
                         <Button onClick={getList} type='primary' loading={getAdAccountList.loading}>搜索</Button>
                         <Button onClick={getList} type='primary' loading={getAdAccountList.loading}>搜索</Button>
                         <AddAccountToGroup onChange={() => getAdAccountList.refresh()} />
                         <AddAccountToGroup onChange={() => getAdAccountList.refresh()} />
                         {/* <Button type='primary' onClick={() => setVisible(true)}><PlusOutlined />广告账号授权</Button> */}
                         {/* <Button type='primary' onClick={() => setVisible(true)}><PlusOutlined />广告账号授权</Button> */}
+                        <Button type='primary' onClick={() => setNewVisible(true)}><PlusOutlined />广告业务单元批量授权</Button>
                         {switchType === 'account' ?
                         {switchType === 'account' ?
                             (selectAccData?.length > 0 && <>
                             (selectAccData?.length > 0 && <>
                                 <Button type="primary" ghost icon={<SwapOutlined />} onClick={() => { checkAccount(selectAccData) }}>批量切号</Button>
                                 <Button type="primary" ghost icon={<SwapOutlined />} onClick={() => { checkAccount(selectAccData) }}>批量切号</Button>
@@ -369,14 +371,14 @@ const AdAuthorize: React.FC = () => {
             </Row>
             </Row>
 
 
         </Modal>}
         </Modal>}
-        {/* 广告授权 */}
-        {visible && <QQAuth qqVisible={visible} callBack={() => setVisible(false)} />}
         {/* 变更记录 */}
         {/* 变更记录 */}
         {crShow && <ChangeRecord visible={crShow} data={crData} onClose={() => { setCrShow(false); setCrData(null) }} />}
         {crShow && <ChangeRecord visible={crShow} data={crData} onClose={() => { setCrShow(false); setCrData(null) }} />}
         {/* 切号 */}
         {/* 切号 */}
         {checkAccShow && <CheckAccount value={data} visible={checkAccShow} onChange={() => { getList(); setCheckAccShow(false); setSelectAccData([]) }} onClose={() => { setCheckAccShow(false) }} />}
         {checkAccShow && <CheckAccount value={data} visible={checkAccShow} onChange={() => { getList(); setCheckAccShow(false); setSelectAccData([]) }} onClose={() => { setCheckAccShow(false) }} />}
         {/* 指派 */}
         {/* 指派 */}
         {puShow && <AppointPut value={puData} visible={puShow} onClose={() => { setPuShow(false) }} allOfMember={erpUserALL} onChange={() => { setPuShow(false); getAdAccountList.refresh(); setSelectAccData([]) }} />}
         {puShow && <AppointPut value={puData} visible={puShow} onClose={() => { setPuShow(false) }} allOfMember={erpUserALL} onChange={() => { setPuShow(false); getAdAccountList.refresh(); setSelectAccData([]) }} />}
+        {/* 广告业务单元批量授权 */}
+        {newVisible && <QQAuth qqVisible={newVisible} callBack={() => setNewVisible(false)} adAppType={0} smType={"WX"}  title='广告业务单元批量授权'/>}
 
 
         {remarkData.visible && <Modal
         {remarkData.visible && <Modal
             open={remarkData.visible}
             open={remarkData.visible}