完善测试建表并统一前端格式

This commit is contained in:
yml2213
2026-07-14 01:32:14 +08:00
parent 2efcede800
commit 2ca6fd9306
36 changed files with 714 additions and 478 deletions
@@ -52,7 +52,14 @@ export function readQueryNumber(query: LocationQuery | LocationQueryRaw, key: st
export function readQueryCSV(query: LocationQuery | LocationQueryRaw, key: string): string[] {
const raw = readQueryString(query, key)
if (!raw) return []
return [...new Set(raw.split(',').map(item => item.trim()).filter(Boolean))]
return [
...new Set(
raw
.split(',')
.map(item => item.trim())
.filter(Boolean)
),
]
}
/** 将多选数组序列化为 CSV;空数组返回 undefined 以便从 query 中省略。 */
@@ -134,11 +134,7 @@ export function useHomeFilters(
}
function setStringFilter(key: StringFilterKey, value: string | string[]) {
filters[key] = Array.isArray(value)
? uniqueOptions(value)
: value.trim()
? [value.trim()]
: []
filters[key] = Array.isArray(value) ? uniqueOptions(value) : value.trim() ? [value.trim()] : []
closeFilterPopover()
}