wjx 10 bulan lalu
induk
melakukan
222990b55f
3 mengubah file dengan 103 tambahan dan 109 penghapusan
  1. 101 87
      config/routerConfig.ts
  2. 1 21
      src/components/RightContent/index.tsx
  3. 1 1
      src/services/user.ts

+ 101 - 87
config/routerConfig.ts

@@ -14,19 +14,19 @@ function headrRouter(initialState: any, history: any) {
             }
             }
         }
         }
     })
     })
-    if (history?.location?.pathname === '/launchSystemNew') { //当切换一级菜单的辅助跳转
+    if (history?.location?.pathname === '/launchSystemV3') { //当切换一级菜单的辅助跳转
         history?.goBack()
         history?.goBack()
         initialState?.menu?.data.forEach((item: { roles: string[], path: string, routes: { path: string, routes: any[] }[] }) => {
         initialState?.menu?.data.forEach((item: { roles: string[], path: string, routes: { path: string, routes: any[] }[] }) => {
-            if (item?.routes?.some((i: { path: string }) => i.path?.includes('/launchSystemNew'))) {
+            if (item?.routes?.some((i: { path: string }) => i.path?.includes('/launchSystemV3'))) {
                 let path = item?.routes?.length > 0 ? (item?.routes[0]?.routes?.length > 0 && item?.routes[0]?.routes[0]?.path) ? item?.routes[0]?.routes[0]?.path : item?.routes[0].path : item?.routes[0].path
                 let path = item?.routes?.length > 0 ? (item?.routes[0]?.routes?.length > 0 && item?.routes[0]?.routes[0]?.path) ? item?.routes[0]?.routes[0]?.path : item?.routes[0].path : item?.routes[0].path
                 isPhone ? history.push(path) : window.open(location.origin + '/#' + path)
                 isPhone ? history.push(path) : window.open(location.origin + '/#' + path)
             }
             }
         })
         })
     }
     }
-    if (history?.location?.pathname === '/launchSystemV3') { //当切换一级菜单的辅助跳转
+    if (history?.location?.pathname === '/launchSystemNew') { //当切换一级菜单的辅助跳转
         history?.goBack()
         history?.goBack()
         initialState?.menu?.data.forEach((item: { roles: string[], path: string, routes: { path: string, routes: any[] }[] }) => {
         initialState?.menu?.data.forEach((item: { roles: string[], path: string, routes: { path: string, routes: any[] }[] }) => {
-            if (item?.routes?.some((i: { path: string }) => i.path?.includes('/launchSystemV3'))) {
+            if (item?.routes?.some((i: { path: string }) => i.path?.includes('/launchSystemNew'))) {
                 let path = item?.routes?.length > 0 ? (item?.routes[0]?.routes?.length > 0 && item?.routes[0]?.routes[0]?.path) ? item?.routes[0]?.routes[0]?.path : item?.routes[0].path : item?.routes[0].path
                 let path = item?.routes?.length > 0 ? (item?.routes[0]?.routes?.length > 0 && item?.routes[0]?.routes[0]?.path) ? item?.routes[0]?.routes[0]?.path : item?.routes[0].path : item?.routes[0].path
                 isPhone ? history.push(path) : window.open(location.origin + '/#' + path)
                 isPhone ? history.push(path) : window.open(location.origin + '/#' + path)
             }
             }
@@ -75,12 +75,6 @@ function getMyMenu(code: any, data: any,) {
                 new_data.push(data[key][0])
                 new_data.push(data[key][0])
             }
             }
         })
         })
-        // 处理顺序
-        new_data = new_data?.sort((a, b) => {
-            let v1 = a.orderNum
-            let v2 = b.orderNum
-            return v1 - v2
-        })
         new_data?.forEach((items: any) => {
         new_data?.forEach((items: any) => {
             if (items?.children?.length === 0) {//假如路由的子路由只有一个代表当前组件没有子路由,将children中的component组件路径给外层component
             if (items?.children?.length === 0) {//假如路由的子路由只有一个代表当前组件没有子路由,将children中的component组件路径给外层component
                 newData.push({ path: items.children[0].path, name: items.meta.title, icon: items.meta.icon, component: items.children[0].component, key: items.menuId })  // roles: roles
                 newData.push({ path: items.children[0].path, name: items.meta.title, icon: items.meta.icon, component: items.children[0].component, key: items.menuId })  // roles: roles
@@ -93,6 +87,100 @@ function getMyMenu(code: any, data: any,) {
     }
     }
     return newData
     return newData
 }
 }
+const launchSystemV3 = {
+    path: '/launchSystemV3',
+    routes: [
+        {
+            path: '/launchSystemV3/adMonitorListV3',
+            name: '广告监控',
+            component: './launchSystemV3/adMonitorListV3',
+            access: 'adMonitorListV3',
+        },
+        {
+            path: '/launchSystemV3/adqv3',
+            name: '腾讯广告',
+            component: './launchSystemV3/adqv3',
+            access: 'adqv3',
+        },
+        {
+            path: '/launchSystemV3/account',
+            name: '广告账户管理',
+            access: 'account',
+            routes: [
+                {
+                    name: '小说',
+                    path: '/launchSystemV3/account/novel',
+                    access: 'novel',
+                    component: './launchSystemNew/account/novel',
+                },
+                {
+                    name: '游戏',
+                    path: '/launchSystemV3/account/game',
+                    access: 'game',
+                    component: './launchSystemNew/account/game',
+                },
+            ],
+        },
+        {
+            path: '/launchSystemV3/tencentAdPutIn',
+            name: '广告投放',
+            access: 'tencentAdPutIn',
+            routes: [
+                {
+                    name: '广告创建',
+                    path: '/launchSystemV3/tencentAdPutIn/create',
+                    access: 'create',
+                    component: './launchSystemV3/tencentAdPutIn/create',
+                },
+                {
+                    name: '任务列表',
+                    path: '/launchSystemV3/tencentAdPutIn/taskList',
+                    access: 'taskList',
+                    component: './launchSystemV3/tencentAdPutIn/taskList',
+                },
+            ],
+        },
+        {
+            path: '/launchSystemV3/tencenTasset',
+            name: '资产',
+            access: 'tencenTasset',
+            routes: [
+                {
+                    name: '定向模板',
+                    path: '/launchSystemV3/tencenTasset/targeting',
+                    access: 'targeting',
+                    component: './launchSystemV3/tencenTasset/targeting',
+                },
+                {
+                    name: '品牌形象',
+                    path: '/launchSystemV3/tencenTasset/brand',
+                    access: 'brand',
+                    component: './launchSystemV3/tencenTasset/brand',
+                },
+                {
+                    name: '头像昵称跳转页',
+                    path: '/launchSystemV3/tencenTasset/profiles',
+                    access: 'profiles',
+                    component: './launchSystemV3/tencenTasset/profiles',
+                }
+            ],
+        },
+        {
+            path: '/launchSystemV3/material',
+            name: '素材库',
+            access: 'material',
+            icon: 'DatabaseOutlined',
+            routes: [
+                {
+                    name: '本地素材',
+                    path: '/launchSystemV3/material/cloud',
+                    access: 'cloud',
+                    component: './launchSystemNew/material/cloud',
+                },
+            ],
+        },
+    ]
+}
 /** 投放系统 */
 /** 投放系统 */
 const launchSystem = {
 const launchSystem = {
     path: '/launchSystemNew',
     path: '/launchSystemNew',
@@ -182,81 +270,7 @@ const launchSystem = {
     ],
     ],
 
 
 }
 }
-const launchSystemV3 = {
-    path: '/launchSystemV3',
-    routes: [
-        {
-            path: '/launchSystemV3/adMonitorListV3',
-            name: '广告监控',
-            component: './launchSystemV3/adMonitorListV3',
-            access: 'adMonitorListV3',
-        },
-        {
-            path: '/launchSystemV3/adqv3',
-            name: '腾讯广告',
-            component: './launchSystemV3/adqv3',
-            access: 'adqv3',
-        },
-        {
-            path: '/launchSystemV3/tencentAdPutIn',
-            name: '广告投放',
-            access: 'tencentAdPutIn',
-            routes: [
-                {
-                    name: '广告创建',
-                    path: '/launchSystemV3/tencentAdPutIn/create',
-                    access: 'create',
-                    component: './launchSystemV3/tencentAdPutIn/create',
-                },
-                {
-                    name: '任务列表',
-                    path: '/launchSystemV3/tencentAdPutIn/taskList',
-                    access: 'taskList',
-                    component: './launchSystemV3/tencentAdPutIn/taskList',
-                },
-            ],
-        },
-        {
-            path: '/launchSystemV3/tencenTasset',
-            name: '资产',
-            access: 'tencenTasset',
-            routes: [
-                {
-                    name: '定向模板',
-                    path: '/launchSystemV3/tencenTasset/targeting',
-                    access: 'targeting',
-                    component: './launchSystemV3/tencenTasset/targeting',
-                },
-                {
-                    name: '品牌形象',
-                    path: '/launchSystemV3/tencenTasset/brand',
-                    access: 'brand',
-                    component: './launchSystemV3/tencenTasset/brand',
-                },
-                {
-                    name: '头像昵称跳转页',
-                    path: '/launchSystemV3/tencenTasset/profiles',
-                    access: 'profiles',
-                    component: './launchSystemV3/tencenTasset/profiles',
-                }
-            ],
-        },
-        {
-            path: '/launchSystemV3/material',
-            name: '素材库',
-            access: 'material',
-            icon: 'DatabaseOutlined',
-            routes: [
-                {
-                    name: '本地素材',
-                    path: '/launchSystemV3/material/cloud',
-                    access: 'cloud',
-                    component: './launchSystemNew/material/cloud',
-                },
-            ],
-        },
-    ]
-}
+
 /** 头条 */
 /** 头条 */
 const adMonitor = {
 const adMonitor = {
     path: '/toutiao',
     path: '/toutiao',
@@ -273,7 +287,7 @@ const adMonitor = {
 export {
 export {
     headrRouter,
     headrRouter,
     getMyMenu,
     getMyMenu,
+    launchSystemV3,
     launchSystem,
     launchSystem,
-    adMonitor,
-    launchSystemV3
+    adMonitor
 }
 }

+ 1 - 21
src/components/RightContent/index.tsx

@@ -1,6 +1,6 @@
 import { Tag, Space, Badge, Modal } from 'antd';
 import { Tag, Space, Badge, Modal } from 'antd';
 import React, { useCallback } from 'react';
 import React, { useCallback } from 'react';
-import { useModel, history } from 'umi';
+import { useModel } from 'umi';
 import Avatar from './AvatarDropdown';
 import Avatar from './AvatarDropdown';
 import styles from './index.less';
 import styles from './index.less';
 import { exitFullScreen, requestFullScreen, isFull } from '@/utils/fullScreen'
 import { exitFullScreen, requestFullScreen, isFull } from '@/utils/fullScreen'
@@ -29,18 +29,6 @@ const GlobalHeaderRight: React.FC<{}> = () => {
       requestFullScreen()
       requestFullScreen()
     }
     }
   }
   }
-  const onMenuClick = useCallback(
-    (event: {
-      key: React.Key;
-      keyPath: React.Key[];
-      item: React.ReactInstance;
-      domEvent: React.MouseEvent<HTMLElement>;
-    }) => {
-      const { key } = event;
-      history.push(key);
-    },
-    [],
-  );
   //消息弹窗更新
   //消息弹窗更新
   const inform = useCallback(() => {
   const inform = useCallback(() => {
     let bdVersions = localStorage.getItem('versions') //本地
     let bdVersions = localStorage.getItem('versions') //本地
@@ -73,14 +61,6 @@ const GlobalHeaderRight: React.FC<{}> = () => {
   }, [])
   }, [])
   return (
   return (
     <div style={{ display: 'flex', justifyContent: 'space-between' }}>
     <div style={{ display: 'flex', justifyContent: 'space-between' }}>
-      {/* <Menu onClick={onMenuClick} selectedKeys={['/operatePage/operate']} mode="horizontal">
-        <Menu.Item key='/operatePage' >
-          运营中心
-        </Menu.Item>
-        <Menu.Item key='/dataStatistics' >
-          数据统计
-        </Menu.Item>
-      </Menu> */}
       <Space className={className}>
       <Space className={className}>
         {versionsOpen && <div onClick={versionsOpen && inform}>
         {versionsOpen && <div onClick={versionsOpen && inform}>
           <Badge count={versionsOpen && 1} size='small' offset={[2, 0]}>
           <Badge count={versionsOpen && 1} size='small' offset={[2, 0]}>

+ 1 - 1
src/services/user.ts

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