diff --git a/web/src/components/ChannelsTable.js b/web/src/components/ChannelsTable.js index 2cd6c15d..e3af20cc 100644 --- a/web/src/components/ChannelsTable.js +++ b/web/src/components/ChannelsTable.js @@ -605,7 +605,7 @@ const ChannelsTable = () => { } - style={{ width: 500 }} + style={{ width: isMobile() ? '90%' : 500 }} bodyStyle={{ padding: '24px' }} >
@@ -633,7 +633,11 @@ const ChannelsTable = () => { } return ( -
+
handleColumnVisibilityChange(column.key, e.target.checked)} @@ -1253,87 +1257,137 @@ const ChannelsTable = () => {
- {t('使用ID排序')} - { - localStorage.setItem('id-sort', v + ''); - setIdSort(v); - loadChannels(0, pageSize, v, enableTagMode) - .then() - .catch((reason) => { - showError(reason); +
+ {t('使用ID排序')} + { + localStorage.setItem('id-sort', v + ''); + setIdSort(v); + loadChannels(0, pageSize, v, enableTagMode) + .then() + .catch((reason) => { + showError(reason); + }); + }} + > +
+ +
+ - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + } + > + + +
-
- - {t('开启批量操作')} +
+
+ {t('开启批量操作')} { onChange={(v) => { setEnableBatchDelete(v); }} - > + /> +
+ +
@@ -1364,17 +1423,27 @@ const ChannelsTable = () => { content={t('进行该操作时,可能导致渠道访问错误,请仅在数据库出现问题时使用')} okType={'warning'} onConfirm={fixChannelsAbilities} - position={'top'} > - - +
-
- - {t('标签聚合模式')} + +
+
+ {t('标签聚合模式')} { loadChannels(0, pageSize, idSort, v); }} /> +
+ +
+ - +
- { }, onPageChange: handlePageChange }} + expandAllRows={false} onRow={handleRow} rowSelection={ enableBatchDelete @@ -1442,6 +1517,7 @@ const ChannelsTable = () => { onCancel={() => setShowBatchSetTag(false)} maskClosable={false} centered={true} + style={{ width: isMobile() ? '90%' : 500 }} >
{t('请输入要设置的标签名称')} @@ -1450,7 +1526,13 @@ const ChannelsTable = () => { placeholder={t('请输入标签名称')} value={batchSetTagValue} onChange={(v) => setBatchSetTagValue(v)} + size="large" /> +
+ + {t('已选择 ${count} 个渠道').replace('${count}', selectedChannels.length)} + +
{/* 模型测试弹窗 */} @@ -1464,7 +1546,6 @@ const ChannelsTable = () => { footer={null} maskClosable={true} centered={true} - width={600} >
{currentTestChannel && ( @@ -1477,8 +1558,9 @@ const ChannelsTable = () => { setModelSearchKeyword(value)} + onChange={(v) => setModelSearchKeyword(v)} style={{ marginBottom: '16px' }} + prefix={} showClear /> diff --git a/web/src/components/Footer.js b/web/src/components/Footer.js index c7b39205..cea3723a 100644 --- a/web/src/components/Footer.js +++ b/web/src/components/Footer.js @@ -1,12 +1,14 @@ -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 ( -
+
{footer ? (
{ const isSidebarCollapsed = localStorage.getItem('default_collapse_sidebar') === 'true'; return ( - +
{
{styleState.showSider && ( - )} - + diff --git a/web/src/components/SiderBar.js b/web/src/components/SiderBar.js index aadd8c80..d827ba80 100644 --- a/web/src/components/SiderBar.js +++ b/web/src/components/SiderBar.js @@ -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 = () => { {/* Workspace Section */} - {!isCollapsed &&
{t('控制台')}
} + {!isCollapsed && {t('控制台')}} {workspaceItems.map((item) => ( { {/* Admin Section */} - {!isCollapsed &&
{t('管理员')}
} + {!isCollapsed && {t('管理员')}} {adminItems.map((item) => ( { {/* Finance Management Section */} - {!isCollapsed &&
{t('个人中心')}
} + {!isCollapsed && {t('个人中心')}} {financeItems.map((item) => ( { ))} { if(collapsed){ diff --git a/web/src/index.css b/web/src/index.css index 7cd0f6e9..b406e1ae 100644 --- a/web/src/index.css +++ b/web/src/index.css @@ -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%;*/ +/*}*/ diff --git a/web/vite.config.js b/web/vite.config.js index 97adcc42..55d1f656 100644 --- a/web/vite.config.js +++ b/web/vite.config.js @@ -52,6 +52,7 @@ export default defineConfig({ }, }, server: { + host: '0.0.0.0', proxy: { '/api': { target: 'http://localhost:3000',