中图法分类
This commit is contained in:
@@ -59,15 +59,16 @@ function metaValue(row: VersionResource, key: string): string {
|
||||
/** 输入框内容(与查询参数分离,避免按途径分发后被清空) */
|
||||
const input = ref('')
|
||||
const field = ref('综合')
|
||||
const fields = ['综合', '题名', '责任者', '关键词', '出版社', 'ISBN']
|
||||
const fields = ['综合', '题名', '责任者', '关键词', '出版社', '中图分类', 'ISBN']
|
||||
|
||||
/** 检索途径 → 查询参数字段 */
|
||||
const fieldParamMap: Record<string, 'keyword' | 'title' | 'author' | 'publisher' | 'isbn'> = {
|
||||
const fieldParamMap: Record<string, 'keyword' | 'title' | 'author' | 'publisher' | 'clcCode' | 'isbn'> = {
|
||||
综合: 'keyword',
|
||||
题名: 'title',
|
||||
责任者: 'author',
|
||||
关键词: 'keyword',
|
||||
出版社: 'publisher',
|
||||
中图分类: 'clcCode',
|
||||
ISBN: 'isbn'
|
||||
}
|
||||
|
||||
@@ -80,6 +81,7 @@ const hitFieldMap: Record<string, string[]> = {
|
||||
责任者: ['author'],
|
||||
关键词: ['keywords'],
|
||||
出版社: ['publisher'],
|
||||
中图分类: ['clcCode'],
|
||||
ISBN: ['isbn']
|
||||
}
|
||||
|
||||
@@ -89,6 +91,7 @@ const fieldLabels: Record<string, string> = {
|
||||
keywords: '关键词',
|
||||
summary: '摘要',
|
||||
publisher: '出版者',
|
||||
clcCode: '中图分类',
|
||||
isbn: 'ISBN'
|
||||
}
|
||||
|
||||
@@ -134,7 +137,14 @@ async function doSearch() {
|
||||
// 按所选途径分发检索词;多词用空格分隔,词与词之间为 AND
|
||||
const kw = input.value.trim()
|
||||
query.title = query.author = query.publisher = query.isbn = query.keyword = ''
|
||||
;(query as unknown as Record<string, string>)[fieldParamMap[field.value]] = kw
|
||||
query.clcCode = ''
|
||||
const fp = fieldParamMap[field.value]
|
||||
// 用检索框按中图分类检索时,清掉左侧分类树的点选,避免两套 CLC 条件叠加
|
||||
if (fp === 'clcCode') {
|
||||
query.clcCodes = undefined
|
||||
selectedClc.value = ''
|
||||
}
|
||||
;(query as unknown as Record<string, string>)[fp] = kw
|
||||
// 去除关键字:多个排除词以空格拼接提交后端统一排除
|
||||
query.excludeKeyword = excludeTerms.value.length ? excludeTerms.value.join(' ') : ''
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user