滚动条样式更新

This commit is contained in:
2025-12-24 18:39:48 +08:00
parent 6f44b8210e
commit c98928f703
3 changed files with 12 additions and 3 deletions

View File

@@ -73,9 +73,11 @@ const apiRequest = async (url, options = {}) => {
export const eventService = {
getEvents: (params = {}) => {
// Filter out null, undefined, and empty strings (but keep 0 and false)
// Filter out null, undefined, empty strings, and internal fields (starting with _)
const cleanParams = Object.fromEntries(
Object.entries(params).filter(([_, v]) => v !== null && v !== undefined && v !== '')
Object.entries(params).filter(([key, v]) =>
v !== null && v !== undefined && v !== '' && !key.startsWith('_')
)
);
const query = new URLSearchParams(cleanParams).toString();
return apiRequest(`/api/events?${query}`);

View File

@@ -129,7 +129,11 @@ const CompactSearchBox = ({
useEffect(() => {
if (!filters) return;
if (filters.sort) setSort(filters.sort);
// 优先使用 _sortDisplay原始排序值否则回退到 sort
// 这样可以正确显示 returns_avg, returns_week 等复合排序选项
if (filters._sortDisplay || filters.sort) {
setSort(filters._sortDisplay || filters.sort);
}
if (filters.importance) {
const importanceArray = filters.importance === 'all'
@@ -250,6 +254,8 @@ const CompactSearchBox = ({
const result = {
...overrides,
sort: actualSort,
// 保留原始排序值用于 UI 显示(如 returns_avg, returns_week
_sortDisplay: sortValue,
importance: importanceValue,
q: (overrides.q ?? filters.q) ?? '',
industry_code: overrides.industry_code ?? (industryValue?.join(',') || ''),

1
temp_week.json Normal file

File diff suppressed because one or more lines are too long