项目框架
This commit is contained in:
@@ -0,0 +1,162 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
|
||||
const router = useRouter()
|
||||
const keyword = ref('')
|
||||
const field = ref('题名')
|
||||
const fields = ['题名', '关键词', '作者', '出版机构']
|
||||
const types = ref<string[]>([])
|
||||
const typeOpts = ['纸质图书', '电子图书', '中文文献', '外文文献']
|
||||
const hot = ['古籍版本', '学位论文', '地方志', '民国文献']
|
||||
|
||||
function doSearch() {
|
||||
router.push({ path: '/search', query: { keyword: keyword.value } })
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="hero">
|
||||
<div class="hero-inner">
|
||||
<h1>一站式版本资源统一检索</h1>
|
||||
<p class="sub">支持纸电一体检索、表达式检索、主题联想、分面聚类检索</p>
|
||||
|
||||
<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>
|
||||
|
||||
<div class="hot">
|
||||
<span>热门检索:</span>
|
||||
<a v-for="h in hot" :key="h" @click="keyword = h; doSearch()">{{ h }}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.hero {
|
||||
min-height: calc(100vh - 64px);
|
||||
margin: -20px -24px;
|
||||
background: var(--page-bg-img) center / cover no-repeat, #0d2a6b;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
|
||||
&::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background: var(--hero-light-img) center bottom / contain no-repeat;
|
||||
filter: var(--hero-filter);
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
&::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
height: 42%;
|
||||
background: var(--hero-blur-img) center bottom / cover no-repeat;
|
||||
filter: var(--hero-filter);
|
||||
pointer-events: none;
|
||||
}
|
||||
}
|
||||
|
||||
.hero-inner {
|
||||
width: 100%;
|
||||
max-width: 900px;
|
||||
text-align: center;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
padding: 40px 20px;
|
||||
|
||||
h1 {
|
||||
color: #fff;
|
||||
font-size: 42px;
|
||||
letter-spacing: 2px;
|
||||
margin: 0 0 14px;
|
||||
}
|
||||
|
||||
.sub {
|
||||
color: rgba(255, 255, 255, 0.82);
|
||||
font-size: 14px;
|
||||
margin: 0 0 40px;
|
||||
}
|
||||
}
|
||||
|
||||
.searchbox {
|
||||
display: flex;
|
||||
background: #fff;
|
||||
border-radius: 6px;
|
||||
padding: 6px;
|
||||
gap: 6px;
|
||||
align-items: center;
|
||||
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
|
||||
}
|
||||
|
||||
.sel { width: 120px; flex: none; }
|
||||
.sel :deep(.el-input__wrapper) { box-shadow: none; }
|
||||
|
||||
.ipt {
|
||||
flex: 1;
|
||||
border: none;
|
||||
outline: none;
|
||||
font-size: 15px;
|
||||
padding: 0 8px;
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
.btn {
|
||||
height: 40px;
|
||||
padding: 0 26px;
|
||||
border: none;
|
||||
border-radius: 4px;
|
||||
font-size: 15px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.btn.primary { background: var(--brand-primary); color: #fff; }
|
||||
.btn.ghost { background: #fff; color: var(--brand-primary); border: 1px solid var(--brand-primary); }
|
||||
|
||||
.types {
|
||||
margin-top: 22px;
|
||||
display: flex;
|
||||
gap: 26px;
|
||||
justify-content: center;
|
||||
color: rgba(255, 255, 255, 0.9);
|
||||
font-size: 13px;
|
||||
|
||||
label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
|
||||
}
|
||||
|
||||
.hot {
|
||||
margin-top: 26px;
|
||||
color: rgba(255, 255, 255, 0.75);
|
||||
font-size: 13px;
|
||||
|
||||
a {
|
||||
margin-left: 14px;
|
||||
color: #fff;
|
||||
cursor: pointer;
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user