update 文档比对

This commit is contained in:
赵霄
2023-09-18 15:05:46 +08:00
parent b9d19e081b
commit e9c563383f
6 changed files with 218 additions and 300 deletions
@@ -1,556 +0,0 @@
<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>
<comparison-add-full-comment ref="comparisonAddFullComment"></comparison-add-full-comment>
</a-spin>
</template>
<script>
import { postAction, getAction } from '@/api/manage'
// 添加全文评论弹框
import ComparisonAddFullComment from './ComparisonAddFullComment'
export default {
name: 'DocumentDataComparison',
components: { ComparisonAddFullComment },
data () {
return {
formInline: {},
loadingText: false,
rules: {},
loading: 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 () {
const query = {
id: this.$route.query.id
}
postAction('/compare/sarFileCompareInfo/getComparisonDetail', query).then((res) => {
if (res.success) {
this.$refs.comparisonAddFullComment.open(res.result.comments || '')
}
})
},
// 关闭自动匹配、开启自动匹配
turnOffAutomaticMatchingClick () {
this.isMatching = !this.isMatching
this.$message.success(this.$t('operationSuccessful'))
},
// 获取文件对比详情
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 || {}
} 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: 30px;
overflow-y: auto;
&-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,612 +0,0 @@
<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>
<j-table
ref="table"
size="middle"
:can-drag="true"
: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"
>
</j-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>
<j-table
ref="table"
size="middle"
:can-drag="true"
:loading="loadingRight"
:pagination="false"
:scroll="{x: '100%',y:340}"
rowKey="id"
:data-source="dataSourceRight"
:row-selection="{ selectedRowKeys: selectedRowKeysRight, onChange: onSelectChangeRight, columnTitle:' ', type: 'radio'}"
:columns="tableColumns"
@change="tableChangeRight"
>
</j-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 JTable from '@/components/jero/JTable'
import { getAction, downloadFile, getFileAccessHttpUrl } from '@/api/manage'
import { previewPdf } from '@/utils/previewPdf'
import { Base64 } from 'js-base64'
import { mapGetters } from 'vuex'
export default {
name: 'InitiateComparison',
components: { JTable },
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('docTool.comparison.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('docTool.comparison.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: '/documentTool/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>