修改全文对比得细节问题

This commit is contained in:
范强强
2024-02-29 15:19:09 +08:00
parent ac4e7f2cfc
commit 6adbe33288
3 changed files with 240 additions and 10 deletions
@@ -60,10 +60,31 @@
<div class="detail-content-left-item" @click="detailLeft(index,item)" <div class="detail-content-left-item" @click="detailLeft(index,item)"
v-for="(item,index) in resultData.textLeft" :key="index" v-for="(item,index) in resultData.textLeft" :key="index"
:class="{'detail-content-item-selected': leftHighlightMenuId === item.menuId,'detail-content-item-saved':item.reviewed + '' === '1'}"> :class="{'detail-content-item-selected': leftHighlightMenuId === item.menuId,'detail-content-item-saved':item.reviewed + '' === '1'}">
<div style="position: relative">
<div class="detail-content-item-text" style="margin-bottom: 10px;color: #040B29"> <div class="detail-content-item-text" style="margin-bottom: 10px;color: #040B29">
{{ item.itemsNum + ' ' + item.itemsName }} {{ item.itemsNum + ' ' + item.itemsName }}
</div> </div>
<div class="detail-content-item-text" v-html="item.itemsText"></div> <div class="detail-content-item-text" v-html="item.itemsText"></div>
<div @click="addViewRemark(item)" class="addRemarkBtn" v-show="!item.remark && !item.closeBtn">
<a-icon type="plus-circle" class="iconClass" /></div>
<div @click="addViewRemark(item)" class="addRemarkBtn" v-show="item.remark && !item.closeBtn">
<a-icon type="eye" class="iconClass"/></div>
<div @click="closeView(item)" class="addRemarkBtn" v-show="item.closeBtn">
<a-icon type="close-circle" class="iconClass"/></div>
</div>
<div v-if="item.addModalState">
<a-textarea
v-model.trim="item.remark"
:maxlength="500"
placeholder="书写笔记"
:auto-size="{ minRows: 3, maxRows: 5 }"
/>
<div style="text-align: right;margin: 10px 0">
<a-button type="primary" @click="modalSave(item)">
提交
</a-button>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>
@@ -122,17 +143,39 @@
<div class="detail-content-right-item" @click="detailRight(index,item)" <div class="detail-content-right-item" @click="detailRight(index,item)"
v-for="(item,index) in resultData.textRight" :key="index" v-for="(item,index) in resultData.textRight" :key="index"
:class="{'detail-content-item-selected': item.menuId === rightHighlightMenuId, 'detail-content-item-saved':item.reviewed + '' === '1'}"> :class="{'detail-content-item-selected': item.menuId === rightHighlightMenuId, 'detail-content-item-saved':item.reviewed + '' === '1'}">
<div class="detail-content-item-text" style="margin-bottom: 10px;color: #040B29"> <div style="position: relative">
{{ item.itemsNum + ' ' + item.itemsName }} <div class="detail-content-item-text" style="margin-bottom: 10px;color: #040B29">
{{ item.itemsNum + ' ' + item.itemsName }}
</div>
<div class="detail-content-item-text" v-html="item.itemsText">
</div>
<div @click="addViewRemark(item)" class="addRemarkBtn" v-show="!item.remark && !item.closeBtn">
<a-icon type="plus-circle" class="iconClass" /></div>
<div @click="addViewRemark(item)" class="addRemarkBtn" v-show="item.remark && !item.closeBtn">
<a-icon type="eye" class="iconClass"/></div>
<div @click="closeView(item)" class="addRemarkBtn" v-show="item.closeBtn">
<a-icon type="close-circle" class="iconClass"/></div>
</div> </div>
<div class="detail-content-item-text" v-html="item.itemsText"> <div v-if="item.addModalState">
<a-textarea
v-model.trim="item.remark"
:maxlength="500"
placeholder="书写笔记"
:auto-size="{ minRows: 3, maxRows: 5 }"
/>
<div style="text-align: right;margin: 10px 0">
<a-button type="primary" @click="modalSave(item)">
提交
</a-button>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div>
</internal-detail-page> </internal-detail-page>
</template> </template>
@@ -141,6 +184,7 @@
import InternalDetailPage from '../../../components/InternalDetailPage.vue' import InternalDetailPage from '../../../components/InternalDetailPage.vue'
import { getComparisonDetail, clauseComparison } from '../../../api/documentToolApi.js' import { getComparisonDetail, clauseComparison } from '../../../api/documentToolApi.js'
import { postAction } from '../../../api/manage'
export default { export default {
name: 'DocumentDataComparison', name: 'DocumentDataComparison',
@@ -164,6 +208,28 @@ export default {
rightHighlightMenuId: null, // 右侧高亮数据的menuId rightHighlightMenuId: null, // 右侧高亮数据的menuId
similarityDegree: '', similarityDegree: '',
textContent: '', textContent: '',
itemLeftIndex: '',
itemRightIndex: ''
}
},
watch: {
itemRightIndex: {
deep: true,
handler (newVal, oldVal) {
if (oldVal !== '') {
this.resultData.textRight[oldVal].addModalState = false
this.resultData.textRight[oldVal].closeBtn = false
}
}
},
itemLeftIndex: {
deep: true,
handler (newVal, oldVal) {
if (oldVal !== '') {
this.resultData.textLeft[oldVal].addModalState = false
this.resultData.textLeft[oldVal].closeBtn = false
}
}
} }
}, },
mounted () { mounted () {
@@ -191,6 +257,7 @@ export default {
this.leftTreeSelectedKeys = [item.menuId] this.leftTreeSelectedKeys = [item.menuId]
this.similarityDegree = '' this.similarityDegree = ''
this.textContent = '' this.textContent = ''
this.itemLeftIndex = num
if (item.id === this.dataLeft.id && !this.isMatching) { if (item.id === this.dataLeft.id && !this.isMatching) {
this.dataLeft = {} this.dataLeft = {}
this.leftHighlightMenuId = null this.leftHighlightMenuId = null
@@ -221,6 +288,7 @@ export default {
this.rightTreeSelectedKeys = [item.menuId] this.rightTreeSelectedKeys = [item.menuId]
this.similarityDegree = '' this.similarityDegree = ''
this.textContent = '' this.textContent = ''
this.itemRightIndex = num
if (item.id === this.dataRight.id && !this.isMatching) { if (item.id === this.dataRight.id && !this.isMatching) {
this.dataRight = {} this.dataRight = {}
this.rightHighlightMenuId = null this.rightHighlightMenuId = null
@@ -276,6 +344,7 @@ export default {
const index = this.resultData.textLeft.findIndex(tt => tt.menuId === node.menuId) const index = this.resultData.textLeft.findIndex(tt => tt.menuId === node.menuId)
this.dataLeft = this.resultData.textLeft[index] this.dataLeft = this.resultData.textLeft[index]
this.dataLeft.numIndex = index this.dataLeft.numIndex = index
this.itemLeftIndex = index
this.leftHighlightMenuId = this.dataLeft.menuId this.leftHighlightMenuId = this.dataLeft.menuId
this.leftTreeSelectedKeys = [this.dataLeft.menuId] this.leftTreeSelectedKeys = [this.dataLeft.menuId]
this.handleJumpLeftData(index) this.handleJumpLeftData(index)
@@ -302,6 +371,7 @@ export default {
const index = this.resultData.textRight.findIndex(tt => tt.menuId === node.menuId) const index = this.resultData.textRight.findIndex(tt => tt.menuId === node.menuId)
this.dataRight = this.resultData.textRight[index] this.dataRight = this.resultData.textRight[index]
this.dataRight.numIndex = index this.dataRight.numIndex = index
this.itemRightIndex = index
this.rightHighlightMenuId = this.dataRight.menuId this.rightHighlightMenuId = this.dataRight.menuId
this.rightTreeSelectedKeys = [this.dataRight.menuId] this.rightTreeSelectedKeys = [this.dataRight.menuId]
this.handleJumpRightData(index) this.handleJumpRightData(index)
@@ -352,6 +422,45 @@ export default {
}, },
changeRightCatalogueShow () { changeRightCatalogueShow () {
this.rightCatalogueShow = !this.rightCatalogueShow this.rightCatalogueShow = !this.rightCatalogueShow
},
// 添加笔记
addViewRemark (item) {
item.addModalState = true
item.closeBtn = true
},
closeView (item) {
// if (item.remark !== item.oldRemark) {
// this.$confirm({
// title: '提示',
// content: '<p>笔记内容有修改,是否保存?</p>',
// onOk: () => {
// this.modalSave(item)
// item.closeBtn = false
// item.addModalState = false
// },
// onCancel: () => {
// item.closeBtn = false
// item.addModalState = false
// }
// })
// } else {
item.closeBtn = false
item.addModalState = false
// }
},
modalSave (item) {
const query = {
remark: item.remark,
id: item.id
}
postAction('/compare/sarFileCompareItem/edit', query).then((res) => {
item.oldRemark = item.remark
if (res.success) {
this.$message.success(res.message)
} else {
this.$message.warning(res.message)
}
})
} }
} }
} }
@@ -506,6 +615,7 @@ export default {
border: 1px solid #EFF1F3; border: 1px solid #EFF1F3;
cursor: pointer; cursor: pointer;
background-color: white; background-color: white;
position: relative;
} }
.detail-content-right-item { .detail-content-right-item {
@@ -514,6 +624,7 @@ export default {
border: 1px solid #EFF1F3; border: 1px solid #EFF1F3;
cursor: pointer; cursor: pointer;
background-color: white; background-color: white;
position: relative;
} }
.detail-content-left-item:last-child { .detail-content-left-item:last-child {
@@ -681,4 +792,13 @@ export default {
text-align: right; text-align: right;
padding-right: 16px; padding-right: 16px;
} }
.addRemarkBtn{
position: absolute;
bottom: 0;
right: -10px;
/*z-index: 10;*/
}
.iconClass{
font-size: 18px;
}
</style> </style>
@@ -14,14 +14,13 @@
:columns="columns" :columns="columns"
:data-source="dataSource" :data-source="dataSource"
:can-drag="true" :can-drag="true"
:loading="loading"
:pagination="ipagination" :pagination="ipagination"
:scroll="{x: '100%', y: yScrollHeight}" :scroll="{x: '100%', y: yScrollHeight}"
@operationClick="operationClick" @operationClick="operationClick"
:operation-list="operationList"> :operation-list="operationList">
</j-table> </j-table>
</div> </div>
<viewDifferenceModal ref="viewDifferenceModalRef"/> <viewDifferenceModal ref="viewDifferenceModalRef" @viewDifferenceModalForm="viewDifferenceModalForm"/>
</internal-detail-page> </internal-detail-page>
</template> </template>
@@ -113,6 +112,9 @@ export default {
viewDifferenceClick (item) { viewDifferenceClick (item) {
console.log(item) console.log(item)
this.$refs.viewDifferenceModalRef.open(item) this.$refs.viewDifferenceModalRef.open(item)
},
viewDifferenceModalForm () {
this.loadData()
} }
} }
} }
@@ -6,9 +6,9 @@
:confirm-loading="confirmLoading" :confirm-loading="confirmLoading"
:maskClosable="false" :maskClosable="false"
switchFullscreen switchFullscreen
@cancel="visible = false"> @cancel="cancel">
<template slot="footer"> <template slot="footer">
<a-button @click="visible = false"> <a-button @click="cancel">
关闭 关闭
</a-button> </a-button>
</template> </template>
@@ -23,7 +23,28 @@
<div class="detail-content-left-container"> <div class="detail-content-left-container">
<div class="detail-content-left-scroll"> <div class="detail-content-left-scroll">
<div class="detail-content-left-item"> <div class="detail-content-left-item">
<div class="detail-content-item-text" style="margin-bottom: 10px;color: #040B29" v-html="textLeft"> <div style="position: relative">
<div class="detail-content-item-text" style="margin-bottom: 10px;color: #040B29" v-html="textLeft">
</div>
<div @click="addViewRemark" class="addRemarkBtn" v-show="!oldRemark && !oldCloseBtn">
<a-icon type="plus-circle" class="iconClass" /></div>
<div @click="addViewRemark" class="addRemarkBtn" v-show="oldRemark && !oldCloseBtn">
<a-icon type="eye" class="iconClass"/></div>
<div @click="closeView" class="addRemarkBtn" v-show="oldCloseBtn">
<a-icon type="close-circle" class="iconClass"/></div>
</div>
<div v-if="oldAddModalState" style="margin-top: 10px">
<a-textarea
v-model.trim="oldRemark"
:maxlength="500"
placeholder="书写笔记"
:auto-size="{ minRows: 3, maxRows: 5 }"
/>
<div style="text-align: right;margin: 10px 0">
<a-button type="primary" @click="modalSave('old')">
提交
</a-button>
</div>
</div> </div>
</div> </div>
</div> </div>
@@ -35,8 +56,29 @@
<div class="detail-content-right-container"> <div class="detail-content-right-container">
<div class="detail-content-right-scroll"> <div class="detail-content-right-scroll">
<div class="detail-content-right-item"> <div class="detail-content-right-item">
<div style="position: relative">
<div class="detail-content-item-text" v-html="textRight"> <div class="detail-content-item-text" v-html="textRight">
</div> </div>
<div @click="newAddViewRemark" class="addRemarkBtn" v-show="!newRemark && !newCloseBtn">
<a-icon type="plus-circle" class="iconClass" /></div>
<div @click="newAddViewRemark" class="addRemarkBtn" v-show="newRemark && !newCloseBtn">
<a-icon type="eye" class="iconClass"/></div>
<div @click="newCloseView" class="addRemarkBtn" v-show="newCloseBtn">
<a-icon type="close-circle" class="iconClass"/></div>
</div>
<div v-if="newAddModalState" style="margin-top: 10px">
<a-textarea
v-model.trim="newRemark"
:maxlength="500"
placeholder="书写笔记"
:auto-size="{ minRows: 3, maxRows: 5 }"
/>
<div style="text-align: right;margin: 10px 0">
<a-button type="primary" @click="modalSave('new')">
提交
</a-button>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>
@@ -47,6 +89,7 @@
</template> </template>
<script> <script>
import { postAction } from '@/api/manage'
export default { export default {
name: 'viewDifferenceModal', name: 'viewDifferenceModal',
data () { data () {
@@ -56,13 +99,31 @@ export default {
textLeft: '', textLeft: '',
textRight: '', textRight: '',
similarityDegree: '', similarityDegree: '',
textContent: '' textContent: '',
oldRemark: '',
oldCloseBtn: false,
oldAddModalState: false,
newCloseBtn: false,
newAddModalState: false,
newRemark: '',
dataId: ''
} }
}, },
methods: { methods: {
cancel () {
this.visible = false
this.$emit('viewDifferenceModalForm')
},
open (item) { open (item) {
this.textLeft = item.oldItemsText this.textLeft = item.oldItemsText
this.textRight = item.newItemsText this.textRight = item.newItemsText
this.oldRemark = item.oldRemark
this.newRemark = item.newRemark
this.dataId = item.id
this.oldCloseBtn = false
this.oldAddModalState = false
this.newCloseBtn = false
this.newAddModalState = false
this.similarityDegree = item.similarityDegree this.similarityDegree = item.similarityDegree
if (parseFloat(item.similarityDegree) < parseFloat('75%')) { if (parseFloat(item.similarityDegree) < parseFloat('75%')) {
this.textContent = '不相似' this.textContent = '不相似'
@@ -72,6 +133,43 @@ export default {
this.textContent = '相同' this.textContent = '相同'
} }
this.visible = true this.visible = true
},
addViewRemark () {
this.oldCloseBtn = true
this.oldAddModalState = true
},
closeView () {
this.oldCloseBtn = false
this.oldAddModalState = false
},
newAddViewRemark () {
this.newCloseBtn = true
this.newAddModalState = true
},
newCloseView () {
this.newCloseBtn = false
this.newAddModalState = false
},
modalSave (type) {
let query = {}
if (type === 'old') {
query = {
id: this.dataId,
oldRemark: this.oldRemark
}
} else {
query = {
id: this.dataId,
newRemark: this.newRemark
}
}
postAction('/compare/sarItemsCompareHis/edit', query).then((res) => {
if (res.success) {
this.$message.success(res.message)
} else {
this.$message.warning(res.message)
}
})
} }
} }
} }
@@ -161,6 +259,7 @@ export default {
border: 1px solid #fff; border: 1px solid #fff;
cursor: pointer; cursor: pointer;
background-color: white; background-color: white;
position: relative;
} }
.detail-content-right-item { .detail-content-right-item {
@@ -169,6 +268,7 @@ export default {
/*border: 1px solid #EFF1F3;*/ /*border: 1px solid #EFF1F3;*/
cursor: pointer; cursor: pointer;
background-color: white; background-color: white;
position: relative;
} }
.detail-content-left-item:last-child { .detail-content-left-item:last-child {
@@ -200,4 +300,12 @@ export default {
border-bottom: 2px solid #EFF1F3 ; border-bottom: 2px solid #EFF1F3 ;
font-size: 16px; font-size: 16px;
} }
.iconClass{
font-size: 18px;
}
.addRemarkBtn{
position: absolute;
bottom: 0;
right: 0;
}
</style> </style>