|
@@ -12,9 +12,9 @@ const keyword = ref("");
|
|
|
const field = ref("TP");
|
|
const field = ref("TP");
|
|
|
const placeholder = ref("请输入文献主题")
|
|
const placeholder = ref("请输入文献主题")
|
|
|
|
|
|
|
|
-const hotWords = ref(['建筑工程','工程设计','BIM'])
|
|
|
|
|
|
|
+const hotWords = ref(['建筑工程','工程设计','BIM','工程造价','质量控制'])
|
|
|
const spinning = ref(true);
|
|
const spinning = ref(true);
|
|
|
-const searchResult: any = ref(null)
|
|
|
|
|
|
|
+const searchResult: any = ref([])
|
|
|
|
|
|
|
|
const onSearch = () => {
|
|
const onSearch = () => {
|
|
|
const kwd = keyword.value.trim();
|
|
const kwd = keyword.value.trim();
|
|
@@ -79,18 +79,22 @@ function getHoyKeyword(size: number){
|
|
|
|
|
|
|
|
function recommendsearch() {
|
|
function recommendsearch() {
|
|
|
spinning.value = true;
|
|
spinning.value = true;
|
|
|
- const fullYear = new Date().getFullYear();
|
|
|
|
|
let request = {
|
|
let request = {
|
|
|
from: 0,
|
|
from: 0,
|
|
|
- size: 10,
|
|
|
|
|
- sort: {cited: "desc"},
|
|
|
|
|
- filter: " PY=("+fullYear+" "+ (fullYear - 2)+ " "+(fullYear - 1)+")"
|
|
|
|
|
|
|
+ size: 2,
|
|
|
|
|
+ sort: {PY: "desc"},
|
|
|
|
|
+ query: ''
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- searchService.search(request).then((resp) => {
|
|
|
|
|
- searchResult.value = resp
|
|
|
|
|
- spinning.value = false;
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ for (let item of hotWords.value) {
|
|
|
|
|
+ request.query = 'TP=('+item+')' ;
|
|
|
|
|
+ searchService.search(request).then((resp) => {
|
|
|
|
|
+ for (let doc of resp.docs) {
|
|
|
|
|
+ searchResult.value.push(doc)
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ spinning.value = false;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function search(kwd: string){
|
|
function search(kwd: string){
|
|
@@ -132,7 +136,7 @@ function search(kwd: string){
|
|
|
<a-row type="flex" class="search-result">
|
|
<a-row type="flex" class="search-result">
|
|
|
<a-spin :spinning="spinning" :indicator="h(LoadingOutlined, { style: { fontSize: '24px', }, spin: true, })">
|
|
<a-spin :spinning="spinning" :indicator="h(LoadingOutlined, { style: { fontSize: '24px', }, spin: true, })">
|
|
|
最新文献推荐
|
|
最新文献推荐
|
|
|
- <div v-for="(doc, index) in searchResult.docs" :key="index" v-if="searchResult" class="search-result-content">
|
|
|
|
|
|
|
+ <div v-for="(doc, index) in searchResult" :key="index" v-if="searchResult" class="search-result-content">
|
|
|
<SearchResultItem :data="doc"/>
|
|
<SearchResultItem :data="doc"/>
|
|
|
</div>
|
|
</div>
|
|
|
</a-spin>
|
|
</a-spin>
|