From 5807fc22aba974b4ca85a8049ecd983673b0ca28 Mon Sep 17 00:00:00 2001
From: skyouc <958836976@qq.com>
Date: 星期一, 20 十月 2025 16:59:34 +0800
Subject: [PATCH] 1. 添加大屏接口 2. 任务站点确认修改
---
rsf-admin/src/App.jsx | 43 +++++++++++++++++++++++++++----------------
1 files changed, 27 insertions(+), 16 deletions(-)
diff --git a/rsf-admin/src/App.jsx b/rsf-admin/src/App.jsx
index 7ede214..c8601b9 100644
--- a/rsf-admin/src/App.jsx
+++ b/rsf-admin/src/App.jsx
@@ -31,7 +31,19 @@
import { getSystemInfo, getSystemDicts, tenants } from "@/api/auth";
import chineseMessages from 'ra-language-chinese';
import { createTheme, ThemeProvider } from '@mui/material/styles';
-import { zhCN } from '@mui/material/locale';
+import { zhCN, frFR, enUS } from '@mui/material/locale';
+
+
+const getMaterialUILocale = (locale) => {
+ switch (locale) {
+ case 'en':
+ return enUS;
+ case 'fr':
+ return frFR;
+ default:
+ return zhCN;
+ }
+};
const i18nProvider = polyglotI18nProvider(
(locale) => {
@@ -44,6 +56,11 @@
[
{ locale: "en", name: "English" },
{ locale: "zh", name: "绠�浣撲腑鏂�" },
+ { locale: "jp", name: "鏃ユ湰瑾�" },
+ { locale: "kr", name: "頃滉淡鞚�" },
+ { locale: "ru", name: "Russian" },
+ { locale: "lk", name: "袪褍褋褋泻懈泄" },
+ { locale: "es", name: "Espa帽ola" },
],
{
// msg in console
@@ -52,21 +69,17 @@
);
-const theme = createTheme(
- {
- palette: { main: '#1976d2' },
- },
- zhCN
-)
-
-
const store = localStorageStore(SPA_VERSION, SPA_NAME);
const App = () => {
const [themeName] = useStore("themeName", DEFAULT_THEME_NAME);
const lightTheme = themes.find((theme) => theme.name === themeName)?.light;
const darkTheme = themes.find((theme) => theme.name === themeName)?.dark;
-
+ const [locale, setLocale] = useState('zh');
+ const theme = createTheme(
+ {
+ ...lightTheme
+ }, getMaterialUILocale(locale))
useEffect(() => {
getSystemInfo().then((data) => {
localStorage.setItem("system", JSON.stringify(data));
@@ -83,6 +96,7 @@
lightTheme={lightTheme}
darkTheme={darkTheme}
defaultTheme={DEFAULT_THEME_MODE}
+ theme={theme}
i18nProvider={i18nProvider}
dataProvider={DataProvider(DATA_PROVIDER_SPRING)}
loginPage={Login}
@@ -112,12 +126,9 @@
};
const AppWrapper = () => (
- <ThemeProvider theme={theme}>
- <StoreContextProvider value={store}>
- <App />
- </StoreContextProvider>
- </ThemeProvider>
-
+ <StoreContextProvider value={store}>
+ <App />
+ </StoreContextProvider>
);
export default AppWrapper;
\ No newline at end of file
--
Gitblit v1.9.1