fix: 第16轮搜索审计修复 — all_not/group_negated分离 + _parse_primary重复组 + 错误显示
CI / backend (push) Canceled after 0s
CI / frontend (push) Canceled after 0s

- Bug 2 (MEDIUM): all_not 混淆外部NOT与内部NOT,新增 group_negated
  字段区分,_pubmed_conditions 改用 pp.group_negated[idx] 替代 all_not
- Bug 1 (MEDIUM): _parse_primary 括号组内重复group赋值,只处理
  group_id < 0 的未分配terms,_parse_or_expr 增加 depth>0 守卫
- Bug 3 (MEDIUM): SearchView.vue 搜索错误显示为"no results",
  新增 searchError ref + NResult 错误面板
- Bug 4 (LOW): literature.py UUID类型转换优化
This commit is contained in:
34047007@qq.com
2026-07-28 14:08:46 +08:00
parent 1f46f05586
commit de1f4a4bb8
6 changed files with 85 additions and 13 deletions
+1
View File
@@ -15,6 +15,7 @@ declare module 'vue' {
NModal: typeof import('naive-ui')['NModal']
NoteEditModal: typeof import('./components/notes/NoteEditModal.vue')['default']
NotificationBell: typeof import('./components/common/NotificationBell.vue')['default']
NResult: typeof import('naive-ui')['NResult']
PageSkeleton: typeof import('./components/common/PageSkeleton.vue')['default']
RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView']
+6 -1
View File
@@ -28,6 +28,7 @@ const sort = ref('date')
const results = ref<LiteratureItem[]>([])
const loading = ref(false)
const searched = ref(false)
const searchError = ref('')
const savedPmids = ref<Set<number>>(new Set())
// ── 筛选参数 ──
@@ -361,8 +362,11 @@ const { page, total, goToPage } = usePagination({
delete keysetCursors.value[p + 1]
}
yearCounts.value = data.year_counts || []
searchError.value = ''
} catch (e: any) {
if (e?.name === 'CanceledError' || e?.code === 'ERR_CANCELED') return
results.value = []
searchError.value = '搜索失败,请检查网络或稍后重试'
toast.apiError(e, '搜索失败,请重试')
}
finally {
@@ -897,7 +901,8 @@ const specialTags = computed(() => filterOptions.value?.special_tags || {})
</div>
<PageSkeleton :loading="loading && !results.length">
<NEmpty v-if="searched&&!loading&&!results.length" description="未找到匹配文献尝试修改搜索条件" />
<NResult v-if="searchError" status="error" :title="searchError" description="可稍后重试或联系管理员" />
<NEmpty v-else-if="searched&&!loading&&!results.length" description="未找到匹配文献尝试修改搜索条件" />
<LiteratureCard
v-for="item in results"