Commit b8ef848f authored by chenshouchao's avatar chenshouchao

feat: 增加项目设置页面

parent e70beb15
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -30,6 +30,22 @@ const demo = [ ...@@ -30,6 +30,22 @@ const demo = [
icon: "", icon: "",
type: "product", type: "product",
routes: [ routes: [
{
id: "PROJECT_SETTING",
type: "page",
name: "项目设置",
path: "/setting",
icon: "",
element: "ProjectSetting",
show: "true",
// children: [
// {
// id: "PROJECT_OVERIVEW_CREATE",
// type: "operation",
// name: "创建项目",
// },
// ],
},
{ {
id: "PROJECT_OVERIVEW", id: "PROJECT_OVERIVEW",
type: "page", type: "page",
......
...@@ -4,6 +4,7 @@ import MenuLayout from "@/views/MenuLayout"; ...@@ -4,6 +4,7 @@ import MenuLayout from "@/views/MenuLayout";
import * as React from "react"; import * as React from "react";
import NotFound from "@/views/404"; import NotFound from "@/views/404";
import Demo from "@/views/demo"; import Demo from "@/views/demo";
import ProjectSetting from "@/views/Project/ProjectSetting";
export type route = { export type route = {
id?: string; id?: string;
...@@ -36,6 +37,7 @@ export const elements: { ...@@ -36,6 +37,7 @@ export const elements: {
}) => JSX.Element; }) => JSX.Element;
} = { } = {
Demo: Demo, Demo: Demo,
ProjectSetting: ProjectSetting,
}; };
export const routes: Array<route | navigate> = [ export const routes: Array<route | navigate> = [
......
...@@ -3,3 +3,6 @@ ...@@ -3,3 +3,6 @@
align-items: flex-start; align-items: flex-start;
justify-content: center; justify-content: center;
} }
.content{
flex: 1;
}
...@@ -18,7 +18,7 @@ const MenuLayout = observer(() => { ...@@ -18,7 +18,7 @@ const MenuLayout = observer(() => {
return ( return (
<Box className={style.container}> <Box className={style.container}>
<Box sx={{ width: "10%" }}> <Box sx={{ width: "10%", minWidth: "220px" }}>
<List> <List>
{permissionStore.sidebarRouters.map((item, index) => { {permissionStore.sidebarRouters.map((item, index) => {
return ( return (
...@@ -33,7 +33,7 @@ const MenuLayout = observer(() => { ...@@ -33,7 +33,7 @@ const MenuLayout = observer(() => {
})} })}
</List> </List>
</Box> </Box>
<Box sx={{ width: "90%" }}> <Box className={style.content}>
<Outlet></Outlet> <Outlet></Outlet>
</Box> </Box>
</Box> </Box>
......
import { useMessage } from "@/components/MySnackbar";
import usePass from "@/hooks/usePass";
import { operation, route } from "@/router";
import { Button } from "@mui/material";
import { Box } from "@mui/system";
import { useEffect } from "react";
const ProjectSetting = ({
childrenRoutes,
}: {
childrenRoutes?: Array<route | operation>;
}) => {
const message = useMessage();
const isPass = usePass();
useEffect(() => {
console.log(isPass("PROJECT_OVERIVEW_CREATE"), "11111111111");
console.log(isPass("PROJECT_SUMMARY_MEMBER"), "2222222");
console.log(isPass("test"), "33333");
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
return (
<Box>
<Box>ProjectSetting123</Box>
<Box>{JSON.stringify(childrenRoutes)}</Box>
<Box>{JSON.stringify(process.env.NODE_ENV)}</Box>
<Button onClick={() => message.success("测试测试")}>message测试</Button>
</Box>
);
};
export default ProjectSetting;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment