fix: 第七轮深度搜索审计修复 — 20项
- HIGH: isdecimal() → re.match() for PMID (non-ASCII digit crash) - HIGH: boolean_operator 应用到字段分组和无标签词(AND/OR 错误) - HIGH: Cursor 分页 pub_date 优先(article_date 导致数据错位) - Parser: parse 异常处理器清理字段标签/布尔符/引号 - Parser: _parse_range date:year 反向交换(第4分支) - Parser: MAX_TERMS 保护、TITLE/ABSTRACT 大写键补充 - Engine: best_match 排序剥离字段标签 - Engine: year_from/year_to is not None(年份=0 被 falsy 跳过) - Engine: _single_term_condition SB 字段全量分发 - Engine: journal_tiers/nlm_subsets 空条件预警(0结果保障) - Engine: ATM 展开和 _expand_mesh_tag_ids pass → logger.exception - Engine: 降级 regex [\w/: -] 兼容 [MH:noexp] 冒号 - Frontend: syncSearchToUrl 移到 finally 块 - Frontend: 年份滑块/resetAllFilters 清除 URL 日期 - Frontend: Null cursor 日期安全守卫 - Docs: 新增 P7-1~P7-20 记录,测试数更新至 276
This commit is contained in:
@@ -89,6 +89,7 @@ function onYearSliderChange(val: any) {
|
||||
yearFromStr.value = String(val[0])
|
||||
yearToStr.value = String(val[1])
|
||||
datePreset.value = null
|
||||
urlDateFrom.value = ''; urlDateTo.value = '' // P6: clear stale URL dates
|
||||
if (_sliderTimer) clearTimeout(_sliderTimer)
|
||||
_sliderTimer = setTimeout(() => goToPage(1), 250)
|
||||
}
|
||||
@@ -352,20 +353,26 @@ const { page, total, goToPage } = usePagination({
|
||||
if (items.length > 0) {
|
||||
const last = items[items.length - 1]
|
||||
keysetCursors.value[p + 1] = {
|
||||
cursor_date: last.article_date || last.pub_date || '',
|
||||
cursor_date: last.pub_date || last.article_date || '',
|
||||
cursor_id: last.id,
|
||||
}
|
||||
// 当两个日期都为空时,不设游标(避免空串 fromisoformat 失败)
|
||||
if (!last.pub_date && !last.article_date) {
|
||||
delete keysetCursors.value[p + 1]
|
||||
}
|
||||
}
|
||||
} else {
|
||||
total.value = data.total || 0
|
||||
}
|
||||
yearCounts.value = data.year_counts || []
|
||||
syncSearchToUrl()
|
||||
} catch (e: any) {
|
||||
if (e?.name === 'CanceledError' || e?.code === 'ERR_CANCELED') return
|
||||
toast.apiError(e, '搜索失败,请重试')
|
||||
}
|
||||
finally { if (gen === searchGeneration.value) loading.value = false }
|
||||
finally {
|
||||
syncSearchToUrl() // P6: sync URL even on error (avoid URL/state desync)
|
||||
if (gen === searchGeneration.value) loading.value = false
|
||||
}
|
||||
},
|
||||
pageSize: pageSize.value,
|
||||
})
|
||||
@@ -518,6 +525,7 @@ function syncSearchToUrl() {
|
||||
|
||||
function resetAllFilters() {
|
||||
yearFromStr.value = ''; yearToStr.value = ''
|
||||
urlDateFrom.value = ''; urlDateTo.value = '' // P6: clear stale URL dates
|
||||
datePreset.value = null
|
||||
selectedTiers.value = []
|
||||
selectedTags.value = []
|
||||
|
||||
Reference in New Issue
Block a user