Merge remote-tracking branch 'origin/master'

This commit is contained in:
wangzhijiang
2024-02-29 11:33:12 +08:00
@@ -18,9 +18,9 @@
</div>
<!--左边的目录-->
<div class="standard-catalogue part-common" :class="{'hide-catalogue': !leftCatalogueShow}">
<div class="catalogue-show" @click="changeLeftCatalogueShow">
<a-icon :type="leftCatalogueShow ? 'left' : 'right'" />
</div>
<!-- <div class="catalogue-show" @click="changeLeftCatalogueShow">-->
<!-- <a-icon :type="leftCatalogueShow ? 'left' : 'right'" />-->
<!-- </div>-->
<div class="part-title" v-show="leftCatalogueShow">{{ $t('standardRegulationLibrary.standardCatalogue') }}</div>
<div class="has-title-part-content" v-show="leftCatalogueShow">
<a-tree
@@ -43,9 +43,17 @@
<div class="standard-name">
<a-tooltip placement="topLeft">
<template #title>
{{ resultData.serialNumberLeft }} {{ resultData.fileNameLeft }}
<span>{{ dataLeft.itemsNum ? dataLeft.itemsNum + dataLeft.itemsName : '' }}</span>
<span v-if="similarityDegree">相似度
<span>{{similarityDegree}}</span>
<span>{{textContent}}</span>
</span>
</template>
<span>{{ resultData.serialNumberLeft }} {{ resultData.fileNameLeft }}</span>
<span>{{ dataLeft.itemsNum ? dataLeft.itemsNum + dataLeft.itemsName : '' }}</span>
<span v-if="similarityDegree">相似度
<span style="color: red">{{similarityDegree}}</span>
<span>{{textContent}}</span>
</span>
</a-tooltip>
</div>
<div class="detail-content-left-scroll">
@@ -72,9 +80,9 @@
</div>
<!--右侧目录-->
<div class="standard-catalogue part-common" :class="{'hide-catalogue': !rightCatalogueShow}">
<div class="catalogue-show" @click="changeRightCatalogueShow">
<a-icon :type="rightCatalogueShow ? 'left' : 'right'" />
</div>
<!-- <div class="catalogue-show" @click="changeRightCatalogueShow">-->
<!-- <a-icon :type="rightCatalogueShow ? 'left' : 'right'" />-->
<!-- </div>-->
<div class="part-title" v-show="rightCatalogueShow">{{ $t('standardRegulationLibrary.standardCatalogue') }}</div>
<div class="has-title-part-content" v-show="rightCatalogueShow">
<a-tree
@@ -97,9 +105,17 @@
<div class="standard-name">
<a-tooltip placement="topLeft">
<template #title>
{{ resultData.serialNumberRight }} {{ resultData.fileNameRight }}
<span>{{ dataRight.itemsNum ? dataRight.itemsNum + dataRight.itemsName : '' }}</span>
<span v-if="similarityDegree">相似度
<span>{{similarityDegree}}</span>
<span>{{textContent}}</span>
</span>
</template>
<span>{{ resultData.serialNumberRight }} {{ resultData.fileNameRight }}</span>
<span>{{ dataRight.itemsNum ? dataRight.itemsNum + dataRight.itemsName : '' }}</span>
<span v-if="similarityDegree">相似度
<span style="color: red">{{similarityDegree}}</span>
<span>{{textContent}}</span>
</span>
</a-tooltip>
</div>
<div class="detail-content-right-scroll">
@@ -145,28 +161,15 @@ export default {
leftTreeSelectedKeys: [], // 左侧被选中树节点
rightTreeSelectedKeys: [], // 右侧被选中树节点
leftHighlightMenuId: null, // 左侧高亮数据的menuId
rightHighlightMenuId: null // 右侧高亮数据的menuId
rightHighlightMenuId: null, // 右侧高亮数据的menuId
similarityDegree: '',
textContent: '',
}
},
mounted () {
this.getData()
},
methods: {
// 查看对比结果按钮点击
viewTheComparisonResultsClick () {
this.$router.push({
path: '/documentTool/ComparisonResults',
query: {
id: this.$route.query.id,
isDisplay: 2
}
})
},
// 关闭自动匹配、开启自动匹配
turnOffAutomaticMatchingClick () {
this.isMatching = !this.isMatching
this.$message.success(this.$t('operationSuccessful'))
},
// 获取文件对比详情
getData () {
const query = {
@@ -186,6 +189,8 @@ export default {
// 点击左侧文档内容
detailLeft (num, item) {
this.leftTreeSelectedKeys = [item.menuId]
this.similarityDegree = ''
this.textContent = ''
if (item.id === this.dataLeft.id && !this.isMatching) {
this.dataLeft = {}
this.leftHighlightMenuId = null
@@ -204,12 +209,18 @@ export default {
this.rightTreeSelectedKeys = [this.dataRight.menuId]
this.handleJumpRightData(index)
this.clauseComparison()
} else {
this.rightHighlightMenuId = ''
this.dataRight = {}
this.resultData = { ...this.resultData }
}
}
},
// 点击右侧文档内容
detailRight (num, item) {
this.rightTreeSelectedKeys = [item.menuId]
this.similarityDegree = ''
this.textContent = ''
if (item.id === this.dataRight.id && !this.isMatching) {
this.dataRight = {}
this.rightHighlightMenuId = null
@@ -227,6 +238,10 @@ export default {
this.leftTreeSelectedKeys = [this.dataLeft.menuId]
this.handleJumpLeftData(index)
this.clauseComparison()
} else {
this.dataLeft = {}
this.leftHighlightMenuId = ''
this.resultData = { ...this.resultData }
}
}
},
@@ -236,14 +251,22 @@ export default {
leftId: this.dataLeft.id,
rightId: this.dataRight.id
}
this.loadingText = true
this.loading = true
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]
this.loading = false
this.resultData.textLeft[this.dataLeft.numIndex].itemsText = res.result.htmlDiffStr[0]
this.resultData.textRight[this.dataRight.numIndex].itemsText = res.result.htmlDiffStr[1]
this.similarityDegree = res.result.similarityDegree
if (parseFloat(res.result.similarityDegree) < parseFloat('75%')) {
this.textContent = '不相似'
} else if (parseFloat(res.result.similarityDegree) >= parseFloat('75%') && parseFloat(res.result.similarityDegree) !== parseFloat('100%')) {
this.textContent = '相似'
} else if (parseFloat(res.result.similarityDegree) === parseFloat('100%')) {
this.textContent = '相同'
}
} else {
this.loadingText = false
this.loading = false
}
})
},
@@ -252,7 +275,6 @@ export default {
const node = exports.node.$vnode.data.props.dataRef
const index = this.resultData.textLeft.findIndex(tt => tt.menuId === node.menuId)
this.dataLeft = this.resultData.textLeft[index]
console.log(this.dataLeft)
this.dataLeft.numIndex = index
this.leftHighlightMenuId = this.dataLeft.menuId
this.leftTreeSelectedKeys = [this.dataLeft.menuId]
@@ -267,6 +289,10 @@ export default {
this.rightTreeSelectedKeys = [this.dataRight.menuId]
this.handleJumpRightData(indexRight)
this.clauseComparison()
} else {
this.rightHighlightMenuId = ''
this.dataRight = {}
this.resultData = { ...this.resultData }
}
}
},
@@ -289,6 +315,10 @@ export default {
this.leftTreeSelectedKeys = [this.dataLeft.menuId]
this.handleJumpLeftData(indexLeft)
this.clauseComparison()
} else {
this.dataLeft = {}
this.leftHighlightMenuId = ''
this.resultData = { ...this.resultData }
}
}
},