我分享的撤回

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

@@ -52,9 +52,7 @@
<el-radio-button v-for="item in Profess" :key="item.code" :label="item.name" > {{ item.name }} </el-radio-button>
</el-radio-group>
</div>
</div>
</el-col>
</el-row>
</div>
@@ -80,45 +78,33 @@
<div class="case-info-cont">
<router-link :to="'/case/detail?id='+item.id">
<div class="case-info-title">
<!-- <span v-if="i % 2 == 0" style="color:red;margin-right:5px">[组织推荐]</span> -->
<div class="case-titdiv">
<span class="case-tittext" v-html="item.title"></span>
<div class="case-info-date">
<i class="el-icon-time"></i>
<time-show :time="item.sysCreateTime"></time-show>
</div>
</div>
<div class="case-titdiv">
<span class="case-tittext" v-html="item.title"></span>
<div class="case-info-date">
<i class="el-icon-time"></i>
<time-show :time="item.sysCreateTime"></time-show>
</div>
</div>
</div>
</router-link>
<div style="height:35px; ">
<author :avatar="item.authorInfo.avatar" :name="item.authorInfo.name" :info="item.authorInfo.orgInfo" :sex="item.authorInfo.sex"></author>
</div>
<router-link :to="'/case/detail?id='+item.id">
<div class="keyword-text">
<span v-if="item.keyword1">{{ item.keyword1 }}</span>
<span v-if="item.keyword2">{{ item.keyword2 }}</span>
<span v-if="item.keyword3">{{ item.keyword3 }}</span>
<span v-if="item.keyword4">{{ item.keyword4 }}</span>
<span v-if="item.keyword5">{{ item.keyword5 }}</span>
</div>
<div style="height:35px; ">
<author :avatar="item.authorInfo.avatar" :name="item.authorInfo.name" :info="item.authorInfo.orgInfo" :sex="item.authorInfo.sex"></author>
</div>
<div class="keyword-text">
<span v-if="item.keyword1">{{ item.keyword1 }}</span>
<span v-if="item.keyword2">{{ item.keyword2 }}</span>
<span v-if="item.keyword3">{{ item.keyword3 }}</span>
<span v-if="item.keyword4">{{ item.keyword4 }}</span>
<span v-if="item.keyword5">{{ item.keyword5 }}</span>
</div>
</router-link>
<div class="case-info-summary">
<router-link :to="'/case/detail?id='+item.id">
{{displayAll(item)}}
<span style="color:#588afc" v-if="item.summary.length>190" @click.stop="changeIsAll(item)">
</router-link>
<span style="color:#588afc;cursor:pointer;" v-if="item.summary.length>190" @click.stop="changeIsAll(item)">
{{item.isAll?'收起':'展开'}}
</span>
</div>
</router-link>
<div style="display: flex;justify-content: space-between;">
<div style="margin:8px 0;">
<interactBar :type="0" :shares="false" :data="item" :readonly="true"></interactBar> </div>
@@ -134,10 +120,8 @@
<span class="pag-text-msg" v-else-if="isSeach">没有查询到相关内容</span>
</div>
<div v-if="isSeach" style="height:382px">
</div>
</el-card>
</el-col>
</el-row>
</div>
@@ -308,8 +292,8 @@ export default {
orderField: "comments",
// breCommend:null,
keyWord: "",
majorType: '', //专业分类
orgDomain: '', // 组织领域
majorType: "", //专业分类
orgDomain: "", // 组织领域
orderAsc: false
},
keyWord: "",
@@ -358,20 +342,20 @@ export default {
window.removeEventListener("scroll", this.handleScroll);
},
methods: {
debounce(func, wait) {// 非立即执行
debounce(func, wait) {
// 非立即执行
let timeout;
return function () {
return function() {
let context = this;
let args = arguments;
if (timeout) clearTimeout(timeout);
timeout = setTimeout(() => {
func.apply(context, args)
func.apply(context, args);
}, wait);
}
};
},
//展示全部
displayAll(item) {
if (!item.isAll && item.summary && item.summary.length > 180) {
return item.summary.slice(0, 180) + "...";
}
@@ -398,7 +382,7 @@ export default {
apiCase.usernameList(5).then(res => {
if (res.status == 200) {
this.ankingList = res.result;
console.log(res)
console.log(res);
}
});
},
@@ -453,7 +437,7 @@ export default {
let scrollTop = document.documentElement.scrollTop;
if (outerHeight + scrollTop + 350 >= innerHeight) {
if (this.moreState == 1) {
this.debounce(this.loadMore(),5000);
this.debounce(this.loadMore(), 5000);
}
}
if (scrollTop > 630) {
@@ -571,9 +555,9 @@ export default {
if (i == "orgDomain") {
this.queryCondition.orgDomain = null;
}
if(i == "keyWord"){
this.queryCondition.keyWord = '';
this.keyWord = '';
if (i == "keyWord") {
this.queryCondition.keyWord = "";
this.keyWord = "";
}
this.queryCondition[i] = "";
this.searchTags.splice(index, 1);
@@ -633,40 +617,38 @@ export default {
</script>
<style scoped lang="scss">
::v-deep .el-button{
::v-deep .el-button {
border-radius: 0px;
}
.case-titdiv{
.case-titdiv {
line-height: 25px;
display: flex;
.case-tittext{
.case-tittext {
font-size: 18px;
width: 80%;
display: -webkit-box;
display: -webkit-box;
overflow: hidden;
word-break: break-all;
text-overflow: ellipsis;
-webkit-box-orient: vertical;
-webkit-line-clamp: 1;
box-sizing: border-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 1;
box-sizing: border-box;
}
}
::v-deep .interact-bar .interact-bar-btns .interact-bar-btn{
::v-deep .interact-bar .interact-bar-btns .interact-bar-btn {
margin-left: 0;
margin-right:20px;
margin-right: 20px;
}
.keyword-text{
span{
.keyword-text {
span {
line-height: 30px;
font-size:12px;
font-size: 12px;
color: #9c9c9c;
border: 1px solid #c2c3c8;
padding: 2px 5px;
border-radius: 2px;
margin-right: 8px;
}
}
.searBox {
text-align: center;
@@ -838,9 +820,7 @@ export default {
}
.case-info {
.case-info-cont {
.case-info-cont {
.case-info-title {
font-size: 15px;
color: #333;
@@ -860,11 +840,11 @@ export default {
}
.case-info-summary {
margin-bottom: 5px;
word-break: break-all;
word-break: break-all;
line-height: 25px;
font-size: 15px;
color: #121212;
font-weight: 400;;
font-weight: 400;
}
.case-info-tools {
height: 30px;
@@ -888,7 +868,6 @@ export default {
}
}
}
}
}
.search-div {

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;">