From 7bc7a9c11f4ed9b8539e9c72e5a09effcedf317a Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期日, 25 二月 2024 23:39:12 +0800
Subject: [PATCH] #
---
zy-asrs-flow/src/App.jsx | 18 +++++-------------
zy-asrs-flow/package.json | 16 ++++++++++++----
zy-asrs-flow/src/components/index.ts | 4 ++--
zy-asrs-flow/src/components/RightContent/index.tsx | 20 ++++++++++++++++++++
4 files changed, 39 insertions(+), 19 deletions(-)
diff --git a/zy-asrs-flow/package.json b/zy-asrs-flow/package.json
index 983f4a7..046aecd 100644
--- a/zy-asrs-flow/package.json
+++ b/zy-asrs-flow/package.json
@@ -36,11 +36,17 @@
},
"lint-staged": {
"**/*.{js,jsx,ts,tsx}": "npm run lint-staged:js",
- "**/*.{js,jsx,tsx,ts,less,md,json}": ["prettier --write"]
+ "**/*.{js,jsx,tsx,ts,less,md,json}": [
+ "prettier --write"
+ ]
},
- "browserslist": ["> 1%", "last 2 versions", "not ie <= 10"],
+ "browserslist": [
+ "> 1%",
+ "last 2 versions",
+ "not ie <= 10"
+ ],
"dependencies": {
- "@ant-design/icons": "^4.8.1",
+ "@ant-design/icons": "^5.3.0",
"@ant-design/pro-components": "^2.6.48",
"@umijs/route-utils": "^2.2.2",
"antd": "^5.13.2",
@@ -87,5 +93,7 @@
"umi-presets-pro": "^2.0.3",
"umi-serve": "^1.9.11"
},
- "engines": { "node": ">=12.0.0" }
+ "engines": {
+ "node": ">=12.0.0"
+ }
}
diff --git a/zy-asrs-flow/src/App.jsx b/zy-asrs-flow/src/App.jsx
index 4d783c2..f5ebeca 100644
--- a/zy-asrs-flow/src/App.jsx
+++ b/zy-asrs-flow/src/App.jsx
@@ -1,5 +1,5 @@
import React from 'react';
-import { Footer, Question, SelectLang, AvatarDropdown, AvatarName } from '@/components';
+import { Footer, Question, SelectLang, AvatarDropdown, AvatarName, Brightness } from '@/components';
import { LinkOutlined } from '@ant-design/icons';
import { SettingDrawer } from '@ant-design/pro-components';
import { history, Link } from '@umijs/max';
@@ -82,7 +82,7 @@
// 浼樺厛绾� layout > config > defaultSetting
export const layout = ({ initialState, setInitialState }) => {
return {
- actionsRender: () => [<Question key="doc" />, <SelectLang key="SelectLang" />],
+ actionsRender: () => [<Brightness />, <Question key="doc" />, <SelectLang key="SelectLang" />],
avatarProps: {
src: initialState?.currentUser?.avatar,
title: <AvatarName />,
@@ -144,15 +144,7 @@
},
],
// 鏄剧ず鍦ㄨ彍鍗曞彸涓嬭鐨勫揩鎹锋搷浣�
- links: false
- // links: isDev
- ? [
- <Link key="openapi" to="/umi/plugin/openapi" target="_blank">
- <LinkOutlined />
- <span>OpenAPI 鏂囨。</span>
- </Link>,
- ]
- : [],
+ links: [],
menuHeaderRender: undefined,
// 鑷畾涔� 403 椤甸潰
// unAccessible: <div>unAccessible</div>,
@@ -180,7 +172,7 @@
);
},
...initialState?.settings,
- layout: 'top', // layout 鐨勮彍鍗曟ā寮忥紝side锛氬彸渚у鑸紝top锛氶《閮ㄥ鑸�
+ layout: 'mix', // layout 鐨勮彍鍗曟ā寮忥紝side锛氬彸渚у鑸紝top锛氶《閮ㄥ鑸�
// contentStyle: () => { // layout 鐨勫唴瀹瑰尯 style
// return
// },
@@ -188,7 +180,7 @@
fixedHeader: true, // 鍥哄畾 header
fixSiderbar: true, // 鍥哄畾瀵艰埅
// settings: defaultSettings, // layout 鐨勮缃�
- waterMarkProps: { content: initialState?.currentUser?.nickname }, //姘村嵃
+ // waterMarkProps: { content: initialState?.currentUser?.nickname }, //姘村嵃
navTheme: 'realDark', // 榛樿涓婚棰滆壊 "realDark" | "light" | undef...
footerRender: false, // 椤佃剼 鍚敤璇锋敞閲婏紝涓嶆槸璁剧疆涓簍rue
};
diff --git a/zy-asrs-flow/src/components/RightContent/index.tsx b/zy-asrs-flow/src/components/RightContent/index.tsx
index 20a7831..a565679 100644
--- a/zy-asrs-flow/src/components/RightContent/index.tsx
+++ b/zy-asrs-flow/src/components/RightContent/index.tsx
@@ -1,6 +1,7 @@
import { QuestionCircleOutlined } from '@ant-design/icons';
import { SelectLang as UmiSelectLang } from '@umijs/max';
import React from 'react';
+import { MoonOutlined, BulbOutlined } from '@ant-design/icons';
export type SiderTheme = 'light' | 'dark';
@@ -29,3 +30,22 @@
</div>
);
};
+
+export const Brightness = () => {
+ return (
+ <>
+ <div
+ style={{
+ display: 'flex',
+ height: 26,
+ }}
+ onClick={() => {
+ window.open('https://pro.ant.design/docs/getting-started');
+ }}
+ >
+ {/* <BulbOutlined /> */}
+ <MoonOutlined />
+ </div>
+ </>
+ )
+}
diff --git a/zy-asrs-flow/src/components/index.ts b/zy-asrs-flow/src/components/index.ts
index ca88a6d..8b24539 100644
--- a/zy-asrs-flow/src/components/index.ts
+++ b/zy-asrs-flow/src/components/index.ts
@@ -6,7 +6,7 @@
* 甯冨眬缁勪欢
*/
import Footer from './Footer';
-import { Question, SelectLang } from './RightContent';
+import { Question, SelectLang, Brightness } from './RightContent';
import { AvatarDropdown, AvatarName } from './RightContent/AvatarDropdown';
-export { Footer, Question, SelectLang, AvatarDropdown, AvatarName };
+export { Footer, Question, SelectLang, AvatarDropdown, AvatarName, Brightness };
--
Gitblit v1.9.1