|
@@ -13,8 +13,11 @@
|
|
|
<div class="search-nav">
|
|
|
<div id="search-block " class="">
|
|
|
<div class="search-input">
|
|
|
+ <el-tabs v-model="searchType" type="card" @tab-click="handleTypeClick">
|
|
|
+ <el-tab-pane v-for="item in searchTypeArr" :label="item.label" :name="item.value" :key="item.value"></el-tab-pane>
|
|
|
+ </el-tabs>
|
|
|
<el-input placeholder="请输入内容" v-model="searchVal" class="input-with-select">
|
|
|
- <el-button class="search-button" slot="append" type="primary" @click="loadTechnologyArticles">搜索</el-button>
|
|
|
+ <el-button class="search-button" slot="append" type="primary" @click="loadTechnologyArticles(1)">搜索</el-button>
|
|
|
</el-input>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -37,7 +40,7 @@
|
|
|
<el-row>
|
|
|
<el-col :span="18" class="project-task">
|
|
|
<TechnologyCard
|
|
|
- :techArticleList = techArticleList.content v-if="searchType=='0'" @refreshList="loadTechnologyArticles">
|
|
|
+ :techArticleList = techArticleList.content v-if="searchType=='0'" @refreshList="loadTechnologyArticles(activePage)">
|
|
|
</TechnologyCard>
|
|
|
<TechnologyMG :techArticleList = techArticleList.content v-if="searchType=='1'"></TechnologyMG>
|
|
|
<el-pagination
|
|
@@ -85,11 +88,13 @@
|
|
|
searchTypeArr:[
|
|
|
{
|
|
|
"name": "技术文章",
|
|
|
- "value": "0"
|
|
|
+ "value": "0",
|
|
|
+ "label":'文章'
|
|
|
},
|
|
|
{
|
|
|
"name": "论文专著",
|
|
|
- "value": "1"
|
|
|
+ "value": "1",
|
|
|
+ "label":'专著'
|
|
|
}
|
|
|
],
|
|
|
articleArr:[],
|
|
@@ -99,21 +104,25 @@
|
|
|
}
|
|
|
},
|
|
|
methods:{
|
|
|
+ handleTypeClick(tab){
|
|
|
+ this.handleTabClick(tab);
|
|
|
+ },
|
|
|
handleTabClick(tab){
|
|
|
this.searchType = tab.name
|
|
|
this.activePage = 1;
|
|
|
this.searchVal = '';
|
|
|
- this.loadTechnologyArticles();
|
|
|
+ this.loadTechnologyArticles(1);
|
|
|
},
|
|
|
loadHotArticles(){
|
|
|
Http.get('/api/technical/ranking').then((res)=>{
|
|
|
this.articleArr = res.data.technicalArticlesPage.content;
|
|
|
})
|
|
|
},
|
|
|
- loadTechnologyArticles(){
|
|
|
+ loadTechnologyArticles(index){
|
|
|
// let url=`/api/technical/articles?searchCondition={"keyword":"${this.keyword}","activePage":${this.activePage}}`;
|
|
|
// Http.get(encodeURI(url))
|
|
|
let url = '/api/technical/articles';
|
|
|
+ this.activePage = index;
|
|
|
let params = {
|
|
|
"keyword": this.searchVal,//查询条件,分页展示时就不填
|
|
|
"activePage": this.activePage,//指定页数
|
|
@@ -140,12 +149,12 @@
|
|
|
},
|
|
|
handlePageChange(index){
|
|
|
this.activePage = index;
|
|
|
- this.loadTechnologyArticles();
|
|
|
+ this.loadTechnologyArticles(index);
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
this.loadHotArticles();
|
|
|
- this.loadTechnologyArticles();
|
|
|
+ this.loadTechnologyArticles(1);
|
|
|
}
|
|
|
}
|
|
|
</script>
|