更新Company页面的UI为FUI风格
This commit is contained in:
1
app.py
1
app.py
@@ -351,6 +351,7 @@ def generate_events_cache_key(args_dict):
|
|||||||
params_str = json.dumps(filtered_params, sort_keys=True)
|
params_str = json.dumps(filtered_params, sort_keys=True)
|
||||||
params_hash = hashlib.md5(params_str.encode()).hexdigest()
|
params_hash = hashlib.md5(params_str.encode()).hexdigest()
|
||||||
|
|
||||||
|
|
||||||
return f"{EVENTS_CACHE_PREFIX}{params_hash}"
|
return f"{EVENTS_CACHE_PREFIX}{params_hash}"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -16,12 +16,6 @@ import {
|
|||||||
Badge,
|
Badge,
|
||||||
Center,
|
Center,
|
||||||
Spinner,
|
Spinner,
|
||||||
Modal,
|
|
||||||
ModalOverlay,
|
|
||||||
ModalContent,
|
|
||||||
ModalHeader,
|
|
||||||
ModalBody,
|
|
||||||
ModalCloseButton,
|
|
||||||
useColorModeValue,
|
useColorModeValue,
|
||||||
useToast,
|
useToast,
|
||||||
useDisclosure,
|
useDisclosure,
|
||||||
@@ -34,7 +28,7 @@ import { useNotification } from '@contexts/NotificationContext';
|
|||||||
import EventScrollList from './EventScrollList';
|
import EventScrollList from './EventScrollList';
|
||||||
import ModeToggleButtons from './ModeToggleButtons';
|
import ModeToggleButtons from './ModeToggleButtons';
|
||||||
import PaginationControl from './PaginationControl';
|
import PaginationControl from './PaginationControl';
|
||||||
import DynamicNewsDetailPanel from '@components/EventDetailPanel';
|
import EventDetailModal from '../EventDetailModal';
|
||||||
import CompactSearchBox from '../SearchFilters/CompactSearchBox';
|
import CompactSearchBox from '../SearchFilters/CompactSearchBox';
|
||||||
import {
|
import {
|
||||||
fetchDynamicNews,
|
fetchDynamicNews,
|
||||||
@@ -692,21 +686,12 @@ const [currentMode, setCurrentMode] = useState('vertical');
|
|||||||
</Box>
|
</Box>
|
||||||
</CardBody>
|
</CardBody>
|
||||||
|
|
||||||
{/* 四排模式详情弹窗 - 未打开时不渲染 */}
|
{/* 四排/主线模式详情弹窗 - 深色风格 */}
|
||||||
{isModalOpen && (
|
<EventDetailModal
|
||||||
<Modal isOpen={isModalOpen} onClose={onModalClose} size="full" scrollBehavior="inside">
|
open={isModalOpen}
|
||||||
<ModalOverlay />
|
onClose={onModalClose}
|
||||||
<ModalContent maxW="1600px" mx="auto" my={8}>
|
event={modalEvent}
|
||||||
<ModalHeader>
|
/>
|
||||||
{modalEvent?.title || '事件详情'}
|
|
||||||
</ModalHeader>
|
|
||||||
<ModalCloseButton />
|
|
||||||
<ModalBody pb={6}>
|
|
||||||
{modalEvent && <DynamicNewsDetailPanel event={modalEvent} />}
|
|
||||||
</ModalBody>
|
|
||||||
</ModalContent>
|
|
||||||
</Modal>
|
|
||||||
)}
|
|
||||||
</Card>
|
</Card>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -7,13 +7,11 @@
|
|||||||
@glass-border: rgba(255, 255, 255, 0.12);
|
@glass-border: rgba(255, 255, 255, 0.12);
|
||||||
@glass-text: #F7FAFC;
|
@glass-text: #F7FAFC;
|
||||||
@glass-text-secondary: #CBD5E0;
|
@glass-text-secondary: #CBD5E0;
|
||||||
@glass-card-bg: #354259;
|
|
||||||
@glass-section-bg: #3D4A5C;
|
|
||||||
|
|
||||||
|
// 使用 :global 确保样式全局生效
|
||||||
|
:global {
|
||||||
// 深色抽屉样式
|
// 深色抽屉样式
|
||||||
.event-detail-drawer-dark {
|
.event-detail-drawer-dark {
|
||||||
// 整个抽屉容器
|
|
||||||
&.ant-drawer {
|
|
||||||
// 内容包装器 - 移除白边
|
// 内容包装器 - 移除白边
|
||||||
.ant-drawer-content-wrapper {
|
.ant-drawer-content-wrapper {
|
||||||
box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.4) !important;
|
box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.4) !important;
|
||||||
@@ -64,10 +62,3 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 原有基础样式保留(非深色模式)
|
|
||||||
.event-detail-drawer:not(.event-detail-drawer-dark) {
|
|
||||||
.ant-drawer-title {
|
|
||||||
color: #1A202C;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { useSelector } from 'react-redux';
|
import { useSelector } from 'react-redux';
|
||||||
import { Drawer } from 'antd';
|
import { Drawer, ConfigProvider, theme } from 'antd';
|
||||||
import { CloseOutlined } from '@ant-design/icons';
|
import { CloseOutlined } from '@ant-design/icons';
|
||||||
import { selectIsMobile } from '@store/slices/deviceSlice';
|
import { selectIsMobile } from '@store/slices/deviceSlice';
|
||||||
import DynamicNewsDetailPanel from '@components/EventDetailPanel';
|
import DynamicNewsDetailPanel from '@components/EventDetailPanel';
|
||||||
import './EventDetailModal.less';
|
|
||||||
|
|
||||||
interface EventDetailModalProps {
|
interface EventDetailModalProps {
|
||||||
/** 是否打开弹窗 */
|
/** 是否打开弹窗 */
|
||||||
@@ -15,17 +14,16 @@ interface EventDetailModalProps {
|
|||||||
event: any; // TODO: 后续可替换为具体的 Event 类型
|
event: any; // TODO: 后续可替换为具体的 Event 类型
|
||||||
}
|
}
|
||||||
|
|
||||||
// 深色主题颜色 - 比背景亮,形成层次感(使用实色确保覆盖)
|
// 深色主题颜色 - 比背景亮,形成层次感
|
||||||
const GLASS_THEME = {
|
const THEME = {
|
||||||
bg: '#2D3748',
|
bg: '#2D3748',
|
||||||
headerBg: '#3D4A5C',
|
headerBg: '#3D4A5C',
|
||||||
borderColor: 'rgba(255, 255, 255, 0.12)',
|
borderColor: 'rgba(255, 255, 255, 0.12)',
|
||||||
textColor: '#F7FAFC',
|
textColor: '#F7FAFC',
|
||||||
secondaryText: '#CBD5E0',
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 事件详情抽屉组件(从底部弹出)- 深色毛玻璃风格
|
* 事件详情抽屉组件(从底部弹出)- 深色风格
|
||||||
*/
|
*/
|
||||||
const EventDetailModal: React.FC<EventDetailModalProps> = ({
|
const EventDetailModal: React.FC<EventDetailModalProps> = ({
|
||||||
open,
|
open,
|
||||||
@@ -35,6 +33,27 @@ const EventDetailModal: React.FC<EventDetailModalProps> = ({
|
|||||||
const isMobile = useSelector(selectIsMobile);
|
const isMobile = useSelector(selectIsMobile);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
<ConfigProvider
|
||||||
|
theme={{
|
||||||
|
algorithm: theme.darkAlgorithm,
|
||||||
|
token: {
|
||||||
|
colorBgElevated: THEME.bg,
|
||||||
|
colorBgContainer: THEME.bg,
|
||||||
|
colorText: THEME.textColor,
|
||||||
|
colorTextHeading: THEME.textColor,
|
||||||
|
colorIcon: THEME.textColor,
|
||||||
|
colorBorderSecondary: THEME.borderColor,
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
Drawer: {
|
||||||
|
colorBgElevated: THEME.bg,
|
||||||
|
colorText: THEME.textColor,
|
||||||
|
colorIcon: THEME.textColor,
|
||||||
|
colorIconHover: '#FFFFFF',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
>
|
||||||
<Drawer
|
<Drawer
|
||||||
open={open}
|
open={open}
|
||||||
onClose={onClose}
|
onClose={onClose}
|
||||||
@@ -43,14 +62,7 @@ const EventDetailModal: React.FC<EventDetailModalProps> = ({
|
|||||||
width={isMobile ? '100%' : '70vw'}
|
width={isMobile ? '100%' : '70vw'}
|
||||||
title={event?.title || '事件详情'}
|
title={event?.title || '事件详情'}
|
||||||
destroyOnHidden
|
destroyOnHidden
|
||||||
rootClassName="event-detail-drawer event-detail-drawer-dark"
|
closeIcon={<CloseOutlined />}
|
||||||
closeIcon={null}
|
|
||||||
extra={
|
|
||||||
<CloseOutlined
|
|
||||||
onClick={onClose}
|
|
||||||
style={{ cursor: 'pointer', fontSize: 18, color: GLASS_THEME.textColor }}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
styles={{
|
styles={{
|
||||||
wrapper: isMobile ? {} : {
|
wrapper: isMobile ? {} : {
|
||||||
maxWidth: 1400,
|
maxWidth: 1400,
|
||||||
@@ -61,22 +73,22 @@ const EventDetailModal: React.FC<EventDetailModalProps> = ({
|
|||||||
},
|
},
|
||||||
content: {
|
content: {
|
||||||
borderRadius: '16px 16px 0 0',
|
borderRadius: '16px 16px 0 0',
|
||||||
background: GLASS_THEME.bg,
|
background: THEME.bg,
|
||||||
border: 'none',
|
|
||||||
},
|
},
|
||||||
header: {
|
header: {
|
||||||
background: GLASS_THEME.headerBg,
|
background: THEME.headerBg,
|
||||||
borderBottom: `1px solid ${GLASS_THEME.borderColor}`,
|
borderBottom: `1px solid ${THEME.borderColor}`,
|
||||||
borderRadius: '16px 16px 0 0',
|
borderRadius: '16px 16px 0 0',
|
||||||
},
|
},
|
||||||
body: {
|
body: {
|
||||||
padding: 0,
|
padding: 0,
|
||||||
background: GLASS_THEME.bg,
|
background: THEME.bg,
|
||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{event && <DynamicNewsDetailPanel event={event} showHeader={false} />}
|
{event && <DynamicNewsDetailPanel event={event} showHeader={false} />}
|
||||||
</Drawer>
|
</Drawer>
|
||||||
|
</ConfigProvider>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user