update 文档对比

This commit is contained in:
赵霄
2023-09-20 11:26:34 +08:00
parent fbe03c0564
commit 4601acb8b2
6 changed files with 72 additions and 67 deletions
@@ -121,7 +121,8 @@
</div>
</div>
</div>
<commentList ref="commentListRef" />
<!--评论-->
<comment-list ref="commentListRef" />
<!--编辑对比评论-->
<comparison-result-edit-modal ref="comparisonResultEditModal" @ok="getData" />
<div id="images">
@@ -137,7 +138,7 @@ import { getAction, downloadFile, getFileAccessHttpUrl } from '../../../api/mana
import { previewPdf } from '../../../utils/previewPdf.js'
import { Base64 } from 'js-base64'
import { mapGetters } from 'vuex'
import CommentList from '../modules/CommentList.vue'
import CommentList from './modules/CommentList.vue'
import ComparisonResultEditModal from './modules/ComparisonResultEditModal.vue'
import InternalDetailPage from '../../../components/InternalDetailPage.vue'
import { deleteComparisonResult, getComparisonResultDetail } from '../../../api/documentToolApi.js'
@@ -27,7 +27,7 @@
</a-form-item>
</a-col>
<div style="float: right;overflow: hidden;margin-right: 11px" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery">{{ $t('query') }}</a-button>
<a-button type="primary" @click="searchQuery" v-has="'documentComparison:search'">{{ $t('query') }}</a-button>
<a-button style="margin-left: 8px" @click="searchReset">{{ $t('reset') }}</a-button>
</div>
</a-row>
@@ -35,12 +35,11 @@
</div>
<div class="table-operator">
<!--发起对比-->
<!-- v-has="'documentComparison:Initiate'"-->
<a-button icon="block" type="primary" ghost @click="initiatingProcessClick">{{ $t('docTool.comparison.initiateComparison') }}
<a-button icon="block" type="primary" ghost @click="initiatingProcessClick" v-has="'documentComparison:initiateComparison'">
{{ $t('docTool.comparison.initiateComparison') }}
</a-button>
<!--批量删除-->
<!-- v-has="'documentComparison:batchDelete'"-->
<a-button type="primary" icon="delete" ghost @click="batchDelete" v-has="'split:sarFileSplitInfo:deleteBatch'">{{ $t('batchDelete') }}
<a-button type="primary" icon="delete" ghost @click="batchDelete" v-has="'documentComparison:deleteBatch'">{{ $t('batchDelete') }}
</a-button>
</div>
<div>
@@ -100,6 +99,7 @@ export default {
// url传参严格按照当前命名
url: {
list: '/compare/sarFileCompareInfo/page',
delete: '/compare/sarFileCompareInfo/delete',
deleteBatch: '/compare/sarFileCompareInfo/deleteBatch'
},
loading: false,
@@ -179,13 +179,13 @@ export default {
{
text: this.$t('docTool.comparison.comparisonResults'),
clickEvent: 'comparisonResultsClick',
has: 'domesticStandard:collection'
has: 'documentComparison:comparisonResults'
},
// 发布
{
text: this.$t('release'),
clickEvent: 'subscribe',
has: 'domesticStandard:collection',
has: 'documentComparison:publishWithdraw',
show: (record) => {
return (record.createBy === this.userInfo.username || this.administrators) && (!record.releaseState || record.releaseState === 'draft')
}
@@ -194,7 +194,7 @@ export default {
{
text: this.$t('withdraw'),
clickEvent: 'subscribe',
has: 'domesticStandard:collection',
has: 'documentComparison:publishWithdraw',
show: (record) => {
return (record.createBy === this.userInfo.username || this.administrators) && !(!record.releaseState || record.releaseState === 'draft')
}
@@ -203,7 +203,7 @@ export default {
{
text: this.$t('edit'),
clickEvent: 'edit',
has: 'domesticStandard:collection',
has: 'documentComparison:edit',
show: (record) => {
return (record.createBy === this.userInfo.username || this.administrators) && record.releaseState === 'draft'
}
@@ -211,8 +211,8 @@ export default {
// 删除
{
text: this.$t('delete'),
clickEvent: 'comparisonResultsClick',
has: 'domesticStandard:collection',
clickEvent: 'handleDelete',
has: 'documentComparison:delete',
show: (record) => {
return (record.createBy === this.userInfo.username || this.administrators) && record.releaseState === 'draft'
}
@@ -1,7 +1,7 @@
<template>
<div>
<a-drawer
:title="$t('comment')"
:title="$t('docTool.comparison.comment')"
:maskClosable="false"
:width="482"
placement="right"
@@ -13,9 +13,10 @@
@search="allowClearChange"
:placeholder="$t('pleaseEnter')+$t('docTool.comparison.comment')"
v-model="commentContent"></a-input-search>
<a-button @click="submitQuery" style="margin-right: 8px;" type="primary">{{$t('query')}}</a-button>
<a-button @click="submitQuery" style="margin-right: 8px;" type="primary">{{ $t('query') }}</a-button>
<!--发表评论-->
<a-button @click="handleSubmit" :title="$t('docTool.comparison.publishComment')" type="primary">
{{$t('docTool.comparison.publishComment')}}
{{ $t('docTool.comparison.publishComment') }}
</a-button>
</div>
<div class="comment-box" v-if="dataList && dataList.length > 0">
@@ -23,48 +24,49 @@
<!-- <div class="title-text">{{$t('record')+(index + 1)}}</div>-->
<div class="box-content">
<div class="img-box">
<img src="../../../assets/image/daiban.png" class="img" alt="">
<img src="../../../../assets/image/daiban.png" class="img" alt="">
</div>
<div class="box-text">
<span class="box-text-name">{{item.name}}</span>
<span class="box-text-time">{{item.createTime}}</span>
<span class="box-text-name">{{ item.name }}</span>
<span class="box-text-time">{{ item.createTime }}</span>
</div>
<div class="box-text-text">
{{item.content}}
{{ item.content }}
</div>
<div class="box-icon" @click="messageClick(item)">
<a-icon type="message"/>
<a-icon type="message" />
</div>
</div>
<div class="inside-box" v-if="item.resComVoList && item.resComVoList.length > 0">
<div class="box-content-inside" v-for="(val,indexOne) in item.resComVoList" :key="indexOne">
<div class="img-box">
<img src="../../../assets/image/daiban.png" class="img" alt="">
<img src="../../../../assets/image/daiban.png" class="img" alt="">
</div>
<div class="box-text">
<span class="box-text-name">{{val.name}}</span>
<span class="box-text-time">{{val.createTime}}</span>
<span class="box-text-name">{{ val.name }}</span>
<span class="box-text-time">{{ val.createTime }}</span>
</div>
<div class="box-text-text">
{{val.content}}
{{ val.content }}
</div>
<div class="box-icon" @click="messageClick(item)">
<a-icon type="message"/>
<a-icon type="message" />
</div>
</div>
</div>
</div>
</div>
<div class="comment-box-text" v-else>{{$t('docTool.comparison.noComment')}}</div>
<div class="comment-box-text" v-else>{{ $t('docTool.comparison.noComment') }}</div>
</a-drawer>
<comparison-add-reply-comment ref="comparisonAddReplyComment"></comparison-add-reply-comment>
<!--发表评论-->
<comparison-add-reply-comment ref="comparisonAddReplyComment" @ok="getList" />
</div>
</template>
<script>
import { getAction } from '@/api/manage'
import { getCommentList } from '../../../../api/documentToolApi.js'
//
import ComparisonAddReplyComment from './ComparisonAddReplyComment'
import ComparisonAddReplyComment from './ComparisonAddReplyComment.vue'
export default {
name: 'CommentList',
@@ -74,12 +76,7 @@ export default {
visible: false,
dataList: [],
commentContent: '',
loading: false,
url: {
list: '/compare/sarFileCompareResComment/queryListByInfoId',
add: '/compare/sarFileCompareResComment/add',
edit: '/compare/sarFileCompareResComment/edit'
}
loading: false
}
},
methods: {
@@ -103,7 +100,7 @@ export default {
},
getList () {
this.loading = true
getAction(this.url.list, {
getCommentList({
id: this.$route.query.id,
str: this.commentContent
}).then((res) => {
@@ -298,6 +295,7 @@ export default {
white-space: nowrap;
margin-top: 4px;
}
.box-input-search {
/deep/ .ant-input-search-icon {
display: none;
@@ -14,7 +14,7 @@
<div class="box-title-text">
<div class="title-text">
<span class="required">*</span>
<span class="title-text-text" :title="title">{{title}}</span>
<span class="title-text-text" :title="title">{{ title }}</span>
</div>
<a-form-model-item v-if="title === $t('docTool.comparison.replyToComments')" class="item-model" :prop="'replyContent'">
<a-textarea
@@ -30,7 +30,7 @@
:disabled="false"
:maxLength="500"
v-model.trim="formInline.commentContent"
:autoSize="{ minRows: 2, maxRows: 6 }"/>
:autoSize="{ minRows: 2, maxRows: 6 }" />
</a-form-model-item>
</div>
</a-col>
@@ -40,7 +40,7 @@
</template>
<script>
import { postAction } from '@/api/manage'
import { addComment } from '../../../../api/documentToolApi.js'
export default {
name: 'ComparisonAddReplyComment',
@@ -76,19 +76,13 @@ export default {
handleOkComment () {
this.$refs.ruleForm.validate(valid => {
if (valid) {
let url = ''
let query = {}
let Action
if (this.title === this.$t('docTool.comparison.publishComment')) {
url = this.url.add
Action = postAction
query = {
comment: this.formInline.commentContent,
infoId: this.$route.query.id
}
} else if (this.title === this.$t('docTool.comparison.replyToComments')) {
Action = postAction
url = this.url.add
query = {
comment: this.formInline.replyContent,
parentId: this.formInline.projectCommentId,
@@ -96,11 +90,11 @@ export default {
}
}
this.confirmLoading = true
Action(url, query).then((res) => {
addComment(query).then((res) => {
if (res.success) {
this.$message.success(this.$t('operationSuccessful'))
this.visible = false
this.getList()
this.$emit('ok')
} else {
this.$message.warning(this.$t('operationFailed'))
}
@@ -118,5 +112,5 @@ export default {
</script>
<style scoped lang="less">
@import'~@assets/less/common.less';
@import '~../../../../assets/less/common.less';
</style>