From 5c3d381bdfdf1bef8391aa45572237370b720bc2 Mon Sep 17 00:00:00 2001
From: skyouc
Date: 星期一, 30 六月 2025 17:02:39 +0800
Subject: [PATCH] 新增波次订单关联表
---
rsf-admin/src/page/settings/index.jsx | 83 +++++++++++++++++++----------------------
1 files changed, 38 insertions(+), 45 deletions(-)
diff --git a/rsf-admin/src/page/settings/index.jsx b/rsf-admin/src/page/settings/index.jsx
index 63e48b6..ff3f665 100644
--- a/rsf-admin/src/page/settings/index.jsx
+++ b/rsf-admin/src/page/settings/index.jsx
@@ -1,35 +1,24 @@
import React, { useState, useRef, useEffect, useMemo } from "react";
import { useNavigate } from 'react-router-dom';
import {
- Edit,
- SimpleForm,
- FormDataConsumer,
useTranslate,
- TextInput,
- NumberInput,
- BooleanInput,
- SaveButton,
- SelectInput,
- Toolbar,
- Labeled,
- NumberField,
- required,
- useRecordContext,
- useTheme,
useAuthProvider,
} from 'react-admin';
import { useWatch, useFormContext } from "react-hook-form";
-import { Stack, Grid, Box, Typography, Card, CardContent, Tabs, Tab } from '@mui/material';
+import { Stack, Grid, Box, Typography, Card, CardContent, Tabs, Tab, useTheme } from '@mui/material';
import * as Common from '@/utils/common';
-import { } from '@/config/setting';
import BaseSettings from "./BaseSettings";
+import SecuritySettings from "./SecuritySettings"
+import { queryUserInfo } from '@/api/auth';
const Index = () => {
const authProvider = useAuthProvider();
const navigate = useNavigate();
const translate = useTranslate();
const theme = useTheme();
- const [value, setValue] = React.useState(0);
+
+ const [value, setValue] = useState(0);
+ const [userInfo, setUserInfo] = useState(null);
useEffect(() => {
authProvider.checkAuth().catch(() => {
@@ -38,7 +27,10 @@
}, [authProvider, navigate]);
useEffect(() => {
- }, [value]);
+ queryUserInfo().then(res => {
+ setUserInfo(res);
+ })
+ }, []);
return (
<>
@@ -50,9 +42,10 @@
flexGrow: 1,
bgcolor: 'background.paper',
display: 'flex',
- height: 224,
- border: `1px solid #${theme[0] === 'light' ? 'ddd' : '333'}`,
- borderRadius: 2
+ border: `1px solid #${theme.palette.mode === 'light' ? 'ddd' : '333'}`,
+ borderRadius: 2,
+ pt: 1,
+ pb: 1,
}}
>
<Tabs
@@ -62,8 +55,17 @@
onChange={(event, newValue) => {
setValue(newValue);
}}
- indicatorColor="secondary"
+ indicatorColor="primary"
textColor="inherit"
+ TabIndicatorProps={{
+ style: {
+ left: 0,
+ right: 'auto',
+ width: '5px',
+ borderRadius: '2px',
+ opacity: .8,
+ }
+ }}
sx={{
borderRight: 1,
borderColor: 'divider',
@@ -80,33 +82,24 @@
aria-controls='vertical-tabpanel-1'
/>
</Tabs>
- <BaseSettings
- value={value}
- />
- <SecuritySettings
- value={value}
- />
+
+ {value === 0 && (
+ <BaseSettings
+ value={value}
+ userInfo={userInfo}
+ />
+ )}
+ {value === 1 && (
+ <SecuritySettings
+ value={value}
+ userInfo={userInfo}
+ />
+ )}
+
</Box>
</CardContent>
</Card>
</>
- )
-}
-
-const SecuritySettings = (props) => {
- const { children, value, ...other } = props;
-
- return (
- <Box
- hidden={value !== 1}
- sx={{ p: 3 }}
- {...other}
- >
- <Typography>
- Security Settings
- </Typography>
- </Box>
-
)
}
--
Gitblit v1.9.1