From 33c0b9cc43cb9c8e51a8fd1b4add76dd76cb8955 Mon Sep 17 00:00:00 2001 From: R2m1liA <15258427350@163.com> Date: Thu, 18 Dec 2025 15:05:17 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=AD=A3=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E6=9D=A1=E7=9B=AE=E6=97=A0=E6=B3=95=E5=AE=8C=E5=85=A8=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 为查询/搜索添加更大的limit --- app/components/shared/QuestionList.vue | 14 ++++++++++++-- server/api/search.get.ts | 2 +- server/assets/graphql/documentList.graphql | 2 +- server/assets/graphql/productList.graphql | 2 +- server/assets/graphql/questionList.graphql | 2 +- server/assets/graphql/solutionList.graphql | 2 +- 6 files changed, 17 insertions(+), 7 deletions(-) diff --git a/app/components/shared/QuestionList.vue b/app/components/shared/QuestionList.vue index 43798f9..7bfb69d 100644 --- a/app/components/shared/QuestionList.vue +++ b/app/components/shared/QuestionList.vue @@ -51,9 +51,19 @@ // 展开目标项 activeNames.value = [target.id]; + await nextTick(); + await new Promise((resolve) => setTimeout(resolve, 100)); // 等待动画完成 + // 平滑滚动到对应位置 - const el = document.querySelector(`#q-${target.id}`); - el?.scrollIntoView({ behavior: 'smooth', block: 'start' }); + // const el = document.querySelector(`#q-${target.id}`); + // el?.scrollIntoView({ behavior: 'smooth', block: 'start' }); + setTimeout(() => { + const el = document.querySelector(`#q-${target.id}`); + el?.scrollIntoView({ + behavior: 'smooth', + block: 'start', + }); + }, 200); // 与 el-collapse 的 transition 时间匹配 }, { immediate: true } ); diff --git a/server/api/search.get.ts b/server/api/search.get.ts index eea7a3c..eda0077 100644 --- a/server/api/search.get.ts +++ b/server/api/search.get.ts @@ -11,7 +11,7 @@ export default defineEventHandler(async (event) => { if (!q) return []; const meili = getMeiliService(); - const sections = await meili.search(q, { limit: 12 }, locale); + const sections = await meili.search(q, { limit: 500 }, locale); // 空Section过滤 const filteredSections = sections.filter( diff --git a/server/assets/graphql/documentList.graphql b/server/assets/graphql/documentList.graphql index 3a64458..d9b1f24 100644 --- a/server/assets/graphql/documentList.graphql +++ b/server/assets/graphql/documentList.graphql @@ -1,5 +1,5 @@ query GetDocumentList($locale: String!) { - product_documents(filter: { status: { _eq: "published" } }) { + product_documents(filter: { status: { _eq: "published" } }, limit: 500) { id file { id diff --git a/server/assets/graphql/productList.graphql b/server/assets/graphql/productList.graphql index 788d12a..2c8feac 100644 --- a/server/assets/graphql/productList.graphql +++ b/server/assets/graphql/productList.graphql @@ -1,5 +1,5 @@ query GetProductList($locale: String!) { - products(filter: { status: { _eq: "in-production" } }) { + products(filter: { status: { _eq: "in-production" } }, limit: 200) { id status translations(filter: { languages_code: { code: { _eq: $locale } } }) { diff --git a/server/assets/graphql/questionList.graphql b/server/assets/graphql/questionList.graphql index bdad9c7..27c40e7 100644 --- a/server/assets/graphql/questionList.graphql +++ b/server/assets/graphql/questionList.graphql @@ -1,5 +1,5 @@ query GetQuestionList($locale: String!) { - questions(filter: { status: { _eq: "published" } }) { + questions(filter: { status: { _eq: "published" } }, limit: 500) { id type { id diff --git a/server/assets/graphql/solutionList.graphql b/server/assets/graphql/solutionList.graphql index 3ecc511..2b74842 100644 --- a/server/assets/graphql/solutionList.graphql +++ b/server/assets/graphql/solutionList.graphql @@ -1,5 +1,5 @@ query GetSolutionList($locale: String!) { - solutions(filter: { status: { _eq: "published" } }) { + solutions(filter: { status: { _eq: "published" } }, limit: 200) { id cover { id