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>
<!--左边的目录--> <!--左边的目录-->
<div class="standard-catalogue part-common" :class="{'hide-catalogue': !leftCatalogueShow}"> <div class="standard-catalogue part-common" :class="{'hide-catalogue': !leftCatalogueShow}">
<div class="catalogue-show" @click="changeLeftCatalogueShow"> <!-- <div class="catalogue-show" @click="changeLeftCatalogueShow">-->
<a-icon :type="leftCatalogueShow ? 'left' : 'right'" /> <!-- <a-icon :type="leftCatalogueShow ? 'left' : 'right'" />-->
</div> <!-- </div>-->
<div class="part-title" v-show="leftCatalogueShow">{{ $t('standardRegulationLibrary.standardCatalogue') }}</div> <div class="part-title" v-show="leftCatalogueShow">{{ $t('standardRegulationLibrary.standardCatalogue') }}</div>
<div class="has-title-part-content" v-show="leftCatalogueShow"> <div class="has-title-part-content" v-show="leftCatalogueShow">
<a-tree <a-tree
@@ -43,9 +43,17 @@
<div class="standard-name"> <div class="standard-name">
<a-tooltip placement="topLeft"> <a-tooltip placement="topLeft">
<template #title> <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> </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> </a-tooltip>
</div> </div>
<div class="detail-content-left-scroll"> <div class="detail-content-left-scroll">
@@ -72,9 +80,9 @@
</div> </div>
<!--右侧目录--> <!--右侧目录-->
<div class="standard-catalogue part-common" :class="{'hide-catalogue': !rightCatalogueShow}"> <div class="standard-catalogue part-common" :class="{'hide-catalogue': !rightCatalogueShow}">
<div class="catalogue-show" @click="changeRightCatalogueShow"> <!-- <div class="catalogue-show" @click="changeRightCatalogueShow">-->
<a-icon :type="rightCatalogueShow ? 'left' : 'right'" /> <!-- <a-icon :type="rightCatalogueShow ? 'left' : 'right'" />-->
</div> <!-- </div>-->
<div class="part-title" v-show="rightCatalogueShow">{{ $t('standardRegulationLibrary.standardCatalogue') }}</div> <div class="part-title" v-show="rightCatalogueShow">{{ $t('standardRegulationLibrary.standardCatalogue') }}</div>
<div class="has-title-part-content" v-show="rightCatalogueShow"> <div class="has-title-part-content" v-show="rightCatalogueShow">
<a-tree <a-tree
@@ -97,9 +105,17 @@
<div class="standard-name"> <div class="standard-name">
<a-tooltip placement="topLeft"> <a-tooltip placement="topLeft">
<template #title> <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> </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> </a-tooltip>
</div> </div>
<div class="detail-content-right-scroll"> <div class="detail-content-right-scroll">
@@ -145,28 +161,15 @@ export default {
leftTreeSelectedKeys: [], // 左侧被选中树节点 leftTreeSelectedKeys: [], // 左侧被选中树节点
rightTreeSelectedKeys: [], // 右侧被选中树节点 rightTreeSelectedKeys: [], // 右侧被选中树节点
leftHighlightMenuId: null, // 左侧高亮数据的menuId leftHighlightMenuId: null, // 左侧高亮数据的menuId
rightHighlightMenuId: null // 右侧高亮数据的menuId rightHighlightMenuId: null, // 右侧高亮数据的menuId
similarityDegree: '',
textContent: '',
} }
}, },
mounted () { mounted () {
this.getData() this.getData()
}, },
methods: { 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 () { getData () {
const query = { const query = {
@@ -186,6 +189,8 @@ export default {
// 点击左侧文档内容 // 点击左侧文档内容
detailLeft (num, item) { detailLeft (num, item) {
this.leftTreeSelectedKeys = [item.menuId] this.leftTreeSelectedKeys = [item.menuId]
this.similarityDegree = ''
this.textContent = ''
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
@@ -204,12 +209,18 @@ export default {
this.rightTreeSelectedKeys = [this.dataRight.menuId] this.rightTreeSelectedKeys = [this.dataRight.menuId]
this.handleJumpRightData(index) this.handleJumpRightData(index)
this.clauseComparison() this.clauseComparison()
} else {
this.rightHighlightMenuId = ''
this.dataRight = {}
this.resultData = { ...this.resultData }
} }
} }
}, },
// 点击右侧文档内容 // 点击右侧文档内容
detailRight (num, item) { detailRight (num, item) {
this.rightTreeSelectedKeys = [item.menuId] this.rightTreeSelectedKeys = [item.menuId]
this.similarityDegree = ''
this.textContent = ''
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
@@ -227,6 +238,10 @@ export default {
this.leftTreeSelectedKeys = [this.dataLeft.menuId] this.leftTreeSelectedKeys = [this.dataLeft.menuId]
this.handleJumpLeftData(index) this.handleJumpLeftData(index)
this.clauseComparison() this.clauseComparison()
} else {
this.dataLeft = {}
this.leftHighlightMenuId = ''
this.resultData = { ...this.resultData }
} }
} }
}, },
@@ -236,14 +251,22 @@ export default {
leftId: this.dataLeft.id, leftId: this.dataLeft.id,
rightId: this.dataRight.id rightId: this.dataRight.id
} }
this.loadingText = true this.loading = true
clauseComparison(query).then((res) => { clauseComparison(query).then((res) => {
if (res.success) { if (res.success) {
this.loadingText = false this.loading = false
this.resultData.textLeft[this.dataLeft.numIndex].itemsText = res.result[0] this.resultData.textLeft[this.dataLeft.numIndex].itemsText = res.result.htmlDiffStr[0]
this.resultData.textRight[this.dataRight.numIndex].itemsText = res.result[1] 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 { } else {
this.loadingText = false this.loading = false
} }
}) })
}, },
@@ -252,7 +275,6 @@ export default {
const node = exports.node.$vnode.data.props.dataRef const node = exports.node.$vnode.data.props.dataRef
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]
console.log(this.dataLeft)
this.dataLeft.numIndex = index this.dataLeft.numIndex = index
this.leftHighlightMenuId = this.dataLeft.menuId this.leftHighlightMenuId = this.dataLeft.menuId
this.leftTreeSelectedKeys = [this.dataLeft.menuId] this.leftTreeSelectedKeys = [this.dataLeft.menuId]
@@ -267,6 +289,10 @@ export default {
this.rightTreeSelectedKeys = [this.dataRight.menuId] this.rightTreeSelectedKeys = [this.dataRight.menuId]
this.handleJumpRightData(indexRight) this.handleJumpRightData(indexRight)
this.clauseComparison() this.clauseComparison()
} else {
this.rightHighlightMenuId = ''
this.dataRight = {}
this.resultData = { ...this.resultData }
} }
} }
}, },
@@ -289,6 +315,10 @@ export default {
this.leftTreeSelectedKeys = [this.dataLeft.menuId] this.leftTreeSelectedKeys = [this.dataLeft.menuId]
this.handleJumpLeftData(indexLeft) this.handleJumpLeftData(indexLeft)
this.clauseComparison() this.clauseComparison()
} else {
this.dataLeft = {}
this.leftHighlightMenuId = ''
this.resultData = { ...this.resultData }
} }
} }
}, },