Просмотр исходного кода

标题搜索加载后面的三段

visuddhinanda 2 лет назад
Родитель
Сommit
3249e59d0e
1 измененных файлов с 6 добавлено и 5 удалено
  1. 6 5
      dashboard/src/components/fts/FullTextSearchResult.tsx

+ 6 - 5
dashboard/src/components/fts/FullTextSearchResult.tsx

@@ -132,11 +132,12 @@ const FullTxtSearchResultWidget = ({
         },
       }}
       renderItem={(item) => {
-        const paragraph = [
-          item.paragraph - 1,
-          item.paragraph,
-          item.paragraph + 1,
-        ];
+        let paragraph: number[];
+        if (view === "title") {
+          paragraph = [item.paragraph, item.paragraph + 1, item.paragraph + 2];
+        } else {
+          paragraph = [item.paragraph - 1, item.paragraph, item.paragraph + 1];
+        }
         return (
           <List.Item>
             {loading ? (