我分享的撤回

This commit is contained in:
zhaofang
2022-06-09 15:28:31 +08:00
parent 447f73ad81
commit c9d8b320d1
3 changed files with 99 additions and 95 deletions

View File

@@ -27,13 +27,13 @@
<!-- 全部 -->
<el-tab-pane label="全部" name="all">
<div v-for="(item, index) in dataList.list">
<course-items type="toMy" v-if="item.type==1" :items="[item]" @confirm="confirm"></course-items>
<case-items type="toMy" v-if="item.type==3" :items="[item]" @confirm="confirm" ></case-items>
<article-items type="toMy" v-if="item.type==2" @confirm="confirm" :items="[item]"></article-items>
<qa-items type="toMy" v-if="item.type==4" :items="[item]" @confirm="confirm" :collect="true" :share="false" :remove="false" :edit="false"></qa-items>
<course-items type="myShare" v-if="item.type==1" :items="[item]" @confirm="confirm"></course-items>
<case-items type="myShare" v-if="item.type==3" :items="[item]" @confirm="confirm" ></case-items>
<article-items type="myShare" v-if="item.type==2" @confirm="confirm" :items="[item]"></article-items>
<qa-items type="myShare" v-if="item.type==4" :items="[item]" @confirm="confirm" :collect="true" :share="false" :remove="false" :edit="false"></qa-items>
</div>
<!-- v-if="courseList.count>courseList.pageSize" -->
<div style="text-align: center;margin-top:57px">
<div style="text-align: center;margin-top:57px" v-if="dataList.list.length > 0">
<el-pagination
background
@size-change="handleSizeChange"
@@ -45,12 +45,18 @@
:total="dataList.count"
></el-pagination>
</div>
<div v-else>
<div v-if="dataList.list.length == 0">
<div v-if="isSearh" class="zan-wu">没有查询到相关内容</div>
<div v-else class="zan-wu">暂无数据</div>
</div>
</div>
</el-tab-pane>
<el-tab-pane label="课程" name="course">
<div style="min-height: 500px;">
<course-items @confirm="confirm" type="toMy" :items="courseList.list"></course-items>
<course-items @confirm="confirm" type="myShare" :items="courseList.list"></course-items>
<!-- v-if="courseList.count>courseList.pageSize" -->
<div v-if="courseList.list.length > 0" style="text-align: center;margin-top:57px">
<el-pagination
@@ -68,15 +74,15 @@
<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 v-else class="zan-wu">暂无数据</div>
</div>
</div>
</div>
</el-tab-pane>
<el-tab-pane label="案例" name="case">
<div style="min-height: 500px;">
<case-items @confirm="confirm" type="toMy" :items="caseList.list"></case-items>
<case-items @confirm="confirm" type="myShare" :items="caseList.list"></case-items>
<div v-if="caseList.list.length > 0" style="text-align: center;margin-top:57px;">
<el-pagination
background
@@ -99,7 +105,7 @@
</el-tab-pane>
<el-tab-pane label="文章" name="article">
<div style="min-height: 500px;">
<article-items @confirm="confirm" type="toMy" :items="articleList.list"></article-items>
<article-items @confirm="confirm" type="myShare" :items="articleList.list"></article-items>
<!-- v-if="articleList.count>articleList.pageSize" -->
<div v-if="articleList.list.length > 0" style="text-align: center;margin-top:57px;">
<el-pagination
@@ -123,7 +129,7 @@
</el-tab-pane>
<el-tab-pane label="问答" name="qa">
<div>
<qa-items @confirm="confirm" type="toMy" :items="qaList.list"></qa-items>
<qa-items @confirm="confirm" type="myShare" :items="qaList.list"></qa-items>
<!-- v-if="qaList.count>qaList.pageSize" -->
<div v-if="qaList.list.length > 0" style="text-align: center;margin-top:57px;">
<el-pagination
@@ -210,7 +216,6 @@
let query = { pageIndex, pageSize, keyword: this.keyword, isRead: this.isRead };
apiShares.findMeShare(query).then(res=>{
if(res.status == 200){
console.log(res);
this.dataList.count = res.result.count;
res.result.list.forEach(item => {
if(item.type == 4) {
@@ -447,21 +452,35 @@
});
},
confirm(item) {
apiShares.deleteshares(item.id).then(res=>{
let id = '';
if (this.tabName == 'all') {
id = item.shareId;
} else {
id = item.id;
}
apiShares.deleteshares(id).then(res=>{
if(res.status == 200){
this.$message.success('撤回成功');
if (this.tabName == 'qa') {
this.findQa();
}
if (this.tabName == 'article') {
this.findArticle();
}
if (this.tabName == 'course') {
this.findCourse();
}
if (this.tabName == 'case') {
this.findCase();
if(res.result) {
this.$message.success('撤回成功');
if (this.tabName == 'qa') {
this.findQa();
}
if (this.tabName == 'article') {
this.findArticle();
}
if (this.tabName == 'course') {
this.findCourse();
}
if (this.tabName == 'case') {
this.findCase();
}
if (this.tabName == 'all') {
this.findAll();
}
} else {
this.$message.warning(res.message);
}
}else{
this.$message.error('撤回失败');
}

View File

@@ -26,7 +26,7 @@
<qa-items type="toMy" v-if="item.type==4" :items="[item]" @confirm="confirm" :collect="true" :share="false" :remove="false" :edit="false"></qa-items>
</div>
<!-- v-if="courseList.count>courseList.pageSize" -->
<div style="text-align: center;margin-top:57px">
<div style="text-align: center;margin-top:57px" v-if="dataList.list.length > 0">
<el-pagination
background
@size-change="handleSizeChange"
@@ -38,6 +38,12 @@
:total="dataList.count"
></el-pagination>
</div>
<div v-else>
<div v-if="dataList.list.length == 0">
<div v-if="isSearh" class="zan-wu">没有查询到相关内容</div>
<div v-else class="zan-wu">暂无数据</div>
</div>
</div>
</el-tab-pane>
<el-tab-pane label="课程" name="course">
<div style="min-height: 500px;">