shenwu 2 anni fa
parent
commit
1a0f25e057

+ 1 - 1
README.md

@@ -1,4 +1,4 @@
-## 趣程运营后台
+## 趣程广告投放管理
 
 ## Environment Prepare
 

+ 1 - 1
config/config.ts

@@ -19,7 +19,7 @@ export default defineConfig({
     hmr: true,
   },
   layout: {
-    name: '趣程管理后台',
+    name: '趣程投放工具',
     locale: false,
     siderWidth: 208,
   },

+ 1 - 1
config/defaultSettings.ts

@@ -13,7 +13,7 @@ export default {
   menu: {
     locale: false,
   },
-  title: '趣程管理后台',
+  title: '广告投放管理',
   pwa: false,
   iconfontUrl: '',
 } as LayoutSettings & {

+ 6 - 0
config/routerConfig.ts

@@ -87,6 +87,12 @@ function getMyMenu(code: any, data: any,) {
 const launchSystem = {
     path: '/launchSystemNew',
     routes: [
+        {
+            path: '/launchSystemNew/adMonitorList',
+            name: '广告监控',
+            component: './adMonitor/adMonitorList',
+            access: 'adMonitorList',
+        },
         {
             path: '/launchSystemNew/account',
             name: '广告账户管理',

+ 2 - 2
src/manifest.json

@@ -1,6 +1,6 @@
 {
-  "name": "趣程后台管理",
-  "short_name": "趣程后台管理",
+  "name": "趣程广告投放管理",
+  "short_name": "趣程广告投放管理",
   "display": "standalone",
   "start_url": "./?utm_source=homescreen",
   "theme_color": "#002140",

+ 1 - 1
src/pages/document.ejs

@@ -194,7 +194,7 @@
             width="32"
             style="margin-right: 8px"
           />
-          趣程后台管理
+          趣程投放工具
         </div>
       </div>
     </div>

+ 1 - 1
src/pages/launchSystemNew/adq/ad/copy.tsx

@@ -55,7 +55,7 @@ const Copy: React.FC<Props> = (props) => {
             console.log(newValues);
             copyAdAd.run({ ...newValues, adgroupIds: selectedRows.map((item: { adgroupId: number }) => item.adgroupId) }).then(res => {
                 if (res) {
-                    message.success(`复制完成.成功: ${res.success},失败: ${res.fail}`)
+                    message.success(`复制操作完成.结果请在操作记录查询!`)//成功: ${res.success},失败: ${res.fail}
                     if (res?.fail) {
                         notification.error({
                             message: `复制失败`,

+ 92 - 17
src/pages/launchSystemNew/adq/ad/index.tsx

@@ -1,14 +1,15 @@
 
 import { useAjax } from '@/Hook/useAjax'
-import { PromotedObjectType } from '@/services/launchAdq/enum'
+import { AdStatusEnum, PromotedObjectType } from '@/services/launchAdq/enum'
 import { Col, Row, Input, Select, message, Space, Button, Popconfirm, Switch, notification } from 'antd'
 import React, { useEffect, useCallback, useState } from 'react'
 import TableData from '../../components/TableData'
 import tableConfig from './tableConfig'
-import { putAdqAdgroupsSync, getAdqAdgroupsList, delListAdqAdgroupsApi, editAdqAdgroupsDataApi } from '@/services/launchAdq/adq'
+import { putAdqAdgroupsSync, getAdqAdgroupsList, delListAdqAdgroupsApi, newEditAdqAdgroupsDataApi } from '@/services/launchAdq/adq'
 import { CopyOutlined, DeleteOutlined, FieldTimeOutlined, PauseCircleOutlined, PlayCircleOutlined, TransactionOutlined } from '@ant-design/icons'
 import UpdateAd from './updateAd'
 import Copy from './copy'
+
 type Props = {
     accountId: string,
     adAccountId: string,
@@ -45,23 +46,31 @@ const Ad: React.FC<Props> = (props) => {
     const listAjax = useAjax((params) => getAdqAdgroupsList(params), { formatResult: true })
     const syncAjax = useAjax((adAccountId) => putAdqAdgroupsSync(adAccountId))
     const delListAdqAdgroups = useAjax((params) => delListAdqAdgroupsApi(params))
-    const editAdqAdgroupsData = useAjax((params) => editAdqAdgroupsDataApi(params))
+    const editAdqAdgroupsData = useAjax((params) => newEditAdqAdgroupsDataApi(params))
     /************************/
 
     useEffect(() => {
-        getList({ pageNum: 1, pageSize: 20, accountId, ...queryParmas })
+        let {accountId,campaignId,adgroupId,...obj} = queryParmas
+        let new_queryParmas = {
+            ...obj,
+            accountIdList:accountId?[accountId]:[],
+            campaignIdList:campaignId?[campaignId]:[],
+            adgroupIdList:adgroupId?[adgroupId]:[]
+        }
+        getList({ pageNum: 1, pageSize: 20, ...new_queryParmas,accountIdList:accountId?[accountId]:[] })
     }, [accountId, userId, queryParmas])
 
     // 获取列表
     const getList = useCallback((params: {
         pageNum: number;
         pageSize: number;
-        accountId?: string;
+        accountIdList?: any[];
         adgroupName?: string;
-        adgroupId?: string;
+        adgroupIdList?: any[];
         promotedObjectType?: string;
         isDeleted?: boolean
-        campaignId?: string
+        campaignIdList?: any[]
+        statusList?:any[]
     }) => {
         if (!params.adgroupName || params.adgroupName !== listAjax?.params[0]?.adgroupName) {
             !params.adgroupName && delete params.adgroupName
@@ -119,7 +128,7 @@ const Ad: React.FC<Props> = (props) => {
             return
         }
         editAdqAdgroupsData.run(params).then(res => {
-            message.success(`${type === 'play' ? '启动' : '暂停'}完成.成功: ${res.success},失败: ${res.fail}`)
+            message.success(`${type === 'play' ? '启动' : '暂停'}成功: ${res.success},失败: ${res.fail}`)//
             if (res?.fail) {
                 notification.error({
                     message: `${type === 'play' ? '启动' : '暂停'}失败`,
@@ -172,19 +181,34 @@ const Ad: React.FC<Props> = (props) => {
                             style={{ width: 150 }}
                             onBlur={(e) => {
                                 let value = e.target.value
-                                getList({ pageNum: 1, pageSize: 20, accountId: value })
+                                let arr:any = []
+                                if(value){
+                                    value = value.replace(/[,,\s]/g,',')
+                                    arr = value.split(',').filter(a=>a)
+                                }
+                                getList({ pageNum: 1, pageSize: 20, accountIdList: arr })
                             }}
                             onKeyDownCapture={(e: any) => {
                                 let key = e.key
                                 if (key === 'Enter') {
                                     let value = e.target.value
-                                    getList({ pageNum: 1, pageSize: 20, accountId: value })
+                                    let arr:any = []
+                                    if(value){
+                                        value = value.replace(/[,,\s]/g,',')
+                                        arr = value.split(',').filter((a: any)=>a)
+                                    }
+                                    getList({ pageNum: 1, pageSize: 20, accountIdList: arr })
                                 }
                             }}
                             onChange={(e) => {
                                 let value = e.target.value
                                 if (!value) {
-                                    getList({ pageNum: 1, pageSize: 20, accountId: value })
+                                    let arr:any = []
+                                    if(value){
+                                        value = value.replace(/[,,\s]/g,',')
+                                        arr = value.split(',').filter((a: any)=>a)
+                                    }
+                                    getList({ pageNum: 1, pageSize: 20, accountIdList: arr })
                                 }
                             }}
                         />
@@ -220,19 +244,34 @@ const Ad: React.FC<Props> = (props) => {
                             style={{ width: 150 }}
                             onBlur={(e) => {
                                 let value = e.target.value
-                                getList({ pageNum: 1, pageSize: 20, adgroupId: value })
+                                let arr:any = []
+                                if(value){
+                                    value = value.replace(/[,,\s]/g,',')
+                                    arr = value.split(',').filter((a: any)=>a)
+                                }
+                                getList({ pageNum: 1, pageSize: 20, adgroupIdList: arr })
                             }}
                             onKeyDownCapture={(e: any) => {
                                 let key = e.key
                                 if (key === 'Enter') {
                                     let value = e.target.value
-                                    getList({ pageNum: 1, pageSize: 20, adgroupId: value })
+                                    let arr:any = []
+                                    if(value){
+                                        value = value.replace(/[,,\s]/g,',')
+                                        arr = value.split(',').filter((a: any)=>a)
+                                    }
+                                    getList({ pageNum: 1, pageSize: 20, adgroupIdList: arr })
                                 }
                             }}
                             onChange={(e) => {
                                 let value = e.target.value
                                 if (!value) {
-                                    getList({ pageNum: 1, pageSize: 20, adgroupId: value })
+                                    let arr:any = []
+                                    if(value){
+                                        value = value.replace(/[,,\s]/g,',')
+                                        arr = value.split(',').filter((a: any)=>a)
+                                    }
+                                    getList({ pageNum: 1, pageSize: 20, adgroupIdList: arr })
                                 }
                             }}
                         />
@@ -244,19 +283,34 @@ const Ad: React.FC<Props> = (props) => {
                             style={{ width: 150 }}
                             onBlur={(e) => {
                                 let value = e.target.value
-                                getList({ pageNum: 1, pageSize: 20, campaignId: value })
+                                let arr:any = []
+                                if(value){
+                                    value = value.replace(/[,,\s]/g,',')
+                                    arr = value.split(',').filter((a: any)=>a)
+                                }
+                                getList({ pageNum: 1, pageSize: 20, campaignIdList: arr })
                             }}
                             onKeyDownCapture={(e: any) => {
                                 let key = e.key
                                 if (key === 'Enter') {
                                     let value = e.target.value
-                                    getList({ pageNum: 1, pageSize: 20, campaignId: value })
+                                    let arr:any = []
+                                    if(value){
+                                        value = value.replace(/[,,\s]/g,',')
+                                        arr = value.split(',').filter((a: any)=>a)
+                                    }
+                                    getList({ pageNum: 1, pageSize: 20, campaignIdList: arr })
                                 }
                             }}
                             onChange={(e) => {
                                 let value = e.target.value
                                 if (!value) {
-                                    getList({ pageNum: 1, pageSize: 20, campaignId: value })
+                                    let arr:any = []
+                                    if(value){
+                                        value = value.replace(/[,,\s]/g,',')
+                                        arr = value.split(',').filter((a: any)=>a)
+                                    }
+                                    getList({ pageNum: 1, pageSize: 20, campaignIdList: arr })
                                 }
                             }}
                         />
@@ -296,6 +350,27 @@ const Ad: React.FC<Props> = (props) => {
                             <Select.Option value={false}>未删除</Select.Option>
                         </Select>
                     </Col>
+                    <Col>
+                        <Select
+                            placeholder='广告状态'
+                            mode="multiple"
+                            style={{ width: 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, statusList: value })
+                            }}
+                        >
+                            {
+                                Object.keys(AdStatusEnum).map(key=>{
+                                    return  <Select.Option value={key} key={key}>{AdStatusEnum[key]}</Select.Option>
+                                })
+                            }
+                        </Select>
+                    </Col>
                 </Row>
                 <Row gutter={[10, 10]} align='middle'>
                     <Col>

+ 2 - 2
src/pages/launchSystemNew/adq/ad/switchStatus.tsx

@@ -1,5 +1,5 @@
 import { useAjax } from "@/Hook/useAjax"
-import { editAdqAdgroupsDataApi } from "@/services/launchAdq/adq"
+import { newEditAdqAdgroupsDataApi } from "@/services/launchAdq/adq"
 import { message, notification, Switch } from "antd"
 import React from "react"
 
@@ -17,7 +17,7 @@ interface Props {
 const SwitchStatus: React.FC<Props> = (prosp) => {
 
     const { configuredStatus, isDeleted, adgroupId, onChange } = prosp
-    const editAdqAdgroupsData = useAjax((params) => editAdqAdgroupsDataApi(params))
+    const editAdqAdgroupsData = useAjax((params) => newEditAdqAdgroupsDataApi(params))
     
     const switchHandle = (adgroupIds: number[], configuredStatus: string) => {
         editAdqAdgroupsData.run({ adgroupIds, configuredStatus }).then(res => {

+ 1 - 1
src/pages/launchSystemNew/adq/ad/updateAd.tsx

@@ -94,7 +94,7 @@ const UpdateAd: React.FC<Props> = ({ title = '修改广告', visible, onChange,
             // console.log('params--->', adgroupsUpdateDatetimeDTO);
             editAdqAdgroupsData.run({ adgroupIds: selectedRows.map((item: { adgroupId: number }) => item.adgroupId), adgroupsUpdateDatetimeDTO, adgroupsUpdateBidAmountDTO, deepConversionSpec }).then(res => {
                 if (res) {
-                    message.success(`修改完成.成功: ${res.success},失败: ${res.fail}`)
+                    message.success(`修改操作完成.结果请在操作记录查询!`)//成功: ${res.success},失败: ${res.fail}
                     if (res?.fail) {
                         notification.error({
                             message: `修改失败`,

+ 8 - 2
src/pages/launchSystemNew/adq/log/tableConfig.tsx

@@ -1,4 +1,5 @@
 import { copy } from "@/utils/utils"
+import { Badge } from "antd"
 import React from "react"
 
 
@@ -117,8 +118,13 @@ function tableConfig(tableIdClick: (props: {
             key: 'status',
             width: 70,
             align: 'center',
-            render: (a: number, b: any) => {
-                return <span style={b?.failCount > 0 ? { color: 'red' } : { color: 'rgb(103, 194, 58)' }}>{b?.failCount > 0 ? '失败' : '成功'}</span>
+            render: (a:any) => {
+                let obj={
+                    '成功':'success',
+                    '失败':'error',
+                    '执行中':'warning'
+                }
+                return <Badge status={obj[a]} text={a} />
             }
         },
         {

+ 3 - 2
src/pages/user/login/index.tsx

@@ -318,7 +318,7 @@ const Login: React.FC<{}> = () => {
             <div className={styles.content}>
 
               {sessionStorage.getItem('Admin-Token') && companyList?.length > 0 ? <div className={`${styles.company}  ${isMobile ? '' : show ? '' : styles.login_hide}`}>
-                <h1>趣程运营管理后台</h1>
+                <h1>趣程广告投放管理</h1>
 
                 <div className={styles.companyAccount}>
                   <h3 className={styles.title}>请选择公司账户登录</h3>
@@ -338,7 +338,7 @@ const Login: React.FC<{}> = () => {
                 </div>
 
               </div> : <div className={`${styles.main}  ${isMobile ? '' : show ? '' : styles.login_hide}`}>
-                <h1>趣程运营管理后台</h1>
+                <h1>趣程广告投放管理</h1>
                 {<div className={styles.tabs}>
                   <span onClick={() => { setTab(1) }} style={tab === 1 ? { color: localStorage.getItem('color') || '#24DB95' } : {}}>手机</span>
                   <span onClick={() => { setTab(2) }} style={tab === 2 ? { color: localStorage.getItem('color') || '#24DB95' } : {}}>钉钉</span>
@@ -398,6 +398,7 @@ const Login: React.FC<{}> = () => {
                     <div id='login_container' />
                 }
               </div>}
+              
             </div>
             {/**背景 */}
             {!isMobile && <Bg data={videoMenu} open={setVideoMenu} show={handleShow} isShow={show} />}

+ 6 - 1
src/services/launchAdq/adq.ts

@@ -164,7 +164,12 @@ export async function editAdqAdgroupsDataApi(data: EditAdqAdgroupsProps) {
     data
   });
 }
-
+export async function newEditAdqAdgroupsDataApi(data: EditAdqAdgroupsProps) {
+  return request(api + `/adq/adgroups/configStatus/update/batch`, {
+    method: 'POST',
+    data
+  });
+}
 export interface CopyAdProps{
   adgroupIds: number[],   // 广告组id列表
   beginDate: string,

+ 1 - 1
src/services/user.ts

@@ -16,7 +16,7 @@ export async function queryCurrent() {
 export async function getMenu(): Promise<any> {
   return request(api + '/erp/menu/getRouters', {
     method: 'PUT',
-    data: ["adq_put", "ad_monitor"]
+    data: ["adq_put"]// "ad_monitor"
   })
 }