Merge remote-tracking branch 'origin/master'

This commit is contained in:
2026-10-29 09:16:24 +08:00
15 changed files with 189 additions and 56 deletions
@@ -66,7 +66,8 @@ public class VersionResource implements Serializable {
@Schema(description = "所属任务年份(必备)") @Schema(description = "所属任务年份(必备)")
private String taskYear; private String taskYear;
@Schema(description = "来源馆(必备)") @TableField("source_library")
@Schema(description = "来源馆(必备),对应 version_resource.source_library")
private String sourceLibrary; private String sourceLibrary;
@Schema(description = "来源馆地址(必备,IP:端口或域名)") @Schema(description = "来源馆地址(必备,IP:端口或域名)")
@@ -44,6 +44,9 @@ public class SpecialRecommendVO implements Serializable {
@Schema(description = "下载/电子版地址(special_resource.ebook_url,version_resource 场景取全文地址)") @Schema(description = "下载/电子版地址(special_resource.ebook_url,version_resource 场景取全文地址)")
private String ebookUrl; private String ebookUrl;
@Schema(description = "来源馆(version_resource.source_library)")
private String sourceLibrary;
@Schema(description = "数据来源:VERSION=version_resource特藏标记 / MANUAL=special_resource手工维护") @Schema(description = "数据来源:VERSION=version_resource特藏标记 / MANUAL=special_resource手工维护")
private String source; private String source;
} }
@@ -40,6 +40,10 @@ public class SpecialResource implements Serializable {
@Schema(description = "电子版下载地址") @Schema(description = "电子版下载地址")
private String ebookUrl; private String ebookUrl;
@TableField("source_library")
@Schema(description = "来源馆,对应 special_resource.source_library")
private String sourceLibrary;
@Schema(description = "排序号") @Schema(description = "排序号")
private Integer sortNo; private Integer sortNo;
@@ -129,6 +129,7 @@ public class SpecialServiceImpl extends ServiceImpl<SpecialResourceMapper, Speci
vo.setNote(r.getNote()); vo.setNote(r.getNote());
vo.setAuthor(r.getAuthor()); vo.setAuthor(r.getAuthor());
vo.setPublishYear(r.getPublishYear()); vo.setPublishYear(r.getPublishYear());
vo.setSourceLibrary(r.getSourceLibrary());
vo.setFulltextUrl(r.getFulltextUrl()); vo.setFulltextUrl(r.getFulltextUrl());
// version_resource 无封面与电子版字段,下载地址用全文地址兜底 // version_resource 无封面与电子版字段,下载地址用全文地址兜底
vo.setEbookUrl(r.getFulltextUrl()); vo.setEbookUrl(r.getFulltextUrl());
@@ -143,6 +144,7 @@ public class SpecialServiceImpl extends ServiceImpl<SpecialResourceMapper, Speci
vo.setNote(s.getSummary()); vo.setNote(s.getSummary());
vo.setCoverUrl(s.getCoverUrl()); vo.setCoverUrl(s.getCoverUrl());
vo.setEbookUrl(s.getEbookUrl()); vo.setEbookUrl(s.getEbookUrl());
vo.setSourceLibrary(s.getSourceLibrary());
vo.setSource("MANUAL"); vo.setSource("MANUAL");
return vo; return vo;
} }
@@ -0,0 +1,4 @@
-- 特藏推荐表补来源馆,首页书脊下侧展示该字段。
ALTER TABLE special_resource ADD COLUMN IF NOT EXISTS source_library VARCHAR(256);
COMMENT ON COLUMN special_resource.source_library IS '来源馆';
+4
View File
@@ -18,6 +18,8 @@ export interface SpecialRecommendItem {
summary?: string summary?: string
author?: string author?: string
publishYear?: string publishYear?: string
/** 来源馆(version_resource.source_library) */
sourceLibrary?: string
/** 封面图片(special_resource.cover_url) */ /** 封面图片(special_resource.cover_url) */
coverUrl?: string coverUrl?: string
/** 全文地址(version_resource.fulltext_url) */ /** 全文地址(version_resource.fulltext_url) */
@@ -50,6 +52,8 @@ export interface SpecialResource {
category?: string category?: string
coverUrl?: string coverUrl?: string
ebookUrl?: string ebookUrl?: string
/** 来源馆(special_resource.source_library) */
sourceLibrary?: string
sortNo?: number sortNo?: number
status?: number status?: number
} }
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 231 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 212 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 391 KiB

+1 -1
View File
@@ -88,7 +88,7 @@ function openAdmin() {
height: 72px; height: 72px;
background: background:
linear-gradient(rgba(10, 28, 20, 0.5), rgba(10, 28, 20, 0.62)), linear-gradient(rgba(10, 28, 20, 0.5), rgba(10, 28, 20, 0.62)),
url('../assets/banner/b2.jpg') center 18% / cover no-repeat; url('../assets/banner/army2.jpg') center 18% / cover no-repeat;
z-index: -1; z-index: -1;
} }
+168 -53
View File
@@ -1,10 +1,11 @@
<script setup lang="ts"> <script setup lang="ts">
import { onBeforeUnmount, onMounted, ref } from 'vue' import { computed, onBeforeUnmount, onMounted, ref } from 'vue'
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
import { getOverview, type AnalysisOverview } from '@/api/analysis'
import { getRecommend, type SpecialRecommendItem } from '@/api/special' import { getRecommend, type SpecialRecommendItem } from '@/api/special'
import b1 from '@/assets/banner/b1.jpg' import b1 from '@/assets/banner/army1.jpg'
import b2 from '@/assets/banner/b2.jpg' import b2 from '@/assets/banner/army2.jpg'
import b3 from '@/assets/banner/b3.jpg' import b3 from '@/assets/banner/army3.jpg'
const router = useRouter() const router = useRouter()
const keyword = ref('') const keyword = ref('')
@@ -14,18 +15,38 @@ const types = ref<string[]>([])
const typeOpts = ['纸质图书', '电子图书', '中文文献', '外文文献'] const typeOpts = ['纸质图书', '电子图书', '中文文献', '外文文献']
const slides = [ const slides = [
{ img: b1, kicker: '馆藏资源', title: '典藏中华版本,赓续中华文脉' }, { img: b1, kicker: '馆藏资源', title: '陆军领域军事版本资源联合服务平台' },
{ img: b2, kicker: '统一检索', title: '纸电一体,一站式发现' }, { img: b2, kicker: '统一检索', title: '陆军领域军事版本资源联合服务平台' },
{ img: b3, kicker: '联合服务', title: '多馆协同,资源互联互通' } { img: b3, kicker: '联合服务', title: '陆军领域军事版本资源联合服务平台' }
] ]
const sources = [ const overview = ref<AnalysisOverview | null>(null)
{ name: '馆藏资源检索', on: true },
{ name: '版本资源库', on: false }, function mediaCount(keyword: string) {
{ name: '古籍善本', on: false }, const item = overview.value?.mediaRatio?.find((m) => (m.name || '').includes(keyword))
{ name: '电子文献', on: false }, return item?.value ?? 0
{ name: '特色专题库', on: false } }
]
function formatCount(n: number | undefined | null) {
if (!overview.value) return '—'
return Number(n || 0).toLocaleString('zh-CN')
}
const statItems = computed(() => [
{ label: '资源总量', value: formatCount(overview.value?.totalCount) },
{ label: '纸质资源', value: formatCount(mediaCount('纸')) },
{ label: '电子资源', value: formatCount(mediaCount('电')) },
{ label: '今日检索', value: formatCount(overview.value?.todaySearchCount) },
{ label: '当前在线', value: formatCount(overview.value?.onlineCount) }
])
async function fetchOverview() {
try {
overview.value = await getOverview()
} catch {
overview.value = null
}
}
/* ---------- 3D 书架:一本书对应一条特藏,点击进入特藏详情 ---------- */ /* ---------- 3D 书架:一本书对应一条特藏,点击进入特藏详情 ---------- */
const bookColors = ['#2c4d40', '#7a2e2e', '#2b3a67', '#8a6420', '#5a2e42'] const bookColors = ['#2c4d40', '#7a2e2e', '#2b3a67', '#8a6420', '#5a2e42']
@@ -40,6 +61,10 @@ function titleOf(it: SpecialRecommendItem) {
return it.title || it.name || '' return it.title || it.name || ''
} }
function sourceOf(it: SpecialRecommendItem) {
return (it.sourceLibrary || '').trim()
}
/* 拉取特藏列表,为每本书随机分配姿态与呼吸延迟,使节奏互不同步 */ /* 拉取特藏列表,为每本书随机分配姿态与呼吸延迟,使节奏互不同步 */
async function fetchSpecials() { async function fetchSpecials() {
try { try {
@@ -60,13 +85,16 @@ function openSpecial(it: SpecialRecommendItem) {
router.push({ path: '/special', query: { id: String(it.id ?? '') } }) router.push({ path: '/special', query: { id: String(it.id ?? '') } })
} }
const hoverIndex = ref(-1) const hoverKey = ref('')
const shelfPaused = ref(false)
/* X 轴推挤:悬停某本书时,左侧书本左推、右侧书本右推 */ /* X 轴推挤:悬停某本书时,同一排左侧书本左推、右侧书本右推 */
function wrapperStyle(i: number) { function wrapperStyle(copy: number, i: number) {
if (hoverIndex.value < 0) return {} const prefix = `${copy}-`
if (i < hoverIndex.value) return { transform: 'translateX(-40px)' } if (!hoverKey.value.startsWith(prefix)) return {}
if (i > hoverIndex.value) return { transform: 'translateX(40px)' } const hi = Number(hoverKey.value.slice(prefix.length))
if (i < hi) return { transform: 'translateX(-40px)' }
if (i > hi) return { transform: 'translateX(40px)' }
return { transform: 'translateX(0px)' } return { transform: 'translateX(0px)' }
} }
@@ -126,6 +154,7 @@ function doSearch() {
onMounted(() => { onMounted(() => {
reset() reset()
fetchSpecials() fetchSpecials()
fetchOverview()
}) })
onBeforeUnmount(pause) onBeforeUnmount(pause)
</script> </script>
@@ -154,12 +183,13 @@ onBeforeUnmount(pause)
<div class="panel"> <div class="panel">
<aside class="panel-side"> <aside class="panel-side">
<div class="side-head"> <div class="side-head">
<el-icon :size="15"><Search /></el-icon> <el-icon :size="15"><DataAnalysis /></el-icon>
<span>搜索馆藏资源</span> <span>资源统计</span>
</div>
<div v-for="s in statItems" :key="s.label" class="side-item">
<span>{{ s.label }}</span>
<strong>{{ s.value }}</strong>
</div> </div>
<a v-for="s in sources" :key="s.name" class="side-item">
{{ s.name }}
</a>
</aside> </aside>
<section class="panel-main"> <section class="panel-main">
@@ -190,15 +220,27 @@ onBeforeUnmount(pause)
</section> </section>
</div> </div>
<!-- 特藏书架:一本书 = 一条特藏,点击查看特藏详情 --> <!-- 特藏书架:横向循环滚动,悬停暂停,点击进入特藏详情 -->
<div v-if="specials.length" class="shelf"> <div
v-if="specials.length"
class="shelf"
@mouseenter="shelfPaused = true"
@mouseleave="shelfPaused = false; hoverKey = ''"
>
<div class="shelf-track" :class="{ paused: shelfPaused }">
<div
v-for="copy in 2"
:key="copy"
class="shelf-group"
:aria-hidden="copy === 2 ? 'true' : undefined"
>
<div <div
v-for="(e, i) in specials" v-for="(e, i) in specials"
:key="e.id ?? i" :key="`${copy}-${e.id ?? i}`"
class="book-wrapper" class="book-wrapper"
:style="[wrapperStyle(i), { '--delay': bookMeta[i]?.delay || '0s' }]" :style="[wrapperStyle(copy, i), { '--delay': bookMeta[i]?.delay || '0s' }]"
@mouseenter="hoverIndex = i" @mouseenter="hoverKey = `${copy}-${i}`"
@mouseleave="hoverIndex = -1" @mouseleave="hoverKey = ''"
@click="openSpecial(e)" @click="openSpecial(e)"
> >
<!-- 中层:随机倾斜 + 呼吸悬浮 --> <!-- 中层:随机倾斜 + 呼吸悬浮 -->
@@ -211,13 +253,22 @@ onBeforeUnmount(pause)
}" }"
> >
<!-- 内层:书本本体,悬停时飞出转正 --> <!-- 内层:书本本体,悬停时飞出转正 -->
<div class="book" :style="{ backgroundColor: bookMeta[i]?.color || '#2c4d40' }"> <div
<span class="book-title">{{ titleOf(e) }}</span> class="book"
:class="{ 'has-source': sourceOf(e) }"
:style="{ backgroundColor: bookMeta[i]?.color || '#2c4d40' }"
>
<div class="book-copy">
<span class="book-title">{{ titleOf(e) }}</span>
<span v-if="sourceOf(e)" class="book-source" :title="sourceOf(e)">{{ sourceOf(e) }}</span>
</div>
</div> </div>
</div> </div>
<!-- 底层:与呼吸同步的投影 --> <!-- 底层:与呼吸同步的投影 -->
<div class="book-shadow" /> <div class="book-shadow" />
</div> </div>
</div>
</div>
</div> </div>
<p v-else class="shelf-empty">暂无特藏推荐,可在资源管理中将版本资源标记为特藏</p> <p v-else class="shelf-empty">暂无特藏推荐,可在资源管理中将版本资源标记为特藏</p>
</div> </div>
@@ -365,15 +416,22 @@ onBeforeUnmount(pause)
border-bottom: 1px solid rgba(255, 255, 255, 0.12); border-bottom: 1px solid rgba(255, 255, 255, 0.12);
} }
/* 纯展示,不可点击,因此不做高亮与悬停态 */
.side-item { .side-item {
display: block; display: flex;
padding: 14px 20px; align-items: center;
justify-content: space-between;
gap: 8px;
padding: 12px 18px;
font-size: 14px; font-size: 14px;
letter-spacing: 0.5px; letter-spacing: 0.5px;
color: rgba(255, 255, 255, 0.68); color: rgba(255, 255, 255, 0.68);
cursor: default;
pointer-events: none; strong {
font-size: 16px;
font-weight: 600;
letter-spacing: 0;
color: #fff;
}
} }
.panel-main { .panel-main {
@@ -483,17 +541,40 @@ onBeforeUnmount(pause)
color: rgba(255, 255, 255, 0.45); color: rgba(255, 255, 255, 0.45);
} }
/* ---------- 快捷入口:3D 悬浮书架 ---------- */ /* ---------- 快捷入口:3D 悬浮书架,横向循环滚动 ---------- */
.shelf { .shelf {
margin-top: 30px;
overflow: hidden;
mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.shelf-track {
display: flex;
width: max-content;
animation: shelfMarquee 36s linear infinite;
&.paused {
animation-play-state: paused;
}
}
.shelf-group {
display: flex; display: flex;
justify-content: center;
align-items: flex-end; align-items: flex-end;
gap: 18px; gap: 18px;
margin-top: 30px; padding: 36px 9px 0;
padding: 30px 16px 0;
perspective: 1200px; perspective: 1200px;
} }
@keyframes shelfMarquee {
from {
transform: translateX(0);
}
to {
transform: translateX(-50%);
}
}
/* 外层:仅负责悬停时的 X 轴推挤位移 */ /* 外层:仅负责悬停时的 X 轴推挤位移 */
.book-wrapper { .book-wrapper {
flex: none; flex: none;
@@ -564,22 +645,30 @@ onBeforeUnmount(pause)
box-shadow: 0 34px 64px rgba(0, 0, 0, 0.6); box-shadow: 0 34px 64px rgba(0, 0, 0, 0.6);
} }
/* 竖排烫金书名(楷体 + 锐利金属倒角),过长自动截断 */ /* 书脊文字:书名竖排在上,来源在书名下侧横向居中 */
.book-title { .book-copy {
position: absolute; position: absolute;
inset: 0; inset: 10px 4px;
display: flex; display: flex;
flex-direction: column;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
gap: 6px;
min-height: 0;
}
.book-title {
flex: 0 1 auto;
max-height: 100%;
min-height: 0;
overflow: hidden;
/* vertical-lr:每列自上而下,多列时从左往右排(rl 会把开头那列放到最右,看着像反了) */ /* vertical-lr:每列自上而下,多列时从左往右排(rl 会把开头那列放到最右,看着像反了) */
writing-mode: vertical-lr; writing-mode: vertical-lr;
font-family: 'Kaiti SC', 'STKaiti', 'KaiTi', '楷体', serif; font-family: 'Kaiti SC', 'STKaiti', 'KaiTi', '楷体', serif;
font-size: 15px; font-size: 15px;
line-height: 1.15;
letter-spacing: 5px; letter-spacing: 5px;
color: var(--brand-gold); color: var(--brand-gold);
overflow: hidden;
text-overflow: ellipsis;
padding: 10px 0;
text-shadow: text-shadow:
-0.5px -0.5px 0px rgba(255, 255, 255, 0.8), -0.5px -0.5px 0px rgba(255, 255, 255, 0.8),
1px 1px 0px #704e10, 1px 1px 0px #704e10,
@@ -587,6 +676,28 @@ onBeforeUnmount(pause)
2px 2px 3px rgba(0, 0, 0, 0.9); 2px 2px 3px rgba(0, 0, 0, 0.9);
} }
.has-source .book-title {
max-height: 62%;
}
.book-source {
flex: 0 0 auto;
width: 100%;
writing-mode: horizontal-tb;
text-align: center;
font-size: 10px;
line-height: 1.25;
letter-spacing: 0;
color: rgba(255, 248, 220, 0.9);
border-top: 1px solid rgba(232, 201, 122, 0.55);
padding-top: 4px;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
word-break: break-all;
}
.shelf-empty { .shelf-empty {
margin: 30px 0 0; margin: 30px 0 0;
text-align: center; text-align: center;
@@ -713,6 +824,7 @@ onBeforeUnmount(pause)
/* ---------- 响应式 ---------- */ /* ---------- 响应式 ---------- */
@media (prefers-reduced-motion: reduce) { @media (prefers-reduced-motion: reduce) {
.shelf-track,
.book-inner, .book-inner,
.book-shadow::before, .book-shadow::before,
.hero-text h1, .hero-text h1,
@@ -724,9 +836,8 @@ onBeforeUnmount(pause)
} }
@media (max-width: 1080px) { @media (max-width: 1080px) {
.shelf { .shelf-track {
flex-wrap: wrap; animation-duration: 28s;
row-gap: 22px;
} }
} }
@@ -744,7 +855,7 @@ onBeforeUnmount(pause)
display: none; display: none;
} }
.shelf { .shelf-group {
gap: 12px; gap: 12px;
} }
@@ -758,7 +869,11 @@ onBeforeUnmount(pause)
.book-title { .book-title {
font-size: 13px; font-size: 13px;
letter-spacing: 5px; letter-spacing: 3px;
}
.book-source {
font-size: 9px;
} }
} }
</style> </style>
+1 -1
View File
@@ -103,7 +103,7 @@ async function handleLogin() {
color: var(--text-on-dark); color: var(--text-on-dark);
background: background:
linear-gradient(180deg, rgba(16, 38, 28, 0.2) 0%, rgba(16, 38, 28, 0.72) 100%), linear-gradient(180deg, rgba(16, 38, 28, 0.2) 0%, rgba(16, 38, 28, 0.72) 100%),
url('../assets/banner/b2.jpg') center 30% / cover no-repeat; url('../assets/banner/army2.jpg') center 30% / cover no-repeat;
&::after { &::after {
content: ''; content: '';