lushixing 3 هفته پیش
والد
کامیت
78aa46b45a
4فایلهای تغییر یافته به همراه25 افزوده شده و 4 حذف شده
  1. 0 2
      components.d.ts
  2. 1 1
      index.html
  3. BIN
      public/favicon.jpg
  4. 24 1
      src/views/search.vue

+ 0 - 2
components.d.ts

@@ -25,7 +25,6 @@ declare module 'vue' {
     NavigationNavSideBar: typeof import('./src/components/Navigation/NavSideBar.vue')['default']
     NButton: typeof import('naive-ui')['NButton']
     NConfigProvider: typeof import('naive-ui')['NConfigProvider']
-    NDialog: typeof import('naive-ui')['NDialog']
     NDialogProvider: typeof import('naive-ui')['NDialogProvider']
     NEllipsis: typeof import('naive-ui')['NEllipsis']
     NEmpty: typeof import('naive-ui')['NEmpty']
@@ -37,7 +36,6 @@ declare module 'vue' {
     NNotificationProvider: typeof import('naive-ui')['NNotificationProvider']
     NResult: typeof import('naive-ui')['NResult']
     NSelect: typeof import('naive-ui')['NSelect']
-    NSpace: typeof import('naive-ui')['NSpace']
     NSpin: typeof import('naive-ui')['NSpin']
     NTooltip: typeof import('naive-ui')['NTooltip']
     Pagination: typeof import('./src/components/Pagination/index.vue')['default']

+ 1 - 1
index.html

@@ -2,7 +2,7 @@
 <html>
   <head>
     <meta charset="UTF-8" />
-    <link rel="icon" href="/favicon.svg" />
+    <link rel="icon" href="/favicon.jpg" />
     <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover, user-scalable=no" />
     <title>歌莉娅知识库</title>
   </head>

BIN
public/favicon.jpg


+ 24 - 1
src/views/search.vue

@@ -13,6 +13,7 @@ interface KnowledgeItem {
   file_url: string
   match_text: string
   file_updated_at: string
+  cover_url: string
 }
 
 const knowledgeList = ref<KnowledgeItem[]>([])
@@ -247,7 +248,19 @@ async function previewFile(fileUrl: string) {
                 class="knowledge__list-items"
                 @click="openLink(acc.file_url)"
               >
-                <span class="items-img"></span>
+                <span
+                  v-if="acc.cover_url"
+                  class="items-img"
+                >
+                  <img
+                    :src="acc.cover_url"
+                    alt=""
+                  >
+                </span>
+                <span
+                  v-else
+                  class="items-img"
+                >GOELIA</span>
                 <div class="items-info">
                   <h2>{{ acc.file_name }}</h2>
                   <p
@@ -441,6 +454,16 @@ async function previewFile(fileUrl: string) {
         flex: 0 0 60px;
         border-radius: 2px;
         background: #f2f2f2;
+        color: #dddddd;
+        display: flex;
+        justify-content: center;
+        align-items: center;
+        font-size: 13px;
+
+        img {
+          display: block;
+          max-width: 100%;
+        }
       }
       .items-info {
         width: calc(100% - 70px);