页面优化 数据采集 优化 / 提示 / 提纯
This commit is contained in:
@@ -28,7 +28,7 @@ const sources = [
|
||||
]
|
||||
|
||||
/* ---------- 3D 书架:一本书对应一条特藏,点击进入特藏详情 ---------- */
|
||||
const bookColors = ['#2c4d40', '#7a2e2e', '#2b3a67', '#b3862d', '#5a2e42']
|
||||
const bookColors = ['#2c4d40', '#7a2e2e', '#2b3a67', '#8a6420', '#5a2e42']
|
||||
|
||||
const specials = ref<SpecialRecommendItem[]>([])
|
||||
const bookMeta = ref<
|
||||
@@ -326,10 +326,10 @@ onBeforeUnmount(pause)
|
||||
/* ---------- 半透明检索面板 ---------- */
|
||||
.panel {
|
||||
display: flex;
|
||||
background: rgba(16, 38, 28, 0.58);
|
||||
background: var(--header-glass);
|
||||
backdrop-filter: blur(22px) saturate(140%);
|
||||
-webkit-backdrop-filter: blur(22px) saturate(140%);
|
||||
border: 1px solid rgba(255, 255, 255, 0.16);
|
||||
border: 1px solid rgba(232, 215, 168, 0.35);
|
||||
border-radius: var(--radius-sm);
|
||||
overflow: hidden;
|
||||
box-shadow: 0 18px 46px rgba(0, 0, 0, 0.3);
|
||||
@@ -423,22 +423,22 @@ onBeforeUnmount(pause)
|
||||
|
||||
.btn.primary {
|
||||
color: #fff;
|
||||
background: linear-gradient(180deg, #6aa889, #4f8a6b);
|
||||
background: var(--btn-primary-bg);
|
||||
|
||||
&:hover {
|
||||
background: linear-gradient(180deg, #78b697, #57956f);
|
||||
background: var(--btn-primary-hover);
|
||||
}
|
||||
}
|
||||
|
||||
.btn.ghost {
|
||||
color: var(--brand-primary-deep);
|
||||
background: #fff;
|
||||
border: 1px solid #cfe0d5;
|
||||
border: 1px solid var(--brand-gold);
|
||||
letter-spacing: 1px;
|
||||
|
||||
&:hover {
|
||||
background: var(--brand-light);
|
||||
border-color: var(--brand-primary);
|
||||
background: var(--paper-warm);
|
||||
border-color: var(--brand-gold-deep);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -566,7 +566,7 @@ onBeforeUnmount(pause)
|
||||
font-family: 'Kaiti SC', 'STKaiti', 'KaiTi', '楷体', serif;
|
||||
font-size: 15px;
|
||||
letter-spacing: 5px;
|
||||
color: #b8862d;
|
||||
color: var(--brand-gold);
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
padding: 10px 0;
|
||||
@@ -702,6 +702,17 @@ onBeforeUnmount(pause)
|
||||
}
|
||||
|
||||
/* ---------- 响应式 ---------- */
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.book-inner,
|
||||
.book-shadow::before,
|
||||
.hero-text h1,
|
||||
.progress span,
|
||||
.bg-slide {
|
||||
animation: none;
|
||||
transition: none;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 1080px) {
|
||||
.shelf {
|
||||
flex-wrap: wrap;
|
||||
|
||||
@@ -45,9 +45,14 @@ async function handleLogin() {
|
||||
|
||||
<template>
|
||||
<div class="login-page">
|
||||
<aside class="login-visual" aria-hidden="true">
|
||||
<p class="visual-kicker">纸电一体 · 版本馆藏</p>
|
||||
<h1>典藏中华版本<br />赓续中华文脉</h1>
|
||||
</aside>
|
||||
<div class="login-panel">
|
||||
<div class="login-box">
|
||||
<div class="login-title">
|
||||
<el-icon :size="30" color="#9ec7ae"><Collection /></el-icon>
|
||||
<el-icon class="login-mark" :size="28"><Collection /></el-icon>
|
||||
<h2>版本资源联合服务系统</h2>
|
||||
<p>数据集成库 · 检索发现 · 大数据分析</p>
|
||||
</div>
|
||||
@@ -75,28 +80,76 @@ async function handleLogin() {
|
||||
|
||||
<div class="login-tip">默认账号:admin / admin123</div>
|
||||
</div>
|
||||
<p class="copyright">版本馆 · 纸电版本资源联合服务</p>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.login-page {
|
||||
height: 100vh;
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
background: var(--page-bg);
|
||||
}
|
||||
|
||||
.login-visual {
|
||||
position: relative;
|
||||
flex: 1.15;
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: flex-end;
|
||||
padding: 64px 56px;
|
||||
color: var(--text-on-dark);
|
||||
background:
|
||||
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;
|
||||
|
||||
&::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 28px;
|
||||
right: 28px;
|
||||
bottom: 28px;
|
||||
left: 28px;
|
||||
border: 1px solid rgba(232, 215, 168, 0.45);
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
h1 {
|
||||
position: relative;
|
||||
margin: 12px 0 0;
|
||||
font-size: 40px;
|
||||
line-height: 1.35;
|
||||
letter-spacing: 4px;
|
||||
font-weight: 700;
|
||||
}
|
||||
}
|
||||
|
||||
.visual-kicker {
|
||||
position: relative;
|
||||
margin: 0;
|
||||
letter-spacing: 4px;
|
||||
color: var(--brand-gold-light);
|
||||
}
|
||||
|
||||
.login-panel {
|
||||
flex: 0.85;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
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%);
|
||||
padding: 40px 24px;
|
||||
}
|
||||
|
||||
.login-box {
|
||||
width: 386px;
|
||||
width: 400px;
|
||||
max-width: 100%;
|
||||
padding: 40px 34px 26px;
|
||||
background: #fff;
|
||||
border: 1px solid rgba(180, 214, 190, 0.5);
|
||||
border-radius: 3px;
|
||||
box-shadow: 0 20px 56px rgba(0, 0, 0, 0.32);
|
||||
background: var(--card-bg);
|
||||
border: 1px solid var(--card-gold-border);
|
||||
border-radius: var(--radius-sm);
|
||||
box-shadow: var(--shadow-card);
|
||||
|
||||
.login-title {
|
||||
text-align: center;
|
||||
@@ -104,27 +157,53 @@ async function handleLogin() {
|
||||
|
||||
h2 {
|
||||
margin: 14px 0 8px;
|
||||
font-family: 'Noto Serif SC', 'Source Han Serif SC', 'Songti SC', 'STSong',
|
||||
'SimSun', serif;
|
||||
font-size: 20px;
|
||||
font-size: 22px;
|
||||
font-weight: 700;
|
||||
letter-spacing: 2px;
|
||||
color: #23362c;
|
||||
color: var(--text-main);
|
||||
}
|
||||
|
||||
p {
|
||||
margin: 0;
|
||||
font-size: 12px;
|
||||
letter-spacing: 1px;
|
||||
color: #a1937f;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
}
|
||||
|
||||
.login-tip {
|
||||
text-align: center;
|
||||
font-size: 12px;
|
||||
color: #c3b5a1;
|
||||
color: var(--text-muted);
|
||||
margin-top: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.login-mark {
|
||||
color: var(--brand-gold);
|
||||
}
|
||||
|
||||
.copyright {
|
||||
margin: 18px 0 0;
|
||||
font-size: 12px;
|
||||
letter-spacing: 1px;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
@media (max-width: 860px) {
|
||||
.login-page {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.login-visual {
|
||||
min-height: 220px;
|
||||
flex: none;
|
||||
padding: 36px 28px;
|
||||
|
||||
h1 {
|
||||
font-size: 26px;
|
||||
letter-spacing: 2px;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -5,19 +5,59 @@ const router = useRouter()
|
||||
|
||||
<template>
|
||||
<div class="not-found">
|
||||
<el-result icon="warning" title="404" sub-title="页面不存在">
|
||||
<template #extra>
|
||||
<el-button type="primary" @click="router.push('/')">返回首页</el-button>
|
||||
</template>
|
||||
</el-result>
|
||||
<div class="seal" aria-hidden="true">未录</div>
|
||||
<p class="code">404</p>
|
||||
<h1>页面不在馆藏目录中</h1>
|
||||
<p class="sub">您访问的地址没有对应页面,可返回首页继续检索。</p>
|
||||
<el-button type="primary" @click="router.push('/')">返回首页</el-button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
<style scoped lang="scss">
|
||||
.not-found {
|
||||
height: 100vh;
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 32px;
|
||||
background:
|
||||
radial-gradient(420px 180px at 50% 0%, rgba(184, 134, 45, 0.08), transparent 70%),
|
||||
var(--page-bg);
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.seal {
|
||||
width: 64px;
|
||||
height: 64px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-bottom: 12px;
|
||||
border: 2px solid var(--brand-gold);
|
||||
color: var(--brand-gold-deep);
|
||||
font-family: var(--font-kai);
|
||||
letter-spacing: 2px;
|
||||
transform: rotate(-8deg);
|
||||
}
|
||||
|
||||
.code {
|
||||
margin: 0;
|
||||
font-family: var(--font-serif);
|
||||
font-size: 72px;
|
||||
line-height: 1;
|
||||
letter-spacing: 6px;
|
||||
color: var(--brand-primary-deep);
|
||||
}
|
||||
|
||||
h1 {
|
||||
margin: 8px 0 8px;
|
||||
font-size: 22px;
|
||||
letter-spacing: 2px;
|
||||
}
|
||||
|
||||
.sub {
|
||||
margin: 0 0 22px;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -534,17 +534,16 @@ onMounted(() => {
|
||||
|
||||
.page-title {
|
||||
margin: 0 0 12px;
|
||||
font-family: 'Noto Serif SC', 'Songti SC', 'SimSun', serif;
|
||||
font-size: 22px;
|
||||
letter-spacing: 2px;
|
||||
color: #1d3a2a;
|
||||
}
|
||||
|
||||
.admin-tabs {
|
||||
background: #fff;
|
||||
border-radius: 10px;
|
||||
background: var(--card-bg);
|
||||
border: 1px solid var(--card-gold-border);
|
||||
border-radius: var(--radius-sm);
|
||||
padding: 8px 20px 20px;
|
||||
box-shadow: 0 2px 10px rgba(20, 45, 30, 0.06);
|
||||
box-shadow: var(--shadow-card);
|
||||
}
|
||||
|
||||
.toolbar {
|
||||
@@ -592,8 +591,11 @@ onMounted(() => {
|
||||
}
|
||||
|
||||
.panel-title {
|
||||
font-family: var(--font-serif);
|
||||
font-weight: 600;
|
||||
color: #1d3a2a;
|
||||
color: var(--text-main);
|
||||
padding-left: 10px;
|
||||
border-left: 2px solid var(--brand-gold);
|
||||
}
|
||||
|
||||
.link {
|
||||
@@ -608,6 +610,6 @@ onMounted(() => {
|
||||
.form-tip {
|
||||
margin-left: 10px;
|
||||
font-size: 12px;
|
||||
color: #999;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -22,6 +22,11 @@ const contribRef = ref<HTMLElement>()
|
||||
const hotRef = ref<HTMLElement>()
|
||||
const charts: echarts.ECharts[] = []
|
||||
|
||||
function cssVar(name: string, fallback: string) {
|
||||
const value = getComputedStyle(document.documentElement).getPropertyValue(name).trim()
|
||||
return value || fallback
|
||||
}
|
||||
|
||||
function initChart(el?: HTMLElement) {
|
||||
if (!el) return null
|
||||
const c = echarts.init(el)
|
||||
@@ -34,11 +39,20 @@ async function loadAll() {
|
||||
hotKeywords.value = await getHotKeywords(20)
|
||||
recent.value = await getRecentActivity()
|
||||
|
||||
const ink = cssVar('--brand-primary-deep', '#2f5d47')
|
||||
const leaf = cssVar('--brand-primary', '#5b9a78')
|
||||
const mist = cssVar('--brand-primary-soft', '#6fa88a')
|
||||
const gold = cssVar('--brand-gold', '#b8862d')
|
||||
const goldDeep = cssVar('--brand-gold-deep', '#8a6420')
|
||||
const paper = cssVar('--text-main', '#23362c')
|
||||
const axis = { axisLabel: { color: paper, fontFamily: 'PingFang SC, Microsoft YaHei, sans-serif' } }
|
||||
const tip = { textStyle: { fontFamily: 'PingFang SC, Microsoft YaHei, sans-serif', color: paper } }
|
||||
|
||||
const ratio = await getResourceRatio()
|
||||
initChart(ratioRef.value)?.setOption({
|
||||
color: ['#5b9a78', '#9dc4ac', '#2f5d47', '#cfe3d3', '#7cb094', '#b4cdbd'],
|
||||
tooltip: { trigger: 'item' },
|
||||
legend: { bottom: 0 },
|
||||
color: [ink, gold, leaf, goldDeep, mist, cssVar('--brand-light', '#eaf4ed')],
|
||||
tooltip: { trigger: 'item', ...tip },
|
||||
legend: { bottom: 0, textStyle: { color: paper } },
|
||||
series: [
|
||||
{
|
||||
name: '资源比例',
|
||||
@@ -51,17 +65,25 @@ async function loadAll() {
|
||||
|
||||
const year = await getYearDistribution()
|
||||
initChart(yearRef.value)?.setOption({
|
||||
tooltip: { trigger: 'axis' },
|
||||
color: ['#5b9a78'],
|
||||
tooltip: { trigger: 'axis', ...tip },
|
||||
color: [goldDeep],
|
||||
grid: { left: 45, right: 20, top: 30, bottom: 30 },
|
||||
xAxis: { type: 'category', data: year.map((y) => y.year) },
|
||||
yAxis: { type: 'value' },
|
||||
xAxis: { type: 'category', data: year.map((y) => y.year), ...axis },
|
||||
yAxis: { type: 'value', ...axis },
|
||||
series: [
|
||||
{
|
||||
name: '资源量',
|
||||
type: 'line',
|
||||
smooth: true,
|
||||
areaStyle: { opacity: 0.15 },
|
||||
symbol: 'circle',
|
||||
lineStyle: { color: goldDeep, width: 2 },
|
||||
itemStyle: { color: gold },
|
||||
areaStyle: {
|
||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||
{ offset: 0, color: gold },
|
||||
{ offset: 1, color: 'rgba(47, 93, 71, 0.02)' }
|
||||
])
|
||||
},
|
||||
data: year.map((y) => y.count)
|
||||
}
|
||||
]
|
||||
@@ -69,39 +91,50 @@ async function loadAll() {
|
||||
|
||||
const contrib = await getLibraryContribution()
|
||||
initChart(contribRef.value)?.setOption({
|
||||
tooltip: { trigger: 'axis' },
|
||||
tooltip: { trigger: 'axis', ...tip },
|
||||
grid: { left: 45, right: 20, top: 30, bottom: 60 },
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
data: contrib.map((c) => c.name),
|
||||
axisLabel: { rotate: 25, fontSize: 10 }
|
||||
axisLabel: { rotate: 25, fontSize: 10, color: paper }
|
||||
},
|
||||
yAxis: { type: 'value' },
|
||||
yAxis: { type: 'value', ...axis },
|
||||
series: [
|
||||
{
|
||||
name: '资源量',
|
||||
type: 'bar',
|
||||
barMaxWidth: 36,
|
||||
itemStyle: { color: '#5b9a78' },
|
||||
itemStyle: {
|
||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||
{ offset: 0, color: gold },
|
||||
{ offset: 1, color: ink }
|
||||
])
|
||||
},
|
||||
data: contrib.map((c) => c.value)
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
initChart(hotRef.value)?.setOption({
|
||||
tooltip: { trigger: 'axis' },
|
||||
tooltip: { trigger: 'axis', ...tip },
|
||||
grid: { left: 90, right: 20, top: 20, bottom: 30 },
|
||||
xAxis: { type: 'value' },
|
||||
xAxis: { type: 'value', ...axis },
|
||||
yAxis: {
|
||||
type: 'category',
|
||||
inverse: true,
|
||||
data: hotKeywords.value.slice(0, 10).map((k) => k.name)
|
||||
data: hotKeywords.value.slice(0, 10).map((k) => k.name),
|
||||
axisLabel: { color: paper }
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: '检索次数',
|
||||
type: 'bar',
|
||||
itemStyle: { color: '#9dc4ac' },
|
||||
itemStyle: {
|
||||
color: new echarts.graphic.LinearGradient(0, 0, 1, 0, [
|
||||
{ offset: 0, color: ink },
|
||||
{ offset: 1, color: gold }
|
||||
])
|
||||
},
|
||||
data: hotKeywords.value.slice(0, 10).map((k) => k.value)
|
||||
}
|
||||
]
|
||||
@@ -186,16 +219,31 @@ onBeforeUnmount(() => {
|
||||
|
||||
<style scoped lang="scss">
|
||||
.mini {
|
||||
position: relative;
|
||||
text-align: center;
|
||||
overflow: hidden;
|
||||
|
||||
&::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
width: 3px;
|
||||
background: linear-gradient(180deg, var(--brand-gold-light), var(--brand-gold-deep));
|
||||
}
|
||||
|
||||
.v {
|
||||
font-size: 22px;
|
||||
font-family: var(--font-serif);
|
||||
font-size: 28px;
|
||||
font-weight: 700;
|
||||
letter-spacing: 1px;
|
||||
color: var(--brand-primary-deep);
|
||||
}
|
||||
|
||||
.l {
|
||||
font-size: 13px;
|
||||
color: #909399;
|
||||
color: var(--text-muted);
|
||||
margin-top: 6px;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,25 +1,52 @@
|
||||
<script setup lang="ts">
|
||||
import { onMounted, reactive, ref } from 'vue'
|
||||
import { computed, onMounted, reactive, ref } from 'vue'
|
||||
import { ElMessage, type FormInstance, type FormRules } from 'element-plus'
|
||||
import { createCollectTask, listCollectTasks, startCollectTask, type CollectTask } from '@/api/collect'
|
||||
import {
|
||||
createCollectTask,
|
||||
listCollectTasks,
|
||||
previewCollectSource,
|
||||
startCollectTask,
|
||||
type CollectTable,
|
||||
type CollectTask
|
||||
} from '@/api/collect'
|
||||
|
||||
const loading = ref(false)
|
||||
const startingId = ref<number | null>(null)
|
||||
const previewing = ref(false)
|
||||
const list = ref<CollectTask[]>([])
|
||||
const preview = ref<CollectTable | null>(null)
|
||||
|
||||
const dialogVisible = ref(false)
|
||||
const formRef = ref<FormInstance>()
|
||||
const form = reactive<CollectTask>({
|
||||
libraryCode: '',
|
||||
libraryName: '',
|
||||
sourceType: 'MARC',
|
||||
sourceType: 'DB',
|
||||
dbHost: '',
|
||||
dbPort: 5432,
|
||||
dbName: '',
|
||||
dbUsername: '',
|
||||
dbPassword: '',
|
||||
sourceTable: '',
|
||||
targetCount: 200000
|
||||
})
|
||||
|
||||
const rules: FormRules = {
|
||||
libraryCode: [{ required: true, message: '请输入单位编码', trigger: 'blur' }],
|
||||
libraryName: [{ required: true, message: '请输入单位名称', trigger: 'blur' }]
|
||||
libraryName: [{ required: true, message: '请输入单位名称', trigger: 'blur' }],
|
||||
dbHost: [{ required: true, message: '请输入数据库地址', trigger: 'blur' }],
|
||||
dbPort: [{ required: true, message: '请输入端口', trigger: 'blur' }],
|
||||
dbName: [{ required: true, message: '请输入数据库名', trigger: 'blur' }],
|
||||
dbUsername: [{ required: true, message: '请输入用户名', trigger: 'blur' }],
|
||||
dbPassword: [{ required: true, message: '请输入密码', trigger: 'blur' }],
|
||||
sourceTable: [{ required: true, message: '请输入表名', trigger: 'blur' }]
|
||||
}
|
||||
|
||||
const mappedColumns = computed(() => (preview.value?.columns || []).filter((item) => item.targetField))
|
||||
const unmappedColumns = computed(() =>
|
||||
(preview.value?.columns || []).filter((item) => !item.targetField).map((item) => item.columnName)
|
||||
)
|
||||
|
||||
async function fetchList() {
|
||||
loading.value = true
|
||||
try {
|
||||
@@ -30,22 +57,61 @@ async function fetchList() {
|
||||
}
|
||||
|
||||
function openCreate() {
|
||||
form.libraryCode = ''
|
||||
form.libraryName = ''
|
||||
form.sourceType = 'DB'
|
||||
form.dbHost = ''
|
||||
form.dbPort = 5432
|
||||
form.dbName = ''
|
||||
form.dbUsername = ''
|
||||
form.dbPassword = ''
|
||||
form.sourceTable = ''
|
||||
form.targetCount = 200000
|
||||
preview.value = null
|
||||
dialogVisible.value = true
|
||||
}
|
||||
|
||||
async function handlePreview() {
|
||||
await formRef.value?.validateField(['dbHost', 'dbPort', 'dbName', 'dbUsername', 'dbPassword', 'sourceTable'])
|
||||
previewing.value = true
|
||||
preview.value = null
|
||||
try {
|
||||
preview.value = await previewCollectSource(form)
|
||||
ElMessage.success(`连接成功,表中共 ${preview.value.rowCount} 条`)
|
||||
} finally {
|
||||
previewing.value = false
|
||||
}
|
||||
}
|
||||
|
||||
async function handleCreate() {
|
||||
await formRef.value?.validate()
|
||||
form.sourceType = 'DB'
|
||||
await createCollectTask(form)
|
||||
ElMessage.success('采集任务已创建')
|
||||
ElMessage.success('采集任务已创建,可在列表中执行')
|
||||
dialogVisible.value = false
|
||||
formRef.value?.resetFields()
|
||||
fetchList()
|
||||
}
|
||||
|
||||
async function handleStart(row: CollectTask) {
|
||||
await startCollectTask(row.id as number)
|
||||
ElMessage.success('采集任务已执行')
|
||||
fetchList()
|
||||
startingId.value = row.id as number
|
||||
try {
|
||||
const task = await startCollectTask(row.id as number)
|
||||
if (task.status === 'FAILED') {
|
||||
ElMessage.error(task.message || '采集失败')
|
||||
} else {
|
||||
ElMessage.success(task.message || '采集完成')
|
||||
}
|
||||
await fetchList()
|
||||
} finally {
|
||||
startingId.value = null
|
||||
}
|
||||
}
|
||||
|
||||
function wrotePercent(row: CollectTask) {
|
||||
const target = Number(row.targetCount) || 0
|
||||
const got = Number(row.collectedCount) || 0
|
||||
if (target <= 0) return '0%'
|
||||
return `${Math.min(100, Math.round((got / target) * 100))}%`
|
||||
}
|
||||
|
||||
function statusTag(status?: string) {
|
||||
@@ -55,6 +121,11 @@ function statusTag(status?: string) {
|
||||
return 'info'
|
||||
}
|
||||
|
||||
function sourceText(row: CollectTask) {
|
||||
if (!row.dbHost) return row.sourceTable || '-'
|
||||
return `${row.dbHost}:${row.dbPort || ''}/${row.dbName || ''} / ${row.sourceTable || ''}`
|
||||
}
|
||||
|
||||
onMounted(fetchList)
|
||||
</script>
|
||||
|
||||
@@ -66,7 +137,7 @@ onMounted(fetchList)
|
||||
</div>
|
||||
|
||||
<el-alert
|
||||
title="采集 4 家单位图书馆纸电版本资源元数据,各馆不低于 20 万条,优先采集纸书元数据"
|
||||
title="填写来源数据库的地址、用户名、密码和表名。测试连接后可看到每列写入版本资源表的哪个字段;执行后按这些字段入库。"
|
||||
type="info"
|
||||
:closable="false"
|
||||
class="mb-16"
|
||||
@@ -74,16 +145,25 @@ onMounted(fetchList)
|
||||
|
||||
<el-table v-loading="loading" :data="list" border stripe>
|
||||
<el-table-column prop="libraryCode" label="单位编码" width="110" />
|
||||
<el-table-column prop="libraryName" label="单位名称" min-width="160" />
|
||||
<el-table-column prop="sourceType" label="数据源" width="100" />
|
||||
<el-table-column prop="targetCount" label="目标量" width="100" />
|
||||
<el-table-column prop="collectedCount" label="已采集" width="100" />
|
||||
<el-table-column prop="libraryName" label="单位名称" min-width="140" />
|
||||
<el-table-column label="来源库 / 表" min-width="240" show-overflow-tooltip>
|
||||
<template #default="{ row }">{{ sourceText(row) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="dbUsername" label="用户名" width="110" />
|
||||
<el-table-column label="本次写入" width="120">
|
||||
<template #default="{ row }">
|
||||
<div class="wrote">
|
||||
<span>{{ row.collectedCount ?? 0 }}</span>
|
||||
<i class="wrote-bar"><b :style="{ width: wrotePercent(row) }" /></i>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" width="110">
|
||||
<template #default="{ row }">
|
||||
<el-tag :type="statusTag(row.status)" size="small">{{ row.status }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="message" label="信息" min-width="140" show-overflow-tooltip />
|
||||
<el-table-column prop="message" label="结果" min-width="240" show-overflow-tooltip />
|
||||
<el-table-column prop="createTime" label="创建时间" width="170" />
|
||||
<el-table-column label="操作" width="110" fixed="right">
|
||||
<template #default="{ row }">
|
||||
@@ -91,7 +171,8 @@ onMounted(fetchList)
|
||||
link
|
||||
type="primary"
|
||||
size="small"
|
||||
:disabled="row.status === 'RUNNING'"
|
||||
:loading="startingId === row.id"
|
||||
:disabled="row.status === 'RUNNING' || !row.dbHost"
|
||||
@click="handleStart(row)"
|
||||
>
|
||||
执行
|
||||
@@ -100,24 +181,59 @@ onMounted(fetchList)
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<el-dialog v-model="dialogVisible" title="新建采集任务" width="480px">
|
||||
<el-form ref="formRef" :model="form" :rules="rules" label-width="100px">
|
||||
<el-dialog v-model="dialogVisible" title="新建采集任务" width="720px">
|
||||
<el-form ref="formRef" :model="form" :rules="rules" label-width="110px">
|
||||
<el-row :gutter="12">
|
||||
<el-col :span="16">
|
||||
<el-form-item label="数据库地址" prop="dbHost">
|
||||
<el-input v-model="form.dbHost" placeholder="如 10.1.1.14 或 db.example.com" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="端口" prop="dbPort" label-width="60px">
|
||||
<el-input-number v-model="form.dbPort" :min="1" :max="65535" controls-position="right" style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item label="数据库名" prop="dbName">
|
||||
<el-input v-model="form.dbName" placeholder="如 banben" />
|
||||
</el-form-item>
|
||||
<el-row :gutter="12">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="用户名" prop="dbUsername">
|
||||
<el-input v-model="form.dbUsername" placeholder="数据库账号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="密码" prop="dbPassword" label-width="60px">
|
||||
<el-input v-model="form.dbPassword" type="password" show-password placeholder="数据库密码" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item label="表名" prop="sourceTable">
|
||||
<el-input v-model="form.sourceTable" placeholder="如 src_library_catalog,或 public.src_library_catalog" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button :loading="previewing" @click="handlePreview">测试连接并查看字段</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="preview" label="字段对应">
|
||||
<div class="map-box">
|
||||
<p class="unmap">{{ preview.tableName }} 共 {{ preview.rowCount }} 条。同名或常见别名会写入版本资源表。</p>
|
||||
<el-tag v-for="col in mappedColumns" :key="col.columnName" size="small" class="map-tag">
|
||||
{{ col.columnName }} → {{ col.targetLabel }}
|
||||
</el-tag>
|
||||
<p v-if="unmappedColumns.length" class="unmap">不写入:{{ unmappedColumns.join('、') }}</p>
|
||||
<p v-if="!mappedColumns.length" class="unmap">这张表没有能对应到版本资源字段的列。</p>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="单位编码" prop="libraryCode">
|
||||
<el-input v-model="form.libraryCode" placeholder="如 NC-01" />
|
||||
</el-form-item>
|
||||
<el-form-item label="单位名称" prop="libraryName">
|
||||
<el-input v-model="form.libraryName" placeholder="如 江西南昌某馆" />
|
||||
</el-form-item>
|
||||
<el-form-item label="数据源类型">
|
||||
<el-select v-model="form.sourceType" style="width: 100%">
|
||||
<el-option label="MARC" value="MARC" />
|
||||
<el-option label="Excel" value="EXCEL" />
|
||||
<el-option label="数据库" value="DB" />
|
||||
<el-option label="接口" value="API" />
|
||||
</el-select>
|
||||
<el-input v-model="form.libraryName" placeholder="如 陆军步兵学院图书馆" />
|
||||
</el-form-item>
|
||||
<el-form-item label="目标采集量">
|
||||
<el-input-number v-model="form.targetCount" :min="0" :step="10000" style="width: 100%" />
|
||||
<el-input-number v-model="form.targetCount" :min="1" :step="1000" style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
@@ -134,4 +250,40 @@ onMounted(fetchList)
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.map-box {
|
||||
width: 100%;
|
||||
line-height: 1.8;
|
||||
}
|
||||
|
||||
.map-tag {
|
||||
margin: 0 8px 8px 0;
|
||||
}
|
||||
|
||||
.unmap {
|
||||
margin: 0 0 8px;
|
||||
color: var(--text-muted);
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.wrote {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 4px;
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
|
||||
.wrote-bar {
|
||||
display: block;
|
||||
height: 3px;
|
||||
background: var(--brand-light);
|
||||
border-radius: 2px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.wrote-bar b {
|
||||
display: block;
|
||||
height: 100%;
|
||||
background: linear-gradient(90deg, var(--brand-primary-deep), var(--brand-gold));
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -104,8 +104,9 @@ onMounted(() => {
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
label-width="110px"
|
||||
style="max-width: 660px"
|
||||
style="max-width: 720px"
|
||||
>
|
||||
<p class="section-kicker">呈缴单位</p>
|
||||
<el-form-item label="单位名称" prop="orgName">
|
||||
<el-input v-model="form.orgName" placeholder="请输入呈缴单位名称" />
|
||||
</el-form-item>
|
||||
@@ -118,6 +119,7 @@ onMounted(() => {
|
||||
<el-form-item label="邮箱">
|
||||
<el-input v-model="form.email" placeholder="请输入邮箱" />
|
||||
</el-form-item>
|
||||
<p class="section-kicker">资源信息</p>
|
||||
<el-form-item label="资源名称" prop="resourceTitle">
|
||||
<el-input v-model="form.resourceTitle" placeholder="请输入版本资源名称" />
|
||||
</el-form-item>
|
||||
|
||||
@@ -1,26 +1,50 @@
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref } from 'vue'
|
||||
import { computed, onMounted, ref } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import {
|
||||
listDataset,
|
||||
listGovernanceJobs,
|
||||
previewHints,
|
||||
runHint,
|
||||
runMerge,
|
||||
runOptimize,
|
||||
runPurify,
|
||||
type DatasetItem,
|
||||
type DefectItem,
|
||||
type DuplicateItem,
|
||||
type GovernanceHint,
|
||||
type GovernanceJob
|
||||
} from '@/api/governance'
|
||||
import { governStatusLabel, governStatusTagType } from '@/constants/dict'
|
||||
|
||||
const loading = ref(false)
|
||||
const running = ref('')
|
||||
const jobs = ref<GovernanceJob[]>([])
|
||||
const hintReport = ref<GovernanceHint>({
|
||||
duplicateGroupCount: 0,
|
||||
defectCount: 0,
|
||||
duplicateGroups: [],
|
||||
defects: []
|
||||
})
|
||||
const dataset = ref<DatasetItem[]>([])
|
||||
|
||||
const actions = [
|
||||
{ type: 'MERGE', title: '聚同', desc: '将不同来源、不同媒体类型的同一文献元数据聚合为一条,并标注来源。', fn: runMerge },
|
||||
{ type: 'OPTIMIZE', title: '优化', desc: '整合聚同文献的不同描述元数据,生成质量更高、要素更完整的元数据。', fn: runOptimize },
|
||||
{ type: 'HINT', title: '提示', desc: '生成疑似同一文献提示清单、疑似元数据错漏提示清单。', fn: runHint },
|
||||
{ type: 'PURIFY', title: '提纯', desc: '将相关纸电图书数据从全部图书数据中提取出来,形成版本资源数据集。', fn: runPurify }
|
||||
{ type: 'MERGE', title: '聚同', desc: '将不同来源、不同媒体类型的同一文献元数据聚合为一条,并标注来源。' },
|
||||
{ type: 'OPTIMIZE', title: '优化', desc: '整合聚同文献的不同描述元数据,生成质量更高、要素更完整的元数据。' },
|
||||
{ type: 'HINT', title: '提示', desc: '生成疑似同一文献提示清单、疑似元数据错漏提示清单。' },
|
||||
{ type: 'PURIFY', title: '提纯', desc: '将相关纸电图书数据从全部图书数据中提取出来,形成版本资源数据集。' }
|
||||
]
|
||||
|
||||
const duplicateRows = computed(() => {
|
||||
const rows: Array<DuplicateItem & { reason: string }> = []
|
||||
for (const group of hintReport.value.duplicateGroups || []) {
|
||||
for (const record of group.records || []) {
|
||||
rows.push({ ...record, reason: group.reason })
|
||||
}
|
||||
}
|
||||
return rows
|
||||
})
|
||||
|
||||
async function fetchJobs() {
|
||||
loading.value = true
|
||||
try {
|
||||
@@ -30,11 +54,33 @@ async function fetchJobs() {
|
||||
}
|
||||
}
|
||||
|
||||
async function loadHints() {
|
||||
hintReport.value = await previewHints()
|
||||
}
|
||||
|
||||
async function loadDataset() {
|
||||
dataset.value = await listDataset()
|
||||
}
|
||||
|
||||
async function handleRun(action: (typeof actions)[number]) {
|
||||
running.value = action.type
|
||||
try {
|
||||
const job = await action.fn()
|
||||
ElMessage.success(`${action.title}完成:${job.resultSummary || ''}`)
|
||||
if (action.type === 'HINT') {
|
||||
hintReport.value = await runHint()
|
||||
ElMessage.success(hintReport.value.job?.resultSummary || '提示完成')
|
||||
} else if (action.type === 'MERGE') {
|
||||
const job = await runMerge()
|
||||
ElMessage.success(`${action.title}完成:${job.resultSummary || ''}`)
|
||||
await loadHints()
|
||||
} else if (action.type === 'OPTIMIZE') {
|
||||
const job = await runOptimize()
|
||||
ElMessage.success(`${action.title}完成:${job.resultSummary || ''}`)
|
||||
await loadHints()
|
||||
} else {
|
||||
const job = await runPurify()
|
||||
ElMessage.success(`${action.title}完成:${job.resultSummary || ''}`)
|
||||
await loadDataset()
|
||||
}
|
||||
fetchJobs()
|
||||
} finally {
|
||||
running.value = ''
|
||||
@@ -48,14 +94,30 @@ function statusTag(status?: string) {
|
||||
return 'info'
|
||||
}
|
||||
|
||||
onMounted(fetchJobs)
|
||||
function issueText(row: DefectItem) {
|
||||
return (row.issues || []).join(';')
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
await fetchJobs()
|
||||
try {
|
||||
await loadHints()
|
||||
} catch {
|
||||
// 错误已由响应拦截器提示
|
||||
}
|
||||
try {
|
||||
await loadDataset()
|
||||
} catch {
|
||||
// 错误已由响应拦截器提示
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="page-card">
|
||||
<h3 class="page-title">数据治理</h3>
|
||||
<el-alert
|
||||
title="治理四动作:聚同 / 优化 / 提示 / 提纯"
|
||||
title="建议顺序:先看提示清单,再对完全一致的重复文献执行聚同、优化,最后提纯。疑似同一文献只出清单,不自动合并。"
|
||||
type="info"
|
||||
:closable="false"
|
||||
class="mb-16"
|
||||
@@ -63,7 +125,7 @@ onMounted(fetchJobs)
|
||||
|
||||
<el-row :gutter="16">
|
||||
<el-col v-for="a in actions" :key="a.type" :xs="24" :sm="12">
|
||||
<el-card shadow="hover" class="gov-card">
|
||||
<el-card shadow="hover" class="gov-card" :class="'tone-' + a.type">
|
||||
<h4>{{ a.title }}</h4>
|
||||
<p>{{ a.desc }}</p>
|
||||
<el-button type="primary" :loading="running === a.type" @click="handleRun(a)">
|
||||
@@ -73,6 +135,58 @@ onMounted(fetchJobs)
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<h3 class="page-title" style="margin-top: 8px">
|
||||
疑似同一文献提示清单({{ hintReport.duplicateGroupCount }} 组)
|
||||
</h3>
|
||||
<el-table :data="duplicateRows" border stripe empty-text="暂无疑似同一文献">
|
||||
<el-table-column prop="reason" label="提示原因" min-width="280" show-overflow-tooltip />
|
||||
<el-table-column prop="processNo" label="加工编号" width="140" />
|
||||
<el-table-column prop="title" label="正题名" min-width="180" show-overflow-tooltip />
|
||||
<el-table-column prop="author" label="责任者" width="100" />
|
||||
<el-table-column prop="isbn" label="ISBN" width="170" show-overflow-tooltip />
|
||||
<el-table-column prop="mediaType" label="媒体" width="80" />
|
||||
<el-table-column prop="sourceLibrary" label="来源馆" min-width="160" show-overflow-tooltip />
|
||||
<el-table-column label="治理状态" width="100">
|
||||
<template #default="{ row }">
|
||||
<el-tag :type="governStatusTagType(row.governStatus)" size="small">
|
||||
{{ governStatusLabel(row.governStatus) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<h3 class="page-title" style="margin-top: 20px">
|
||||
疑似元数据错漏提示清单({{ hintReport.defectCount }} 条)
|
||||
</h3>
|
||||
<el-table :data="hintReport.defects" border stripe empty-text="暂无疑似错漏">
|
||||
<el-table-column prop="processNo" label="加工编号" width="140" />
|
||||
<el-table-column prop="title" label="正题名" min-width="180" show-overflow-tooltip />
|
||||
<el-table-column prop="author" label="责任者" width="100" />
|
||||
<el-table-column prop="sourceLibrary" label="来源馆" min-width="160" show-overflow-tooltip />
|
||||
<el-table-column prop="mediaType" label="媒体" width="80" />
|
||||
<el-table-column label="错漏说明" min-width="280" show-overflow-tooltip>
|
||||
<template #default="{ row }">{{ issueText(row) }}</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<h3 class="page-title" style="margin-top: 20px">版本资源数据集({{ dataset.length }} 条)</h3>
|
||||
<el-table :data="dataset" border stripe empty-text="尚未提纯">
|
||||
<el-table-column prop="processNo" label="加工编号" width="140" />
|
||||
<el-table-column prop="title" label="正题名" min-width="200" show-overflow-tooltip />
|
||||
<el-table-column prop="author" label="责任者" width="100" />
|
||||
<el-table-column prop="mediaType" label="媒体" width="80" />
|
||||
<el-table-column prop="contentForm" label="内容形式" width="100" />
|
||||
<el-table-column prop="sourceLibrary" label="来源馆" min-width="160" show-overflow-tooltip />
|
||||
<el-table-column prop="publishYear" label="出版年份" width="100" />
|
||||
<el-table-column label="治理状态" width="100">
|
||||
<template #default="{ row }">
|
||||
<el-tag :type="governStatusTagType(row.governStatus)" size="small">
|
||||
{{ governStatusLabel(row.governStatus) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<h3 class="page-title" style="margin-top: 20px">治理任务历史</h3>
|
||||
<el-table v-loading="loading" :data="jobs" border stripe>
|
||||
<el-table-column type="index" label="#" width="50" />
|
||||
@@ -92,16 +206,24 @@ onMounted(fetchJobs)
|
||||
<style scoped lang="scss">
|
||||
.gov-card {
|
||||
margin-bottom: 16px;
|
||||
border-top: 3px solid var(--brand-primary);
|
||||
|
||||
h4 {
|
||||
margin: 0 0 8px;
|
||||
font-family: var(--font-serif);
|
||||
letter-spacing: 1px;
|
||||
}
|
||||
|
||||
p {
|
||||
font-size: 13px;
|
||||
color: #909399;
|
||||
color: var(--text-muted);
|
||||
min-height: 38px;
|
||||
margin: 0 0 12px;
|
||||
}
|
||||
}
|
||||
|
||||
.tone-MERGE { border-top-color: var(--brand-primary-deep); }
|
||||
.tone-OPTIMIZE { border-top-color: var(--brand-gold); }
|
||||
.tone-HINT { border-top-color: var(--brand-primary); }
|
||||
.tone-PURIFY { border-top-color: var(--brand-gold-deep); }
|
||||
</style>
|
||||
|
||||
@@ -329,8 +329,9 @@ onMounted(fetchData)
|
||||
|
||||
.special-tag {
|
||||
margin-right: 6px;
|
||||
background: #8a6d3b;
|
||||
border-color: #8a6d3b;
|
||||
background: var(--brand-gold-deep);
|
||||
border-color: var(--brand-gold-deep);
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.form-grid {
|
||||
|
||||
@@ -19,7 +19,8 @@ function search() {
|
||||
|
||||
<template>
|
||||
<div class="adv">
|
||||
<h2>高级检索</h2>
|
||||
<h2 class="page-title">高级检索</h2>
|
||||
<p class="section-kicker">检索条件</p>
|
||||
<div v-for="(r, i) in rows" :key="i" class="row">
|
||||
<el-select v-model="r.field" style="width: 140px">
|
||||
<el-option v-for="f in fields" :key="f" :label="f" :value="f" />
|
||||
@@ -41,12 +42,11 @@ function search() {
|
||||
.adv {
|
||||
max-width: 820px;
|
||||
margin: 20px auto;
|
||||
background: #fff;
|
||||
border: 1px solid var(--card-border);
|
||||
background: var(--card-bg);
|
||||
border: 1px solid var(--card-gold-border);
|
||||
border-radius: var(--radius-sm);
|
||||
padding: 24px;
|
||||
|
||||
h2 { margin: 0 0 20px; font-size: 19px; letter-spacing: 1px; }
|
||||
box-shadow: var(--shadow-card);
|
||||
}
|
||||
|
||||
.row {
|
||||
|
||||
@@ -57,7 +57,6 @@ const totalCount = computed(() =>
|
||||
const cloudRef = ref<HTMLDivElement | null>(null)
|
||||
const stageRef = ref<HTMLDivElement | null>(null)
|
||||
|
||||
const colors = ['#5c7c9e', '#c96b6b', '#4a7a8c', '#b39b8b', '#8c9aaf', '#d19b9b']
|
||||
const FONT_FAMILY = '"Microsoft YaHei", "PingFang SC", sans-serif'
|
||||
const MAX_WEIGHT = 120
|
||||
|
||||
@@ -77,7 +76,7 @@ function render() {
|
||||
weightFactor: (size: number) => 17 + 44 * (size / MAX_WEIGHT),
|
||||
fontFamily: FONT_FAMILY,
|
||||
fontWeight: 'bold',
|
||||
color: (word: string) => colors[Math.abs(hash(word)) % colors.length],
|
||||
color: (word: string) => cloudColor(word),
|
||||
// 给每个词加上类名,便于用 CSS 实现悬停放大
|
||||
classes: 'cloud-word',
|
||||
rotateRatio: 0,
|
||||
@@ -86,6 +85,15 @@ function render() {
|
||||
})
|
||||
}
|
||||
|
||||
/** 词云配色取自主题变量,保证两套主题一致且在白底上可读 */
|
||||
function cloudColor(word: string) {
|
||||
const names = ['--brand-primary-deep', '--brand-primary', '--brand-gold-deep', '--brand-primary-ink']
|
||||
const value = getComputedStyle(document.documentElement)
|
||||
.getPropertyValue(names[Math.abs(hash(word)) % names.length])
|
||||
.trim()
|
||||
return value || '#2f5d47'
|
||||
}
|
||||
|
||||
/** 字符串散列,让每个词的配色固定 */
|
||||
function hash(str: string) {
|
||||
let h = 0
|
||||
@@ -201,16 +209,17 @@ function go(keyword: string) {
|
||||
em {
|
||||
font-style: normal;
|
||||
margin-left: 10px;
|
||||
color: #b3a48f;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------- 词云 ---------- */
|
||||
.field {
|
||||
padding: 24px;
|
||||
background: #fff;
|
||||
border: 1px solid var(--card-border);
|
||||
background: var(--card-bg);
|
||||
border: 1px solid var(--card-gold-border);
|
||||
border-radius: var(--radius-sm);
|
||||
box-shadow: var(--shadow-card);
|
||||
}
|
||||
|
||||
.stage {
|
||||
|
||||
@@ -254,10 +254,15 @@ onMounted(() => {
|
||||
.bar {
|
||||
max-width: 860px;
|
||||
margin: 8px auto 20px;
|
||||
padding: 10px;
|
||||
background: var(--card-bg);
|
||||
border: 1px solid var(--card-gold-border);
|
||||
border-radius: var(--radius-sm);
|
||||
box-shadow: var(--shadow-card);
|
||||
|
||||
:deep(.el-input-group__append) {
|
||||
background: var(--brand-primary);
|
||||
border-color: var(--brand-primary);
|
||||
background: var(--brand-primary-deep);
|
||||
border-color: var(--brand-primary-deep);
|
||||
color: #fff;
|
||||
padding: 0;
|
||||
|
||||
@@ -279,37 +284,45 @@ onMounted(() => {
|
||||
}
|
||||
|
||||
.side {
|
||||
width: 210px;
|
||||
width: 220px;
|
||||
flex: none;
|
||||
background: #fff;
|
||||
border: 1px solid var(--card-border);
|
||||
background: var(--card-bg);
|
||||
border: 1px solid var(--card-gold-border);
|
||||
border-radius: var(--radius-sm);
|
||||
padding: 12px;
|
||||
height: fit-content;
|
||||
box-shadow: var(--shadow-card);
|
||||
|
||||
.side-title {
|
||||
font-family: var(--font-serif);
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
margin: 10px 0 6px;
|
||||
padding-left: 8px;
|
||||
border-left: 2px solid var(--brand-gold);
|
||||
}
|
||||
|
||||
.side-item {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
font-size: 13px;
|
||||
color: #5b6472;
|
||||
padding: 4px 6px;
|
||||
border-radius: 4px;
|
||||
color: var(--text-sub);
|
||||
padding: 6px 8px;
|
||||
border-radius: var(--radius-sm);
|
||||
cursor: pointer;
|
||||
|
||||
&:hover { background: var(--brand-light); }
|
||||
&.on { background: var(--brand-light); color: var(--brand-primary); }
|
||||
em { color: #9aa3b2; font-style: normal; }
|
||||
&.on {
|
||||
background: var(--paper-warm);
|
||||
color: var(--brand-gold-deep);
|
||||
box-shadow: inset 2px 0 0 var(--brand-gold);
|
||||
}
|
||||
em { color: var(--text-muted); font-style: normal; }
|
||||
}
|
||||
}
|
||||
|
||||
.list { flex: 1; }
|
||||
.meta { font-size: 13px; color: #6b7280; margin-bottom: 10px; }
|
||||
.list { flex: 1; min-width: 0; }
|
||||
.meta { font-size: 13px; color: var(--text-sub); margin-bottom: 10px; }
|
||||
|
||||
.cards {
|
||||
display: flex;
|
||||
@@ -319,41 +332,56 @@ onMounted(() => {
|
||||
|
||||
.card {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
background: #fff;
|
||||
border: 1px solid var(--card-border);
|
||||
gap: 14px;
|
||||
background: var(--card-bg);
|
||||
border: 1px solid var(--card-gold-border);
|
||||
border-radius: var(--radius-sm);
|
||||
padding: 14px;
|
||||
cursor: pointer;
|
||||
transition: box-shadow 0.2s;
|
||||
transition: box-shadow 0.22s ease, transform 0.22s ease, border-color 0.22s ease;
|
||||
|
||||
&:hover { box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1); }
|
||||
&:hover {
|
||||
border-color: var(--brand-gold);
|
||||
box-shadow: var(--shadow-lift);
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
}
|
||||
|
||||
.cover {
|
||||
width: 56px;
|
||||
height: 76px;
|
||||
height: 78px;
|
||||
flex: none;
|
||||
border-radius: 4px;
|
||||
background: var(--brand-primary);
|
||||
color: #fff;
|
||||
border-radius: 2px 4px 4px 2px;
|
||||
background:
|
||||
linear-gradient(90deg, rgba(255, 255, 255, 0.12), transparent 18%),
|
||||
var(--brand-primary-deep);
|
||||
color: var(--brand-gold-light);
|
||||
border: 1px solid var(--brand-gold);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 18px;
|
||||
font-family: var(--font-kai);
|
||||
font-size: 16px;
|
||||
letter-spacing: 1px;
|
||||
}
|
||||
|
||||
.info {
|
||||
min-width: 0;
|
||||
|
||||
.t { font-size: 14px; font-weight: 600; color: #1f2937; margin-bottom: 6px; }
|
||||
.d { font-size: 12px; color: #8b93a1; }
|
||||
.t {
|
||||
font-family: var(--font-serif);
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: var(--text-main);
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
.d { font-size: 12px; color: var(--text-muted); }
|
||||
}
|
||||
|
||||
/* 命中关键词高亮(v-html 动态插入的节点不带 scoped 属性,需用 :deep 穿透) */
|
||||
:deep(.hl) {
|
||||
background: #ffe6a3;
|
||||
color: #8a4b00;
|
||||
background: var(--hl-bg);
|
||||
color: var(--hl-text);
|
||||
border-radius: 2px;
|
||||
padding: 0 1px;
|
||||
}
|
||||
@@ -361,13 +389,14 @@ onMounted(() => {
|
||||
.snippet {
|
||||
margin-top: 4px;
|
||||
font-size: 12px;
|
||||
color: #7b8493;
|
||||
color: var(--text-sub);
|
||||
line-height: 1.5;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.snippet-label {
|
||||
color: #4b5563;
|
||||
font-family: var(--font-serif);
|
||||
color: var(--brand-primary-deep);
|
||||
}
|
||||
|
||||
.pager {
|
||||
@@ -378,6 +407,18 @@ onMounted(() => {
|
||||
/* 页码较多时自动换行,保证页码按钮与跳转框都能点到 */
|
||||
:deep(.el-pagination__jump) { margin-left: 12px; }
|
||||
}
|
||||
.dt { margin: 0 0 12px; font-size: 17px; }
|
||||
.sim-item { font-size: 13px; padding: 6px 0; border-bottom: 1px dashed #eee; cursor: pointer; }
|
||||
.dt { margin: 0 0 12px; font-size: 18px; letter-spacing: 1px; }
|
||||
.sim-item {
|
||||
font-size: 13px;
|
||||
padding: 8px 0;
|
||||
border-bottom: 1px solid var(--hair-line);
|
||||
cursor: pointer;
|
||||
|
||||
&:hover { color: var(--brand-gold-deep); }
|
||||
}
|
||||
|
||||
@media (max-width: 760px) {
|
||||
.body { flex-direction: column; }
|
||||
.side { width: 100%; }
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -188,7 +188,7 @@ onMounted(async () => {
|
||||
.sub-desc {
|
||||
margin: -6px 0 18px;
|
||||
font-size: 13px;
|
||||
color: #a09480;
|
||||
color: var(--text-muted);
|
||||
letter-spacing: 1px;
|
||||
}
|
||||
|
||||
@@ -214,19 +214,20 @@ onMounted(async () => {
|
||||
align-items: center;
|
||||
gap: 22px;
|
||||
padding: 14px 20px;
|
||||
background: #faf7ee;
|
||||
border: 1px solid #f0e9d8;
|
||||
border-radius: 6px;
|
||||
background: var(--card-bg);
|
||||
border: 1px solid var(--card-gold-border);
|
||||
border-radius: var(--radius-sm);
|
||||
cursor: pointer;
|
||||
transition: background 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
|
||||
|
||||
&:hover {
|
||||
background: #f5efdf;
|
||||
box-shadow: 0 6px 18px rgba(90, 70, 20, 0.12);
|
||||
background: var(--paper-warm);
|
||||
border-color: var(--brand-gold);
|
||||
box-shadow: var(--shadow-lift);
|
||||
transform: translateY(-2px);
|
||||
|
||||
.goto {
|
||||
color: #8a6d3b;
|
||||
color: var(--brand-gold-deep);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -237,7 +238,7 @@ onMounted(async () => {
|
||||
width: 150px;
|
||||
height: 100px;
|
||||
border-radius: 4px;
|
||||
background: linear-gradient(135deg, #2c4d40 0%, #1f3a30 100%);
|
||||
background: linear-gradient(135deg, var(--brand-primary-deep) 0%, var(--brand-primary-ink) 100%);
|
||||
box-shadow: inset 0 0 0 3px rgba(0, 0, 0, 0.15), 0 4px 10px rgba(0, 0, 0, 0.25);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -253,7 +254,7 @@ onMounted(async () => {
|
||||
.cover-frame {
|
||||
width: 56px;
|
||||
height: 84px;
|
||||
border: 1px solid rgba(184, 134, 45, 0.85);
|
||||
border: 1px solid var(--brand-gold);
|
||||
border-radius: 2px;
|
||||
box-shadow: inset 0 0 0 2px rgba(184, 134, 45, 0.25);
|
||||
display: flex;
|
||||
@@ -263,10 +264,10 @@ onMounted(async () => {
|
||||
|
||||
.cover-title {
|
||||
writing-mode: vertical-rl;
|
||||
font-family: 'Kaiti SC', 'STKaiti', 'KaiTi', '楷体', serif;
|
||||
font-family: var(--font-kai);
|
||||
font-size: 15px;
|
||||
letter-spacing: 4px;
|
||||
color: #d8b25e;
|
||||
color: var(--brand-gold-light);
|
||||
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
}
|
||||
@@ -277,9 +278,10 @@ onMounted(async () => {
|
||||
}
|
||||
|
||||
.name {
|
||||
font-family: var(--font-serif);
|
||||
font-size: 18px;
|
||||
font-weight: 700;
|
||||
color: #8a6d3b;
|
||||
color: var(--text-main);
|
||||
margin-bottom: 10px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
@@ -291,11 +293,11 @@ onMounted(async () => {
|
||||
align-items: center;
|
||||
gap: 16px;
|
||||
padding: 10px 14px;
|
||||
border: 1px solid #e7dfc8;
|
||||
border-radius: 4px;
|
||||
border: 1px solid var(--card-gold-border);
|
||||
border-radius: var(--radius-sm);
|
||||
font-size: 14px;
|
||||
line-height: 1.7;
|
||||
color: #666;
|
||||
color: var(--text-sub);
|
||||
|
||||
.desc-text {
|
||||
min-width: 0;
|
||||
@@ -312,21 +314,22 @@ onMounted(async () => {
|
||||
align-items: center;
|
||||
gap: 3px;
|
||||
font-size: 14px;
|
||||
color: #a9832f;
|
||||
color: var(--brand-gold-deep);
|
||||
cursor: pointer;
|
||||
white-space: nowrap;
|
||||
|
||||
&:hover {
|
||||
color: #8a6d3b;
|
||||
color: var(--brand-gold-deep);
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
/* 删除:红色示警 */
|
||||
&.del {
|
||||
color: #c0392b;
|
||||
color: var(--el-color-danger);
|
||||
|
||||
&:hover {
|
||||
color: #96281b;
|
||||
color: var(--el-color-danger);
|
||||
opacity: 0.82;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user