feat(web): ArticleDetail 三段式(评论/译文/原文) + LLM 屏蔽词配置 + .diary-para 兜底
- types: Source / LlmSetting 加 blocklist_tags 字段
- AdminLlmSettings:
- 新增 '全局屏蔽分类(命中即删文章)' 卡片(逗号/换行分隔,双向绑 blocklist_tags)
- 分类 prompt 提示加 {blocklist} / drop 字段说明
- ArticleDetail 三段式:
- 顶部:评论(LLM 点评)
- 中部:文章译文(优先 LLM 排版版 / fallback 原始译文)
- 底部:文章原文
- AI 插图挂在译文卡片下作附属
- style.css: .diary-para 兜底规则(margin 0 0 1.5em 0 / line-height 1.7 / color #3e3e3e)
This commit is contained in:
@@ -156,25 +156,31 @@ onMounted(load)
|
||||
本条翻译失败,可点 "重译" 重试,或查看后端日志。
|
||||
</NAlert>
|
||||
|
||||
<div v-if="article.image_ai_url" style="margin-top: 16px">
|
||||
<NCard title="🎨 AI 插图">
|
||||
<NImage :src="article.image_ai_url" object-fit="cover" style="max-width: 100%; border-radius: 6px" />
|
||||
</NCard>
|
||||
</div>
|
||||
<!-- 三段式:评论(顶部) / 译文(中) / 原文(底) -->
|
||||
|
||||
<!-- 1) 评论(LLM 点评) -->
|
||||
<NCard v-if="article.commentary" style="margin-top: 16px" title="💬 评论">
|
||||
<template #header-extra>
|
||||
<NTag size="tiny" :type="statusTagType(article.commentary_status)">{{ article.commentary_status || 'n/a' }}</NTag>
|
||||
</template>
|
||||
<p style="white-space: pre-wrap; line-height: 1.8; margin: 0">{{ article.commentary }}</p>
|
||||
</NCard>
|
||||
|
||||
<!-- 2) 译文(优先 LLM 排版版,fallback 原始译文) -->
|
||||
<div v-if="showTranslation" style="margin-top: 16px">
|
||||
<NCard v-if="article.body_zh_formatted" title="译文(LLM 排版版)">
|
||||
<NCard v-if="article.body_zh_formatted" title="📖 文章译文">
|
||||
<template #header-extra>
|
||||
<NSpace align="center">
|
||||
<NTag size="tiny" :type="statusTagType(article.format_status)">{{ article.format_status || 'n/a' }}</NTag>
|
||||
<NTag size="tiny" :type="statusTagType(article.format_status)">排版:{{ article.format_status || 'n/a' }}</NTag>
|
||||
<NButton text size="tiny" @click="showFormatted = !showFormatted">
|
||||
{{ showFormatted ? '隐藏' : '显示' }}
|
||||
{{ showFormatted ? '隐藏排版' : '显示排版' }}
|
||||
</NButton>
|
||||
</NSpace>
|
||||
</template>
|
||||
<div v-if="showFormatted" v-html="article.body_zh_formatted" style="line-height: 1.8" />
|
||||
<div v-if="showFormatted" v-html="article.body_zh_formatted" />
|
||||
<NText v-else depth="3" style="font-size: 12px">已隐藏排版版(点击右上角显示)</NText>
|
||||
</NCard>
|
||||
<NCard v-else title="译文(原始)" style="margin-top: 16px">
|
||||
<NCard v-else title="📖 文章译文(原始)" style="margin-top: 16px">
|
||||
<div v-if="article.body_zh_html" v-html="article.body_zh_html" style="line-height: 1.8" />
|
||||
<div v-else-if="article.body_zh_text" style="white-space: pre-wrap; line-height: 1.8">
|
||||
{{ article.body_zh_text }}
|
||||
@@ -183,20 +189,21 @@ onMounted(load)
|
||||
</NCard>
|
||||
</div>
|
||||
|
||||
<!-- AI 插图(挂在译文卡片下,作附属) -->
|
||||
<div v-if="article.image_ai_url" style="margin-top: 16px">
|
||||
<NCard title="🎨 AI 插图">
|
||||
<NImage :src="article.image_ai_url" object-fit="cover" style="max-width: 100%; border-radius: 6px" />
|
||||
</NCard>
|
||||
</div>
|
||||
|
||||
<!-- 3) 原文 -->
|
||||
<div v-if="showOriginal" style="margin-top: 16px">
|
||||
<NCard title="原文">
|
||||
<NCard title="📄 文章原文">
|
||||
<div v-if="article.body_html" v-html="article.body_html" style="line-height: 1.8" />
|
||||
<div v-else style="white-space: pre-wrap; line-height: 1.8">{{ article.body_text }}</div>
|
||||
</NCard>
|
||||
</div>
|
||||
|
||||
<NCard v-if="article.commentary" style="margin-top: 16px" title="💬 AI 点评">
|
||||
<template #header-extra>
|
||||
<NTag size="tiny" :type="statusTagType(article.commentary_status)">{{ article.commentary_status || 'n/a' }}</NTag>
|
||||
</template>
|
||||
<p style="white-space: pre-wrap; line-height: 1.8; margin: 0">{{ article.commentary }}</p>
|
||||
</NCard>
|
||||
|
||||
<NCard v-if="article.entities" style="margin-top: 16px" title="🔍 实体(预留)">
|
||||
<code style="font-size: 12px">{{ JSON.stringify(article.entities) }}</code>
|
||||
</NCard>
|
||||
|
||||
Reference in New Issue
Block a user