This commit is contained in:
zhaofang
2022-06-07 18:53:29 +08:00
parent 5efe874e99
commit 4ea2cc39fa
2 changed files with 87 additions and 13 deletions

View File

@@ -64,6 +64,30 @@
</div>
</div>
</el-tab-pane>
<el-tab-pane label="案例" name="case">
<div style="min-height: 500px;">
<article-items :keyword="keyword" type="toMy" @confirm="confirm" :items="caseList.list"></article-items>
<!-- v-if="articleList.count>articleList.pageSize" -->
<div v-if="caseList.list.length > 0" style="text-align: center; margin-top:57px">
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="caseList.pageIndex"
:page-sizes="[10, 20, 30, 40]"
:page-size="caseList.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="caseList.count"
></el-pagination>
</div>
<div v-else>
<div v-if="caseList.list.length == 0">
<div v-if="isSearh" class="zan-wu">没有查询到相关内容</div>
<div v-else class="zan-wu">暂无数据</div>
</div>
</div>
</div>
</el-tab-pane>
<el-tab-pane label="文章" name="article">
<div style="min-height: 500px;">
<article-items :keyword="keyword" type="toMy" @confirm="confirm" :items="articleList.list"></article-items>
@@ -180,6 +204,9 @@ export default {
if (this.tabName == 'course') {
this.findCourse();
}
if (this.tabName == 'case') {
this.findCase();
}
},
resData() {
@@ -212,6 +239,9 @@ export default {
if (tab.name == 'course') {
this.findCourse();
}
if (tab.name == 'case') {
this.findCase();
}
},
//分页点击事件
handleSizeChange(value) {
@@ -227,7 +257,10 @@ export default {
this.courseList.pageSize = value;
this.findCourse();
}
if (this.tabName == 'case') {
this.caseList.pageSize = value;
this.findCase()
}
},
//分页点击事件
handleCurrentChange(value) {
@@ -243,8 +276,25 @@ export default {
this.courseList.pageIndex = value;
this.findCourse();
}
if (this.tabName == 'case') {
this.caseList.pageIndex = value;
this.findCase();
}
},
// 案例
findCase(){
let { pageIndex, pageSize } = this.caseList;
let query = { pageIndex, pageSize, keyword: this.keyword, isRead: this.isRead };
apiShares.myCaseList(query).then(res=>{
if(res.status == 200) {
this.caseList.count = res.result.count;
this.caseList.list = res.result.list;
} else {
this.$message.error(res.message);
}
})
},
//问答数据查询
findQa() {
let { pageIndex, pageSize } = this.qaList;