|
|
@@ -231,9 +231,11 @@
|
|
|
<span class="label">相似度:</span>
|
|
|
<span>{{ currentDetail?.score }}%</span>
|
|
|
</div>
|
|
|
- <div class="detail-item full-content" v-if="currentDetail?.parent_id">
|
|
|
- <span class="label">父段内容:</span>
|
|
|
- <div class="text-box" v-loading="parentLoading">
|
|
|
+ <div class="view-content-section" v-if="currentDetail?.parent_id && currentDetail?.parent_id !== '0'">
|
|
|
+ <div class="section-title">
|
|
|
+ <el-icon><Connection /></el-icon> 父段内容
|
|
|
+ </div>
|
|
|
+ <div v-loading="parentLoading">
|
|
|
<el-tabs v-if="parentSegments.length > 1" v-model="activeParentTab" type="card">
|
|
|
<el-tab-pane
|
|
|
v-for="(seg, idx) in parentSegments"
|
|
|
@@ -241,10 +243,10 @@
|
|
|
:label="`父段片段 ${idx + 1}`"
|
|
|
:name="String(idx)"
|
|
|
>
|
|
|
- <div class="parent-tab-content">{{ seg.content || '暂无内容' }}</div>
|
|
|
+ <div class="content-box parent-content">{{ seg.content || '暂无内容' }}</div>
|
|
|
</el-tab-pane>
|
|
|
</el-tabs>
|
|
|
- <div v-else class="parent-tab-content">{{ parentSegments[0]?.content || '暂无内容' }}</div>
|
|
|
+ <div v-else class="content-box parent-content">{{ parentSegments[0]?.content || '暂无内容' }}</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="detail-item full-content">
|
|
|
@@ -262,7 +264,7 @@
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
import { ref, reactive, onMounted } from 'vue'
|
|
|
-import { Search, Plus, Delete } from '@element-plus/icons-vue'
|
|
|
+import { Search, Plus, Delete, Connection } from '@element-plus/icons-vue'
|
|
|
import { ElMessage } from 'element-plus'
|
|
|
import { getKnowledgeBases, getKnowledgeBaseMetadata, type KnowledgeBase } from '@/api/knowledge-base'
|
|
|
import { searchKnowledgeBase, type KBSearchResultItem } from '@/api/search-engine'
|
|
|
@@ -584,6 +586,41 @@ onMounted(() => {
|
|
|
min-height: calc(100vh - 84px);
|
|
|
}
|
|
|
|
|
|
+.view-content-section {
|
|
|
+ margin-top: 20px;
|
|
|
+}
|
|
|
+
|
|
|
+.view-content-section .section-title {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ gap: 8px;
|
|
|
+ font-weight: 600;
|
|
|
+ margin-bottom: 12px;
|
|
|
+ font-size: 16px;
|
|
|
+ color: #303133;
|
|
|
+ border-left: 4px solid #409EFF;
|
|
|
+ padding-left: 10px;
|
|
|
+}
|
|
|
+
|
|
|
+.content-box {
|
|
|
+ background-color: #f5f7fa;
|
|
|
+ padding: 15px;
|
|
|
+ border-radius: 4px;
|
|
|
+ border: 1px solid #e4e7ed;
|
|
|
+ color: #606266;
|
|
|
+ line-height: 1.6;
|
|
|
+ max-height: 400px;
|
|
|
+ overflow-y: auto;
|
|
|
+ white-space: pre-wrap;
|
|
|
+ word-break: break-all;
|
|
|
+}
|
|
|
+
|
|
|
+.parent-content {
|
|
|
+ background-color: #fcf6ec;
|
|
|
+ border-color: #f3d19e;
|
|
|
+ color: #e6a23c;
|
|
|
+}
|
|
|
+
|
|
|
.header-section {
|
|
|
margin-bottom: 20px;
|
|
|
display: flex;
|