Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
new-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
ddd6706c
authored
Mar 10, 2025
by
1808837298@qq.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: Enhance mobile UI responsiveness and layout for ChannelsTable and SiderBar
parent
e28ad368
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
73 additions
and
53 deletions
+73
-53
web/src/components/ChannelsTable.js
+0
-0
web/src/components/Footer.js
+7
-2
web/src/components/PageLayout.js
+30
-20
web/src/components/SiderBar.js
+11
-12
web/src/index.css
+24
-19
web/vite.config.js
+1
-0
No files found.
web/src/components/ChannelsTable.js
View file @
ddd6706c
This diff is collapsed.
Click to expand it.
web/src/components/Footer.js
View file @
ddd6706c
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
React
,
{
useEffect
,
useState
,
useContext
}
from
'react'
;
import
{
useTranslation
}
from
'react-i18next'
;
import
{
getFooterHTML
,
getSystemName
}
from
'../helpers'
;
import
{
Layout
,
Tooltip
}
from
'@douyinfe/semi-ui'
;
import
{
StyleContext
}
from
'../context/Style/index.js'
;
const
FooterBar
=
()
=>
{
const
{
t
}
=
useTranslation
();
const
systemName
=
getSystemName
();
const
[
footer
,
setFooter
]
=
useState
(
getFooterHTML
());
const
[
styleState
]
=
useContext
(
StyleContext
);
let
remainCheckTimes
=
5
;
const
loadFooter
=
()
=>
{
...
...
@@ -57,7 +59,10 @@ const FooterBar = () => {
},
[]);
return
(
<
div
style
=
{{
textAlign
:
'center'
}}
>
<
div
style
=
{{
textAlign
:
'center'
,
paddingBottom
:
styleState
?.
isMobile
?
'112px'
:
'5px'
,
}}
>
{
footer
?
(
<
div
className
=
'custom-footer'
...
...
web/src/components/PageLayout.js
View file @
ddd6706c
...
...
@@ -71,7 +71,12 @@ const PageLayout = () => {
const
isSidebarCollapsed
=
localStorage
.
getItem
(
'default_collapse_sidebar'
)
===
'true'
;
return
(
<
Layout
style
=
{{
height
:
'100vh'
,
display
:
'flex'
,
flexDirection
:
'column'
}}
>
<
Layout
style
=
{{
height
:
'100vh'
,
display
:
'flex'
,
flexDirection
:
'column'
,
overflow
:
'hidden'
}}
>
<
Header
style
=
{{
padding
:
0
,
height
:
'auto'
,
...
...
@@ -85,46 +90,51 @@ const PageLayout = () => {
<
HeaderBar
/>
<
/Header
>
<
Layout
style
=
{{
marginTop
:
'56px'
,
height
:
'calc(100vh - 56px)'
,
overflow
:
styleState
.
isMobile
?
'auto'
:
'hidden'
marginTop
:
'56px'
,
height
:
'calc(100vh - 56px)'
,
overflow
:
'auto'
,
display
:
'flex'
,
flexDirection
:
'column'
}}
>
{
styleState
.
showSider
&&
(
<
Sider
style
=
{{
height
:
'calc(100vh - 56px)'
,
<
Sider
style
=
{{
position
:
'fixed'
,
left
:
0
,
top
:
'56px'
,
zIndex
:
90
,
overflowY
:
'auto'
,
overflowX
:
'hidden'
,
width
:
'auto'
,
background
:
'transparent'
,
boxShadow
:
'none'
,
zIndex
:
99
,
background
:
'var(--semi-color-bg-1)'
,
boxShadow
:
'0 2px 8px rgba(0, 0, 0, 0.15)'
,
border
:
'none'
,
paddingRight
:
'5px'
paddingRight
:
'0'
,
transition
:
'transform 0.3s ease'
,
height
:
'calc(100vh - 56px)'
,
}}
>
<
SiderBar
/>
<
/Sider
>
)}
<
Layout
style
=
{{
marginLeft
:
styleState
.
showSider
?
(
isSidebarCollapsed
?
'60px'
:
'200px'
)
:
'0'
,
marginLeft
:
styleState
.
isMobile
?
'0'
:
(
styleState
.
showSider
?
(
isSidebarCollapsed
?
'60px'
:
'200px'
)
:
'0'
)
,
transition
:
'margin-left 0.3s ease'
,
height
:
'100%'
,
overflow
:
'auto'
flex
:
'1 1 auto'
,
display
:
'flex'
,
flexDirection
:
'column'
}}
>
<
Content
style
=
{{
height
:
'100%
'
,
overflowY
:
'auto'
,
flex
:
'1 0 auto
'
,
overflowY
:
'auto'
,
WebkitOverflowScrolling
:
'touch'
,
padding
:
styleState
.
shouldInnerPadding
?
'24px'
:
'0'
,
position
:
'relative'
position
:
'relative'
,
paddingBottom
:
styleState
.
isMobile
?
'80px'
:
'0'
// 移动端底部额外内边距
}}
>
<
App
/>
<
/Content
>
<
Layout
.
Footer
>
<
Layout
.
Footer
style
=
{{
flex
:
'0 0 auto'
,
width
:
'100%'
}}
>
<
FooterBar
/>
<
/Layout.Footer
>
<
/Layout
>
...
...
web/src/components/SiderBar.js
View file @
ddd6706c
...
...
@@ -33,6 +33,7 @@ import { setStatusData } from '../helpers/data.js';
import
{
stringToColor
}
from
'../helpers/render.js'
;
import
{
useSetTheme
,
useTheme
}
from
'../context/Theme/index.js'
;
import
{
StyleContext
}
from
'../context/Style/index.js'
;
import
Text
from
'@douyinfe/semi-ui/lib/es/typography/text'
;
// 自定义侧边栏按钮样式
const
navItemStyle
=
{
...
...
@@ -298,16 +299,16 @@ const SiderBar = () => {
className
=
"custom-sidebar-nav"
style
=
{{
width
:
isCollapsed
?
'60px'
:
'200px'
,
height
:
'100%'
,
boxShadow
:
'0 1px 6px rgba(0, 0, 0, 0.08)'
,
boxShadow
:
'0 2px 8px rgba(0, 0, 0, 0.15)'
,
borderRight
:
'1px solid var(--semi-color-border)'
,
background
:
'var(--semi-color-bg-
0
)'
,
borderRadius
:
'0 8px 8px 0'
,
background
:
'var(--semi-color-bg-
1
)'
,
borderRadius
:
styleState
.
isMobile
?
'0'
:
'0 8px 8px 0'
,
transition
:
'all 0.3s ease'
,
position
:
'relative'
,
zIndex
:
95
,
height
:
'100%'
,
overflowY
:
'auto'
,
WebkitOverflowScrolling
:
'touch'
// Improve scrolling on iOS devices
WebkitOverflowScrolling
:
'touch'
,
// Improve scrolling on iOS devices
}}
defaultIsCollapsed
=
{
localStorage
.
getItem
(
'default_collapse_sidebar'
)
===
'true'
...
...
@@ -419,7 +420,7 @@ const SiderBar = () => {
<
Divider
style
=
{
dividerStyle
}
/
>
{
/* Workspace Section */
}
{
!
isCollapsed
&&
<
div
style
=
{
groupLabelStyle
}
>
{
t
(
'控制台'
)}
<
/div
>
}
{
!
isCollapsed
&&
<
Text
style
=
{
groupLabelStyle
}
>
{
t
(
'控制台'
)}
<
/Text
>
}
{
workspaceItems
.
map
((
item
)
=>
(
<
Nav
.
Item
key
=
{
item
.
itemKey
}
...
...
@@ -436,7 +437,7 @@ const SiderBar = () => {
<
Divider
style
=
{
dividerStyle
}
/
>
{
/* Admin Section */
}
{
!
isCollapsed
&&
<
div
style
=
{
groupLabelStyle
}
>
{
t
(
'管理员'
)}
<
/div
>
}
{
!
isCollapsed
&&
<
Text
style
=
{
groupLabelStyle
}
>
{
t
(
'管理员'
)}
<
/Text
>
}
{
adminItems
.
map
((
item
)
=>
(
<
Nav
.
Item
key
=
{
item
.
itemKey
}
...
...
@@ -453,7 +454,7 @@ const SiderBar = () => {
<
Divider
style
=
{
dividerStyle
}
/
>
{
/* Finance Management Section */
}
{
!
isCollapsed
&&
<
div
style
=
{
groupLabelStyle
}
>
{
t
(
'个人中心'
)}
<
/div
>
}
{
!
isCollapsed
&&
<
Text
style
=
{
groupLabelStyle
}
>
{
t
(
'个人中心'
)}
<
/Text
>
}
{
financeItems
.
map
((
item
)
=>
(
<
Nav
.
Item
key
=
{
item
.
itemKey
}
...
...
@@ -465,12 +466,10 @@ const SiderBar = () => {
))}
<
Nav
.
Footer
collapseButton
=
{
true
}
style
=
{{
borderTop
:
'1px solid var(--semi-color-border)'
,
padding
:
'12px 0'
,
marginTop
:
'auto'
paddingBottom
:
styleState
?.
isMobile
?
'112px'
:
'0'
,
}}
collapseButton
=
{
true
}
collapseText
=
{(
collapsed
)
=>
{
if
(
collapsed
){
...
...
web/src/index.css
View file @
ddd6706c
...
...
@@ -82,6 +82,16 @@ body {
.semi-navigation-horizontal
.semi-navigation-header
{
margin-right
:
0
;
}
/* 确保移动端内容可滚动 */
.semi-layout-content
{
-webkit-overflow-scrolling
:
touch
!important
;
}
/* 隐藏在移动设备上 */
.hide-on-mobile
{
display
:
none
!important
;
}
}
.semi-table-tbody
>
.semi-table-row
>
.semi-table-row-cell
{
...
...
@@ -162,14 +172,14 @@ code {
}
}
.semi-navigation-vertical
{
/*flex: 0 0 auto;
*/
/*display: flex;
*/
/*flex-direction: column;
*/
/*width: 100%;
*/
height
:
100%
;
overflow
:
hidden
;
}
/*.semi-navigation-vertical {*/
/* !*flex: 0 0 auto;*!
*/
/* !*display: flex;*!
*/
/* !*flex-direction: column;*!
*/
/* !*width: 100%;*!
*/
/* height: 100%;*/
/* overflow: hidden;*/
/*}*/
.main-content
{
padding
:
4px
;
...
...
@@ -184,12 +194,6 @@ code {
font-size
:
1.1em
;
}
@media
only
screen
and
(
max-width
:
600px
)
{
.hide-on-mobile
{
display
:
none
!important
;
}
}
/* 顶部栏样式 */
.topnav
{
padding
:
0
16px
;
...
...
@@ -248,8 +252,9 @@ code {
}
/* Custom sidebar shadow */
.custom-sidebar-nav
{
box-shadow
:
0
1px
6px
rgba
(
0
,
0
,
0
,
0.08
)
!important
;
-webkit-box-shadow
:
0
1px
6px
rgba
(
0
,
0
,
0
,
0.08
)
!important
;
-moz-box-shadow
:
0
1px
6px
rgba
(
0
,
0
,
0
,
0.08
)
!important
;
}
/*.custom-sidebar-nav {*/
/* box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08) !important;*/
/* -webkit-box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08) !important;*/
/* -moz-box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08) !important;*/
/* min-height: 100%;*/
/*}*/
web/vite.config.js
View file @
ddd6706c
...
...
@@ -52,6 +52,7 @@ export default defineConfig({
},
},
server
:
{
host
:
'0.0.0.0'
,
proxy
:
{
'/api'
:
{
target
:
'http://localhost:3000'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment