shenwu vor 6 Tagen
Ursprung
Commit
b3000b25fe

+ 1 - 0
config/config.ts

@@ -4,6 +4,7 @@ import { join } from 'path';
 import defaultSettings from './defaultSettings';
 import proxy from './proxy';
 import routes from './routes';
+import menu from '@/locales/bn-BD/menu';
 const { REACT_APP_ENV = 'dev' } = process.env;
 const assetDir = 'static';
 let isBuild = process.env.npm_lifecycle_event?.includes('build');

+ 21 - 3
config/defaultSettings.ts

@@ -9,22 +9,40 @@ const Settings: ProLayoutProps & {
 } = {
   navTheme: 'light',
   // 拂晓蓝
-  colorPrimary: '#1890ff',
-  layout: 'mix',
+  colorPrimary: '#3246ee',//#1890ff
+  layout: 'side',//mix
   contentWidth: 'Fluid',
   fixedHeader: true,
   fixSiderbar: true,
   colorWeak: false,
-  title: '小说管理后台',
+  title: '星创AI',
   pwa: true,
   logo: 'https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png',
   iconfontUrl: '',
   // "splitMenus": true,
   // siderMenuType:"group",
   token: {
+    sider: {
+      colorMenuBackground: '#3246ee',//#3246ee , #001529
+      colorTextMenu: '#f0f4ff',
+      colorTextMenuSelected: "#fff",
+      colorTextMenuActive: "#fff",
+      colorBgMenuItemHover: '#b0c0ff',
+      colorTextMenuItemHover: "#fff",
+      colorBgMenuItemSelected: "#879bff",
+      colorTextMenuTitle:"#fff"
+    },
+    header: {
+      colorTextMenu: 'rgba(255,255,255,0.65)',
+      colorTextMenuSelected: "#fff",
+      colorTextMenuActive: "#fff",
+      colorBgHeader: '#001529',
+      colorHeaderTitle: "#fff"
+    }
     // 参见ts声明,demo 见文档,通过token 修改样式
     //https://procomponents.ant.design/components/layout#%E9%80%9A%E8%BF%87-token-%E4%BF%AE%E6%94%B9%E6%A0%B7%E5%BC%8F
   },
+  "splitMenus": false//关闭分割菜单
 };
 
 export default Settings;

+ 59 - 1
config/routes.tsx

@@ -1,4 +1,6 @@
-/**
+import route from "mock/route";
+
+/**
  * @name umi 的路由配置
  * @description 只支持 path,component,routes,redirect,wrappers,name,icon 的配置
  * @param path  path 只支持两种占位符配置,第一种是动态参数 :id 的形式,第二种是 * 通配符,通配符只能出现路由字符串的最后。
@@ -185,6 +187,62 @@ const newMenu = [
       },
     ],
   },
+  {
+    path: '/ai',
+    name: '小说AI',
+    icon: 'icon-xitong',
+    routes: [
+      {
+        path: '/ai',
+        redirect: '/ai/custom',
+      },
+      {
+        path: '/ai/custom',
+        name: '自定义生成器',
+        component: './ai',
+      },
+      {
+        path: '/ai/expand',
+        name: '小说扩写',
+        component: './ai',
+      },
+      {
+        path: '/ai/mainPlot',
+        name: '主线剧情设定',
+        component: './ai',
+      },
+      {
+        path: "/ai/branchPlot",
+        name: '支线剧情分解',
+        component: './ai',
+      },
+      {
+        path: "/ai/outline",
+        name: '小说大纲生成',
+        component: './ai',
+      },
+      {
+        path: "/ai/chapterOutline",
+        name: '章节细纲生成',
+        component: './ai',
+      },
+      {
+        path: "/ai/reversePlot",
+        name: '剧情反转设定',
+        component: './ai',
+      },
+      {
+        path: "/ai/plot",
+        name: '剧情创作',
+        component: './ai',
+      },
+      {
+        path: "/ai/character",
+        name: '人物创作',
+        component: './ai',
+      },
+    ],
+  }
 ];
 export default [
   {

+ 1 - 1
src/app.tsx

@@ -178,7 +178,7 @@ export const layout: RunTimeLayoutConfig = ({ initialState, setInitialState }) =
       );
     },
     ...initialState?.settings,
-    navTheme: initialState?.navTheme === '2' ? 'light' : 'realDark',
+    // navTheme: initialState?.navTheme === '2' ? 'light' : 'realDark',
     // title:<span style={{fontSize:24,fontFamily:'cursive'}}>{defaultSettings?.title}</span>
     // title:initialState?.selectApp ? defaultSettings?.title + '--'+initialState?.selectApp?.appName : defaultSettings?.title //标题修改
   };

+ 1 - 1
src/components/RightContent/AvatarDropdown.tsx

@@ -15,7 +15,7 @@ export type GlobalHeaderRightProps = {
 export const AvatarName = () => {
   const { initialState } = useModel('@@initialState');
   const { currentUser } = initialState || {};
-  return <span className="anticon">{currentUser?.nickname}</span>;
+  return <span className="anticon" style={{color:"#fff"}}>{currentUser?.nickname}</span>;
 };
 
 const useStyles = createStyles(({ token }) => {

+ 0 - 0
src/pages/ai/index.less


+ 55 - 0
src/pages/ai/index.tsx

@@ -0,0 +1,55 @@
+import { useEffect, useState } from "react";
+import "./index.less"
+function Ai() {
+    const [url,setUrl]=useState("https://ibiling.cn/novel/detail/zdyscq?pageid=01jacqn2j8tf9ecfwps9nzebnz")
+    useEffect(()=>{
+        let name = location.hash
+        switch (name) {
+            case "#/ai/custom":
+                setUrl("https://ibiling.cn/novel/detail/zdyscq?pageid=01jacqn2j8tf9ecfwps9nzebnz")
+                break;
+            case "#/ai/expand":
+                setUrl("https://ibiling.cn/novel/detail/2xskx?pageid=01jn5k01a8hqd1ggapbzpk5m4r")
+               break;
+            case "#/ai/mainPlot":
+                setUrl("https://ibiling.cn/novel/detail/2gszxjq?pageid=01jac7q1d6an5rnx2hwv76zt5k")
+               break;
+            case "#/ai/branchPlot":
+                setUrl("https://ibiling.cn/novel/detail/2zxjqfj?pageid=01j55h3cme81d0bkkn7se51z1a")
+               break;
+            case "#/ai/outline":
+                setUrl("https://ibiling.cn/novel/detail/2xsdgscq?pageid=01jn5ntqvh5s0hgz64gf05tzzw")
+               break;
+            case "#/ai/chapterOutline":
+                setUrl("https://ibiling.cn/novel/detail/2xg?pageid=01j9zw229vdyfv7t3a8ct77025")
+               break;
+            case "#/ai/reversePlot":
+                setUrl("https://ibiling.cn/novel/detail/2xsjqfz?pageid=01j9x8jymezp5ms1hhzgem1m0a")
+               break;
+            case "#/ai/plot":
+                setUrl("https://ibiling.cn/novel/detail/2jqlg?pageid=01jn5pyv03z9twb5qds3rz4h4b")
+               break;
+            case "#/ai/character":
+                setUrl("https://ibiling.cn/novel/detail/2xsrwsd?pageid=01j4re8c7qmmyn3ws2wr3etr6r")
+               break;
+        }
+    },[])
+    return <div>
+        <div style={{ height: "calc(100vh - 63px)", width: "100%", overflow: "hidden", position: "relative", background: "#fff" }}>
+            <iframe
+                id="ai-iframe"
+                width={"100%"}
+                height={"100%"}
+                frameBorder={0}
+                style={{ position: "absolute", top: -63,left:"-20%",width:"110%",}}
+                src={url}
+            >
+            </iframe>
+            <div style={{width:"28%",height:"100%",background:"#fff",zIndex:99,position:"absolute",right:0,top:0}}></div>
+            <div style={{width:"15%",height:"100%",background:"#fff",zIndex:99,position:"absolute",left:0,top:0}}></div>
+            {/* <div style={{width:"50%",height:"10%",background:"#fff",zIndex:99,position:"absolute",left:"15%",top:0}}></div> */}
+        </div>
+    </div>
+}
+
+export default Ai;

+ 2 - 2
src/services/global.ts

@@ -17,8 +17,8 @@ export async function getMenu(data: any[]): Promise<any> {
         let arr = generateNewLocalMenu(routes, res.data[name]);
         menus = [...menus, ...arr];
       }
-      console.log('menus', menus);
-      return menus;
+      console.log('menus', menus,routes[5]);
+      return [...menus,routes[5]];
     })
     .catch((err) => {
       console.log(err);