浏览代码

修改回车问题

xueyiming 1 周之前
父节点
当前提交
f74f9f1c9a
共有 3 个文件被更改,包括 16 次插入9 次删除
  1. 16 7
      src/views/KnowledgeContent.vue
  2. 0 1
      src/views/QAndA.vue
  3. 0 1
      src/views/SearchPage.vue

+ 16 - 7
src/views/KnowledgeContent.vue

@@ -47,6 +47,16 @@
               :index="String(item.doc_id)"
               style="display: flex; justify-content: space-between; align-items: center;"
           >
+            <span v-if="item.statusDesc" style="margin-right: 8px; display: flex; align-items: center;">
+            <span :style="{
+              width: '12px',
+              height: '12px',
+              borderRadius: '50%',
+              backgroundColor: item.statusDesc === '可用' ? '#4fc280' : '#f56c6c',
+              marginRight: '5px'
+              }">
+            </span>
+            </span>
             <!-- 左边文字:固定宽度 + 超出省略号 -->
             <span class="menu-text">{{ item.title || item.text }}</span>
 
@@ -79,8 +89,6 @@
 
       <!-- 右侧内容区域 -->
       <el-main style="padding: 20px; overflow-y: auto; height: calc(100vh - 60px); position: relative;">
-        <!-- 右上角按钮 -->
-        <!-- 右上角按钮:有内容时才显示 -->
         <el-button
             v-if="selectedContent"
             size="small"
@@ -90,7 +98,6 @@
         >
           展示分段
         </el-button>
-
         <h2>{{ selectedTitle }}</h2>
         <p>{{ selectedContent }}</p>
       </el-main>
@@ -113,6 +120,7 @@
             <el-table-column prop="chunk_id" label="分段ID" width="100" header-align="center" align="center"/>
             <el-table-column prop="summary" label="总结" width="300" header-align="center"/>
             <el-table-column prop="text" label="内容" header-align="center"/>
+            <el-table-column prop="statusDesc" label="状态" width="100" header-align="center" align="center"/>
           </el-table>
 
 
@@ -130,9 +138,6 @@
       </el-dialog>
 
 
-
-
-
     </el-container>
 
     <!-- 弹窗 -->
@@ -157,7 +162,7 @@
 </template>
 
 <script lang="ts">
-import { API_BASE_URL } from "@/config";
+import {API_BASE_URL} from "@/config";
 import {defineComponent, onMounted, ref, computed} from 'vue';
 import {useRouter} from 'vue-router'; // 引入 vue-router 用于路由跳转
 import axios from 'axios';
@@ -169,6 +174,7 @@ interface Item {
   doc_id: string;
   title: string | null;
   text: string;
+  statusDesc: string;
 }
 
 export default defineComponent({
@@ -182,6 +188,7 @@ export default defineComponent({
     // 当前选中的内容的标题和内容
     const selectedTitle = ref('');
     const selectedContent = ref('');
+    const statusDesc = ref('');
 
     // 页码控制
     const pageIndex = ref(1);
@@ -238,6 +245,7 @@ export default defineComponent({
       if (selected) {
         selectedTitle.value = selected.title || ''; // 如果 title 为 null,使用默认值
         selectedContent.value = selected.text;
+        statusDesc.value = selected.statusDesc
       }
     };
 
@@ -410,6 +418,7 @@ export default defineComponent({
       chunkTotal,
       openChunkDialog,
       fetchChunks,
+      statusDesc,
     };
   },
 });

+ 0 - 1
src/views/QAndA.vue

@@ -21,7 +21,6 @@
             v-model="query"
             placeholder="请输入提问内容"
             suffix-icon="el-icon-search"
-            @keyup.enter="chat"
             class="search-input"
         ></el-input>
         <!-- 当 loading 时禁用按钮 -->

+ 0 - 1
src/views/SearchPage.vue

@@ -20,7 +20,6 @@
             v-model="query"
             placeholder="请输入搜索内容"
             suffix-icon="el-icon-search"
-            @keyup.enter="search"
             class="search-input"
         ></el-input>
         <el-button @click="search" type="primary" style="margin-left: 15px">搜索</el-button>