对接条款比对

This commit is contained in:
范强强
2024-02-27 16:01:02 +08:00
parent bfc81e9a46
commit d15d8871c9
@@ -18,7 +18,7 @@
<a-tree <a-tree
class="draggable-tree" class="draggable-tree"
:selected-keys="leftTreeSelectedKeys" :selected-keys="leftTreeSelectedKeys"
:replace-fields="{key: 'menuId'}" :replace-fields="{key: 'id'}"
@select="onSelectLeft" @select="onSelectLeft"
:tree-data="menuLeft"> :tree-data="menuLeft">
<a-icon slot="switcherIcon" type="down" :style="{ fontSize: '12px', color: '#103770' }" /> <a-icon slot="switcherIcon" type="down" :style="{ fontSize: '12px', color: '#103770' }" />
@@ -35,9 +35,17 @@
<div class="standard-name"> <div class="standard-name">
<a-tooltip placement="topLeft"> <a-tooltip placement="topLeft">
<template #title> <template #title>
{{ leftData.title }} <span>{{ leftData.title }}</span>
<span v-if="similarityDegree">相似度
<span>{{similarityDegree}}</span>
<span>{{textContent}}</span>
</span>
</template> </template>
<span>{{ leftData.title }}</span> <span>{{ leftData.title }}</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">
@@ -64,7 +72,7 @@
<a-tree <a-tree
class="draggable-tree" class="draggable-tree"
:selected-keys="rightTreeSelectedKeys" :selected-keys="rightTreeSelectedKeys"
:replace-fields="{key: 'menuId'}" :replace-fields="{key: 'id'}"
@select="onSelectRight" @select="onSelectRight"
:tree-data="menuRight"> :tree-data="menuRight">
<a-icon slot="switcherIcon" type="down" :style="{ fontSize: '12px', color: '#103770' }" /> <a-icon slot="switcherIcon" type="down" :style="{ fontSize: '12px', color: '#103770' }" />
@@ -81,9 +89,17 @@
<div class="standard-name"> <div class="standard-name">
<a-tooltip placement="topLeft"> <a-tooltip placement="topLeft">
<template #title> <template #title>
{{ rightData.title }} <span>{{ rightData.title }}</span>
<span v-if="similarityDegree">相似度
<span>{{similarityDegree}}</span>
<span>{{textContent}}</span>
</span>
</template> </template>
<span>{{ rightData.title }}</span> <span>{{ rightData.title }}</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">
@@ -132,7 +148,9 @@ export default {
textRight: '', textRight: '',
textLeft: '', textLeft: '',
textLeftId: '', textLeftId: '',
textRightId: '' textRightId: '',
similarityDegree: '',
textContent: ''
} }
}, },
mounted () { mounted () {
@@ -149,6 +167,9 @@ export default {
if (node.children && node.children.length > 0) { if (node.children && node.children.length > 0) {
return return
} }
this.leftTreeSelectedKeys = [node.id]
this.similarityDegree = ''
this.textContent = ''
this.leftData = node this.leftData = node
this.getLeftDocumentSplitView() this.getLeftDocumentSplitView()
}, },
@@ -183,6 +204,9 @@ export default {
if (node.children && node.children.length > 0) { if (node.children && node.children.length > 0) {
return return
} }
this.rightTreeSelectedKeys = [node.id]
this.similarityDegree = ''
this.textContent = ''
this.rightData = node this.rightData = node
this.getRightDocumentSplitView() this.getRightDocumentSplitView()
}, },
@@ -248,6 +272,15 @@ export default {
this.loading = true this.loading = true
clauseComparisonEvent(query).then((res) => { clauseComparisonEvent(query).then((res) => {
if (res.success) { if (res.success) {
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.loading = false this.loading = false
@@ -540,7 +573,7 @@ export default {
.standard-name > span { .standard-name > span {
font-size: 16px; font-size: 16px;
font-family: PingFang SC-Semibold, PingFang SC, sans-serif; font-family: PingFang SC-Semibold, PingFang SC, sans-serif;
font-weight: 600; font-weight: 500;
color: #1D2129; color: #1D2129;
flex: 1; flex: 1;
width: 0; width: 0;