|
|
@ -48,6 +48,9 @@ |
|
|
|
> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="description" v-if="curRowDetail.description"> |
|
|
|
{{ curRowDetail.description }} |
|
|
|
</div> |
|
|
|
<div class="tags"> |
|
|
|
<template v-if="curRowDetail.tags"> |
|
|
|
<a-tag v-for="tag in curRowDetail.tags.split(',')" :key="tag" color="blue"> |
|
|
@ -58,6 +61,26 @@ |
|
|
|
</div> |
|
|
|
<div class="content-divider"></div> |
|
|
|
<div class="content-body markdown-body" v-html="curRowDetail.solution"></div> |
|
|
|
<!-- 添加附件展示区域 --> |
|
|
|
<div class="attachments" v-if="curRowDetail.files && curRowDetail.files.length"> |
|
|
|
<div class="attachments-header"> |
|
|
|
<paper-clip-outlined /> |
|
|
|
<span>附件列表</span> |
|
|
|
</div> |
|
|
|
<div class="attachments-list"> |
|
|
|
<a-card |
|
|
|
v-for="file in curRowDetail.files" |
|
|
|
:key="file.id" |
|
|
|
class="file-card" |
|
|
|
@click="handleDownload(file)" |
|
|
|
> |
|
|
|
<template #cover> |
|
|
|
<file-outlined class="file-icon" /> |
|
|
|
</template> |
|
|
|
<a-card-meta :title="file.originalFilename" /> |
|
|
|
</a-card> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
<template v-else> |
|
|
@ -84,11 +107,16 @@ |
|
|
|
DeleteOutlined, |
|
|
|
ExportOutlined, |
|
|
|
LeftOutlined, |
|
|
|
PaperClipOutlined, |
|
|
|
FileOutlined, |
|
|
|
} from '@ant-design/icons-vue'; |
|
|
|
import { fetchKnowledgeBaseList, findOneById, addReadCount } from '@/api/knowledgeBase'; |
|
|
|
import { useRoute, useRouter } from 'vue-router'; |
|
|
|
import { useUserStore } from '@/store/modules/user'; |
|
|
|
|
|
|
|
// 添加下载方法 |
|
|
|
const handleDownload = (file) => { |
|
|
|
window.open(file.url, '_blank'); |
|
|
|
}; |
|
|
|
const userStore = useUserStore(); |
|
|
|
|
|
|
|
const isAdmin = userStore.userInfo.isAdmin; |
|
|
@ -108,12 +136,20 @@ |
|
|
|
solution: string; |
|
|
|
createTime: string; |
|
|
|
readCount: any; |
|
|
|
description: string; |
|
|
|
files: Array<{ |
|
|
|
id: string; |
|
|
|
originalFilename: string; |
|
|
|
url: string; |
|
|
|
}>; |
|
|
|
}>({ |
|
|
|
title: '', |
|
|
|
tags: '', |
|
|
|
solution: '', |
|
|
|
createTime: '', |
|
|
|
readCount: 0, |
|
|
|
description: '', |
|
|
|
files: [], |
|
|
|
}); |
|
|
|
|
|
|
|
const goBack = () => { |
|
|
@ -184,6 +220,62 @@ |
|
|
|
border-radius: 8px; |
|
|
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); |
|
|
|
|
|
|
|
.attachments { |
|
|
|
margin-top: 32px; |
|
|
|
padding-top: 24px; |
|
|
|
border-top: 1px solid #e2e8f0; |
|
|
|
|
|
|
|
.attachments-header { |
|
|
|
display: flex; |
|
|
|
align-items: center; |
|
|
|
gap: 8px; |
|
|
|
margin-bottom: 16px; |
|
|
|
color: #1e293b; |
|
|
|
font-size: 16px; |
|
|
|
font-weight: 500; |
|
|
|
|
|
|
|
.anticon { |
|
|
|
color: #3b82f6; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.attachments-list { |
|
|
|
display: grid; |
|
|
|
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); |
|
|
|
gap: 16px; |
|
|
|
|
|
|
|
.file-card { |
|
|
|
cursor: pointer; |
|
|
|
transition: all 0.3s ease; |
|
|
|
border-radius: 8px; |
|
|
|
overflow: hidden; |
|
|
|
|
|
|
|
&:hover { |
|
|
|
transform: translateY(-2px); |
|
|
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); |
|
|
|
} |
|
|
|
|
|
|
|
.file-icon { |
|
|
|
font-size: 40px; |
|
|
|
color: #3b82f6; |
|
|
|
display: flex; |
|
|
|
justify-content: center; |
|
|
|
align-items: center; |
|
|
|
padding: 24px 0; |
|
|
|
background: #f8fafc; |
|
|
|
} |
|
|
|
|
|
|
|
:deep(.ant-card-meta-title) { |
|
|
|
font-size: 14px; |
|
|
|
text-align: center; |
|
|
|
white-space: nowrap; |
|
|
|
overflow: hidden; |
|
|
|
text-overflow: ellipsis; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.card-title { |
|
|
|
display: flex; |
|
|
|
align-items: center; |
|
|
@ -221,6 +313,16 @@ |
|
|
|
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08); |
|
|
|
|
|
|
|
.content-header { |
|
|
|
.description { |
|
|
|
margin: 16px 0; |
|
|
|
padding: 12px 16px; |
|
|
|
background: #f8fafc; |
|
|
|
border-left: 4px solid #3b82f6; |
|
|
|
border-radius: 0 8px 8px 0; |
|
|
|
color: #475569; |
|
|
|
font-size: 15px; |
|
|
|
line-height: 1.6; |
|
|
|
} |
|
|
|
.header-main { |
|
|
|
margin-bottom: 16px; |
|
|
|
|
|
|
@ -329,10 +431,7 @@ |
|
|
|
:deep(blockquote) { |
|
|
|
margin: 20px 0; |
|
|
|
padding: 16px 24px; |
|
|
|
background: #f8fafc; |
|
|
|
border-left: 4px solid #3b82f6; |
|
|
|
border-radius: 0 8px 8px 0; |
|
|
|
color: #475569; |
|
|
|
|
|
|
|
font-style: italic; |
|
|
|
} |
|
|
|
|
|
|
|