滚动条样式更新
This commit is contained in:
@@ -73,9 +73,11 @@ const apiRequest = async (url, options = {}) => {
|
|||||||
|
|
||||||
export const eventService = {
|
export const eventService = {
|
||||||
getEvents: (params = {}) => {
|
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(
|
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();
|
const query = new URLSearchParams(cleanParams).toString();
|
||||||
return apiRequest(`/api/events?${query}`);
|
return apiRequest(`/api/events?${query}`);
|
||||||
|
|||||||
@@ -129,7 +129,11 @@ const CompactSearchBox = ({
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!filters) return;
|
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) {
|
if (filters.importance) {
|
||||||
const importanceArray = filters.importance === 'all'
|
const importanceArray = filters.importance === 'all'
|
||||||
@@ -250,6 +254,8 @@ const CompactSearchBox = ({
|
|||||||
const result = {
|
const result = {
|
||||||
...overrides,
|
...overrides,
|
||||||
sort: actualSort,
|
sort: actualSort,
|
||||||
|
// 保留原始排序值用于 UI 显示(如 returns_avg, returns_week)
|
||||||
|
_sortDisplay: sortValue,
|
||||||
importance: importanceValue,
|
importance: importanceValue,
|
||||||
q: (overrides.q ?? filters.q) ?? '',
|
q: (overrides.q ?? filters.q) ?? '',
|
||||||
industry_code: overrides.industry_code ?? (industryValue?.join(',') || ''),
|
industry_code: overrides.industry_code ?? (industryValue?.join(',') || ''),
|
||||||
|
|||||||
1
temp_week.json
Normal file
1
temp_week.json
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user