更新Company页面的UI为FUI风格

This commit is contained in:
2025-12-21 19:29:42 +08:00
parent d74162b7ce
commit b61f7a5048
10 changed files with 736 additions and 23 deletions

View File

@@ -49,9 +49,11 @@ export const usePagination = ({
filtersRef.current = filters;
// 根据模式决定每页显示数量
// mainline 模式复用 four-row 的分页配置
const pageSize = (() => {
switch (mode) {
case DISPLAY_MODES.FOUR_ROW:
case DISPLAY_MODES.MAINLINE:
return PAGINATION_CONFIG.FOUR_ROW_PAGE_SIZE;
case DISPLAY_MODES.VERTICAL:
return PAGINATION_CONFIG.VERTICAL_PAGE_SIZE;
@@ -73,15 +75,15 @@ export const usePagination = ({
// 纵向模式:从页码映射获取当前页
return allCachedEventsByPage?.[currentPage] || [];
} else {
// 平铺模式:返回全部累积数据
// 平铺模式 / 主线模式:返回全部累积数据
return allCachedEvents || [];
}
}, [mode, allCachedEventsByPage, allCachedEvents, currentPage]);
// 当前显示的事件列表
const displayEvents = useMemo(() => {
if (mode === DISPLAY_MODES.FOUR_ROW) {
// 平铺模式:返回全部累积数据
if (mode === DISPLAY_MODES.FOUR_ROW || mode === DISPLAY_MODES.MAINLINE) {
// 平铺模式 / 主线模式:返回全部累积数据
return allCachedEvents || [];
} else {
// 纵向模式:返回当前页数据
@@ -122,8 +124,11 @@ export const usePagination = ({
filters: filtersRef.current
});
// mainline 模式使用 four-row 的 API 模式(共用同一份数据)
const apiMode = mode === DISPLAY_MODES.MAINLINE ? DISPLAY_MODES.FOUR_ROW : mode;
const result = await dispatch(fetchDynamicNews({
mode: mode, // 传递 mode 参数
mode: apiMode, // 传递 API mode 参数mainline 映射为 four-row
per_page: pageSize,
pageSize: pageSize,
clearCache: clearCache, // 传递 clearCache 参数