【fix】bug82947 加入id匹配验证

This commit is contained in:
yjz
2024-03-25 16:02:29 +08:00
parent a339ca1f12
commit 62843705b6
@@ -72,7 +72,7 @@
<div class="detail-content-left-scroll">
<div class="detail-content-left-item" @click="detailLeft(index,item)"
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 && leftHighlightId === item.id,'detail-content-item-saved':item.reviewed + '' === '1'}">
<div class="detail-content-item-text" style="margin-bottom: 10px;">
<span>{{ item.itemsNum }}</span> <span v-html="item.itemsName"></span>
</div>
@@ -118,7 +118,7 @@
<div class="detail-content-right-scroll">
<div class="detail-content-right-item" @click="detailRight(index,item)"
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 && rightHighlightId === item.id, 'detail-content-item-saved':item.reviewed + '' === '1'}">
<div class="detail-content-item-text" style="margin-bottom: 10px;">
<span>{{ item.itemsNum }}</span> <span v-html="item.itemsName"></span>
</div>
@@ -189,7 +189,9 @@ export default {
leftTreeSelectedKeys: [], // 左侧被选中树节点
rightTreeSelectedKeys: [], // 右侧被选中树节点
leftHighlightMenuId: null, // 左侧高亮数据的menuId
rightHighlightMenuId: null // 右侧高亮数据的menuId
rightHighlightMenuId: null, // 右侧高亮数据的menuId
leftHighlightId: null, // 左侧高亮数据的id
rightHighlightId: null // 右侧高亮数据的id
}
},
mounted () {
@@ -336,9 +338,11 @@ export default {
if (item.id === this.dataLeft.id && !this.isMatching) {
this.dataLeft = {}
this.leftHighlightMenuId = null
this.leftHighlightId = null
return
}
this.leftHighlightMenuId = item.menuId
this.leftHighlightId = item.id
this.dataLeft = item
this.dataLeft.numIndex = num
// 自动匹配,右侧数据需要跳转
@@ -348,6 +352,7 @@ export default {
this.dataRight = this.resultData.textRight[index]
this.dataRight.numIndex = index
this.rightHighlightMenuId = this.dataRight.menuId
this.rightHighlightId = this.dataRight.id
this.rightTreeSelectedKeys = [this.dataRight.menuId]
this.handleJumpRightData(index)
this.clauseComparison()
@@ -360,17 +365,20 @@ export default {
if (item.id === this.dataRight.id && !this.isMatching) {
this.dataRight = {}
this.rightHighlightMenuId = null
this.rightHighlightId = null
return
}
this.dataRight = item
this.dataRight.numIndex = num
this.rightHighlightMenuId = item.menuId
this.rightHighlightId = item.id
if (this.isMatching) {
const index = this.dataRight.targetStand
if (index > -1) {
this.dataLeft = this.resultData.textLeft[index]
this.dataLeft.numIndex = index
this.leftHighlightMenuId = this.dataLeft.menuId
this.leftHighlightId = this.dataLeft.id
this.leftTreeSelectedKeys = [this.dataLeft.menuId]
this.handleJumpLeftData(index)
this.clauseComparison()
@@ -404,6 +412,7 @@ export default {
console.log(this.dataLeft)
this.dataLeft.numIndex = index
this.leftHighlightMenuId = this.dataLeft.menuId
this.leftHighlightId = this.dataLeft.id
this.leftTreeSelectedKeys = [this.dataLeft.menuId]
this.handleJumpLeftData(index)
// 处理选中右侧树
@@ -413,6 +422,7 @@ export default {
this.dataRight = this.resultData.textRight[indexRight]
this.dataRight.numIndex = indexRight
this.rightHighlightMenuId = this.dataRight.menuId
this.rightHighlightId = this.dataRight.id
this.rightTreeSelectedKeys = [this.dataRight.menuId]
this.handleJumpRightData(indexRight)
this.clauseComparison()
@@ -421,12 +431,12 @@ export default {
},
// 右侧树选中
onSelectRight (selectedKeys, exports) {
debugger
const node = exports.node.$vnode.data.props.dataRef
const index = this.resultData.textRight.findIndex(tt => tt.menuId === node.menuId)
this.dataRight = this.resultData.textRight[index]
this.dataRight.numIndex = index
this.rightHighlightMenuId = this.dataRight.menuId
this.rightHighlightId = this.dataRight.id
this.rightTreeSelectedKeys = [this.dataRight.menuId]
this.handleJumpRightData(index)
// 处理选中左侧树
@@ -436,6 +446,7 @@ export default {
this.dataLeft = this.resultData.textLeft[indexLeft]
this.dataLeft.numIndex = indexLeft
this.leftHighlightMenuId = this.dataLeft.menuId
this.leftHighlightId = this.dataLeft.Id
this.leftTreeSelectedKeys = [this.dataLeft.menuId]
this.handleJumpLeftData(indexLeft)
this.clauseComparison()