Skip to content

Commit dc3b402

Browse files
committed
Merge remote-tracking branch 'origin/dev'
2 parents 8f4aa09 + bd3de69 commit dc3b402

15 files changed

Lines changed: 108 additions & 79 deletions

File tree

bun.lock

Lines changed: 50 additions & 42 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,21 +45,21 @@
4545
},
4646
"devDependencies": {
4747
"@biomejs/biome": "^2.0.5",
48-
"@rsbuild/core": "^1.3.22",
48+
"@rsbuild/core": "^1.4.0",
4949
"@rsbuild/plugin-image-compress": "^1.2.0",
5050
"@rsbuild/plugin-react": "^1.3.2",
5151
"@rsbuild/plugin-sass": "^1.3.2",
5252
"@rsbuild/plugin-svgr": "^1.2.0",
5353
"@rsdoctor/rspack-plugin": "^1.1.4",
54-
"@tailwindcss/postcss": "^4.1.10",
54+
"@tailwindcss/postcss": "^4.1.11",
5555
"@types/crypto-js": "^4.2.2",
5656
"@types/lodash-es": "^4.17.12",
5757
"@types/node": "^22.15.33",
5858
"@types/react": "^18.3.23",
5959
"@types/react-dom": "^18.3.7",
6060
"rsbuild-plugin-html-minifier-terser": "^1.1.1",
6161
"rspack-plugin-mock": "^1.1.0",
62-
"tailwindcss": "^4.1.10",
62+
"tailwindcss": "^4.1.11",
6363
"typescript": "^5.8.3"
6464
}
6565
}

rsbuild.config.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import { pluginReact } from '@rsbuild/plugin-react';
77
import { pluginSvgr } from '@rsbuild/plugin-svgr';
88
import { pluginSass } from '@rsbuild/plugin-sass';
99

10+
const isDev = process.env.NODE_ENV === 'development';
11+
1012
export default defineConfig({
1113
plugins: [
1214
// 表示将react和router相关的包拆分为单独的chunk
@@ -79,7 +81,7 @@ export default defineConfig({
7981
},
8082
},
8183
// 启用构建缓存
82-
buildCache: true,
84+
buildCache: !isDev,
8385
// 移除console.[method]语句
8486
removeConsole: true,
8587
// 开启包文件分析
Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,40 @@
1-
import ContentCompact from "../icons/ContentCompact";
2-
import HeaderNav from "../icons/HeaderNav";
3-
import "./layout.scss";
1+
import ContentCompact from '../icons/ContentCompact';
2+
import HeaderNav from '../icons/HeaderNav';
3+
import './layout.scss';
44

55
/**
66
* 预设内容布局
77
*/
88
const PRESET = [
99
{
1010
name: 'wide',
11-
type: HeaderNav
11+
type: HeaderNav,
1212
},
1313
{
1414
name: 'compact',
15-
type: ContentCompact
16-
}
15+
type: ContentCompact,
16+
},
1717
];
1818

1919
/**
2020
* 内容设置
21-
* @returns
21+
* @returns
2222
*/
2323
const Content: React.FC = () => {
2424
return (
25-
<div style={{display: 'flex', width: '100%', gap: '1.25rem'}}>
26-
{
27-
PRESET.map((item) => (
28-
<div key={item.name} style={{width: '100px', cursor: 'pointer', flexDirection: 'column'}}>
29-
<div className="outline-box" style={{display: 'flex', justifyContent: 'center', alignItems: 'center'}}>
30-
<item.type />
31-
</div>
32-
<div className="layoutTitle">
33-
{item.name}
34-
</div>
25+
<div style={{ display: 'flex', width: '100%', gap: '1.25rem' }}>
26+
{PRESET.map((item) => (
27+
<div key={item.name} style={{ width: '100px', cursor: 'pointer', flexDirection: 'column' }}>
28+
<div className="outline-box" style={{ display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
29+
{(() => {
30+
const Comp = item.type;
31+
return <Comp />;
32+
})()}
3533
</div>
36-
))
37-
}
34+
<div className="layoutTitle">{item.name}</div>
35+
</div>
36+
))}
3837
</div>
3938
);
4039
};
41-
export default Content;
40+
export default Content;

src/layouts/Header/component/Setting/Layout/MyLayout.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,10 @@ const MyLayout: React.FC = () => {
8282
justifyContent: 'center',
8383
}}
8484
>
85-
<item.type />
85+
{(() => {
86+
const Comp = item.type;
87+
return <Comp />;
88+
})()}
8689
</div>
8790
<div className="layoutTitle">
8891
{item.name}

src/layouts/Header/component/UserDropdown/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,8 @@ const UserDropdown: React.FC = memo(() => {
171171
return (
172172
<>
173173
<Dropdown
174-
trigger={['click']}
175-
menu={{ items, triggerSubMenuAction: 'click' }}
174+
trigger={['hover']}
175+
menu={{ items, triggerSubMenuAction: 'hover' }}
176176
popupRender={renderDropdown}
177177
placement="bottomLeft"
178178
overlayStyle={{ width: 240 }}

src/layouts/Header/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ const Header: React.FC = memo(() => {
9797
<Badge count={5}>
9898
<MailOutlined style={{ cursor: 'pointer', fontSize: '18px' }} />
9999
</Badge>
100-
<Dropdown placement="bottomRight" popupRender={() => <MessageBox />}>
100+
<Dropdown placement="bottom" popupRender={() => <MessageBox />}>
101101
<Badge count={5}>
102102
<BellOutlined style={{ cursor: 'pointer', fontSize: '18px' }} />
103103
</Badge>

src/locales/en-US/layout.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ const translation = {
99
doc: 'Docs',
1010
profile: 'Profile',
1111
support: 'Support',
12+
switchUser: 'Switch User',
1213
feedback: 'Feedback',
1314
question: 'Question',
1415
refresh: 'Refresh Cache',

src/locales/zh-CN/layout.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ const translation = {
99
doc: '文档',
1010
profile: '个人中心',
1111
support: '支持',
12+
switchUser: '切换用户',
1213
feedback: '反馈',
1314
question: '问题',
1415
refresh: '刷新缓存',

src/locales/zh-CN/menu.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const menu = {
22
home: '首页',
33
statics: {
4-
main: '统计',
4+
main: '数据统计',
55
messageSearch: '消息查询',
66
errorStatics: '错误统计',
77
endpoint: '端点',
@@ -38,7 +38,7 @@ const menu = {
3838
announcement: '系统公告',
3939
},
4040
monitor: {
41-
main: '监控',
41+
main: '系统监控',
4242
timer: '定时器',
4343
},
4444
integration: {

0 commit comments

Comments
 (0)