提交修改

This commit is contained in:
daihh
2022-05-30 23:25:01 +08:00
parent b050613020
commit b749df42e6
19 changed files with 481 additions and 307 deletions

View File

@@ -1,12 +1,12 @@
<template>
<div class="item-agr">
<div style="padding: 40px 20px 0 20px;color: #8a8a8a;">
<div style="text-align: center;font-size: 26px;padding-bottom:40px ;">京东方大学堂内容发布须知</div>
<div style="min-height: 300px;max-height: 500px;overflow-y: auto;">
<div style="line-height: 30px; white-space:pre-line" v-html="context" ></div>
<div style="padding: 0 10px 0 10px;color:#626262;;">
<div style="text-align: center;font-size: 26px;padding-bottom:20px ;">京东方大学堂内容发布须知</div>
<div class="agr-content" style="min-height: 320px;max-height: 320px;overflow-y: auto;">
<div style="" >
<p style="margin-bottom:10px;line-height: 24px; white-space:pre-line" v-for="(item,index) in context" :key="index">{{item}}</p>
</div>
</div>
<!-- <div style="height: 100px;"></div> -->
</div>
</div>
</template>
@@ -16,7 +16,7 @@ import apiProtocol from '@/api/modules/protocol.js';
data(){
return {
baseUrl:process.env.VUE_APP_FILE_BASE_URL,
context:'',
context:[],
}
},
created() {
@@ -33,7 +33,8 @@ import apiProtocol from '@/api/modules/protocol.js';
getprotocol(){
apiProtocol.query(1).then(res=>{
if(res.status == 200){
this.context = res.result.content;
let list = res.result.content.split('\n');
this.context = list;
}
})
}
@@ -42,5 +43,9 @@ import apiProtocol from '@/api/modules/protocol.js';
</script>
<style scoped lang="scss">
.agr-content{
background: #f7f7f7;
padding: 20px;
color: #626262;
}
</style>

View File

@@ -65,7 +65,7 @@
<div class="zan-wu" v-if="list.length == 0">暂无评论</div>
<div class="comment" v-for="(com,comIdx) in list" :key="com.id">
<div class="comment-top">
<div class="comment-">
<div class="comment-author">
<authorInfo :avatar="com.avatar" :name="com.sysCreateBy" :sex="com.sex"></authorInfo>
</div>
<div class="comment-time">
@@ -74,14 +74,19 @@
</div>
<div class="comment-body" >
<div class="comment-info" @mouseover="showButtons(com.id)" @mouseout="hideButtons()">
<div class="comment-content" @click="cancelReply()">{{com.content}}</div>
<div class="comment-content" @click="cancelReply()">
{{displayAll(com)}}
<span v-if="com.content.length>170" @click="changeIsAll(com)">
{{com.isAll?'收起':'全文'}}
</span>
</div>
<div class="comment-btns">
<!-- <a><svg-icon icon-class="like"></svg-icon><span>66</span></a> -->
<div v-show="btnsShowRowId==com.id">
<a @click="showReply(com)"><svg-icon icon-class="comment" style="margin-right: 0px;font-size: 16px;"></svg-icon><span>回复</span></a>
<!--必须当前登录人是一个人-->
<a v-if="userInfo.aid==com.sysCreateAid" @click="delCommnet(com,comIdx)"><svg-icon icon-class="remove" style="margin-right: 0px;font-size: 16px;"></svg-icon><span>删除</span></a>
<a v-if="com.replyList && com.replyList.length==5" @click="showMoreReply(com)" ><svg-icon icon-class="all" style="margin-right: 0px;font-size: 16px;"></svg-icon><span>全部</span></a>
<!-- <a v-if="com.replyList && com.replyList.length==5" @click="showMoreReply(com)" ><svg-icon icon-class="all" style="margin-right: 0px;font-size: 16px;"></svg-icon><span>全部</span></a> -->
</div>
</div>
<div v-if="replyInfo.parentId==com.id" class="comment-reply" style="padding-bottom: 5px;">
@@ -110,7 +115,12 @@
</div>
<div class="comment-body" @mouseover="showButtons(reply.id)" @mouseout="hideButtons()">
<div class="comment-info" >
<div class="comment-content" @click="cancelReply()">{{reply.content}}</div>
<div class="comment-content" @click="cancelReply()">
{{displayAll(reply)}}
<span v-if="reply.content.length>170" @click="changeIsAll(reply)">
{{reply.isAll?'收起':'全文'}}
</span>
</div>
<div class="comment-btns">
<!-- <a><svg-icon icon-class="like"></svg-icon><span>66</span></a> -->
<div v-show="btnsShowRowId==reply.id">
@@ -405,7 +415,8 @@
res.result.list.forEach(item=>{
item.avatar='';
item.orgInfo='';
// item.sex=null;
item.isAll=false;
//item.sex=null;
allList.push(item);
ids.push(item.sysCreateAid);
if(item.replyList && item.replyList!=''){
@@ -413,6 +424,7 @@
reply.avatar='';
reply.orgInfo='';
reply.sex=null;
reply.isAll=false;
allList.push(reply);
ids.push(reply.sysCreateAid);
})
@@ -457,13 +469,14 @@
}
apiComment.add(cdata).then(res=>{
apiComment.add(cdata).then(res=>{
if(res.status==200){
// this.list.unshift(res.result);
// this.sex =
res.result.sex=null;
res.result.isAll=false;
this.list.unshift(res.result);
this.loadAuthorInfo([res.result],[res.result.sysCreateAid]);
this.loadAuthorInfo([res.result],[res.result.sysCreateAid]);
this.$message.success('发布成功');
//
@@ -488,6 +501,17 @@
hideButtons(){
this.btnsShowRowId='';
},
//展示全部
displayAll(item) {
//console.log(item,'item');
if(!item.isAll && item.content && item.content.length > 170) {
return item.content.slice(0, 170) + "...";
}
return item.content;
},
changeIsAll(item) {
item.isAll=!item.isAll;
},
showReply(item){
this.replyInfo.objType=this.objType;
this.replyInfo.objId=this.objId;
@@ -513,7 +537,8 @@
}
apiComment.reply(this.replyInfo).then(res=>{
if(res.status==200){
res.result.sex = null;
res.result.sex = null;
res.result.isAll=false;
this.loadAuthorInfo([res.result],[res.result.sysCreateAid]);
comment.replyList.push(res.result);
this.replyInfo.parentId='';
@@ -617,6 +642,7 @@
apiComment.reply(this.replyInfo).then(res=>{
if(res.status==200){
res.result.sex = null;
res.result.isAll=false;
this.loadAuthorInfo([res.result],[res.result.sysCreateAid]);
this.replyDiaglog.list.push(res.result);
this.replyInfo.parentId='';
@@ -820,7 +846,13 @@
padding-left: 40px;
.comment-content{
padding-bottom: 0px;
white-space: pre-wrap;
word-break:break-all;
span {
color: #409eff;
cursor: pointer;
margin-left: 5px;
}
}
.comment-btns{
// padding: 5px 10px 10px 0px;

View File

@@ -178,7 +178,10 @@ export default {
}
},
created(){
if(this.data && this.data.id!='' && !this.readonly){
},
mounted() {
if(this.data && this.data.id && !this.readonly){
this.checkHas();
}
},