对接评论
This commit is contained in:
@@ -12,36 +12,36 @@
|
||||
<a-button @click="handleSubmit" type="primary">{{$t('publishComment')}}</a-button>
|
||||
</div>
|
||||
<div class="comment-box">
|
||||
<div class="comment-box-top-box" v-for="(item,index) in 3">
|
||||
<div class="comment-box-top-box" v-for="(item,index) in dataList" :key="index">
|
||||
<div class="title-text">{{$t('record')+(index + 1)}}</div>
|
||||
<div class="box-content">
|
||||
<div class="img-box">
|
||||
<img src="../../../assets/daiban.png" class="img" alt="">
|
||||
</div>
|
||||
<div class="box-text">
|
||||
<span class="box-text-name">张三</span>
|
||||
<span calss="box-text-time">2012-45-45 12:00:00</span>
|
||||
<span class="box-text-name">{{item.name}}</span>
|
||||
<span calss="box-text-time">{{item.createTime}}</span>
|
||||
</div>
|
||||
<div class="box-text-text">
|
||||
法规清单缺少标准’’GB 7258“,注意补充
|
||||
{{item.content}}
|
||||
</div>
|
||||
<div class="box-icon" @click="messageClick()">
|
||||
<div class="box-icon" @click="messageClick(item)">
|
||||
<a-icon type="message"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="inside-box">
|
||||
<div class="box-content-inside" v-for="item in 2">
|
||||
<div class="inside-box" v-if="item.ProjectCommentVOList && item.ProjectCommentVOList.length > 0">
|
||||
<div class="box-content-inside" v-for="(val,indexOne) in item.ProjectCommentVOList" :key="indexOne">
|
||||
<div class="img-box">
|
||||
<img src="../../../assets/daiban.png" class="img" alt="">
|
||||
</div>
|
||||
<div class="box-text">
|
||||
<span class="box-text-name">张三</span>
|
||||
<span calss="box-text-time">2012-45-45 12:00:00</span>
|
||||
<span class="box-text-name">{{val.name}}</span>
|
||||
<span calss="box-text-time">{{val.createTime}}</span>
|
||||
</div>
|
||||
<div class="box-text-text">
|
||||
法规清单缺少标准’’GB 7258“,注意补充
|
||||
{{val.content}}
|
||||
</div>
|
||||
<div class="box-icon" @click="messageClick()">
|
||||
<div class="box-icon" @click="messageClick(val)">
|
||||
<a-icon type="message"/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -65,11 +65,17 @@
|
||||
<div class="title-text">
|
||||
<span class="title-text-text" :title="title">{{title}}</span>
|
||||
</div>
|
||||
<a-form-model-item class="itemModel" :prop="'publishComment'">
|
||||
<a-form-model-item v-if="title == $t('replyToComments')" class="itemModel" :prop="'replyContent'">
|
||||
<a-textarea
|
||||
:placeholder="$t('PleaseEnter')+title"
|
||||
:disabled="false"
|
||||
v-model="formInline.publishComment" :rows="4"/>
|
||||
v-model="formInline.replyContent" :rows="4"/>
|
||||
</a-form-model-item>
|
||||
<a-form-model-item v-else-if="title == $t('publishComment')" class="itemModel" :prop="'commentContent'">
|
||||
<a-textarea
|
||||
:placeholder="$t('PleaseEnter')+title"
|
||||
:disabled="false"
|
||||
v-model="formInline.commentContent" :rows="4"/>
|
||||
</a-form-model-item>
|
||||
</div>
|
||||
</a-col>
|
||||
@@ -81,22 +87,37 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getAction, postAction } from '@/api/manage'
|
||||
|
||||
export default {
|
||||
name: 'commentList',
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
dataList: [],
|
||||
formInline: {},
|
||||
title: this.$t('comment'),
|
||||
confirmLoading: false,
|
||||
visibleComment: false,
|
||||
url: {
|
||||
list: '/project/projectCommentEO/list',
|
||||
add: '/project/projectCommentEO/add',
|
||||
edit: '/project/projectReplyEO/add'
|
||||
},
|
||||
rules: {
|
||||
publishComment: [
|
||||
commentContent: [
|
||||
{
|
||||
required: true,
|
||||
message: this.$t('publishComment') + this.$t('cannotEmpty'),
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
replyContent: [
|
||||
{
|
||||
required: true,
|
||||
message: this.$t('replyToComments') + this.$t('cannotEmpty'),
|
||||
trigger: 'blur'
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -112,12 +133,43 @@
|
||||
},
|
||||
handleSubmit() {
|
||||
this.title = this.$t('publishComment')
|
||||
this.formInline = {}
|
||||
this.visibleComment = true
|
||||
},
|
||||
getList() {
|
||||
getAction(this.url.list, {}).then((res) => {
|
||||
if (res.success) {
|
||||
this.dataList = res.result || []
|
||||
} else {
|
||||
this.dataList = []
|
||||
}
|
||||
})
|
||||
},
|
||||
handleOkComment() {
|
||||
this.$refs.ruleForm.validate(valid => {
|
||||
if (valid) {
|
||||
|
||||
let url = ''
|
||||
let query = {}
|
||||
if (this.title == this.$t('publishComment')) {
|
||||
url = this.url.add
|
||||
query = {
|
||||
commentContent: this.formInline.commentContent,
|
||||
projectLibraryId: this.$route.query.id
|
||||
}
|
||||
} else if (this.title == this.$t('replyToComments')) {
|
||||
url = this.url.edit
|
||||
query = {
|
||||
replyContent: this.formInline.replyContent,
|
||||
projectCommentId: this.formInline.id
|
||||
}
|
||||
}
|
||||
postAction(url, query).then((res) => {
|
||||
if (res.success) {
|
||||
this.$message.success(this.$t('OperationSuccessful'))
|
||||
} else {
|
||||
this.$message.success(this.$t('operationFailed'))
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
this.visibleComment = false
|
||||
@@ -125,7 +177,9 @@
|
||||
handleCancelComment() {
|
||||
this.visibleComment = false
|
||||
},
|
||||
messageClick() {
|
||||
messageClick(row) {
|
||||
this.formInline = {}
|
||||
this.formInline.projectCommentId = row.id
|
||||
this.title = this.$t('replyToComments')
|
||||
this.visibleComment = true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user