shenwu 2 anos atrás
pai
commit
fb5c8256ed

+ 6 - 0
config/routerConfig.ts

@@ -81,6 +81,12 @@ function getMyMenu(code: any, data: any,) {
 const launchSystem = {
     path: '/launchSystemNew',
     routes: [
+        {
+            path: '/launchSystemNew/adq',
+            name: '广点通',
+            component: './launchSystemNew/adq',
+            access: 'adq',
+        },
         {
             path: '/launchSystemNew/launchManage',
             name: '广告投放',

+ 16 - 16
src/app.tsx

@@ -4,7 +4,7 @@ import { Button, notification, Result } from 'antd';
 import { history, RequestConfig } from 'umi';
 import RightContent from '@/components/RightContent';
 import { ResponseError } from 'umi-request';
-import { queryCurrent, getMenu } from './services/user';
+import { queryCurrent, getMenu, getAdAccountAllOfMember } from './services/user';
 import defaultSettings from '../config/defaultSettings';
 import { DesktopOutlined, MessageOutlined, SendOutlined, TeamOutlined, QrcodeOutlined, DatabaseOutlined, ReadOutlined, MobileOutlined, FundViewOutlined, RadarChartOutlined, BarChartOutlined, WechatOutlined, BookOutlined, FileImageOutlined, EyeOutlined, UserOutlined } from '@ant-design/icons';
 import { getMyMenu, headrRouter } from '../config/routerConfig';
@@ -26,7 +26,7 @@ interface CurrentUser {
     label: string;
   }[];
   userId?: string;
-  powerLevel?:number;
+  powerLevel?: number;
   access?: 'user' | 'guest' | 'admin' | any;
   unreadCount?: number;
   companyList?: any[],
@@ -50,18 +50,18 @@ export async function getInitialState(): Promise<{
       let currentUser = {}
       let userInfo: any = await queryCurrent();//用户信息
       let companyInfo = userInfo?.data?.companyRelationInfo?.filter((item: { companyId: number }) => item.companyId !== 4 && item.companyId !== 3)
-      currentUser = { access: 'admin',powerLevel:userInfo?.data?.userInfo?.powerLevel, name: userInfo?.data?.userInfo?.nickname || '', userId: userInfo?.data?.userInfo?.userId, phone: userInfo?.data?.userInfo?.phone || '', companyList: companyInfo, onlineCompanyId: userInfo?.data?.onlineCompanyId }//处理个人信息 
-      let menu: any = await getMenu().then((res: any) => {//获取菜单并处理
+      currentUser = { access: 'admin', powerLevel: userInfo?.data?.userInfo?.powerLevel, name: userInfo?.data?.userInfo?.nickname || '', userId: userInfo?.data?.userInfo?.userId, phone: userInfo?.data?.userInfo?.phone || '', companyList: companyInfo, onlineCompanyId: userInfo?.data?.onlineCompanyId }//处理个人信息 
+      let menu: any = await getMenu().then(async (res: any) => {//获取菜单并处理
         let { code, data } = res
         let path = getMyMenu(code, data)
         if (userInfo?.data?.userInfo?.account === 'admin' && path.length > 0) {//假如是ADMIN加入api测试
-          path[0].routes.push({key:0, path: '/operatePage/apitest', name: 'api测试', icon: '', component: './operatePage/apitest', roles: 'admin' })
+          path[0].routes.push({ key: 0, path: '/operatePage/apitest', name: 'api测试', icon: '', component: './operatePage/apitest', roles: 'admin' })
         }
         return { data: path }
       });
-      localStorage.setItem('sex',userInfo?.data?.userInfo?.sex)
-      localStorage.setItem('userId',userInfo?.data?.userInfo?.userId)
-      localStorage.setItem('name',userInfo?.data?.userInfo?.nickname)
+      localStorage.setItem('sex', userInfo?.data?.userInfo?.sex)
+      localStorage.setItem('userId', userInfo?.data?.userInfo?.userId)
+      localStorage.setItem('name', userInfo?.data?.userInfo?.nickname)
       return {
         currentUser,
         settings: { ...defaultSettings },
@@ -98,12 +98,12 @@ const IconMap = {
   barChart: <BarChartOutlined />,
   wechat: <WechatOutlined />,
   book: <BookOutlined />,
-  peoples:<UserOutlined />,
+  peoples: <UserOutlined />,
   'file-image': <FileImageOutlined />,
   launch: <span role="img" aria-label="fund-view" className="anticon anticon-fund-view"><LaunchSvg /></span>,
   adLaunch: <span role="img" aria-label="fund-view" className="anticon anticon-fund-view"><AdLaunchSvg /></span>,
   material: <span role="img" aria-label="fund-view" className="anticon anticon-fund-view"><MaterialSvg /></span>,
-  eye:<EyeOutlined />
+  eye: <EyeOutlined />
 };
 //处理菜单
 const loopMenuItem = (menus: MenuDataItem[],): MenuDataItem[] => {
@@ -136,12 +136,12 @@ export const layout = ({
     // footerRender: () => <Footer />,
     onPageChange: () => {
       headrRouter(initialState, history)
-      let {pathname,query} = history.location
-      if(query?.t){//带token直接进入对应页面
-        sessionStorage.setItem('Admin-Token',decodeURIComponent(query.t as any))
-        location.href =window.location.origin+'/#'+pathname
+      let { pathname, query } = history.location
+      if (query?.t) {//带token直接进入对应页面
+        sessionStorage.setItem('Admin-Token', decodeURIComponent(query.t as any))
+        location.href = window.location.origin + '/#' + pathname
         location.reload()
-      }else  if (!initialState?.currentUser?.name && history.location.pathname !== '/user/login') {
+      } else if (!initialState?.currentUser?.name && history.location.pathname !== '/user/login') {
         history.push('/user/login');
       }
     },
@@ -263,7 +263,7 @@ export const request: RequestConfig = {
         }
 
       }
-      if(resData.code === 310){//权限错误
+      if (resData.code === 310) {//权限错误
         let msg = sessionStorage.getItem('msg')
         sessionStorage.removeItem('Admin-Token')
         history.push('/user/login')

+ 133 - 0
src/pages/launchSystemNew/adq/ad/index.tsx

@@ -0,0 +1,133 @@
+import { FnAjax, useAjax } from '@/Hook/useAjax'
+import { Data, ListData, SysAdgroupsDTO } from '@/services/launchAdq'
+import { PromotedObjectType } from '@/services/launchAdq/enum'
+import { createSysAdgroups, getSysAdgroupsInfo, getSysAdgroupsList } from '@/services/launchAdq/localAd'
+import { Col, Row, Input, Select, Button } from 'antd'
+import React, { useEffect, useState, useCallback } from 'react'
+import TableData from '../../components/TableData'
+import tableConfig from './tableConfig'
+
+export interface ModalConfig {
+    visible: boolean;
+    title?: string;
+    type?:'add'|'look'|'edit',
+    dataInfo?:null
+}
+
+function Ad(props:{accountId:string}) {
+    const {accountId} = props
+    // 变量
+    const [modalConfig, setModalConfig] = useState<ModalConfig>({
+        visible: false,
+        type:'add'
+    })
+    const [oldsearchData, setOldsearchData] = useState<any>(null)
+    // api方法
+    const sysAdgroupsList: FnAjax<ListData<SysAdgroupsDTO> | any>  = useAjax((params) => getSysAdgroupsList(params),{formatResult:true})
+    const getSysAdgroupsInfos:any = useAjax((adgroupsId) => getSysAdgroupsInfo(adgroupsId),{formatResult:true})
+    const createSysAdgroup = useAjax((params) => createSysAdgroups(params))
+    // 初始获取列表
+    useEffect(() => {
+        getList({ pageSize: 20, pageNum: 1 })
+    }, [])
+    // 获取列表
+    const getList = useCallback((arg: { pageSize: number, pageNum: number, adgroupName?: string, promotedObjectType?: string }) => {
+        Object.keys(arg).forEach(key => {
+            !arg[key] && delete arg[key]
+        })
+        if (JSON.stringify(arg) !== JSON.stringify(oldsearchData)) {
+            setOldsearchData(arg)
+            sysAdgroupsList.run(arg)
+        }
+    }, [oldsearchData])
+
+    // 设置变量
+    const handleModalConfig = useCallback((arg: ModalConfig) => {
+        setModalConfig({ ...modalConfig, ...arg })
+    }, [modalConfig])
+    // submit
+    const submit = useCallback((arg: any) => {
+        console.log(arg)
+        createSysAdgroup.run(arg).then(res => {
+            if (res) {
+                sysAdgroupsList.refresh()
+                handleModalConfig({ visible: false,dataInfo:null,type:'add' })
+            }
+        })
+    }, [sysAdgroupsList])
+    // 获取详情
+    const getInfo = useCallback((adgroupsId,type)=>{
+        getSysAdgroupsInfos.run(adgroupsId).then((res: any)=>{
+            setModalConfig({...modalConfig,visible:true,type,dataInfo:res.data})
+        })
+    },[modalConfig])
+    // 回调
+    const callback=useCallback((data,type)=>{
+        getInfo(data.id,type)
+
+    },[])
+    return <div>
+        {/* <TableData
+            columns={()=>tableConfig(callback)}
+            ajax={sysAdgroupsList}
+            dataSource={sysAdgroupsList?.data?.data?.records}
+            loading={sysAdgroupsList?.loading}
+            scroll={{ y: 600 }}
+            total={sysAdgroupsList?.data?.data?.total}
+            page={sysAdgroupsList?.data?.data?.current}
+            pageSize={sysAdgroupsList?.data?.data?.size}
+            leftChild={<>
+                <Row gutter={[10, 10]}>
+                    <Col span={24}><Button type='primary' onClick={() => {
+                        handleModalConfig({ visible: true })
+                    }}>新建广告模板</Button></Col>
+                    <Col>
+                        <Input
+                            placeholder='广告名称'
+                            allowClear
+                            onBlur={(e) => {
+                                let value = e.target.value
+                                getList({ pageNum: 1, pageSize: 20, adgroupName: value })
+                            }}
+                            onKeyDownCapture={(e: any) => {
+                                let key = e.key
+                                if (key === 'Enter') {
+                                    let value = e.target.value
+                                    getList({ pageNum: 1, pageSize: 20, adgroupName: value })
+                                }
+                            }}
+                            onChange={(e) => {
+                                let value = e.target.value
+                                if (!value) {
+                                    getList({ pageNum: 1, pageSize: 20, adgroupName: value })
+                                }
+                            }}
+                        />
+                    </Col>
+                    <Col>
+                        <Select placeholder='推广目标选择' style={{ minWidth: 200 }} showSearch filterOption={(input, option) =>
+                            (option!.children as unknown as string).toLowerCase().includes(input.toLowerCase())
+                        } allowClear onChange={(value) => {
+                            getList({ pageNum: 1, pageSize: 20, promotedObjectType: value })
+                        }}>
+                            {
+                                Object.keys(PromotedObjectType).map(key => {
+                                    // let obj = JSON.parse(PromotedObjectType[key])
+                                    return <Select.Option value={key} key={key}>{PromotedObjectType[key]}</Select.Option>
+                                })
+                            }
+                        </Select>
+                    </Col>
+                </Row>
+            </>}
+            onChange={(props: any) => {
+                let { sortData, pagination } = props
+                let { current, pageSize } = pagination
+                getList({pageNum:current,pageSize})
+            }}
+        // config={guanggao}
+        // configName={'广告模板列表'}
+        /> */}
+    </div>
+}
+export default Ad

+ 64 - 0
src/pages/launchSystemNew/adq/ad/tableConfig.tsx

@@ -0,0 +1,64 @@
+import { PromotedObjectType } from '@/services/launchAdq/enum'
+import React from 'react'
+import { Space } from 'antd'
+function tableConfig(callback:(data:any,type:'edit'|'look')=>void):any{
+    return [
+        {
+            title: 'ID',
+            dataIndex: 'id',
+            key: 'id',
+            align: 'center',
+            width:70,
+        },
+        {
+            title: '广告名称',
+            dataIndex: 'adgroupName',
+            key: 'adgroupName',
+            align: 'center',
+        },
+        {
+            title: '广告推广目标类型',
+            dataIndex: 'promotedObjectType',
+            key: 'promotedObjectType',
+            align: 'center',
+           render:(a: string | number)=>{
+            return PromotedObjectType[a]
+           } 
+        },
+        {
+            title: '投放日期',
+            dataIndex: 'beginDate',
+            key: 'beginDate',
+            align: 'center',
+            render:(a: string,b: { endDate: string })=>{
+                return b?.endDate ? a+'~'+b.endDate : a+'~'+'长期投放'
+            }
+        },
+        {
+            title: '广告出价',
+            dataIndex: 'bidAmount',
+            key: 'bidAmount',
+            align: 'center',  
+        },
+        {
+            title: '创建时间',
+            dataIndex: 'createTime',
+            key: 'createTime',
+            align: 'center',
+        },
+        {
+            title:'操作',
+            dataIndex:'cz',
+            key: 'cz',
+            align: 'center',  
+            render:(a: any,b: any)=>{
+               return <Space>
+                    <a onClick={()=>{
+                        callback(b,'look')
+                    }}>详情</a>
+                </Space>
+            }
+        }
+    ]
+}
+export default tableConfig

+ 122 - 0
src/pages/launchSystemNew/adq/creative/index.tsx

@@ -0,0 +1,122 @@
+
+import { FnAjax, useAjax } from '@/Hook/useAjax'
+import { ListData, } from '@/services/launchAdq'
+import { PromotedObjectType } from '@/services/launchAdq/enum'
+import { Col, Row, Input, Select, Button } from 'antd'
+import React, { useEffect, useState, useCallback } from 'react'
+import TableData from '../../components/TableData'
+import tableConfig from './tableConfig'
+import { getAdqAdcreativeList } from '@/services/launchAdq/adq'
+
+export interface ModalConfig {
+    visible: boolean;
+    type?:'add'|'look'|'edit',
+    dataInfo?:null
+}
+
+function Creative(props:{accountId:string}) {
+    const {accountId} = props
+    // 变量
+    const [modalConfig, setModalConfig] = useState<ModalConfig>({
+        visible: false,
+        type:'add'
+    })
+    const [oldsearchData, setOldsearchData] = useState<any>(null)
+    // api方法
+    const sysAdcreativeList: FnAjax<ListData<any> | any> = useAjax((params) => getAdqAdcreativeList(params), { formatResult: true })
+    // 初始获取列表
+    useEffect(() => {
+        if(accountId){
+            getList({ pageSize: 20, pageNum: 1,accountId })
+        }
+    }, [accountId])
+    // 获取列表
+    const getList = useCallback((arg: { pageSize: number, pageNum: number, accountId: string }) => {
+        Object.keys(arg).forEach(key => {
+            !arg[key] && delete arg[key]
+        })
+        if (JSON.stringify(arg) !== JSON.stringify(oldsearchData)) {
+            setOldsearchData(arg)
+            sysAdcreativeList.run(arg)
+        }
+    }, [oldsearchData])
+
+    // 设置变量
+    const handleModalConfig = useCallback((arg: ModalConfig) => {
+        setModalConfig({ ...modalConfig, ...arg })
+    }, [modalConfig])
+    // submit
+    // 获取详情
+    const getInfo = useCallback((adgroupsId, type) => {
+        // targetingInfo.run(adgroupsId).then((res: any) => {
+        //     setModalConfig({ ...modalConfig, visible: true, type, dataInfo: res.data })
+        // })
+    }, [modalConfig])
+    // 回调
+    const callback = useCallback((data, type) => {
+        // getInfo(data.id, type)
+
+    }, [])
+    return <div>
+        <TableData
+            columns={()=>tableConfig(callback)}
+            ajax={sysAdcreativeList}
+            dataSource={sysAdcreativeList?.data?.data?.records}
+            loading={sysAdcreativeList?.loading}
+            scroll={{ y: 600 }}
+            total={sysAdcreativeList?.data?.data?.total}
+            page={sysAdcreativeList?.data?.data?.current}
+            pageSize={sysAdcreativeList?.data?.data?.size}
+            leftChild={<>
+                <Row gutter={[10, 10]}>
+                    <Col span={24}><Button type='primary' onClick={() => {
+                        handleModalConfig({ visible: true })
+                    }}>新建创意模板</Button></Col>
+                    <Col>
+                        <Input
+                            placeholder='创意名称'
+                            allowClear
+                            onBlur={(e) => {
+                                let value = e.target.value
+                                getList({ pageNum: 1, pageSize: 20, accountId })
+                            }}
+                            onKeyDownCapture={(e: any) => {
+                                let key = e.key
+                                if (key === 'Enter') {
+                                    let value = e.target.value
+                                    getList({ pageNum: 1, pageSize: 20, accountId })
+                                }
+                            }}
+                            onChange={(e) => {
+                                let value = e.target.value
+                                if (!value) {
+                                    getList({ pageNum: 1, pageSize: 20, accountId })
+                                }
+                            }}
+                        />
+                    </Col>
+                    <Col>
+                        <Select placeholder='推广目标选择' style={{ minWidth: 200 }} showSearch filterOption={(input: any, option: any) =>
+                            (option!.children as unknown as string).toLowerCase().includes(input.toLowerCase())
+                        } allowClear onChange={(value: any) => {
+                            getList({ pageNum: 1, pageSize: 20, accountId})
+                        }}>
+                            {
+                                Object.keys(PromotedObjectType).map(key => {
+                                    // let obj = JSON.parse(PromotedObjectType[key])
+                                    return <Select.Option value={key} key={key}>{PromotedObjectType[key]}</Select.Option>
+                                })
+                            }
+                        </Select>
+                    </Col>
+                </Row>
+            </>}
+            onChange={(props: any) => {
+                let { sortData, pagination } = props
+                let { current, pageSize } = pagination
+                // getList({ pageNum: current, pageSize })
+            }}
+        />
+    </div>
+}
+export default Creative

+ 82 - 0
src/pages/launchSystemNew/adq/creative/tableConfig.tsx

@@ -0,0 +1,82 @@
+import { PageTypeEnum, PromotedObjectType } from '@/services/launchAdq/enum'
+import React from 'react'
+import { Space } from 'antd'
+function tableConfig(callback:(data:any,type:'edit'|'look')=>void): any {
+    return [
+        {
+            title: 'ID',
+            dataIndex: 'id',
+            key: 'id',
+            align: 'center',
+            width: 70
+        },
+        {
+            title: '创意名称',
+            dataIndex: 'adcreativeName',
+            key: 'adcreativeName',
+            align: 'center',
+        },
+        {
+            title: '广告推广目标类型',
+            dataIndex: 'promotedObjectType',
+            key: 'promotedObjectType',
+            align: 'center',
+            render: (a: string | number) => {
+                return PromotedObjectType[a]
+            }
+        },
+        {
+            title: '落地页类型',
+            dataIndex: 'pageType',
+            key: 'pageType',
+            align: 'center',
+            render: (a: string) => {
+                return PageTypeEnum[a]
+            }
+        },
+        {
+            title: '创意形式ID',
+            dataIndex: 'adcreativeTemplateId',
+            key: 'adcreativeTemplateId',
+            align: 'center',
+        },
+        {
+            title: '数据展示',
+            dataIndex: 'conversionDataType',
+            key: 'conversionDataType',
+            align: 'center',
+            render: (a: any, b: any) => {
+                return b.conversionDataType || b.conversionTargetType ? '开' : '关'
+            }
+        },
+        {
+            title: '行动开关',
+            dataIndex: 'linkNameType',
+            key: 'linkNameType',
+            align: 'center',
+            render: (a: any, b: any) => {
+                return b.linkNameType || b.linkPageType ? '开' : '关'
+            }
+        },
+        {
+            title: '创建时间',
+            dataIndex: 'createTime',
+            key: 'createTime',
+            align: 'center',
+        },
+        {
+            title: '操作',
+            dataIndex: 'cz',
+            key: 'cz',
+            align: 'center',
+            render:(a: any,b: any)=>{
+                return <Space>
+                     <a onClick={()=>{
+                         callback(b,'look')
+                     }}>详情</a>
+                 </Space>
+             }
+        }
+    ]
+}
+export default tableConfig

+ 93 - 0
src/pages/launchSystemNew/adq/index.tsx

@@ -0,0 +1,93 @@
+import React, { useState, useEffect } from 'react'
+import { Card, Col, Menu, Row, Tabs } from 'antd';
+// import './index.less'
+import Ad from './ad';
+import Creative from './creative';
+import { useModel } from '@/.umi/plugin-model/useModel';
+import LandingPage from './landingPage';
+import { useAjax } from '@/Hook/useAjax';
+const { TabPane } = Tabs;
+let Menus: any = Menu
+const tabsConfig = [
+    { key: '1', tab: '账户信息', jsx: () => null },
+    { key: '2', tab: '计划', jsx: () => null },
+    { key: '3', tab: '广告', jsx: (props: any) => <Ad {...props} /> },
+    { key: '4', tab: '创意', jsx: (props: any) => <Creative {...props} /> },
+    { key: '5', tab: '落地页', jsx: (props: any) => <LandingPage {...props} /> },
+    { key: '6', tab: '定向', jsx: (props: any) => <LandingPage {...props} /> },
+]
+function Adq() {
+    const [activeKey, setActiveKey] = useState('4')
+    const { getAdAccount } = useModel('useLaunchAdq.useAdAuthorize')
+    const [menuKey, setmenuKey] = useState(['1'])
+    const [childrenObj, setChildrenObj] = useState<any>({})
+    const [accountId, setaccountId] = useState<any>(getAdAccount?.data?.data[0].accountId)
+    useEffect(() => {
+    }, [])
+    useEffect(() => {
+        // 获取账号列表
+        let name = menuKey[0]
+        console.log(name)
+        if (name && !childrenObj[name]) {
+            getAdAccount.run().then(res => {
+                if (res.data) {
+                    setChildrenObj({
+                        ...childrenObj,
+                        [name]: res.data?.map((item: { accountId: any; }) => {
+                            return { key: item.accountId, label: item.accountId + '_' + menuKey[0], }
+                        })
+                    })
+                }
+                setaccountId(res.data[0].accountId)
+            })
+        }
+    }, [menuKey, childrenObj])
+    // const children = useMemo(()=>{
+    //     return getAdAccount?.data?.data?.map((item: { accountId: any; })=>{
+    //         return {key:item.accountId,label:item.accountId+'_'+menuKey[0],}
+    //     })
+
+    // },[menuKey])
+    console.log(accountId)
+    return <Row >
+        <Col span={3} style={{ height: 'calc(100vh - 150px)' }}>
+            <Menus
+                theme='light'
+                onClick={(e: any) => {
+                    setaccountId(e.key)
+                }}
+                onOpenChange={(openKeys: any) => {
+                    setmenuKey(openKeys?.length > 1 ? openKeys.filter((k: any, i: any) => i === 1) : openKeys)
+                }}
+
+                // style={{ width: 256 }}
+                // selectedKeys={}
+                mode="inline"
+                multiple={false}
+                openKeys={menuKey}
+                items={[
+                    {
+                        key: 1,
+                        label: '沈武',
+                        children: childrenObj[1] || []
+                    },
+                ]}
+            />
+        </Col>
+        <Col span={21}>
+            <Card >
+                <Tabs activeKey={activeKey} type="card" onChange={(activeKey) => { setActiveKey(activeKey) }} >
+                    {
+                        tabsConfig?.map(item => {
+                            return <TabPane tab={item.tab} key={item.key} >
+                                {item.jsx({ accountId })}
+                            </TabPane>
+                        })
+                    }
+                </Tabs>
+            </Card>
+        </Col>
+    </Row>
+
+}
+export default Adq

+ 8 - 0
src/pages/launchSystemNew/adq/landingPage/index.tsx

@@ -0,0 +1,8 @@
+import React,{useEffect} from 'react'
+import {} from 'antd'
+
+function LandingPage(){
+  
+    return <div>123</div>
+}
+export default LandingPage

+ 1 - 0
src/pages/launchSystemNew/launchManage/localAd/creative/index.less

@@ -2,6 +2,7 @@
     width: 100%;
     overflow-y: auto;
     display: flex;
+    height: 173px;
     >label{
         height: 100%;
         margin-right: 15px;

+ 3 - 0
src/pages/launchSystemNew/launchManage/localAd/creative/modal.tsx

@@ -137,6 +137,9 @@ function CreativeModal(props: Props) {
             }).then(res => {
                 let newArr: any = []
                 // 过滤掉相同的和即将下线的
+                if(!res){
+                    return
+                }
                 Object.values(res)?.forEach((arr: any) => {
                     Array.isArray(arr) && arr?.forEach((item: any) => {
                         if (newArr.length > 0) {

+ 66 - 0
src/services/launchAdq/adq.ts

@@ -0,0 +1,66 @@
+import { request } from 'umi';
+import { api } from '../api';
+
+
+
+/**
+ * 获取ADQ创意列表
+ * @param adgroupName 广告名称
+ * @param promotedObjectType 广告类型
+ * @param accountId 账户ID
+ */
+export async function getAdqAdcreativeList(params: {
+  pageNum: number;
+  pageSize: number;
+  accountId: string;
+}) {
+  return request(api + '/adq/adcreative/list', {
+    method: 'POST',
+    data: params,
+  });
+}
+
+/**
+ * 获取ADQ落地页列表
+ * @param adgroupName 广告名称
+ * @param promotedObjectType 广告类型
+ * @param accountId 账户ID
+ */
+export async function getAdqLandingPageList(params: {
+  pageNum: number;
+  pageSize: number;
+  accountId: string;
+  pageName: string;
+  pageType: string;
+  pageTemplateId: string;
+  pageStatus: string;
+}) {
+  return request(api + '/adq/landingPageWechat/list ', {
+    method: 'POST',
+    data: params,
+  });
+}
+
+/**
+ * 按账号同步落地页
+ * @param accountId 账户ID
+ */
+ export async function putAdqLandingPage(adAccountId: any) {
+  return request(api + `/adq/landingPageWechat/syncAll/${adAccountId} `, {
+    method: 'PUT',
+  });
+}
+/**
+ * 获取组员及组员账号列表
+*/
+export async function getAdAccountAllOfMember() {
+  return request(api + '/adq/adAccount/allOfMember');
+}
+// export async function get_allOfMember() {
+//   return fetch(api + '/adq/adAccount/allOfMember',{
+//     headers:{
+//       "content-Type":"application/json;charset=UTF-8",
+//       "Authorization": `Bearer ${sessionStorage.getItem("Admin-Token")}`
+//     }
+//   }).then(res=>res.json())
+// }

+ 81 - 63
src/services/launchAdq/createAd.ts

@@ -5,105 +5,123 @@ import { api } from '../api';
 /**
  * 获取商品库列表
  */
- export interface CreateAdProps {
-    campaignName: string, // 计划名称
-    campaignType: string, // 计划类型 CAMPAIGN_TYPE_NORMAL CAMPAIGN_TYPE_SEARCH 
-    promotedObjectType: string, // 推广目标类型
-    dailyBudget?: number,   // 推广计划日预算
-    totalBudget?: number, // 推广计划总预算
-    speedMode: string, // 投放速度模式
-    sysAdgroupsId: number,  // 广告组内容
-    sysTargetingId: number,  // 定向包 id
-    adName: string,  // 广告名称
-    configuredStatus: string,  // 广告状态
-    sysAdcreativeId: number, // 创意ID
-    sysPageId: number, // 落地页Id
-    accountCreateLogs: {
-        adAccountId: number, // 媒体账户ID
-        userActionSets?: number,  // 数据源
-        conversionId?: number, // 广告组 转化Id
-        productId?: number,
-        enterpriseWx?: any[]  // 企业微信客服组
-    }[]
+export interface CreateAdProps {
+  campaignName: string; // 计划名称
+  campaignType: string; // 计划类型 CAMPAIGN_TYPE_NORMAL CAMPAIGN_TYPE_SEARCH
+  promotedObjectType: string; // 推广目标类型
+  dailyBudget?: number; // 推广计划日预算
+  totalBudget?: number; // 推广计划总预算
+  speedMode: string; // 投放速度模式
+  sysAdgroupsId: number; // 广告组内容
+  sysTargetingId: number; // 定向包 id
+  adName: string; // 广告名称
+  configuredStatus: string; // 广告状态
+  sysAdcreativeId: number; // 创意ID
+  sysPageId: number; // 落地页Id
+  accountCreateLogs: {
+    adAccountId: number; // 媒体账户ID
+    userActionSets?: number; // 数据源
+    conversionId?: number; // 广告组 转化Id
+    productId?: number;
+    enterpriseWx?: any[]; // 企业微信客服组
+  }[];
 }
 export async function getSysProductCatalogApi(data: CreateAdProps) {
-    return request(api + `/adq/sysProductCatalog/list`, {
-        method: 'POST',
-        data
-    })
+  return request(api + `/adq/sysProductCatalog/list`, {
+    method: 'POST',
+    data,
+  });
 }
 
-
-
 /**
  * 获取商品列表
  * @param data
- * @returns 
+ * @returns
  */
 export async function getGoodsApi(data: number[]) {
-    return request(api + `/adq/product/allByAccountWithCatalog`, {
-        method: 'POST',
-        data
-    })
+  return request(api + `/adq/product/allByAccountWithCatalog`, {
+    method: 'POST',
+    data,
+  });
 }
 /**
  * 同步商品库
  * @param data
- * @returns 
+ * @returns
  */
 export async function synGoodsApi(data: number[]) {
-    return request(api + `/adq/product/syncProductAndCatalogByAdAccountId`, {
-        method: 'PUT',
-        data
-    })
+  return request(api + `/adq/product/syncProductAndCatalogByAdAccountId`, {
+    method: 'PUT',
+    data,
+  });
 }
 
-
 /**
  * 获取数据源
  * @param data
- * @returns 
+ * @returns
  */
- export async function getDataSourceApi(data: number[]) {
-    return request(api + `/adq/userActionSets/allByAccount`, {
-        method: 'POST',
-        data
-    })
+export async function getDataSourceApi(data: number[]) {
+  return request(api + `/adq/userActionSets/allByAccount`, {
+    method: 'POST',
+    data,
+  });
 }
 
 /**
  * 同步数据源
- * @param data 
- * @returns 
+ * @param data
+ * @returns
  */
 export async function sysDataSourceApi(data: number[]) {
-    return request(api + `/adq/userActionSets/syncByAdAccountId`, {
-        method: 'PATCH',
-        data
-    })
+  return request(api + `/adq/userActionSets/syncByAdAccountId`, {
+    method: 'PATCH',
+    data,
+  });
 }
 
 /**
  * 获取转化ID
- * @param data 
- * @returns 
+ * @param data
+ * @returns
  */
 export async function getIdApi(data: number[]) {
-    return request(api + `/adq/conversions/allByAccount`, {
-        method: 'POST',
-        data
-    })
+  return request(api + `/adq/conversions/allByAccount`, {
+    method: 'POST',
+    data,
+  });
 }
 
-
 /**
  * 同步转化ID
- * @param data 
- * @returns 
+ * @param data
+ * @returns
  */
 export async function sysIdApi(data: number[]) {
-    return request(api + `/adq/conversions/syncByAdAccountId`, {
-        method: 'PUT',
-        data
-    })
-}
+  return request(api + `/adq/conversions/syncByAdAccountId`, {
+    method: 'PUT',
+    data,
+  });
+}
+/**
+ * 推广目标
+ * @param data
+ * @returns
+ */
+export async function get_promotedObject_allByAccount(data: number[]) {
+  return request(api + `/adq/promotedObject/allByAccount`, {
+    method: 'POST',
+    data,
+  });
+}
+/**
+ * 同步更新推广目标
+ * @param data
+ * @returns
+ */
+export async function put_promotedObject_syncByAdAccountId(data: number[]) {
+  return request(api + `/adq/promotedObject/syncByAdAccountId`, {
+    method: 'PUT',
+    data,
+  });
+}

+ 0 - 1
src/services/launchAdq/creative.ts

@@ -1,5 +1,4 @@
 import { request } from 'umi';
-import { ListData } from '.';
 import { api } from '../api';
 
 /**

+ 1 - 1
src/services/user.ts

@@ -36,4 +36,4 @@ export async function modifyPasswordAjax(prams: { userId: string, password: stri
 /**查询公众号到期 */
 export async function getMpsTimeOut(userId: any): Promise<any> {
   return request(api + `/system/mp/getMpsTimeOut/${userId}`)
-}
+}