前段页面调整
This commit is contained in:
+461
-110
@@ -1,6 +1,9 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue'
|
||||
import { onBeforeUnmount, onMounted, ref } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import b1 from '@/assets/banner/b1.jpg'
|
||||
import b2 from '@/assets/banner/b2.jpg'
|
||||
import b3 from '@/assets/banner/b3.jpg'
|
||||
|
||||
const router = useRouter()
|
||||
const keyword = ref('')
|
||||
@@ -8,186 +11,534 @@ const field = ref('题名')
|
||||
const fields = ['题名', '关键词', '作者', '出版机构']
|
||||
const types = ref<string[]>([])
|
||||
const typeOpts = ['纸质图书', '电子图书', '中文文献', '外文文献']
|
||||
const hot = ['古籍版本', '学位论文', '地方志', '民国文献']
|
||||
|
||||
const slides = [
|
||||
{ img: b1, kicker: '馆藏资源', title: '典藏中华版本,赓续中华文脉' },
|
||||
{ img: b2, kicker: '统一检索', title: '纸电一体,一站式发现' },
|
||||
{ img: b3, kicker: '联合服务', title: '多馆协同,资源互联互通' }
|
||||
]
|
||||
|
||||
const sources = [
|
||||
{ name: '馆藏资源检索', on: true },
|
||||
{ name: '版本资源库', on: false },
|
||||
{ name: '古籍善本', on: false },
|
||||
{ name: '电子文献', on: false },
|
||||
{ name: '特色专题库', on: false }
|
||||
]
|
||||
|
||||
const entries = [
|
||||
{ title: '资源检索', path: '/search', icon: 'Search' },
|
||||
{ title: '热词检索', path: '/hotwords', icon: 'Cloudy' },
|
||||
{ title: '特藏推荐', path: '/special', icon: 'Star' },
|
||||
{ title: '资源呈缴', path: '/deposit', icon: 'Upload' },
|
||||
{ title: '数据统计', path: '/analysis', icon: 'DataAnalysis' },
|
||||
{ title: '资源管理', path: '/resource', icon: 'Collection' },
|
||||
{ title: '数据采集', path: '/collect', icon: 'Download' },
|
||||
{ title: '数据治理', path: '/governance', icon: 'MagicStick' }
|
||||
]
|
||||
|
||||
const active = ref(0)
|
||||
const tick = ref(0)
|
||||
let timer: number | undefined
|
||||
const DURATION = 6000
|
||||
|
||||
function reset() {
|
||||
if (timer) window.clearTimeout(timer)
|
||||
tick.value++
|
||||
timer = window.setTimeout(() => go(active.value + 1), DURATION)
|
||||
}
|
||||
function go(i: number) {
|
||||
active.value = (i + slides.length) % slides.length
|
||||
reset()
|
||||
}
|
||||
function next() {
|
||||
go(active.value + 1)
|
||||
}
|
||||
function prev() {
|
||||
go(active.value - 1)
|
||||
}
|
||||
function pause() {
|
||||
if (timer) window.clearTimeout(timer)
|
||||
timer = undefined
|
||||
}
|
||||
function resume() {
|
||||
reset()
|
||||
}
|
||||
|
||||
function doSearch() {
|
||||
router.push({ path: '/search', query: { keyword: keyword.value } })
|
||||
}
|
||||
|
||||
onMounted(reset)
|
||||
onBeforeUnmount(pause)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="hero">
|
||||
<div class="hero-inner">
|
||||
<h1>一站式版本资源统一检索</h1>
|
||||
<p class="sub">支持纸电一体检索、表达式检索、主题联想、分面聚类检索</p>
|
||||
<div class="home" @mouseenter="pause" @mouseleave="resume">
|
||||
<!-- 全屏背景轮播 -->
|
||||
<div class="bg">
|
||||
<div
|
||||
v-for="(s, i) in slides"
|
||||
:key="i"
|
||||
class="bg-slide"
|
||||
:class="{ on: i === active }"
|
||||
:style="{ backgroundImage: `url(${s.img})` }"
|
||||
/>
|
||||
<div class="mask" />
|
||||
</div>
|
||||
|
||||
<div class="searchbox">
|
||||
<div class="row1">
|
||||
<el-select v-model="field" class="sel">
|
||||
<el-option v-for="f in fields" :key="f" :label="f" :value="f" />
|
||||
</el-select>
|
||||
<input v-model="keyword" class="ipt" placeholder="请输入检索词,支持表达式检索" @keyup.enter="doSearch" />
|
||||
<button class="btn primary" @click="doSearch">检索</button>
|
||||
<button class="btn ghost" @click="router.push('/advanced')">高级检索</button>
|
||||
</div>
|
||||
|
||||
<div class="types">
|
||||
<span class="lbl">前置筛选:</span>
|
||||
<label v-for="t in typeOpts" :key="t">
|
||||
<input type="checkbox" :value="t" v-model="types" />{{ t }}
|
||||
</label>
|
||||
</div>
|
||||
<!-- 内容层 -->
|
||||
<div class="stage">
|
||||
<div class="hero-text">
|
||||
<span class="kicker">{{ slides[active].kicker }}</span>
|
||||
<h1>{{ slides[active].title }}</h1>
|
||||
</div>
|
||||
|
||||
<div class="hot">
|
||||
<span>热门检索:</span>
|
||||
<a v-for="h in hot" :key="h" @click="keyword = h; doSearch()">{{ h }}</a>
|
||||
<div class="panel">
|
||||
<aside class="panel-side">
|
||||
<div class="side-head">
|
||||
<el-icon :size="15"><Search /></el-icon>
|
||||
<span>搜索馆藏资源</span>
|
||||
</div>
|
||||
<a v-for="s in sources" :key="s.name" class="side-item">
|
||||
{{ s.name }}
|
||||
</a>
|
||||
</aside>
|
||||
|
||||
<section class="panel-main">
|
||||
<div class="row1">
|
||||
<el-select v-model="field" class="sel">
|
||||
<el-option v-for="f in fields" :key="f" :label="f" :value="f" />
|
||||
</el-select>
|
||||
<input
|
||||
v-model="keyword"
|
||||
class="ipt"
|
||||
placeholder="请输入检索词,支持表达式检索"
|
||||
@keyup.enter="doSearch"
|
||||
/>
|
||||
<button class="btn primary" @click="doSearch">检 索</button>
|
||||
<button class="btn ghost" @click="router.push('/advanced')">高级检索</button>
|
||||
</div>
|
||||
|
||||
<div class="types">
|
||||
<span class="lbl">前置筛选:</span>
|
||||
<label v-for="t in typeOpts" :key="t">
|
||||
<input type="checkbox" :value="t" v-model="types" />{{ t }}
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<p class="hint">
|
||||
覆盖本馆订购与自建的多类型版本资源,支持纸电一体检索与全文获取。
|
||||
</p>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<!-- 快捷入口 -->
|
||||
<div class="quick">
|
||||
<div
|
||||
v-for="e in entries"
|
||||
:key="e.path"
|
||||
class="quick-item"
|
||||
@click="router.push(e.path)"
|
||||
>
|
||||
<el-icon :size="26"><component :is="e.icon" /></el-icon>
|
||||
<span>{{ e.title }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 轮播控制 -->
|
||||
<div class="ctrl">
|
||||
<button class="arrow" @click="prev">‹</button>
|
||||
<div class="dots">
|
||||
<span
|
||||
v-for="(s, i) in slides"
|
||||
:key="i"
|
||||
:class="{ on: i === active }"
|
||||
@click="go(i)"
|
||||
/>
|
||||
</div>
|
||||
<button class="arrow" @click="next">›</button>
|
||||
</div>
|
||||
|
||||
<div :key="tick" class="progress"><span /></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.hero {
|
||||
min-height: calc(100vh - 64px);
|
||||
margin: -20px -24px;
|
||||
background: var(--hero-light-img) center / cover no-repeat, #0d2a6b;
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
justify-content: center;
|
||||
padding-top: 9vh;
|
||||
overflow: hidden;
|
||||
.home {
|
||||
position: relative;
|
||||
min-height: calc(100vh - 72px);
|
||||
margin: -20px -24px;
|
||||
overflow: hidden;
|
||||
background: #16301f;
|
||||
}
|
||||
|
||||
.hero-inner {
|
||||
width: 100%;
|
||||
max-width: 900px;
|
||||
text-align: center;
|
||||
/* ---------- 背景轮播 ---------- */
|
||||
.bg {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
}
|
||||
|
||||
.bg-slide {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background-position: center;
|
||||
background-size: cover;
|
||||
opacity: 0;
|
||||
transform: scale(1.07);
|
||||
transition:
|
||||
opacity 1.1s cubic-bezier(0.4, 0, 0.2, 1),
|
||||
transform 8s cubic-bezier(0.22, 0.61, 0.36, 1);
|
||||
will-change: opacity, transform;
|
||||
|
||||
&.on {
|
||||
opacity: 1;
|
||||
transform: scale(1);
|
||||
}
|
||||
}
|
||||
|
||||
.mask {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background: linear-gradient(
|
||||
180deg,
|
||||
rgba(10, 28, 20, 0.62) 0%,
|
||||
rgba(10, 28, 20, 0.28) 38%,
|
||||
rgba(8, 24, 17, 0.68) 100%
|
||||
);
|
||||
}
|
||||
|
||||
/* ---------- 内容层 ---------- */
|
||||
.stage {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
padding: 0 20px 40px;
|
||||
z-index: 2;
|
||||
max-width: 1240px;
|
||||
margin: 0 auto;
|
||||
padding: 6vh 24px 108px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
min-height: calc(100vh - 72px);
|
||||
}
|
||||
|
||||
.hero-text {
|
||||
margin-bottom: 34px;
|
||||
color: #fff;
|
||||
|
||||
.kicker {
|
||||
display: inline-block;
|
||||
padding: 4px 12px;
|
||||
margin-bottom: 14px;
|
||||
font-size: 12px;
|
||||
letter-spacing: 3px;
|
||||
color: #dcece1;
|
||||
border: 1px solid rgba(220, 236, 225, 0.45);
|
||||
}
|
||||
|
||||
h1 {
|
||||
color: #fff;
|
||||
margin: 0;
|
||||
font-size: 46px;
|
||||
font-weight: 700;
|
||||
letter-spacing: 3px;
|
||||
margin: 0 0 18px;
|
||||
}
|
||||
|
||||
.sub {
|
||||
color: rgba(255, 255, 255, 0.82);
|
||||
font-size: 14px;
|
||||
margin: 0 0 40px;
|
||||
letter-spacing: 6px;
|
||||
text-shadow: 0 2px 18px rgba(0, 0, 0, 0.35);
|
||||
animation: rise 0.9s both;
|
||||
}
|
||||
}
|
||||
|
||||
.searchbox {
|
||||
position: relative;
|
||||
padding: 8px;
|
||||
border-radius: 10px;
|
||||
/* 毛玻璃:半透明白 + 背景模糊 + 提亮(乳白玻璃质感) */
|
||||
background: rgba(255, 255, 255, 0.76);
|
||||
backdrop-filter: blur(24px) saturate(160%) brightness(1.12);
|
||||
-webkit-backdrop-filter: blur(24px) saturate(160%) brightness(1.12);
|
||||
border: 1px solid rgba(255, 255, 255, 0.55);
|
||||
box-shadow:
|
||||
0 12px 34px rgba(0, 0, 0, 0.2),
|
||||
inset 0 1px 0 rgba(255, 255, 255, 0.6);
|
||||
@keyframes rise {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translateY(14px);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------- 半透明检索面板 ---------- */
|
||||
.panel {
|
||||
display: flex;
|
||||
background: rgba(16, 38, 28, 0.58);
|
||||
backdrop-filter: blur(22px) saturate(140%);
|
||||
-webkit-backdrop-filter: blur(22px) saturate(140%);
|
||||
border: 1px solid rgba(255, 255, 255, 0.16);
|
||||
border-radius: var(--radius-sm);
|
||||
overflow: hidden;
|
||||
box-shadow: 0 18px 46px rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
|
||||
.panel-side {
|
||||
width: 214px;
|
||||
flex: none;
|
||||
padding: 16px 0;
|
||||
background: rgba(0, 0, 0, 0.16);
|
||||
border-right: 1px solid rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
|
||||
.side-head {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 7px;
|
||||
padding: 0 18px 14px;
|
||||
margin-bottom: 6px;
|
||||
font-size: 14px;
|
||||
letter-spacing: 1px;
|
||||
color: #fff;
|
||||
border-bottom: 1px solid rgba(255, 255, 255, 0.12);
|
||||
}
|
||||
|
||||
/* 纯展示,不可点击,因此不做高亮与悬停态 */
|
||||
.side-item {
|
||||
display: block;
|
||||
padding: 14px 20px;
|
||||
font-size: 14px;
|
||||
letter-spacing: 0.5px;
|
||||
color: rgba(255, 255, 255, 0.68);
|
||||
cursor: default;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.panel-main {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
padding: 28px 30px;
|
||||
}
|
||||
|
||||
.row1 {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
padding: 8px;
|
||||
background: #fff;
|
||||
border-radius: var(--radius-sm);
|
||||
}
|
||||
|
||||
.sel { width: 120px; flex: none; }
|
||||
.sel :deep(.el-input__wrapper) {
|
||||
background: transparent;
|
||||
box-shadow: none;
|
||||
.sel {
|
||||
width: 120px;
|
||||
flex: none;
|
||||
|
||||
:deep(.el-input__wrapper) {
|
||||
background: transparent;
|
||||
box-shadow: none;
|
||||
}
|
||||
}
|
||||
|
||||
.ipt {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
height: 54px;
|
||||
padding: 0 10px;
|
||||
border: none;
|
||||
outline: none;
|
||||
font-size: 15px;
|
||||
padding: 0 12px;
|
||||
height: 54px;
|
||||
color: #303133;
|
||||
color: var(--text-main);
|
||||
|
||||
&::placeholder {
|
||||
color: #b7bec9;
|
||||
color: #a9b6ac;
|
||||
}
|
||||
}
|
||||
|
||||
.btn {
|
||||
height: 54px;
|
||||
padding: 0 30px;
|
||||
border: none;
|
||||
font-size: 16px;
|
||||
cursor: pointer;
|
||||
background-size: 100% 100%;
|
||||
background-repeat: no-repeat;
|
||||
flex: none;
|
||||
height: 54px;
|
||||
padding: 0 32px;
|
||||
border: none;
|
||||
border-radius: var(--radius-sm);
|
||||
font-size: 15px;
|
||||
letter-spacing: 2px;
|
||||
cursor: pointer;
|
||||
transition: all 0.22s;
|
||||
}
|
||||
|
||||
.btn.primary {
|
||||
color: #fff;
|
||||
background-image: var(--btn-primary-img);
|
||||
background: linear-gradient(180deg, #6aa889, #4f8a6b);
|
||||
|
||||
&:hover {
|
||||
background: linear-gradient(180deg, #78b697, #57956f);
|
||||
}
|
||||
}
|
||||
|
||||
.btn.ghost {
|
||||
color: var(--brand-primary);
|
||||
background-image: var(--btn-ghost-img);
|
||||
color: var(--brand-primary-deep);
|
||||
background: #fff;
|
||||
border: 1px solid #cfe0d5;
|
||||
letter-spacing: 1px;
|
||||
|
||||
&:hover {
|
||||
background: var(--brand-light);
|
||||
border-color: var(--brand-primary);
|
||||
}
|
||||
}
|
||||
|
||||
.types {
|
||||
margin-top: 8px;
|
||||
padding: 8px 6px 2px;
|
||||
display: flex;
|
||||
gap: 18px;
|
||||
align-items: center;
|
||||
color: #43506b;
|
||||
gap: 18px;
|
||||
margin-top: 16px;
|
||||
font-size: 13px;
|
||||
border-top: 1px solid rgba(255, 255, 255, 0.7);
|
||||
color: rgba(255, 255, 255, 0.72);
|
||||
|
||||
.lbl { color: #5d688a; }
|
||||
.lbl {
|
||||
color: rgba(255, 255, 255, 0.5);
|
||||
}
|
||||
|
||||
label {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 5px;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
.hot {
|
||||
margin-top: 32px;
|
||||
color: rgba(255, 255, 255, 0.8);
|
||||
font-size: 13px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 12px;
|
||||
|
||||
a {
|
||||
color: #fff;
|
||||
cursor: pointer;
|
||||
padding: 6px 18px;
|
||||
border-radius: 16px;
|
||||
background: rgba(255, 255, 255, 0.18);
|
||||
border: 1px solid rgba(255, 255, 255, 0.4);
|
||||
backdrop-filter: blur(12px) saturate(150%);
|
||||
-webkit-backdrop-filter: blur(12px) saturate(150%);
|
||||
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
|
||||
|
||||
&:hover {
|
||||
background: rgba(255, 255, 255, 0.3);
|
||||
input {
|
||||
accent-color: var(--brand-gold-light);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.hint {
|
||||
margin: 12px 0 0;
|
||||
font-size: 12px;
|
||||
line-height: 1.7;
|
||||
color: rgba(255, 255, 255, 0.45);
|
||||
}
|
||||
|
||||
/* ---------- 快捷入口 ---------- */
|
||||
.quick {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(8, 1fr);
|
||||
gap: 10px;
|
||||
margin-top: 28px;
|
||||
}
|
||||
|
||||
.quick-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
padding: 24px 8px;
|
||||
color: #fff;
|
||||
font-size: 13px;
|
||||
letter-spacing: 0.5px;
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
border: 1px solid rgba(255, 255, 255, 0.16);
|
||||
border-radius: var(--radius-sm);
|
||||
backdrop-filter: blur(14px);
|
||||
-webkit-backdrop-filter: blur(14px);
|
||||
cursor: pointer;
|
||||
transition: all 0.24s;
|
||||
|
||||
&:hover {
|
||||
background: rgba(255, 255, 255, 0.22);
|
||||
border-color: rgba(255, 255, 255, 0.36);
|
||||
transform: translateY(-3px);
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------- 轮播控制 ---------- */
|
||||
.ctrl {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
bottom: 26px;
|
||||
z-index: 3;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 14px;
|
||||
transform: translateX(-50%);
|
||||
}
|
||||
|
||||
.arrow {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 18px;
|
||||
line-height: 1;
|
||||
color: rgba(255, 255, 255, 0.8);
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
border: 1px solid rgba(255, 255, 255, 0.22);
|
||||
border-radius: 50%;
|
||||
cursor: pointer;
|
||||
transition: all 0.24s;
|
||||
|
||||
&:hover {
|
||||
color: #fff;
|
||||
background: rgba(255, 255, 255, 0.22);
|
||||
}
|
||||
}
|
||||
|
||||
.dots {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
|
||||
span {
|
||||
width: 22px;
|
||||
height: 2px;
|
||||
background: rgba(255, 255, 255, 0.35);
|
||||
cursor: pointer;
|
||||
transition: all 0.3s;
|
||||
|
||||
&.on {
|
||||
width: 40px;
|
||||
background: var(--brand-gold-light);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.progress {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
z-index: 3;
|
||||
height: 2px;
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
|
||||
span {
|
||||
display: block;
|
||||
height: 100%;
|
||||
background: linear-gradient(90deg, var(--brand-primary), var(--brand-gold-light));
|
||||
animation: grow 6s linear forwards;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes grow {
|
||||
from {
|
||||
width: 0;
|
||||
}
|
||||
to {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------- 响应式 ---------- */
|
||||
@media (max-width: 1080px) {
|
||||
.quick {
|
||||
grid-template-columns: repeat(4, 1fr);
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 760px) {
|
||||
.hero-text h1 {
|
||||
font-size: 24px;
|
||||
letter-spacing: 2px;
|
||||
}
|
||||
|
||||
.panel {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.panel-side {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.quick {
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -47,7 +47,7 @@ async function handleLogin() {
|
||||
<div class="login-page">
|
||||
<div class="login-box">
|
||||
<div class="login-title">
|
||||
<el-icon :size="30" color="#409eff"><Collection /></el-icon>
|
||||
<el-icon :size="30" color="#9ec7ae"><Collection /></el-icon>
|
||||
<h2>版本资源联合服务系统</h2>
|
||||
<p>数据集成库 · 检索发现 · 大数据分析</p>
|
||||
</div>
|
||||
@@ -84,38 +84,47 @@ async function handleLogin() {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: var(--header-bg);
|
||||
background:
|
||||
radial-gradient(760px 420px at 50% -12%, rgba(190, 225, 200, 0.3), transparent 62%),
|
||||
radial-gradient(520px 320px at 88% 108%, rgba(169, 201, 173, 0.16), transparent 70%),
|
||||
linear-gradient(180deg, #3a6b52 0%, #1f3f2f 100%);
|
||||
}
|
||||
|
||||
.login-box {
|
||||
width: 380px;
|
||||
padding: 36px 32px 24px;
|
||||
width: 386px;
|
||||
padding: 40px 34px 26px;
|
||||
background: #fff;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
|
||||
border: 1px solid rgba(180, 214, 190, 0.5);
|
||||
border-radius: 3px;
|
||||
box-shadow: 0 20px 56px rgba(0, 0, 0, 0.32);
|
||||
|
||||
.login-title {
|
||||
text-align: center;
|
||||
margin-bottom: 24px;
|
||||
margin-bottom: 26px;
|
||||
|
||||
h2 {
|
||||
margin: 12px 0 6px;
|
||||
font-size: 19px;
|
||||
color: #303133;
|
||||
margin: 14px 0 8px;
|
||||
font-family: 'Noto Serif SC', 'Source Han Serif SC', 'Songti SC', 'STSong',
|
||||
'SimSun', serif;
|
||||
font-size: 20px;
|
||||
font-weight: 700;
|
||||
letter-spacing: 2px;
|
||||
color: #23362c;
|
||||
}
|
||||
|
||||
p {
|
||||
margin: 0;
|
||||
font-size: 12px;
|
||||
color: #909399;
|
||||
letter-spacing: 1px;
|
||||
color: #a1937f;
|
||||
}
|
||||
}
|
||||
|
||||
.login-tip {
|
||||
text-align: center;
|
||||
font-size: 12px;
|
||||
color: #c0c4cc;
|
||||
margin-top: 8px;
|
||||
color: #c3b5a1;
|
||||
margin-top: 10px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -36,6 +36,7 @@ async function loadAll() {
|
||||
|
||||
const ratio = await getResourceRatio()
|
||||
initChart(ratioRef.value)?.setOption({
|
||||
color: ['#5b9a78', '#9dc4ac', '#2f5d47', '#cfe3d3', '#7cb094', '#b4cdbd'],
|
||||
tooltip: { trigger: 'item' },
|
||||
legend: { bottom: 0 },
|
||||
series: [
|
||||
@@ -51,6 +52,7 @@ async function loadAll() {
|
||||
const year = await getYearDistribution()
|
||||
initChart(yearRef.value)?.setOption({
|
||||
tooltip: { trigger: 'axis' },
|
||||
color: ['#5b9a78'],
|
||||
grid: { left: 45, right: 20, top: 30, bottom: 30 },
|
||||
xAxis: { type: 'category', data: year.map((y) => y.year) },
|
||||
yAxis: { type: 'value' },
|
||||
@@ -80,7 +82,7 @@ async function loadAll() {
|
||||
name: '资源量',
|
||||
type: 'bar',
|
||||
barMaxWidth: 36,
|
||||
itemStyle: { color: '#409eff' },
|
||||
itemStyle: { color: '#5b9a78' },
|
||||
data: contrib.map((c) => c.value)
|
||||
}
|
||||
]
|
||||
@@ -99,7 +101,7 @@ async function loadAll() {
|
||||
{
|
||||
name: '检索次数',
|
||||
type: 'bar',
|
||||
itemStyle: { color: '#67c23a' },
|
||||
itemStyle: { color: '#9dc4ac' },
|
||||
data: hotKeywords.value.slice(0, 10).map((k) => k.value)
|
||||
}
|
||||
]
|
||||
|
||||
@@ -42,10 +42,11 @@ function search() {
|
||||
max-width: 820px;
|
||||
margin: 20px auto;
|
||||
background: #fff;
|
||||
border-radius: 8px;
|
||||
border: 1px solid var(--card-border);
|
||||
border-radius: var(--radius-sm);
|
||||
padding: 24px;
|
||||
|
||||
h2 { margin: 0 0 20px; font-size: 18px; }
|
||||
h2 { margin: 0 0 20px; font-size: 19px; letter-spacing: 1px; }
|
||||
}
|
||||
|
||||
.row {
|
||||
|
||||
@@ -0,0 +1,234 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, onMounted, ref } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { getHotKeywords } from '@/api/analysis'
|
||||
import type { FacetItem } from '@/api/search'
|
||||
|
||||
const router = useRouter()
|
||||
const loading = ref(false)
|
||||
const list = ref<FacetItem[]>([])
|
||||
|
||||
/** 排名越靠前,字号(云朵)越大 */
|
||||
function sizeOf(index: number) {
|
||||
return Math.max(13, 28 - index * 0.85)
|
||||
}
|
||||
|
||||
function styleOf(index: number) {
|
||||
return { fontSize: `${sizeOf(index).toFixed(1)}px` }
|
||||
}
|
||||
|
||||
function tierOf(index: number) {
|
||||
if (index < 3) return 'top'
|
||||
if (index < 10) return 'mid'
|
||||
return 'rest'
|
||||
}
|
||||
|
||||
const totalCount = computed(() =>
|
||||
list.value.reduce((sum, item) => sum + (Number(item.value) || 0), 0)
|
||||
)
|
||||
|
||||
function go(keyword: string) {
|
||||
router.push({ path: '/search', query: { keyword } })
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
list.value = (await getHotKeywords(30)) || []
|
||||
} catch {
|
||||
list.value = []
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="hot-page">
|
||||
<div class="head">
|
||||
<div>
|
||||
<h2 class="page-title">检索热词</h2>
|
||||
<p class="desc">按检索热度排序,排名越靠前,云朵越大</p>
|
||||
</div>
|
||||
<div v-if="list.length" class="stat">
|
||||
<span class="num">{{ list.length }}</span>
|
||||
<span class="unit">个热词</span>
|
||||
<em>累计检索 {{ totalCount }} 次</em>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-loading="loading" class="field">
|
||||
<div
|
||||
v-for="(k, i) in list"
|
||||
:key="k.name"
|
||||
class="cloud"
|
||||
:class="tierOf(i)"
|
||||
:style="styleOf(i)"
|
||||
:title="`第 ${i + 1} 位 · 检索 ${k.value} 次`"
|
||||
@click="go(k.name)"
|
||||
>
|
||||
<span class="rank">{{ String(i + 1).padStart(2, '0') }}</span>
|
||||
<span class="word">{{ k.name }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<el-empty v-if="!loading && !list.length" description="暂无热词数据" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.hot-page {
|
||||
max-width: 1180px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.head {
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
justify-content: space-between;
|
||||
gap: 20px;
|
||||
padding-bottom: 16px;
|
||||
margin-bottom: 22px;
|
||||
border-bottom: 1px solid var(--hair-line);
|
||||
|
||||
.page-title {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.desc {
|
||||
margin: 0;
|
||||
font-size: 13px;
|
||||
letter-spacing: 1px;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
}
|
||||
|
||||
.stat {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
gap: 6px;
|
||||
font-size: 12px;
|
||||
color: var(--text-muted);
|
||||
|
||||
.num {
|
||||
font-family: 'Noto Serif SC', 'Songti SC', serif;
|
||||
font-size: 26px;
|
||||
font-weight: 700;
|
||||
color: var(--brand-primary);
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
em {
|
||||
font-style: normal;
|
||||
margin-left: 10px;
|
||||
color: #b3a48f;
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------- 云朵区 ---------- */
|
||||
.field {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 22px 16px;
|
||||
min-height: 420px;
|
||||
padding: 58px 34px 46px;
|
||||
background:
|
||||
radial-gradient(620px 280px at 50% 0%, rgba(91, 154, 120, 0.1), transparent 68%),
|
||||
radial-gradient(520px 240px at 82% 100%, rgba(47, 93, 71, 0.07), transparent 70%),
|
||||
#fff;
|
||||
border: 1px solid var(--card-border);
|
||||
border-radius: var(--radius-sm);
|
||||
}
|
||||
|
||||
/* 云朵:胶囊主体 + 两处鼓包,合并为柔和云形 */
|
||||
.cloud {
|
||||
position: relative;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.5em;
|
||||
padding: 0.52em 1.35em;
|
||||
background: #fff;
|
||||
border-radius: 999px;
|
||||
color: #3d4f44;
|
||||
cursor: pointer;
|
||||
filter: drop-shadow(0 6px 14px rgba(31, 63, 47, 0.12));
|
||||
transition: transform 0.22s, filter 0.22s;
|
||||
|
||||
/* 顶部两团鼓包 */
|
||||
&::before,
|
||||
&::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
border-radius: 50%;
|
||||
background: inherit;
|
||||
}
|
||||
|
||||
&::before {
|
||||
left: 14%;
|
||||
top: -0.7em;
|
||||
width: 1.45em;
|
||||
height: 1.45em;
|
||||
}
|
||||
|
||||
&::after {
|
||||
right: 16%;
|
||||
top: -0.52em;
|
||||
width: 1.1em;
|
||||
height: 1.1em;
|
||||
}
|
||||
|
||||
.rank,
|
||||
.word {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.rank {
|
||||
font-size: 0.5em;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.5px;
|
||||
color: #a9c4b2;
|
||||
}
|
||||
|
||||
.word {
|
||||
font-family: 'Noto Serif SC', 'Source Han Serif SC', 'Songti SC', 'STSong',
|
||||
'SimSun', serif;
|
||||
font-weight: 700;
|
||||
letter-spacing: 1px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
transform: translateY(-3px);
|
||||
filter: drop-shadow(0 10px 20px rgba(31, 63, 47, 0.2));
|
||||
}
|
||||
}
|
||||
|
||||
/* 前三名:描金云朵 */
|
||||
.cloud.top {
|
||||
background: linear-gradient(180deg, #eef7f0, #d6eadc);
|
||||
color: #23503a;
|
||||
|
||||
.rank {
|
||||
color: #6fa287;
|
||||
}
|
||||
}
|
||||
|
||||
/* 4-10 名:米白云朵 */
|
||||
.cloud.mid {
|
||||
background: linear-gradient(180deg, #ffffff, #f3f9f4);
|
||||
}
|
||||
|
||||
/* 其余:纯白云朵 */
|
||||
.cloud.rest {
|
||||
background: #fff;
|
||||
color: #5c6f63;
|
||||
font-weight: 400;
|
||||
|
||||
.word {
|
||||
font-weight: 400;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -175,7 +175,8 @@ onMounted(() => {
|
||||
width: 210px;
|
||||
flex: none;
|
||||
background: #fff;
|
||||
border-radius: 8px;
|
||||
border: 1px solid var(--card-border);
|
||||
border-radius: var(--radius-sm);
|
||||
padding: 12px;
|
||||
height: fit-content;
|
||||
|
||||
@@ -213,7 +214,8 @@ onMounted(() => {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
background: #fff;
|
||||
border-radius: 8px;
|
||||
border: 1px solid var(--card-border);
|
||||
border-radius: var(--radius-sm);
|
||||
padding: 14px;
|
||||
cursor: pointer;
|
||||
transition: box-shadow 0.2s;
|
||||
|
||||
@@ -7,7 +7,7 @@ const list = ref<SpecialResource[]>([])
|
||||
const dialogVisible = ref(false)
|
||||
const current = ref<SpecialResource | null>(null)
|
||||
|
||||
const palette = ['#8e6b3f', '#4a6fa5', '#5a8f5a', '#a54a4a', '#7a5ca8', '#3f8e8a']
|
||||
const palette = ['#5b9a78', '#7cb094', '#2f5d47', '#9dc4ac', '#4a7c5f', '#b4cdbd']
|
||||
|
||||
async function fetchList() {
|
||||
loading.value = true
|
||||
|
||||
Reference in New Issue
Block a user