|
|
@@ -14,7 +14,7 @@
|
|
|
<div id="search-block " class="">
|
|
|
<div class="search-input">
|
|
|
<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 +37,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
|
|
|
@@ -103,17 +103,20 @@
|
|
|
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';
|
|
|
+ console.log(index);
|
|
|
+ this.activePage = index;
|
|
|
+ console.log(this.activePage)
|
|
|
let params = {
|
|
|
"keyword": this.searchVal,//查询条件,分页展示时就不填
|
|
|
"activePage": this.activePage,//指定页数
|
|
|
@@ -126,6 +129,7 @@
|
|
|
}
|
|
|
]
|
|
|
}
|
|
|
+ console.log(params);
|
|
|
Http.post(url,params)
|
|
|
.then(res=>{
|
|
|
if(res.data.technicalArticlesPage){
|
|
|
@@ -140,12 +144,12 @@
|
|
|
},
|
|
|
handlePageChange(index){
|
|
|
this.activePage = index;
|
|
|
- this.loadTechnologyArticles();
|
|
|
+ this.loadTechnologyArticles(index);
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
this.loadHotArticles();
|
|
|
- this.loadTechnologyArticles();
|
|
|
+ this.loadTechnologyArticles(1);
|
|
|
}
|
|
|
}
|
|
|
</script>
|