[add] 文档对比迁移

This commit is contained in:
lideqin
2023-08-17 19:18:16 +08:00
parent e0cc6e726f
commit 9f86c9bbb7
13 changed files with 3233 additions and 284 deletions
@@ -0,0 +1,398 @@
<template>
<a-card :bordered="false">
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="6" :sm="8">
<a-form-item :label="$t('number')" :labelCol="{span: 6}" :wrapperCol="{span: 14}">
<a-input :placeholder="$t('pleaseEnter') + $t('number')"
v-model="queryParam.serialNumber"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="8">
<a-form-item :label="$t('title')" :labelCol="{span: 6}" :wrapperCol="{span: 14}">
<a-input :placeholder="$t('pleaseEnter') + $t('title')"
v-model="queryParam.title"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="8">
<a-form-item :label="$t('docTool.comparison.releaseSituation')" :labelCol="{span: 6}" :wrapperCol="{span: 14}">
<j-dict-select-tag v-model="queryParam.releaseState"
:placeholder="$t('pleaseSelect')+$t('docTool.comparison.releaseSituation')"
type="select"
:triggerChange="false" dictCode="release_condition"/>
</a-form-item>
</a-col>
<span style="float: right;overflow: hidden;margin-right: 11px" class="table-page-search-submitButtons">
<a-col :md="6" :sm="24">
<a-button style="margin-left: 8px" @click="searchReset">{{$t('reset')}}</a-button>
<a-button style="margin-left: 8px" type="primary" @click="searchQuery">{{$t('query')}}</a-button>
</a-col>
</span>
</a-row>
</a-form>
</div>
<div class="table-operator">
<!-- v-has="'documentComparison:Initiate'"-->
<div @click="initiatingProcessClick" class="operator-text">
<a-icon type="block"/>
{{$t('docTool.comparison.initiateComparison')}}
</div>
<!-- v-has="'documentComparison:batchDelete'"-->
<div @click="batchDelete" class="operator-text">
<a-icon type="delete"/>
{{$t('batchDelete')}}
</div>
</div>
<div>
<a-table
ref="table"
size="middle"
:components="drag(columns,'columns')"
:loading="loading"
:pagination="ipagination"
:scroll="{x: '100%',y:'calc(100vh - 280px)'}"
rowKey="id"
:data-source="dataSource"
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
:columns="columns"
@change="tableOnChange"
>
<span slot="operation" slot-scope="text,record">
<a class="text-operation" @click="comparisonResultsClick(record)">{{$t('docTool.comparison.comparisonResults')}}</a>
<a class="text-operation"
v-if="record.createBy === userInfoQuery.username || administrators"
@click="subscribe(record)">
{{!record.releaseState || record.releaseState === 'draft' ? $t('release') :$t('withdraw')}}
</a>
<a class="text-operation"
v-if="(record.createBy === userInfoQuery.username || administrators) && record.releaseState === 'draft'"
@click="edit(record)">{{$t('edit')}}</a>
<a class="text-operation"
v-if="(record.createBy === userInfoQuery.username || administrators) && record.releaseState === 'draft'"
@click="deleteData(record)">{{$t('delete')}}</a>
</span>
<span slot="serialNumberRight" :title="text" slot-scope="text,record">
<a @click="serialNumberRightClick(record)">{{text}}</a>
</span>
<span slot="serialNumberLeft" :title="text" slot-scope="text,record">
<a @click="serialNumberLeftClick(record)">{{text}}</a>
</span>
</a-table>
</div>
</a-card>
</template>
<script>
import { getAction, postAction, deleteAction } from '@/api/manage'
import { ResizeHeader, ResizeColumnProvide } from '@/mixins/header'
import { mapGetters } from 'vuex'
import JDictSelectTag from '../../components/dict/JDictSelectTag'
export default {
name: 'DocumentComparison',
mixins: [ResizeHeader, ResizeColumnProvide],
components: { JDictSelectTag },
data () {
return {
// url传参严格按照当前命名
url: {
list: '/compare/sarFileCompareInfo/page',
deleteBatch: '/compare/sarFileCompareInfo/deleteBatch'
},
loading: false,
dataSource: [],
selectedRowKeys: [],
selectedRows: [],
downLoadFileUrl: window._CONFIG.domianPreviewURL + '/sys/common/download',
downLoadImgUrl: window._CONFIG.domianWebImgURL + '/sys/common/download',
/* 分页参数 */
ipagination: {
current: 1,
pageSize: 50,
pageSizeOptions: ['10', '50', '100', '150', '200'],
showTotal: (total, range) => {
return range[0] + '-' + range[1] + ' ' + this.$t('total') + ' ' + total + ' ' + this.$t('strip')
},
showQuickJumper: true,
showSizeChanger: true,
total: 0
},
queryParam: {},
userInfoQuery: {},
administrators: false,
columns: [
{
title: this.$t('number') + ' 1',
align: 'left',
dataIndex: 'serialNumberLeft',
width: 170,
ellipsis: true,
scopedSlots: { customRender: 'serialNumberLeft' }
},
{
title: this.$t('title') + ' 1',
align: 'left',
dataIndex: 'titleLeft',
width: 170,
ellipsis: true,
scopedSlots: { customRender: 'serialNumberLeft' }
},
{
title: this.$t('docTool.comparison.textStatus') + ' 1',
align: 'left',
width: 200,
ellipsis: true,
dataIndex: 'fileTypeLeft'
},
{
title: this.$t('number') + ' 2',
align: 'left',
dataIndex: 'serialNumberRight',
ellipsis: true,
scopedSlots: { customRender: 'serialNumberRight' },
width: 170
},
{
title: this.$t('title') + ' 2',
align: 'left',
dataIndex: 'titleRight',
scopedSlots: { customRender: 'serialNumberRight' },
ellipsis: true,
width: 170
},
{
title: this.$t('docTool.comparison.textStatus') + ' 2',
align: 'left',
width: 200,
ellipsis: true,
dataIndex: 'fileTypeRight'
},
{
title: this.$t('docTool.comparison.releaseSituation'),
align: 'left',
width: 170,
ellipsis: true,
dataIndex: 'releaseStateTitle'
},
{
title: this.$t('creator'),
align: 'left',
width: 170,
ellipsis: true,
dataIndex: 'createBy'
},
{
title: this.$t('remarks'),
align: 'left',
ellipsis: true,
width: 270,
dataIndex: 'remark'
},
{
title: this.$t('operation'),
align: 'left',
fixed: 'right',
width: 310,
scopedSlots: { customRender: 'operation' }
}
]
}
},
mounted () {
if (this.$route.query.serialNumber) {
this.queryParam.serialNumber = this.$route.query.serialNumber
this.queryParam = { ...this.queryParam }
}
this.userInfoQuery = this.userInfo()
this.administrators = false
if (this.userInfoQuery.userRoleList && this.userInfoQuery.userRoleList.length > 0) {
this.userInfoQuery.userRoleList.forEach(res => {
if (res.roleCode === 'admin') {
this.administrators = true
}
})
}
this.getList()
},
methods: {
...mapGetters(['userInfo']),
searchQuery () {
this.ipagination.current = 1
this.getList()
},
searchReset () {
this.queryParam = {}
this.ipagination.current = 1
this.getList()
},
tableOnChange (pagination) {
this.ipagination = pagination
this.getList()
},
getList () {
const queryParam = JSON.parse(JSON.stringify(this.queryParam))
Object.keys(queryParam).forEach(val => {
if (queryParam[val] instanceof Array) {
queryParam[val] = queryParam[val].join(',')
}
})
const query = {
pageNo: this.ipagination.current,
pageSize: this.ipagination.pageSize,
...queryParam
}
this.loading = true
getAction(this.url.list, query).then((res) => {
if (res.success) {
if (res.result.current > 1 && res.result.records.length === 0) {
this.ipagination.current = 1
this.getList()
return
}
this.dataSource = res.result.records || []
this.ipagination.total = res.result.total
}
}).finally(() => {
this.loading = false
})
},
batchDelete () {
if (this.selectedRowKeys.length > 0) {
this.$confirm({
content: this.$t('confirmBatchDeletion'),
onOk: () => {
const idList = []
const selectedRowKeysRecord = JSON.parse(JSON.stringify(this.selectedRowKeysRecord))
for (let i = 0; i < selectedRowKeysRecord.length; i++) {
if (selectedRowKeysRecord[i].createBy === this.userInfoQuery.username &&
selectedRowKeysRecord[i].releaseState === 'draft') {
idList.push(selectedRowKeysRecord[i].id)
}
}
if (idList.length > 0) {
deleteAction(this.url.deleteBatch, { ids: idList.join(',') }).then((res) => {
if (res.success) {
this.$message.success(this.$t('operationSuccessful'))
this.selectedRowKeys = []
this.getList()
} else {
this.$message.warning(res.message)
}
})
} else {
this.$message.warning(this.$t('doNotHavePermissionDeleteData'))
}
}
})
} else {
this.$message.warning(this.$t('selectLeastOne'))
}
},
onSelectChange (value, record) {
this.selectedRowKeys = value
this.selectedRows = record
},
// 对比结果按钮点击
comparisonResultsClick (item) {
if (item.createBy === this.userInfoQuery.username && item.releaseState === 'draft') {
item.isDisplay = 2
} else {
item.isDisplay = 1
}
const newUrl = this.$router.resolve({
path: '/comparisonResults',
query: {
id: item.id,
isDisplay: item.isDisplay
}
})
window.open(newUrl.href, '_blank')
},
// 撤回按钮点击
subscribe (record) {
this.$confirm({
content: record.releaseState === 'draft' ? this.$t('confirmRelease') : this.$t('confirmWithdraw'),
onOk: () => {
let releaseState = ''
if (record.releaseState === 'draft') {
releaseState = 'draft'
} else {
releaseState = 'published'
}
const query = {
releaseState: releaseState,
id: record.id
}
postAction('/compare/sarFileCompareInfo/changeState', query).then((res) => {
if (res.success) {
this.$message.success(this.$t('operationSuccessful'))
this.getList()
} else {
this.$message.warning(this.$t('operationFailed'))
}
})
}
})
},
edit (row) {
const newUrl = this.$router.resolve({
path: '/documentDataComparison',
query: {
id: row.id
}
})
window.open(newUrl.href, '_blank')
},
// 发起对比按钮点击
initiatingProcessClick () {
this.$router.push({
path: '/initiateDocumentComparison'
})
// let newUrl = this.$router.resolve({
// path: '/initiateDocumentComparison'
// })
// window.open(newUrl.href, '_blank')
},
deleteData (val) {
this.$confirm({
content: this.$t('confirmDeletion'),
onOk: () => {
deleteAction(this.url.deleteBatch, { ids: val.id }).then((res) => {
if (res.success) {
this.$message.success(this.$t('operationSuccessful'))
this.getList()
} else {
this.$message.warning(res.message)
}
})
}
})
},
// 编号2和标题2列的点击事件
serialNumberRightClick (row) {
const newUrl = this.$router.resolve({
path: '/documentManage/library/detail',
query: {
id: row.fileKeyRight
}
})
window.open(newUrl.href, '_blank')
},
// 编号1列和标题1列的点击事件
serialNumberLeftClick (row) {
const newUrl = this.$router.resolve({
path: '/documentManage/library/detail',
query: {
id: row.fileKeyLeft
}
})
window.open(newUrl.href, '_blank')
}
}
}
</script>
<style scoped lang="less">
@import'~@assets/less/common.less';
</style>
@@ -0,0 +1,405 @@
<template>
<div>
<a-drawer
:title="$t('comment')"
:maskClosable="false"
:width="482"
placement="right"
:closable="true"
@close="handleCancel"
:visible="visible">
<div class="button-box">
<a-input-search class="box-input box-input-search" allowClear
@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="handleSubmit" class="button-text" :title="$t('docTool.comparison.publishComment')" type="primary">
{{$t('docTool.comparison.publishComment')}}
</a-button>
</div>
<div class="comment-box" v-if="dataList && dataList.length > 0">
<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/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>
</div>
<div class="box-text-text">
{{item.content}}
</div>
<div class="box-icon" @click="messageClick(item)">
<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="">
</div>
<div class="box-text">
<span class="box-text-name">{{val.name}}</span>
<span class="box-text-time">{{val.createTime}}</span>
</div>
<div class="box-text-text">
{{val.content}}
</div>
<div class="box-icon" @click="messageClick(item)">
<a-icon type="message"/>
</div>
</div>
</div>
</div>
</div>
<div class="comment-box-text" v-else>{{$t('docTool.comparison.noComment')}}</div>
</a-drawer>
<a-modal
:title="title"
:width="500"
:visible="visibleComment"
:confirm-loading="confirmLoading"
:maskClosable="false"
@ok="handleOkComment"
@cancel="handleCancelComment"
>
<a-form-model :model="formInline" class="formAdd" :rules="rules" ref="ruleForm">
<a-row :gutter="24">
<a-col :span="24">
<div class="box-title-text">
<div class="title-text">
<span class="required">*</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
:placeholder="$t('pleaseEnter')+title"
:disabled="false"
:maxLength="500"
v-model.trim="formInline.replyContent" :rows="4"/>
</a-form-model-item>
<a-form-model-item v-else-if="title === $t('docTool.comparison.publishComment')" class="item-model" :prop="'commentContent'">
<a-textarea
:placeholder="$t('pleaseEnter')+title"
:disabled="false"
:maxLength="500"
v-model.trim="formInline.commentContent" :rows="4"/>
</a-form-model-item>
</div>
</a-col>
</a-row>
</a-form-model>
</a-modal>
</div>
</template>
<script>
import { getAction, postAction } from '@/api/manage'
export default {
name: 'CommentList',
data () {
return {
visible: false,
dataList: [],
formInline: {},
commentContent: '',
loading: false,
title: this.$t('docTool.comparison.comment'),
confirmLoading: false,
visibleComment: false,
url: {
list: '/compare/sarFileCompareResComment/queryListByInfoId',
add: '/compare/sarFileCompareResComment/add',
edit: '/compare/sarFileCompareResComment/edit'
},
rules: {
commentContent: [
{
required: true,
message: this.$t('docTool.comparison.publishComment') + this.$t('cannotEmpty'),
trigger: 'blur'
}
],
replyContent: [
{
required: true,
message: this.$t('docTool.comparison.replyToComments') + this.$t('cannotEmpty'),
trigger: 'blur'
}
]
}
}
},
methods: {
handleCancel () {
this.visible = false
},
getData () {
this.visible = true
this.commentContent = ''
this.getList()
},
handleSubmit () {
this.title = this.$t('docTool.comparison.publishComment')
this.formInline = {}
this.visibleComment = true
this.$nextTick(() => {
this.$refs.ruleForm.clearValidate()
})
},
allowClearChange () {
this.getList()
},
submitQuery () {
this.getList()
},
getList () {
this.loading = true
getAction(this.url.list, {
id: this.$route.query.id,
str: this.commentContent
}).then((res) => {
if (res.success) {
this.dataList = res.result || []
} else {
this.dataList = []
}
}).finally(() => {
this.loading = false
})
},
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,
infoId: this.$route.query.id
}
}
this.confirmLoading = true
Action(url, query).then((res) => {
if (res.success) {
this.$message.success(this.$t('operationSuccessful'))
this.visibleComment = false
this.getList()
} else {
this.$message.warning(this.$t('operationFailed'))
}
}).finally(() => {
this.confirmLoading = false
})
}
})
},
handleCancelComment () {
this.visibleComment = false
},
messageClick (row) {
this.formInline = {}
this.formInline.projectCommentId = row.id
this.title = this.$t('docTool.comparison.replyToComments')
this.visibleComment = true
this.$nextTick(() => {
this.$refs.ruleForm.clearValidate()
})
}
}
}
</script>
<style scoped lang="less">
.comment-box {
position: absolute;
left: 0;
height: calc(100% - 140px);
width: 100%;
overflow: auto;
padding: 0 24px 24px 24px;
box-sizing: border-box;
}
.comment-box-top-box {
padding: 30px 24px 24px 24px;
box-sizing: border-box;
border: 1px solid #F1F2F4;
border-radius: 4px;
margin-bottom: 24px;
}
.img-box {
width: 32px;
height: 32px;
border-radius: 50%;
display: inline-block;
margin-right: 8px;
position: absolute;
.img {
width: 100%;
height: 100%;
}
}
.box-text {
display: inline-block;
position: absolute;
margin-left: 40px;
.box-text-name {
font-size: 14px;
font-weight: bold;
color: #040B29;
margin-right: 8px;
}
.box-text-time {
font-size: 14px;
font-weight: 400;
color: #6F7385;
}
}
.box-text-text {
font-size: 14px;
font-weight: 400;
color: #040B29;
display: inline-block;
margin-top: 22px;
margin-left: 40px;
word-break: break-word;
}
.title-text {
font-size: 16px;
font-weight: 400;
color: #040B29;
margin-bottom: 18px;
}
.box-content {
position: relative;
}
.box-content-inside {
position: relative;
margin-bottom: 15px;
}
.box-icon {
position: absolute;
right: 0;
top: 0;
cursor: pointer;
}
.inside-box {
background: #F6F7FA;
border-radius: 4px;
margin-left: 40px;
width: calc(100% - 40px);
padding: 18px;
box-sizing: border-box;
margin-top: 15px;
}
.button-box {
text-align: right;
margin-bottom: 24px;
}
.drawer-bootom-button {
position: absolute;
bottom: 0;
width: 100%;
z-index: 100;
border-top: 1px solid #e8e8e8;
padding: 10px 16px;
text-align: right;
left: 0;
background: #fff;
border-radius: 0 0 2px 2px;
}
.box-title-text {
line-height: 1.4;
display: flex;
/*align-items: center;*/
}
.title-text {
width: 74px;
text-align: right;
display: inline-block;
font-weight: 500;
font-size: 14px;
margin-right: 16px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
height: 42px;
line-height: 48px;
}
.item-model {
width: calc(100% - 64px);
display: inline-block;
margin-top: 2px;
}
.required {
color: red;
margin-right: 4px;
}
.title-text-text {
margin-top: 9px;
}
.comment-box-text {
text-align: center;
margin-top: 40px;
}
.box-input {
width: calc(100% - 183px);
margin-right: 8px;
}
.button-text {
width: 88px;
overflow: hidden;
padding: 0 8px;
float: right;
}
/deep/ .button-text span {
width: 64px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
margin-top: 4px;
}
.box-input-search {
/deep/ .ant-input-search-icon {
display: none;
}
}
</style>
@@ -0,0 +1,832 @@
<template>
<a-spin :spinning="loading">
<div class="doc-detail-wrap">
<div class="doc-detail-header">
<div class="doc-detail-title">
<span style="line-height: 66px;display: inline-block;float: left" @click="goBack">
<a-icon type="arrow-left" style="margin-right: 6px;"/>
</span>
<span> {{$t('docTool.comparison.comparisonResults')}}</span>
</div>
<div class="doc-detail-right">
<div @click="viewVarianceAssessmentClick"
class="operator-text-text"
:class="{'operator-text-text-text': isVarianceOne}"
:title="$t('docTool.comparison.viewVarianceAssessment')">
<a-icon type="eye"/>
{{$t('docTool.comparison.viewVarianceAssessment')}}
</div>
<div @click="viewConsistentAssessmentClick" class="operator-text-text"
:class="{'operator-text-text-text': isVarianceTwo}"
:title="$t('docTool.comparison.viewConsistentAssessment')">
<a-icon type="eye"/>
{{$t('docTool.comparison.viewConsistentAssessment')}}
</div>
<div @click="viewAllClick" class="operator-text-text"
:class="{'operator-text-text-text': isVarianceThe}"
:title="$t('docTool.comparison.viewAll')">
<a-icon type="eye"/>
{{$t('docTool.comparison.viewAll')}}
</div>
<div @click="exportComparisonReportClick" class="operator-text-text"
:title="$t('docTool.comparison.exportComparisonReport')">
<a-icon type="export" :rotate="-90"/>
{{$t('docTool.comparison.exportComparisonReport')}}
</div>
<div @click="commentClick" class="operator-text-text"
:title="$t('docTool.comparison.comment')">
<a-icon type="message"/>
{{$t('docTool.comparison.comment')}}
</div>
</div>
</div>
<div style="">
<div class="detail-content">
<div class="detail-content-header" style="margin-bottom: 20px">
<a-checkbox @change="onChange" :indeterminate="indeterminate" :checked="checkAll"
style="margin-left: 20px;float: left"></a-checkbox>
<div class="detail-content-header-content">
<div class="detail-content-header-content-left"
:title="resultData.serialNumberLeft + resultData.fileNameLeft"
:class="{'detail-content-header-content-left-active': isDisplay}">
{{$t('docTool.comparison.selectedStandard')}}{{resultData.serialNumberLeft}}
<span style="cursor: pointer"
@click="fileClick(resultData.fileNameLeft,resultData.fileIdLeft)">{{resultData.fileNameLeft}}</span>
</div>
<div class="detail-content-header-content-content"
:title="resultData.serialNumberRight + resultData.fileNameRight"
:class="{'detail-content-header-content-left-active':isDisplay}">
{{$t('docTool.comparison.selectedStandard')}}{{resultData.serialNumberRight}}
<span style="cursor: pointer"
@click="fileClick(resultData.fileNameRight,resultData.fileIdRight)">{{resultData.fileNameRight}}</span>
</div>
<div class="detail-content-header-content-rightOne"
:class="{'detail-content-header-content-rightOne-active':isDisplay}"
:title="$t('docTool.comparison.comparisonDifferenceComment')">
{{$t('docTool.comparison.comparisonDifferenceComment')}}
</div>
<div class="detail-content-header-content-right" v-if="!isDisplay">
{{$t('operation')}}
</div>
</div>
</div>
<a-checkbox-group @change="checkboxChange" v-model="checkboxList"
style="width: 100%;height: calc(100vh - 300px)">
<div class="detail-content-content" v-for="(item,index) in resultData.resList" :key="index">
<a-checkbox :value="item.id" class="detail-checkbox"></a-checkbox>
<div class="detail-content-content-text"
:class="{'detail-content-content-text-color':checkboxList.join(',').includes(item.id)}">
<div class="detail-content-content-text-left"
:class="{'detail-content-content-text-dis':isDisplay}">
<div class="detail-content-left">
<div class="detail-content-left-top">
<span>{{item.itemsNumLeft}}</span>
<span style="margin-left: 10px">{{item.itemsNameLeft}}</span>
</div>
<div class="detail-content-left-button" v-html="item.itemsTextLeft"></div>
</div>
<div class="detail-content-right">
<div class="detail-content-left-top">
<span>{{item.itemsNumRight}}</span>
<span style="margin-left: 10px">{{item.itemsNameRight}}</span>
</div>
<div class="detail-content-left-button" v-html="item.itemsTextRight"></div>
</div>
<div class="detail-content-right-one">
<div class="detail-content-left-button">
{{item.comment}}
</div>
</div>
<!-- <div class="detail-content-bottom"-->
<!-- :class="{'detail-content-bottom-color':checkboxList.join(',').includes(item.id)}">-->
<!-- <div class="detail-content-bottom-left"-->
<!-- :class="{'detail-content-bottom-left-text':language == 'en-us' ? true:false}"-->
<!-- :title="$t('docTool.comparison.comparisonDifferenceComment')">-->
<!-- <a-icon type="message"/>-->
<!-- {{$t('docTool.comparison.comparisonDifferenceComment')}}:-->
<!-- </div>-->
<!-- <div class="detail-content-bottom-right"-->
<!-- :class="{'detail-content-bottom-right-text':language == 'en-us' ? true:false}">-->
<!-- {{item.comment}}-->
<!-- </div>-->
<!-- </div>-->
</div>
<div class="detail-content-content-text-right" v-if="!isDisplay">
<span class="text-button-one">
<a class="text-button" @click="comparaEdit(item)">{{$t('edit')}}</a>
<a class="text-button" @click="comparaDelete(item)">{{$t('delete')}}</a>
</span>
</div>
</div>
</div>
</a-checkbox-group>
<div class="detail-content-content">
<a-checkbox @change="fullCheckboxChange" v-model="fullCheckbox" class="detail-checkbox">
</a-checkbox>
<div class="detail-content-content-text" :class="{'detail-content-content-text-color':fullCheckbox}">
<div class="detail-content-content-text-left"
:class="{'detail-content-content-text-dis':isDisplay}">
<div class="detail-content-content-text-left-text" :title="resultData.comments">
<span>{{$t('docTool.comparison.fullTextComments')}}:</span> {{resultData.comments}}
</div>
</div>
<div class="detail-content-content-text-right" v-if="!isDisplay">
<span class="text-button-one">
<a class="text-button" @click="fullTextEdit">{{$t('edit')}}</a>
<!-- <a class="text-button">{{$t('delete')}}</a>-->
</span>
</div>
</div>
</div>
</div>
</div>
</div>
<a-modal
:title="title"
:width="600"
:visible="visible"
:confirm-loading="confirmLoading"
:maskClosable="false"
@cancel="visible = false"
>
<template slot="footer">
<a-button key="back" @click="visible = false">
{{$t('cancel')}}
</a-button>
<a-button type="primary" :loading="confirmLoading" @click="fullTextCommentsSubmit">
{{$t('submit')}}
</a-button>
</template>
<a-form-model :model="formInlineText" class="formAdd" :rules="rulesText" ref="ruleFormText">
<div class="box-title-text-remarks" v-if="title === $t('docTool.comparison.fullTextComments')">
<div class="title-text-remarks" :title="$t('docTool.comparison.fullTextComments')">
<span>{{$t('docTool.comparison.fullTextComments')}}</span>
</div>
<a-form-model-item class="item-model" style="width: calc(100% - 113px)" prop="comment">
<a-textarea :placeholder="$t('pleaseEnter') + $t('docTool.comparison.fullTextComments')"
v-model.trim="formInlineText.comment"
:maxLength="500"
:rows="4"/>
</a-form-model-item>
</div>
<div class="box-title-text-remarks" v-if="title === $t('docTool.comparison.comparativeComments')">
<div class="title-text-remarks" :title="$t('docTool.comparison.comparativeComments')">
<span>{{$t('docTool.comparison.comparativeComments')}}</span>
</div>
<a-form-model-item class="item-model" style="width: calc(100% - 113px)" prop="comment">
<a-textarea :placeholder="$t('pleaseEnter')+$t('docTool.comparison.comparativeComments')"
v-model.trim="formInlineText.comment"
:maxLength="500"
:rows="4"/>
</a-form-model-item>
</div>
</a-form-model>
</a-modal>
<commentList ref="commentListRef"/>
<div id="images">
<div class="image" v-viewer="{movable: false}">
<img v-show="image" :src="imageUrl">
</div>
</div>
</a-spin>
</template>
<script>
import { getAction, downloadFile, deleteAction, putAction, getFileAccessHttpUrl } from '@/api/manage'
import { previewPdf } from '@/utils/previewPdf'
import { Base64 } from 'js-base64'
import { mapGetters } from 'vuex'
import CommentList from './CommentList'
export default {
name: 'ComparisonResults',
components: { CommentList },
data () {
return {
loading: false,
checkboxList: [],
isVarianceOne: false,
isVarianceTwo: false,
isVarianceThe: false,
confirmLoading: false,
downLoadFileUrl: window._CONFIG.domianPreviewURL + '/sys/common/download',
downLoadImgUrl: window._CONFIG.domianWebImgURL + '/sys/common/download',
visible: false,
formInlineText: {},
rulesText: {},
title: '',
indeterminate: false,
checkAll: false,
isDisplay: false,
fullCheckbox: false,
resultData: {},
comment: '',
language: '',
url: {
exportData: '/compare/sarFileCompareItemComment/exportResXls'
},
image: false,
imageUrl: ''
}
},
mounted () {
if (this.$route.query.isDisplay === 2) {
this.isDisplay = false
} else {
this.isDisplay = true
}
document.title = this.$t('docTool.comparison.documentComparison') + ' - ' + this.$t('docTool.comparison.comparisonResults')
this.language = localStorage.getItem('language') || ''
this.getData()
},
methods: {
...mapGetters(['userInfo']),
goBack () {
this.$router.push({
path: '/documentComparison'
})
},
// 评论按钮点击
commentClick () {
this.$refs.commentListRef.getData()
},
// 导出对比报告按钮点击
exportComparisonReportClick () {
const checkboxList = JSON.parse(JSON.stringify(this.checkboxList))
const fullCheckbox = this.fullCheckbox
const query = {
selectIds: checkboxList.join(','),
includeComments: fullCheckbox,
infoId: this.$route.query.id,
comment: this.comment
}
downloadFile(this.url.exportData, this.resultData.serialNumberLeft + ' - ' + this.resultData.serialNumberRight + this.$t('docTool.comparison.comparisonResults') + '.xls', query, this.deselect)
},
deselect () {
this.checkboxList = []
this.fullCheckbox = false
this.indeterminate = false
this.checkAll = false
},
// 查看一致性按钮点击
viewConsistentAssessmentClick () {
this.comment = '一致'
this.isVarianceTwo = true
this.isVarianceOne = false
this.isVarianceThe = false
this.getData()
},
// 查看差异项按钮点击
viewVarianceAssessmentClick () {
this.isVarianceOne = true
this.isVarianceTwo = false
this.isVarianceThe = false
this.comment = '差异'
this.getData()
},
// 查看全部按钮点击
viewAllClick () {
this.comment = ''
this.isVarianceThe = true
this.isVarianceOne = false
this.isVarianceTwo = false
this.getData()
},
// 点击文件名
fileClick (name, id) {
const fileName = name
const index1 = fileName.lastIndexOf('.')
const index2 = fileName.length
const fileSuffix = fileName.substring(index1, index2)
if (fileSuffix === '.pdf') {
// window.open('/pdf/web/viewer.html?file=' + encodeURIComponent('/jero-boot/sys/common/pdf/viewFile?id=' + id + '&userName=' + this.userInfo().username))
const url = previewPdf(id)
window.open(url)
} else if (fileSuffix === '.docx' || fileSuffix === '.doc') {
const url = window._CONFIG.onlinePreviewDomainURL + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + id + fileSuffix)
window.open(url, '_blank')
} else if (fileSuffix === '.xlsx' || fileSuffix === '.xls') {
const url = window._CONFIG.onlinePreviewDomainURL + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + id + fileSuffix)
window.open(url, '_blank')
} else if (fileSuffix === '.png' || fileSuffix === '.jpeg' || fileSuffix === '.gif' || fileSuffix === '.jpg') {
// const url = window._CONFIG.onlinePreviewDomainURL + '?url=' + Base64.encode(this.downLoadImgUrl + '/' + id + fileSuffix)
// window.open(url, '_blank')
this.image = true
this.imageUrl = getFileAccessHttpUrl(id)
// 获取viewer实例
const viewer = this.$el.querySelector('.image').$viewer
// 调用show方法进行显示预览图
viewer.show()
} else {
downloadFile('/sys/common/downLoadFile', name, { id: id })
}
},
// 获取对比结果详情
getData () {
const query = {
id: this.$route.query.id,
infoId: this.$route.query.id,
comment: this.comment
}
this.loading = true
getAction('/compare/sarFileCompareItemComment/queryCompareResult', query).then((res) => {
if (res.success) {
this.resultData = res.result || {}
} else {
this.resultData = {}
}
}).finally(() => {
this.loading = false
})
},
// 复选框组改变
checkboxChange (checkedList) {
this.indeterminate = (!!checkedList.length && checkedList.length < this.resultData.resList.length) || (this.fullCheckbox && this.checkboxList.length < this.resultData.resList.length) || (!this.fullCheckbox && !!checkedList.length)
this.checkAll = checkedList.length === this.resultData.resList.length && this.fullCheckbox
},
// 全文评论复选框改变
fullCheckboxChange (event) {
this.indeterminate = (!!this.checkboxList.length && this.checkboxList.length < this.resultData.resList.length) || (event.target.checked && this.checkboxList.length < this.resultData.resList.length) || (!this.fullCheckbox && !!this.checkboxList.length)
this.checkAll = this.checkboxList.length === this.resultData.resList.length && event.target.checked
},
// 全选复选框改变
onChange (event) {
this.checkAll = event.target.checked
if (event.target.checked) {
this.resultData.resList.forEach(res => {
this.checkboxList.push(res.id)
})
this.fullCheckbox = true
this.indeterminate = false
} else {
this.checkboxList = []
this.fullCheckbox = false
}
if (this.checkboxList.length === 0 && !this.fullCheckbox) {
this.checkAll = false
this.indeterminate = false
}
},
// 发表评论弹框的提交按钮点击
fullTextCommentsSubmit () {
this.$refs.ruleFormText.validate(valid => {
if (valid) {
if (this.title === this.$t('docTool.comparison.fullTextComments')) {
this.fullTextComments()
} else {
this.comparaComments()
}
}
})
},
// 全文评论提交
fullTextComments () {
this.confirmLoading = true
const query = {
id: this.$route.query.id,
comments: this.formInlineText.comment
}
putAction('/compare/sarFileCompareInfo/editComments', query).then((res) => {
if (res.success) {
this.$message.success(this.$t('operationSuccessful'))
this.visible = false
this.getData()
} else {
this.$message.warning(this.$t('operationFailed'))
}
}).finally(() => {
this.confirmLoading = false
})
},
// 发表评论提交
comparaComments () {
this.confirmLoading = true
const query = {
infoId: this.$route.query.id,
id: this.formInlineText.id,
comment: this.formInlineText.comment
}
putAction('/compare/sarFileCompareItemComment/edit', query).then((res) => {
if (res.success) {
this.$message.success(this.$t('operationSuccessful'))
this.visible = false
this.getData()
} else {
this.$message.warning(this.$t('operationFailed'))
}
}).finally(() => {
this.confirmLoading = false
})
},
// 全文评论编辑点击
fullTextEdit (item) {
this.visible = true
this.title = this.$t('docTool.comparison.fullTextComments')
this.formInlineText.comment = this.resultData.comments || ''
this.formInlineText = { ...this.formInlineText }
this.$nextTick(() => {
this.$refs.ruleFormText.clearValidate()
})
},
// 对比结果编辑按钮点击
comparaEdit (item) {
this.visible = true
this.title = this.$t('docTool.comparison.comparativeComments')
this.formInlineText = JSON.parse(JSON.stringify(item))
this.formInlineText = { ...this.formInlineText }
this.$nextTick(() => {
this.$refs.ruleFormText.clearValidate()
})
},
// 对比结果删除按钮点击
comparaDelete (val) {
this.$confirm({
content: this.$t('confirmDeletion'),
onOk: () => {
deleteAction('/compare/sarFileCompareItemComment/delete', { id: val.id }).then((res) => {
if (res.success) {
this.$message.success(this.$t('operationSuccessful'))
this.getData()
} else {
this.$message.warning(this.$t('operationFailed'))
}
})
}
})
}
}
}
</script>
<style scoped lang="less">
.doc-detail-wrap {
.doc-detail-header {
width: 100%;
z-index: 1000;
height: 68px;
line-height: 68px;
padding: 0 0 0 32px;
box-sizing: border-box;
display: flex;
justify-content: space-between;
border-bottom: 2px #eff1f3 solid;
background: #fff;
position: fixed;
top: 0;
.doc-detail-title {
display: inline-block;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
font-size: 20px;
font-weight: 400;
color: #040B29;
line-height: 68px;
}
}
.doc-detail-right {
width: 600px;
line-height: 68px;
display: flex;
.operator-text-text {
cursor: pointer;
margin-right: 53px;
font-size: 14px;
font-weight: 400;
color: #040B29;
display: inline-block;
width: 33.3%;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
text-align: right;
}
}
}
.operator-text-text-text {
color: #00B3BE !important;
}
.detail-content {
padding: 24px 32px 0 32px;
box-sizing: border-box;
background: #fff;
margin-top: 68px;
}
.detail-content-header {
width: 100%;
height: 56px;
line-height: 56px;
}
.detail-content-header-content {
width: calc(100% - 56px);
margin-left: 20px;
display: inline-block;
height: 56px;
font-size: 14px;
font-family: Blue Sky Noto;
font-weight: bold;
color: #040B29;
.detail-content-header-content-left {
width: calc(50% - 194px);
height: 56px;
display: inline-block;
background: rgba(4, 11, 41, 0.0300);
border-radius: 4px 0px 0px 4px;
border-right: 1px #EFF1F3 solid;
padding-left: 24px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.detail-content-header-content-content {
width: calc(50% - 194px);
display: inline-block;
height: 56px;
background: rgba(4, 11, 41, 0.0300);
border-radius: 4px 0px 0px 4px;
border-right: 1px #EFF1F3 solid;
padding-left: 24px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.detail-content-header-content-rightOne {
width: 260px;
display: inline-block;
height: 56px;
background: rgba(4, 11, 41, 0.0300);
border-radius: 4px 0px 0px 4px;
padding-left: 24px;
border-right: 1px #EFF1F3 solid;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.detail-content-header-content-rightOne-active {
border-right: none;
}
.detail-content-header-content-right {
width: 128px;
display: inline-block;
height: 56px;
background: rgba(4, 11, 41, 0.0300);
border-radius: 4px 0px 0px 4px;
padding-left: 24px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
.detail-content-header-content-left {
width: calc(50% - 194px);
height: 56px;
display: inline-block;
background: rgba(4, 11, 41, 0.0300);
border-radius: 4px 0px 0px 4px;
border-right: 1px #EFF1F3 solid;
padding-left: 24px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.detail-content-header-content-content {
width: calc(50% - 194px);
display: inline-block;
height: 56px;
background: rgba(4, 11, 41, 0.0300);
border-radius: 4px 0px 0px 4px;
border-right: 1px #EFF1F3 solid;
padding-left: 24px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.detail-content-header-content-rightOne {
width: 260px;
display: inline-block;
height: 56px;
background: rgba(4, 11, 41, 0.0300);
border-radius: 4px 0px 0px 4px;
padding-left: 24px;
border-right: 1px #EFF1F3 solid;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.detail-content-header-content-rightOne-active {
border-right: none;
}
.detail-content-header-content-right {
width: 128px;
display: inline-block;
height: 56px;
background: rgba(4, 11, 41, 0.0300);
border-radius: 4px 0px 0px 4px;
padding-left: 24px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.detail-content-content {
width: 100%;
height: auto;
position: relative;
margin-bottom: 24px;
}
.detail-checkbox {
margin-left: 28px;
float: left;
position: absolute;
top: 50%;
transform: translate(-50%, -50%);
}
.detail-content-content-text {
width: calc(100% - 56px);
margin-left: 56px;
border: 1px solid #EFF1F3;
border-radius: 4px;
overflow: hidden;
.detail-content-content-text-left {
width: calc(100% - 128px);
float: left;
border-right: 1px solid #EFF1F3;
padding: 24px;
box-sizing: border-box;
overflow: hidden;
}
.detail-content-content-text-right {
width: 128px;
float: left;
height: auto;
text-align: center;
.text-button-one {
display: inline-block;
width: 128px;
position: absolute;
top: 50%;
transform: translate(-50%, -50%);
}
.text-button {
margin-right: 8px;
}
}
}
.detail-content-content-text-color {
border: 1px solid #00B3BE;
background: rgba(0, 179, 190, 0.0300);
}
.detail-content-left {
width: calc(50% - 130px);
display: inline-block;
float: left;
padding-right: 24px;
border-right: 1px #EFF1F3 solid;
}
.detail-content-right {
width: calc(50% - 104px);
display: inline-block;
float: left;
padding-left: 24px;
padding-right: 24px;
border-right: 1px #EFF1F3 solid;
}
.detail-content-right-one {
width: 234px;
display: inline-block;
float: left;
padding-left: 24px;
/*border-right: 1px #EFF1F3 solid;*/
}
.detail-content-left-top {
font-size: 16px;
font-family: Blue Sky Noto;
font-weight: 400;
color: #040B29;
}
.detail-content-left-button {
font-size: 14px;
font-weight: 400;
color: #040B29;
margin-top: 10px;
}
.detail-content-bottom {
width: 100%;
margin-top: 14px;
padding: 24px;
box-sizing: border-box;
background: rgba(4, 11, 41, 0.0300);
border-radius: 4px;
float: left;
}
.detail-content-bottom-color {
background: rgba(0, 179, 190, 0.0300);
}
.detail-content-bottom-left {
width: 115px;
font-size: 14px;
font-weight: 400;
color: #040B29;
float: left;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
.detail-content-bottom-right {
width: calc(50% - 115px);
float: left;
font-size: 14px;
font-weight: 400;
color: #040B29;
word-break: break-word;
}
.detail-content-content-text-left-text {
width: 100%;
font-size: 14px;
font-weight: 400;
color: #040B29;
overflow: hidden;
display: -webkit-box;
text-overflow: ellipsis;
/*! autoprefixer: off */
-webkit-box-orient: vertical;
-webkit-line-clamp: 3;
/*! autoprefixer: on;*/
word-break: break-word;
}
.detail-content-content-text-dis {
width: 100% !important;
}
.detail-content-header-content-left-active {
width: calc(50% - 130px) !important;
}
.detail-content-bottom-left-text {
width: 256px;
}
.detail-content-bottom-right-text {
width: calc(50% - 256px);
}
.box-title-text-remarks {
line-height: 1.4;
display: flex;
/*align-items: center;*/
margin-bottom: 10px;
}
.title-text-remarks {
width: 68px;
color: #000F16;
display: inline-block;
font-weight: 500;
font-size: 14px;
margin-right: 16px;
margin-top: 6px;
text-align: right;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.operator-text-text-text {
color: #00B3BE !important;
}
</style>
@@ -0,0 +1,612 @@
<template>
<a-spin :spinning="loading">
<div class="doc-detail-wrap">
<div class="doc-detail-header" style="position: fixed;top: 0">
<div class="doc-detail-title">
<span style="line-height: 66px;display: inline-block;float: left" @click="goBack">
<a-icon type="arrow-left" style="margin-right: 6px;"/>
</span>
<span> {{$t('docTool.comparison.documentComparison')}}</span>
</div>
<div class="doc-detail-right">
<div @click="viewTheComparisonResultsClick" class="operator-text-text"
:title="$t('docTool.comparison.viewTheComparisonResults')">
<a-icon type="eye"/>
{{$t('docTool.comparison.viewTheComparisonResults')}}
</div>
<div @click="addFullTextCommentClick" class="operator-text-text"
:title="$t('docTool.comparison.addFullTextComment')">
<a-icon type="message"/>
{{$t('docTool.comparison.addFullTextComment')}}
</div>
<div @click="turnOffAutomaticMatchingClick" class="operator-text-text"
:title="isMatching ? $t('docTool.comparison.turnOffAutomaticMatching'):$t('docTool.comparison.turnOnAutoMatch')">
<a-icon :type="isMatching?'close-circle':'check-circle'"/>
{{isMatching ? $t('docTool.comparison.turnOffAutomaticMatching'):$t('docTool.comparison.turnOnAutoMatch')}}
</div>
</div>
</div>
<div class="detail-content">
<div class="detail-content-cont">
<div class="detail-content-left">
<div class="detail-content-left-header"
:title="resultData.serialNumberLeft + resultData.fileNameLeft">
{{this.resultData.serialNumberLeft}}&nbsp;
{{this.resultData.fileNameLeft}}
</div>
<div class="detail-content-content-left">
<a-tree
class="draggable-tree"
@select="onSelectLeft"
:tree-data="resultData.menuLeft"
/>
</div>
<div class="detail-content-content-right-top">
<div class="detail-content-content-right">
<div class="detail-content-content-right-data" @click="detailLeft(index,item)"
v-for="(item,index) in resultData.textLeft" :key="index"
:class="{'detail-content-content-right-data-blue':item.reviewed === '1'}">
<div class="detail-content-content-right-data-text" style="margin-bottom: 10px;color: #040B29">
{{item.itemsNum + ' ' + item.itemsName}}
</div>
<div class="detail-content-content-right-data-text" v-html="item.itemsText"></div>
</div>
</div>
</div>
</div>
<div class="detail-content-right">
<div class="detail-content-left-header">
<span class="detail-content-left-header-text"
:title="resultData.serialNumberRight + resultData.fileNameRight">
{{this.resultData.serialNumberRight}}&nbsp;
{{this.resultData.fileNameRight}}
</span>
<!-- <span class="detail-content-left-header-text-right">-->
<!-- <span style="color: #9B9DA9">相似度:</span>-->
<!-- <span style="color: #E83030">98%</span>-->
<!-- </span>-->
</div>
<div class="detail-content-content-left">
<a-tree
class="draggable-tree"
@select="onSelectRight"
:tree-data="resultData.menuRight"
/>
</div>
<div class="detail-content-content-right-right-top">
<div class="detail-content-content-right-right">
<div class="detail-content-content-right-data-right" @click="detailRight(index,item)"
v-for="(item,index) in resultData.textRight" :key="index"
:class="{'detail-content-content-right-data-blue-right':item.reviewed === '1'}">
<div class="detail-content-content-right-data-text" style="margin-bottom: 10px;color: #040B29">
{{item.itemsNum + ' ' + item.itemsName}}
</div>
<div class="detail-content-content-right-data-text" v-html="item.itemsText">
</div>
</div>
</div>
</div>
</div>
</div>
<div class="remarks">
<a-form-model :model="formInline"
class="formAdd" :rules="rules"
ref="ruleForm">
<div class="box-title-text-remarks">
<div class="title-text-remarks" :title="$t('docTool.comparison.comparisonOfArticles')" style="width: 84px">
<span>{{$t('docTool.comparison.comparisonOfArticles')}}</span>
</div>
<a-form-model-item class="item-model" prop="comment">
<a-textarea :placeholder="$t('pleaseEnter')+$t('docTool.comparison.comparisonOfArticles')"
v-model="formInline.comment"
:maxLength="500"
:rows="3"/>
</a-form-model-item>
</div>
</a-form-model>
</div>
<div class="submit-button">
<a-button style="margin-right: 10px"
type="primary" @click="consistentAssessmentClick()">{{$t('docTool.comparison.consistentAssessment')}}
</a-button>
<a-button type="primary" @click="submit()">{{$t('preservation')}}</a-button>
</div>
</div>
</div>
<a-modal
:title="$t('docTool.comparison.fullTextComments')"
:width="600"
:visible="visible"
:confirm-loading="textDataLoading"
:maskClosable="false"
@cancel="visible = false"
>
<template slot="footer">
<a-button type="primary" :loading="textDataLoading" @click="fullTextCommentsSubmit">
{{$t('submit')}}
</a-button>
</template>
<a-form-model :model="formInlineText" class="formAdd" :rules="rulesText" ref="ruleFormText">
<div class="box-title-text-remarks">
<div class="title-text-remarks" :title="$t('docTool.comparison.fullTextComments')">
<span>{{$t('docTool.comparison.fullTextComments')}}</span>
</div>
<a-form-model-item class="item-model" style="width: calc(100% - 113px)" prop="comment">
<a-textarea :placeholder="$t('pleaseEnter')+' '+$t('docTool.comparison.fullTextComments')"
v-model.trim="formInlineText.comment"
:maxLength="500"
:rows="4"/>
</a-form-model-item>
</div>
</a-form-model>
</a-modal>
</a-spin>
</template>
<script>
import { postAction, putAction, getAction } from '@/api/manage'
export default {
name: 'DocumentDataComparison',
data () {
return {
formInline: {},
formInlineText: {},
loadingText: false,
rules: {},
rulesText: {},
loading: false,
textDataLoading: false,
visible: false, // 全文评论弹框是否显示
resultData: {},
isMatching: true, // 自动匹配是否开启
dataLeft: {},
dataRight: {}
}
},
mounted () {
this.getData()
document.title = this.$t('docTool.comparison.documentComparison') + ' - ' + this.$t('edit')
},
methods: {
goBack () {
this.$router.push({
path: '/documentTool/documentComparison'
})
},
// 文档对比的一致按钮点击
consistentAssessmentClick () {
if (!this.dataLeft.id && !this.dataRight.id) {
this.$message.warning(this.$t('docTool.comparison.pleaseSelectTheDataCompared'))
return
}
const query = {
itemsIdLeft: this.dataLeft.id,
itemsIdRight: this.dataRight.id,
infoId: this.$route.query.id,
comment: '一致'
}
this.loading = true
postAction('/compare/sarFileCompareItemComment/add', query).then((res) => {
if (res.success) {
this.$message.success(this.$t('operationSuccessful'))
this.formInline = {}
this.resultData.textRight.forEach(val => {
if (val.id === this.dataRight.id) {
val.reviewed = 1
}
})
this.resultData.textLeft.forEach(val => {
if (val.id === this.dataLeft.id) {
val.reviewed = 1
}
})
this.resultData = { ...this.resultData }
const detailLeftColor = document.getElementsByClassName('detail-content-content-right-data-color')
if (detailLeftColor && detailLeftColor.length > 0) {
detailLeftColor[0].classList.remove('detail-content-content-right-data-color')
}
const detailRightColor = document.getElementsByClassName('detail-content-content-right-data-color-right')
if (detailRightColor && detailRightColor.length > 0) {
detailRightColor[0].classList.remove('detail-content-content-right-data-color-right')
}
this.dataLeft = {}
this.dataRight = {}
} else {
this.$message.warning(this.$t('operationFailed'))
}
}).finally(() => {
this.loading = false
})
},
// 文档对比的保存按钮点击
submit () {
if (!this.dataLeft.id && !this.dataRight.id) {
this.$message.warning(this.$t('docTool.comparison.pleaseSelectTheDataCompared'))
return
}
this.$refs.ruleForm.validate(valid => {
if (valid) {
const query = {
itemsIdLeft: this.dataLeft.id,
itemsIdRight: this.dataRight.id,
infoId: this.$route.query.id,
comment: this.formInline.comment
}
this.loading = true
postAction('/compare/sarFileCompareItemComment/add', query).then((res) => {
if (res.success) {
this.$message.success(this.$t('operationSuccessful'))
this.formInline = {}
this.resultData.textRight.forEach(val => {
if (val.id === this.dataRight.id) {
val.reviewed = 1
}
})
this.resultData.textLeft.forEach(val => {
if (val.id === this.dataLeft.id) {
val.reviewed = 1
}
})
this.resultData = { ...this.resultData }
const detailLeftColor = document.getElementsByClassName('detail-content-content-right-data-color')
if (detailLeftColor && detailLeftColor.length > 0) {
detailLeftColor[0].classList.remove('detail-content-content-right-data-color')
}
const detailRightColor = document.getElementsByClassName('detail-content-content-right-data-color-right')
if (detailRightColor && detailRightColor.length > 0) {
detailRightColor[0].classList.remove('detail-content-content-right-data-color-right')
}
this.dataLeft = {}
this.dataRight = {}
// this.$router.push({
// path: '/documentComparison'
// })
} else {
this.$message.warning(this.$t('operationFailed'))
}
}).finally(() => {
this.loading = false
})
}
})
},
// 查看对比结果按钮点击
viewTheComparisonResultsClick () {
const newUrl = this.$router.resolve({
path: '/comparisonResults',
query: {
id: this.$route.query.id,
isDisplay: 2
}
})
window.open(newUrl.href, '_blank')
},
// 添加全文评论按钮点击
addFullTextCommentClick () {
this.visible = true
const query = {
id: this.$route.query.id
}
this.textDataLoading = true
postAction('/compare/sarFileCompareInfo/getComparisonDetail', query).then((res) => {
if (res.success) {
this.formInlineText.comment = res.result.comments || ''
this.formInlineText = { ...this.formInlineText }
}
}).finally(() => {
this.textDataLoading = false
})
},
// 关闭自动匹配、开启自动匹配
turnOffAutomaticMatchingClick () {
this.isMatching = !this.isMatching
this.$message.success(this.$t('operationSuccessful'))
},
// 添加全文评论弹框的提交按钮
fullTextCommentsSubmit () {
this.$refs.ruleFormText.validate(valid => {
if (valid) {
const formInlineText = JSON.parse(JSON.stringify(this.formInlineText))
this.textDataLoading = true
const query = {
id: this.$route.query.id,
comments: formInlineText.comment
}
putAction('/compare/sarFileCompareInfo/editComments', query).then((res) => {
if (res.success) {
this.$message.success(this.$t('operationSuccessful'))
this.visible = false
} else {
this.$message.warning(this.$t('operationFailed'))
}
}).finally(() => {
this.textDataLoading = false
})
}
})
},
// 获取文件对比详情
getData () {
const query = {
id: this.$route.query.id
}
// this.loading = true
postAction('/compare/sarFileCompareInfo/getComparisonDetail', query).then((res) => {
if (res.success) {
this.resultData = res.result || {}
this.formInlineText.comment = res.result.comments || ''
this.formInlineText = { ...this.formInlineText }
} else {
this.resultData = {}
}
}).finally(() => {
// this.loading = false
})
},
// 点击左侧文档内容
detailLeft (num, item) {
const detailLeftColor = document.getElementsByClassName('detail-content-content-right-data-color')
if (detailLeftColor && detailLeftColor.length > 0) {
detailLeftColor[0].classList.remove('detail-content-content-right-data-color')
}
if (item.id === this.dataLeft.id && !this.isMatching) {
this.dataLeft = {}
return
}
const detailLeft = document.getElementsByClassName('detail-content-content-right-data')
if (detailLeft && detailLeft.length > 0) {
detailLeft[num].classList.add('detail-content-content-right-data-color')
}
this.dataLeft = item
this.dataLeft.numIndex = num
if (this.isMatching) {
const detailRightColor = document.getElementsByClassName('detail-content-content-right-data-color-right')
if (detailRightColor && detailRightColor.length > 0) {
detailRightColor[0].classList.remove('detail-content-content-right-data-color-right')
}
if (item.targetStand > -1) {
const detailContent = document.getElementsByClassName('detail-content-content-right-right-top')
const detailRight = document.getElementsByClassName('detail-content-content-right-data-right')
this.dataRight = this.resultData.textRight[item.targetStand]
if (detailRight && detailRight.length > 0) {
detailRight[item.targetStand].classList.add('detail-content-content-right-data-color-right')
detailContent[0].scrollTop = detailRight[item.targetStand].offsetTop - 150
}
this.dataRight.numIndex = item.targetStand
this.clauseComparison()
}
}
},
// 点击右侧文档内容
detailRight (num, item) {
const detailRightColor = document.getElementsByClassName('detail-content-content-right-data-color-right')
if (detailRightColor && detailRightColor.length > 0) {
detailRightColor[0].classList.remove('detail-content-content-right-data-color-right')
}
if (item.id === this.dataRight.id && !this.isMatching) {
this.dataRight = {}
return
}
const detailRight = document.getElementsByClassName('detail-content-content-right-data-right')
if (detailRight && detailRight.length > 0) {
detailRight[num].classList.add('detail-content-content-right-data-color-right')
}
this.dataRight = item
this.dataRight.numIndex = num
if (this.isMatching) {
const detailLeftColor = document.getElementsByClassName('detail-content-content-right-data-color')
if (detailLeftColor && detailLeftColor.length > 0) {
detailLeftColor[0].classList.remove('detail-content-content-right-data-color')
}
if (item.targetStand > -1) {
this.dataLeft = this.resultData.textLeft[item.targetStand]
this.dataLeft.numIndex = item.targetStand
const detailContent = document.getElementsByClassName('detail-content-content-right-top')
const detailLeft = document.getElementsByClassName('detail-content-content-right-data')
if (detailLeft && detailLeft.length > 0 && item.targetStand >= 0) {
detailLeft[item.targetStand].classList.add('detail-content-content-right-data-color')
detailContent[0].scrollTop = detailLeft[item.targetStand].offsetTop - 150
}
this.clauseComparison()
}
}
},
// 自动匹配
clauseComparison () {
const query = {
leftId: this.dataLeft.id,
rightId: this.dataRight.id
}
this.loadingText = true
getAction('/compare/sarFileCompareItem/clauseComparison', query).then((res) => {
if (res.success) {
this.loadingText = false
this.resultData.textLeft[this.dataLeft.numIndex].itemsText = res.result[0]
this.resultData.textRight[this.dataRight.numIndex].itemsText = res.result[1]
} else {
this.loadingText = false
}
})
},
// 左侧树选择
onSelectLeft (selectedKeys, exports) {
const node = exports.node.$vnode.data.props.dataRef
const detailLeft = document.getElementsByClassName('detail-content-content-right-data')
const detailContent = document.getElementsByClassName('detail-content-content-right-top')
if (!node.parentId) {
detailContent[0].scrollTop = 0
return
}
for (let i = 0; i < this.resultData.textLeft.length; i++) {
if (node.parentId && node.menuId === this.resultData.textLeft[i].menuId) {
detailContent[0].scrollTop = detailLeft[i].offsetTop - 150
return
}
}
},
// 右侧树选中
onSelectRight (selectedKeys, exports) {
const node = exports.node.$vnode.data.props.dataRef
const detailRight = document.getElementsByClassName('detail-content-content-right-data-right')
const detailContent = document.getElementsByClassName('detail-content-content-right-right-top')
if (!node.parentId) {
detailContent[0].scrollTop = 0
return
}
for (let i = 0; i < this.resultData.textRight.length; i++) {
if (node.parentId && node.menuId === this.resultData.textRight[i].menuId) {
detailContent[0].scrollTop = detailRight[i].offsetTop - 150
return
}
}
}
}
}
</script>
<style scoped lang="less">
.doc-detail-wrap {
.doc-detail-header {
width: 100%;
z-index: 1000;
height: 68px;
line-height: 68px;
padding: 0 0 0 32px;
box-sizing: border-box;
display: flex;
justify-content: space-between;
border-bottom: 2px #eff1f3 solid;
background: #fff;
.doc-detail-title {
display: inline-block;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
font-size: 20px;
font-weight: 400;
color: #040B29;
line-height: 68px;
}
}
.doc-detail-right {
width: 600px;
line-height: 68px;
display: flex;
.operator-text-text {
cursor: pointer;
margin-right: 53px;
font-size: 14px;
font-weight: 400;
color: #040B29;
display: inline-block;
width: 33.3%;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
text-align: right;
}
}
}
.detail-content {
padding-top: 68px;
background: #fff;
padding-bottom: 20px;
&-cont {
width: 100%;
overflow: hidden;
display: flex;
}
&-left {
width: 50%;
height: calc(100vh - 210px);
border-right: 2px #EFF1F3 solid;
padding: 24px 32px;
box-sizing: border-box;
border-bottom: 2px #EFF1F3 solid;
}
&-right {
width: 50%;
height: calc(100vh - 210px);
padding: 24px 32px;
box-sizing: border-box;
border-bottom: 2px #EFF1F3 solid;
}
&-left-header {
margin-bottom: 24px;
}
&-left-header-text {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
display: inline-block;
font-size: 16px;
font-family: Blue Sky Noto;
font-weight: 400;
color: #040B29;
}
}
.detail-content-content-left {
width: 180px;
height: 520px;
float: left;
overflow: auto;
/deep/ .ant-tree-node-content-wrapper {
display: inline-block !important;
color: #040B29 !important;
width: 130px;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
}
.remarks {
margin-top: 20px;
width: 50%;
display: inline-block;
padding: 0 32px;
box-sizing: border-box;
}
.box-title-text-remarks {
line-height: 1.4;
display: flex;
/*align-items: center;*/
margin-bottom: 10px;
}
.title-text-remarks {
width: 68px;
color: #000F16;
display: inline-block;
font-weight: 500;
font-size: 14px;
margin-right: 16px;
margin-top: 6px;
text-align: right;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.item-model {
width: calc(100% - 232px);
}
.submit-button {
width: 100%;
height: 60px;
text-align: right;
padding: 14px 32px 0;
box-sizing: border-box;
border-top: 2px #eff1f3 solid;
background: #ffffff;
position: fixed;
bottom: 0;
}
</style>
@@ -1,6 +1,6 @@
<template>
<a-drawer
:title="$t('importResults')"
:title="$t('docTool.split.importResults')"
placement="right"
:visible="visible"
@close="onClose"
@@ -106,7 +106,7 @@ export default {
},
// 模板下载
downLoadTemplate () {
const name = this.$t('documentSplitTemplate') + '.xlsx'
const name = this.$t('docTool.split.documentSplitTemplate') + '.xlsx'
downloadFile(this.url.downloadTemplate, name, {})
},
// 保存
@@ -117,7 +117,7 @@ export default {
if (this.selectedRowKeys.length === 0) {
this.$message.warning(this.$t('pleaseSelectOne'))
} else if (!this.form.file) {
this.$message.warning(this.$t('pleaseUploadSplitFile'))
this.$message.warning(this.$t('docTool.split.pleaseUploadSplitFile'))
} else if (this.selectedRowKeys && this.selectedRowKeys.length === 1) {
const row = this.selectedRows[0]
const params = {
@@ -133,7 +133,7 @@ export default {
this.loading = true
httpAction(this.url.submit, params, 'post').then(res => {
if (res.data.success) {
this.$message.success(this.$t('OperationSuccessful'))
this.$message.success(this.$t('operationSuccessful'))
this.visible = false
this.$emit('visible', false, 1)
} else {
@@ -0,0 +1,612 @@
<template>
<div class="doc-detail-wrap">
<div class="doc-detail-header">
<div class="doc-detail-title">
<span style="line-height: 66px;display: inline-block;float: left" @click="goBack">
<a-icon type="arrow-left" style="margin-right: 6px;"/>
</span>
<span> {{$t('docTool.comparison.initiateComparison')}}</span>
</div>
</div>
<div class="detail-content">
<div style="width: 100%;height: auto;overflow: hidden">
<div class="detail-content-left">
<a-form layout="inline" @keyup.enter.native="searchQueryLeft">
<a-row :gutter="24">
<a-col :md="8" :sm="8">
<a-form-item :label="$t('number')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input :placeholder="$t('pleaseEnter')+$t('number')"
v-model="queryParamLeft.serialNumber"></a-input>
</a-form-item>
</a-col>
<a-col :md="8" :sm="8">
<a-form-item :label="$t('title')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input :placeholder="$t('pleaseEnter')+$t('title')"
v-model="queryParamLeft.title"></a-input>
</a-form-item>
</a-col>
<span style="text-align:right;overflow: hidden;" class="table-page-search-submitButtons">
<a-col :md="8" :sm="24">
<a-button @click="searchResetLeft">{{$t('reset')}}</a-button>
<a-button style="margin-left: 8px" type="primary" @click="searchQueryLeft">{{$t('query')}}</a-button>
</a-col>
</span>
</a-row>
</a-form>
<a-table
ref="table"
size="middle"
:components="drag(columns,'columns')"
:loading="loadingLeft"
:pagination="false"
:scroll="{x: '100%',y:340}"
rowKey="id"
:data-source="dataSourceLeft"
:row-selection="{ selectedRowKeys: selectedRowKeysLeft, onChange: onSelectChangeLeft, columnTitle:' ', type: 'radio'}"
:columns="columns"
@change="tableChangeLeft"
>
</a-table>
<div class="box-button-standard">
<span class="box-button-standard-left" :title="$t('docTool.comparison.selectedStandard')">
{{$t('docTool.comparison.selectedStandard')}}
</span>
<span class="box-button-standard-right"
@click="selectLeftClick(selectedRowsLeft[0])"
:title="selectedRowsLeft[0]?selectedRowsLeft[0].serialNumber+' '+selectedRowsLeft[0].fileName:$t('docTool.comparison.noComparisonDocumentSelected')"
:class="{'box-button-standard-right-color':selectedRowsLeft[0]}">
{{selectedRowsLeft[0]?selectedRowsLeft[0].serialNumber+' '+selectedRowsLeft[0].fileName:$t('docTool.comparison.noComparisonDocumentSelected')}}
</span>
</div>
</div>
<div class="detail-content-right">
<a-form layout="inline" @keyup.enter.native="searchQueryRight">
<a-row :gutter="24">
<a-col :md="8" :sm="8">
<a-form-item :label="$t('number')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input :placeholder="$t('pleaseEnter')+$t('number')"
v-model="queryParamRight.serialNumber"></a-input>
</a-form-item>
</a-col>
<a-col :md="8" :sm="8">
<a-form-item :label="$t('title')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input :placeholder="$t('pleaseEnter')+$t('title')"
v-model="queryParamRight.title"></a-input>
</a-form-item>
</a-col>
<span style="text-align:right;overflow: hidden;" class="table-page-search-submitButtons">
<a-col :md="8" :sm="24">
<a-button @click="searchResetRight">{{$t('reset')}}</a-button>
<a-button style="margin-left: 8px" type="primary" @click="searchQueryRight">{{$t('query')}}</a-button>
</a-col>
</span>
</a-row>
</a-form>
<a-table
ref="table"
size="middle"
:components="drag(columns,'columns')"
:loading="loadingRight"
:pagination="false"
:scroll="{x: '100%',y:340}"
rowKey="id"
:data-source="dataSourceRight"
:row-selection="{ selectedRowKeys: selectedRowKeysRight, onChange: onSelectChangeRight, columnTitle:' ', type: 'radio'}"
:columns="columns"
@change="tableChangeRight"
>
</a-table>
<div class="box-button-standard">
<span class="box-button-standard-left" :title="$t('docTool.comparison.selectedStandard')">
{{$t('docTool.comparison.selectedStandard')}}
</span>
<span class="box-button-standard-right"
@click="selectLeftClick(selectedRowsRight[0])"
:title="selectedRowsRight[0]?selectedRowsRight[0].serialNumber+' '+selectedRowsRight[0].fileName:$t('docTool.comparison.noComparisonDocumentSelected')"
:class="{'box-button-standard-right-color':selectedRowsRight[0]}">
{{selectedRowsRight[0]?selectedRowsRight[0].serialNumber+' '+selectedRowsRight[0].fileName:$t('docTool.comparison.noComparisonDocumentSelected')}}
</span>
</div>
</div>
</div>
<div class="remarks">
<a-form-model :model="formInline" class="formAdd" :rules="rules" ref="ruleForm">
<div class="box-title-text-remarks">
<div class="title-text-remarks" :title="$t('docTool.comparison.remarkInfo')">
<span>{{$t('docTool.comparison.remarkInfo')}}</span>
</div>
<a-form-model-item class="item-model" prop="remark">
<a-textarea :placeholder="$t('pleaseEnter')+$t('docTool.comparison.remarkInfo')"
:maxLength="300"
v-model="formInline.remark"
:rows="4"/>
</a-form-model-item>
</div>
</a-form-model>
</div>
<div class="submit-button">
<a-button class="box-button" type="primary" @click="submit">{{$t('docTool.comparison.initiateDocumentComparison')}}</a-button>
</div>
</div>
<!-- <JLoading :loading="loading">{{$t('pleaseWaitWhileRunning')}}</JLoading>-->
<div id="images">
<div class="image" v-viewer="{movable: false}">
<img v-show="image" :src="imageUrl">
</div>
</div>
</div>
</template>
<script>
import { getAction, postAction, downloadFile, getFileAccessHttpUrl } from '@/api/manage'
import { previewPdf } from '@/utils/previewPdf'
import { Base64 } from 'js-base64'
import { mapGetters } from 'vuex'
import { ResizeHeader, ResizeColumnProvide } from '@/mixins/header'
export default {
name: 'InitiateComparison',
mixins: [ResizeHeader, ResizeColumnProvide],
data () {
return {
loading: false,
labelCol: {
span: 6
},
wrapperCol: {
span: 14
},
loadingLeft: false,
queryParamLeft: {},
ipaginationLeft: {
current: 1,
pageSize: 50,
pageSizeOptions: ['10', '50', '100', '150', '200'],
showTotal: (total, range) => {
return range[0] + '-' + range[1] + ' ' + this.$t('total') + ' ' + total + ' ' + this.$t('strip')
},
showQuickJumper: true,
showSizeChanger: true,
total: 0
},
selectedRowKeysLeft: [],
selectedRowsLeft: [],
dataSourceLeft: [],
loadingRight: false,
queryParamRight: {},
ipaginationRight: {
current: 1,
pageSize: 50,
pageSizeOptions: ['10', '50', '100', '150', '200'],
showTotal: (total, range) => {
return range[0] + '-' + range[1] + ' ' + this.$t('total') + ' ' + total + ' ' + this.$t('strip')
},
showQuickJumper: true,
showSizeChanger: true,
total: 0
},
selectedRowKeysRight: [],
dataSourceRight: [],
selectedRowsRight: [],
formInline: {},
downLoadFileUrl: window._CONFIG.domianPreviewURL + '/sys/common/download',
downLoadImgUrl: window._CONFIG.domianWebImgURL + '/sys/common/download',
rules: {
// remark: [
// {
// max: 300,
// message: this.$t('RemarkInfo') + this.$t('cannotExceed') + 300 + this.$t('Characters'),
// trigger: 'blur'
// }
// ]
},
columns: [
{
title: this.$t('number'),
align: 'left',
width: 70,
customRender: function (t, r, index) {
return parseInt(index) + 1
}
},
{
title: this.$t('number'),
align: 'left',
ellipsis: true,
dataIndex: 'serialNumber',
width: 79
},
{
title: this.$t('title'),
align: 'left',
ellipsis: true,
dataIndex: 'title',
width: 79
},
{
title: this.$t('TextStatus'),
align: 'left',
ellipsis: true,
dataIndex: 'fileType',
width: 79
},
{
title: this.$t('fileName'),
align: 'left',
ellipsis: true,
dataIndex: 'fileName',
width: 79
}
],
tablecolumns: [
{
title: this.$t('number'),
align: 'left',
width: 70,
customRender: function (t, r, index) {
return parseInt(index) + 1
}
},
{
title: this.$t('number'),
align: 'left',
ellipsis: true,
dataIndex: 'serialNumber',
width: 79
},
{
title: this.$t('title'),
align: 'left',
ellipsis: true,
dataIndex: 'title',
width: 79
},
{
title: this.$t('TextStatus'),
align: 'left',
ellipsis: true,
dataIndex: 'fileType',
width: 79
},
{
title: this.$t('fileName'),
align: 'left',
ellipsis: true,
dataIndex: 'fileName',
width: 79
}
],
url: {
list: '/split/sarFileSplitInfo/page',
add: '/compare/sarFileCompareInfo/fullTextComparison'
},
image: false,
imageUrl: ''
}
},
mounted () {
this.getListLeft()
this.getListRight()
document.title = this.$t('documentComparison') + ' - ' + this.$t('initiateComparison')
},
methods: {
...mapGetters(['userInfo']),
goBack () {
this.$router.push({
path: '/documentComparison'
})
},
searchQueryLeft () {
this.ipaginationLeft.current = 1
this.getListLeft()
},
searchResetLeft () {
this.queryParamLeft = {}
this.ipaginationLeft.current = 1
this.getListLeft()
},
onSelectChangeLeft (value, record) {
this.selectedRowKeysLeft = value
// this.selectedRowsLeft = []
// if (this.selectedRowKeysLeft.length > 1) {
// this.selectedRowKeysLeft.shift()
// }
// const content = record.filter(res => {
// return res.id === this.selectedRowKeysLeft[0]
// })
this.selectedRowsLeft = record
},
tableChangeLeft (pagination) {
this.ipaginationLeft = pagination
this.getListLeft()
},
searchQueryRight () {
this.ipaginationRight.current = 1
this.getListRight()
},
searchResetRight () {
this.queryParamRight = {}
this.ipaginationRight.current = 1
this.getListRight()
},
onSelectChangeRight (value, record) {
this.selectedRowKeysRight = value
// this.selectedRowsRight = []
// if (this.selectedRowKeysRight.length > 1) {
// this.selectedRowKeysRight.shift()
// }
// const content = record.filter(res => {
// return res.id === this.selectedRowKeysRight[0]
// })
this.selectedRowsRight = record
},
tableChangeRight (pagination) {
this.ipaginationRight = pagination
this.getListRight()
},
submit () {
this.$router.push({
path: '/documentDataComparison',
})
// if (!this.selectedRowsRight[0] || !this.selectedRowsLeft[0]) {
// this.$message.warning(this.$t('pleaseSelectTheDataCompared'))
// return
// }
// this.$refs.ruleForm.validate(valid => {
// if (valid) {
// this.loading = true
// const query = {
// leftStandard: this.selectedRowsLeft[0].id,
// rightStandard: this.selectedRowsRight[0].id,
// remark: this.formInline.remark
// }
// postAction(this.url.add, query).then((res) => {
// if (res.success) {
// this.loading = false
// this.$message.success(this.$t('operationSuccessful'))
// this.$router.push({
// path: '/documentDataComparison',
// query: {
// id: res.result
// }
// })
// } else {
// this.loading = false
// this.$message.warning(this.$t('operationFailed'))
// }
// })
// }
// })
},
getListLeft () {
const queryParam = JSON.parse(JSON.stringify(this.queryParamLeft))
Object.keys(queryParam).forEach(val => {
if (queryParam[val] instanceof Array) {
queryParam[val] = queryParam[val].join(',')
}
})
const query = {
pageNo: this.ipaginationLeft.current,
pageSize: this.ipaginationLeft.pageSize,
fileId: '1',
...queryParam
}
this.loadingLeft = true
getAction(this.url.list, query).then((res) => {
if (res.success) {
if (res.result.current > 1 && res.result.records.length === 0) {
this.ipaginationLeft.current = 1
this.getListLeft()
return
}
this.dataSourceLeft = res.result.records || []
this.ipaginationLeft.total = res.result.total
}
}).finally(() => {
this.loadingLeft = false
})
},
selectLeftClick (fileQuery) {
if (fileQuery) {
const fileName = fileQuery.fileName
const index1 = fileName.lastIndexOf('.')
const index2 = fileName.length
const fileSuffix = fileName.substring(index1, index2)
if (fileSuffix === '.pdf') {
// window.open('/pdf/web/viewer.html?file=' + encodeURIComponent('/jero-boot/sys/common/pdf/viewFile?id=' + fileQuery.fileId + '&userName=' + this.userInfo().username))
const url = previewPdf(fileQuery.fileId)
window.open(url)
} else if (fileSuffix === '.docx' || fileSuffix === '.doc') {
const url = window._CONFIG.onlinePreviewDomainURL + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.fileId + fileSuffix)
window.open(url, '_blank')
} else if (fileSuffix === '.xlsx' || fileSuffix === '.xls') {
const url = window._CONFIG.onlinePreviewDomainURL + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.fileId + fileSuffix)
window.open(url, '_blank')
} else if (fileSuffix === '.png' || fileSuffix === '.jpeg' || fileSuffix === '.gif' || fileSuffix === '.jpg') {
// const url = window._CONFIG.onlinePreviewDomainURL + '?url=' + Base64.encode(this.downLoadImgUrl + '/' + fileQuery.fileId + fileSuffix)
// window.open(url, '_blank')
this.image = true
this.imageUrl = getFileAccessHttpUrl(fileQuery.fileId)
// 获取viewer实例
const viewer = this.$el.querySelector('.image').$viewer
// 调用show方法进行显示预览图
viewer.show()
} else {
downloadFile('/sys/common/downLoadFile', fileQuery.fileName, { id: fileQuery.fileId })
}
}
},
getListRight () {
const queryParam = JSON.parse(JSON.stringify(this.queryParamRight))
Object.keys(queryParam).forEach(val => {
if (queryParam[val] instanceof Array) {
queryParam[val] = queryParam[val].join(',')
}
})
const query = {
pageNo: this.ipaginationRight.current,
pageSize: this.ipaginationRight.pageSize,
fileId: '1',
...queryParam
}
this.loadingRight = true
getAction(this.url.list, query).then((res) => {
if (res.success) {
if (res.result.current > 1 && res.result.records.length === 0) {
this.pageNoRight = 1
this.getListRight()
return
}
this.dataSourceRight = res.result.records || []
this.ipaginationRight.total = res.result.total
}
}).finally(() => {
this.loadingRight = false
})
}
}
}
</script>
<style scoped lang="less">
@import'~@assets/less/common.less';
.doc-detail-wrap {
padding-bottom: 20px;
position: relative;
.doc-detail-header {
width: 100%;
z-index: 1000;
height: 68px;
line-height: 68px;
padding: 0 0 0 32px;
box-sizing: border-box;
display: flex;
justify-content: space-between;
border-bottom: 2px #eff1f3 solid;
background: #fff;
position: fixed;
top: 0;
.doc-detail-title {
display: inline-block;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
font-size: 20px;
font-weight: 400;
color: #040B29;
line-height: 68px;
}
}
}
.detail-content {
padding-top: 68px;
}
.detail-content-left {
width: 50%;
float: left;
border-right: 2px #EFF1F3 solid;
padding: 24px 32px;
box-sizing: border-box;
border-bottom: 2px #EFF1F3 solid;
height: 610px;
}
.detail-content-right {
width: 50%;
float: left;
padding: 24px 32px;
box-sizing: border-box;
border-bottom: 2px #EFF1F3 solid;
height: 610px;
}
.box-title-text-remarks {
line-height: 1.4;
display: flex;
margin-bottom: 10px;
}
.title-text-remarks {
width: 68px;
color: #000F16;
display: inline-block;
font-weight: 500;
font-size: 14px;
margin-right: 16px;
margin-top: 6px;
text-align: right;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.box-button-standard {
width: 100%;
margin-top: 20px;
}
.box-button-standard-left {
width: 111px;
height: 46px;
padding: 0 6px;
box-sizing: border-box;
display: inline-block;
border: 1px solid #CED0D8;
border-right: none;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
text-align: center;
line-height: 46px;
color: #040B29;
}
.box-button-standard-right {
width: calc(100% - 111px);
height: 46px;
padding: 0 4px;
box-sizing: border-box;
display: inline-block;
border: 1px solid #CED0D8;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
text-align: center;
line-height: 46px;
color: #9B9DA9;
}
.remarks {
margin-top: 20px;
width: 50%;
padding: 0 32px;
box-sizing: border-box;
margin-bottom: 60px;
}
.item-model {
width: calc(100% - 232px);
}
.submit-button {
width: 100%;
height: 60px;
text-align: right;
padding: 14px 32px 0;
box-sizing: border-box;
border-top: 2px #eff1f3 solid;
background: #ffffff;
position: fixed;
bottom: 0;
}
.box-button-standard-right-color {
color: #040B29;
cursor: pointer;
}
</style>
+31 -31
View File
@@ -5,7 +5,7 @@
<div class="split-detail-wrap">
<div class="split-detail-left">
<div class="split-detail-left-tree">
<a-input-search style="margin-bottom: 8px" :placeholder="$t('NodeQuickLookup')" @change="onLeftChange"
<a-input-search style="margin-bottom: 8px" :placeholder="$t('nodeQuickLookup')" @change="onLeftChange"
@search="onSearch" />
<a-tree
v-if="gData.length>0"
@@ -103,25 +103,25 @@
v-if="$route.query.createBy === userData.username || administrators"
v-has="'split:sarFileSplitItems:template'">
<a-icon type="download" />
{{ $t('TemplateDownload') }}
{{ $t('templateDownload') }}
</div>
<div class="operator-text" @click="handleMergeManage"
v-if="$route.query.createBy === userData.username || administrators"
v-has="'split:sarFileSplitItems:merge'">
<a-icon type="snippets" />
{{ $t('MergerClause') }}
{{ $t('docTool.split.mergerClause') }}
</div>
<div class="operator-text" @click="handleManage"
v-if="$route.query.createBy === userData.username || administrators"
v-has="'split:sarFileSplitItems:set'">
<a-icon type="setting" />
{{ $t('BatchSetting') }}
{{ $t('docTool.split.batchSetting') }}
</div>
<div class="operator-text" @click="handleBatCancel"
v-if="$route.query.createBy === userData.username || administrators"
v-has="'split:sarFileSplitItems:delete'">
<a-icon type="delete" />
{{ $t('BatchDelete') }}
{{ $t('batchDelete') }}
</div>
</div>
<div class="split-detail-table">
@@ -143,7 +143,7 @@
</div>
<!-- 条款详情 -->
<a-modal
:title="$t('clauseContent')"
:title="$t('docTool.split.clauseContent')"
:visible="contentVisible"
:confirm-loading="confirmLoading"
:footer="false"
@@ -169,16 +169,16 @@
:label-col="labelCol"
:wrapper-col="wrapperCol"
>
<a-form-model-item :label="$t('clauseNo')" prop="name">
<a-form-model-item :label="$t('docTool.split.clauseNo')" prop="name">
<a-input class="box-input" v-model="form.name" :placeholder="$t('PleaseEnter')+$t('clauseNo')" :maxLength="200" />
</a-form-model-item>
<a-form-model-item :label="$t('clauseName')" prop="itemName">
<a-form-model-item :label="$t('docTool.split.clauseName')" prop="itemName">
<a-input class="box-input" v-model="form.itemName" :placeholder="$t('PleaseEnter')+$t('clauseName')" :maxLength="200" />
</a-form-model-item>
<a-form-model-item :label="$t('serialNumber')" prop="displaySeq">
<a-input-number v-model="form.displaySeq" :min="1" :max="99999"
class="box-input"
:placeholder="$t('PleaseEnter')+$t('serialNumber')"
:placeholder="$t('pleaseEnter')+$t('serialNumber')"
:formatter="limitNumber"
:parser="limitNumber" style="width: 100%" />
</a-form-model-item>
@@ -187,7 +187,7 @@
<!-- 批量设置弹框 -->
<a-modal
class="show-setting"
:title="$t('batSetting')"
:title="$t('docTool.split.batchSetting')"
:visible="batSetVisible"
:confirm-loading="confirmLoading"
@ok="modalOk"
@@ -256,10 +256,10 @@ export default {
// { required: true, message: this.$t('PleaseEnter') + this.$t('clauseNo'), trigger: 'blur' },
],
itemName: [
{ required: true, message: this.$t('PleaseEnter') + this.$t('clauseName'), trigger: 'blur' }
{ required: true, message: this.$t('pleaseEnter') + this.$t('docTool.split.clauseName'), trigger: 'blur' }
],
displaySeq: [
{ required: true, message: this.$t('PleaseEnter') + this.$t('serialNumber'), trigger: 'blur' }
{ required: true, message: this.$t('pleaseEnter') + this.$t('serialNumber'), trigger: 'blur' }
// { min: 1, max: 99999, message: this.$t('cantExeed') + '99999' + this.$t('characters'), trigger: 'blur' },
]
},
@@ -493,12 +493,12 @@ export default {
// 树形删除
orgDelete () {
this.$confirm({
content: this.$t('deleteNodes'),
content: this.$t('confirmDeleteNodes'),
onOk:
async () => {
getAction(`split/sarFileSplitMenu/deleteMenu`, { id: this.nodeItem.id }).then(res => {
if (res.success) {
this.$message.success(this.$t('OperationSuccessful'))
this.$message.success(this.$t('operationSuccessful'))
this.loadMenuData()
const queryParam = {
menu_id: this.menuId,
@@ -525,7 +525,7 @@ export default {
}
postAction(`split/sarFileSplitMenu/moveUpOrDown`, query).then(res => {
if (res.success) {
this.$message.success(this.$t('OperationSuccessful'))
this.$message.success(this.$t('operationSuccessful'))
this.loadMenuData()
const queryParam = {
menu_id: this.menuId,
@@ -550,7 +550,7 @@ export default {
}
postAction(`split/sarFileSplitMenu/moveUpOrDown`, query).then(res => {
if (res.success) {
this.$message.success(this.$t('OperationSuccessful'))
this.$message.success(this.$t('operationSuccessful'))
this.loadMenuData()
const queryParam = {
menu_id: this.menuId,
@@ -592,7 +592,7 @@ export default {
postAction(`split/sarFileSplitMenu/addMenu`, params).then(res => {
if (res.success) {
this.menuRightVisible = false
this.$message.success(this.$t('OperationSuccessful'))
this.$message.success(this.$t('operationSuccessful'))
// this.onExpand(expandId)
this.form = {}
this.expandedKeys.push(this.nodeItem.id)
@@ -623,7 +623,7 @@ export default {
// console.log('parms',params)
putAction(`split/sarFileSplitMenu/updateMenu`, params).then(res => {
if (res.success) {
this.$message.success(this.$t('OperationSuccessful'))
this.$message.success(this.$t('operationSuccessful'))
this.onExpand(expandId)
this.form = {}
this.loadMenuData()
@@ -654,7 +654,7 @@ export default {
}
if (menuIds && menuIds.length > 0) {
this.$confirm({
title: this.$t('ConfirmReplication'),
title: this.$t('confirmReplication'),
content: '',
onOk:
async () => {
@@ -677,7 +677,7 @@ export default {
})
.then((res) => {
if (res.data.success) {
this.$message.success(this.$t('OperationSuccessful'))
this.$message.success(this.$t('operationSuccessful'))
this.$emit('selectClear')
this.selectClear()
// this.loadData()
@@ -687,7 +687,7 @@ export default {
info_id: this.infoId
}
eventBUs.$emit('searchGetData', JSON.parse(JSON.stringify(queryParam)))
this.$refs.splitDetailTable.$emit('searchGetData', JSON.parse(JSON.stringify(queryParam)))
// eventBUs.$emit('searchReset')
} else {
this.$message.warning(this.$t('operationFailed'))
@@ -698,7 +698,7 @@ export default {
}
})
} else if (menuIds.length === 0) {
this.$message.warning(this.$t('PleaseSelectData'))
this.$message.warning(this.$t('pleaseSelectData'))
}
},
// 新增
@@ -713,7 +713,7 @@ export default {
this.$refs.splitForm.formTitle = this.$t('add')
})
} else {
this.$message.warning(this.$t('selectDirectoryTerms'))
this.$message.warning(this.$t('docTool.split.selectDirectoryTerms'))
}
},
// 关闭新增弹框
@@ -723,7 +723,7 @@ export default {
// 导入
handleImportManage () {
if (!this.menuId) {
this.$message.warning(this.$t('selectDirectoryTerms'))
this.$message.warning(this.$t('docTool.split.selectDirectoryTerms'))
}
},
// 上传成功
@@ -779,7 +779,7 @@ export default {
},
// 模板下载
handleDownManage () {
const name = this.$t('documentSplitTemplate') + '.xlsx'
const name = this.$t('docTool.split.documentSplitTemplate') + '.xlsx'
downloadFile('split/sarFileSplitItems/exportTemplate', name, {})
},
// 合并条款
@@ -789,7 +789,7 @@ export default {
} else {
const ids = this.selectedRowKeys.join(',')
this.$confirm({
title: this.$t('mergeTerms'),
title: this.$t('docTool.split.mergeTerms'),
content: '',
onOk:
async () => {
@@ -805,7 +805,7 @@ export default {
})
.then((res) => {
if (res.data.success) {
this.$message.success(this.$t('OperationSuccessful'))
this.$message.success(this.$t('operationSuccessful'))
this.selectClear()
this.loadMenuData()
const queryParam = {
@@ -858,7 +858,7 @@ export default {
})
.then((res) => {
if (res.data.success) {
this.$message.success(this.$t('OperationSuccessful'))
this.$message.success(this.$t('operationSuccessful'))
this.batSetVisible = false
this.selectClear()
const queryParam = {
@@ -878,7 +878,7 @@ export default {
}
if (this.selecIds && this.selecIds.length > 0) {
this.$confirm({
title: this.$t('ConfirmBatchDeletion'),
title: this.$t('confirmBatchDeletion'),
content: '',
onOk:
async () => {
@@ -901,7 +901,7 @@ export default {
})
.then((res) => {
if (res.data.success) {
this.$message.success(this.$t('OperationSuccessful'))
this.$message.success(this.$t('operationSuccessful'))
this.loadMenuData()
const queryParam = {
menu_id: this.menuId,
@@ -971,7 +971,7 @@ export default {
})
.then((res) => {
if (res.data.success) {
this.$message.success(this.$t('OperationSuccessful'))
this.$message.success(this.$t('operationSuccessful'))
this.loadMenuData()
const queryParam = {
menu_id: this.menuId,