feat: There is no way the,

This commit is contained in:
Superman_Main
2021-11-29 17:38:57 +08:00
parent 69f7c928e9
commit 48215f7da6
@@ -130,6 +130,8 @@ export default {
rowDataRight: JSON.parse(this.$route.query.rowDataRight), rowDataRight: JSON.parse(this.$route.query.rowDataRight),
resRightMapList: [], resRightMapList: [],
saveItemId: '', saveItemId: '',
saveLeftId: '',
saveRightId: '',
saveItemIdRight: '', saveItemIdRight: '',
leftString: '', leftString: '',
rightString: '', rightString: '',
@@ -175,6 +177,14 @@ export default {
} else if (parseFloat(res.data.similarityDegree) < parseFloat('75%')) { } else if (parseFloat(res.data.similarityDegree) < parseFloat('75%')) {
this.textcontent = '不相似' this.textcontent = '不相似'
} }
const treeNodeLeft = {}
treeNodeLeft.id = this.saveLeftId
const treeNodeRight = {}
treeNodeRight.id = this.saveRightId
console.log(treeNodeLeft)
console.log(treeNodeRight)
this.handleLeftTreeClick("domesticTree1",treeNodeLeft)
this.handleRightTreeClick("domesticTree2",treeNodeRight)
// this.resultModal = true // this.resultModal = true
this.spinShow = false this.spinShow = false
}, e => { }, e => {
@@ -232,6 +242,7 @@ export default {
$(this.oldRightId).find('#itemsRightText_' + this.saveItemIdRight).html(this.oldRightContent) $(this.oldRightId).find('#itemsRightText_' + this.saveItemIdRight).html(this.oldRightContent)
} }
this.saveItemId = item.itemsId this.saveItemId = item.itemsId
this.saveLeftId = item.id
this.itemLeftIndex = index this.itemLeftIndex = index
@@ -250,25 +261,26 @@ export default {
this.leftName = item.itemsNum + ' ' + item.itemsName this.leftName = item.itemsNum + ' ' + item.itemsName
this.saveItemIdRight = this.resRightMapList[item.targetStand].itemsId this.saveItemIdRight = this.resRightMapList[item.targetStand].itemsId
this.saveRightId = this.resRightMapList[item.targetStand].id
let scrollToContainer = mainContainer.find(`.children:eq(${item.targetStand})`) let scrollToContainer = mainContainer.find(`.children:eq(${item.targetStand})`)
this.rightName = scrollToContainer.children(':first').html() this.rightName = scrollToContainer.children(':first').html()
scrollToContainer.css('border', '2px solid red') scrollToContainer.css('border', '2px solid red')
// 非动画效果 // 非动画效果
// mainContainer.scrollTop( mainContainer.scrollTop(
// scrollToContainer.offset().top - mainContainer.offset().top + mainContainer.scrollTop() scrollToContainer.offset().top - mainContainer.offset().top + mainContainer.scrollTop()
// ); );
// 动画效果 // 动画效果
mainContainer.animate({ // mainContainer.animate({
scrollTop: scrollToContainer.offset().top - mainContainer.offset().top + mainContainer.scrollTop() // scrollTop: scrollToContainer.offset().top - mainContainer.offset().top + mainContainer.scrollTop()
})// 2秒滑动到指定位置 // })// 2秒滑动到指定位置
} else { } else {
if (this.oldLeftId !== '') { if (this.oldLeftId !== '') {
$(this.oldLeftId).find('#itemsLeftText_' + this.saveItemId).html(this.oldLeftContent) $(this.oldLeftId).find('#itemsLeftText_' + this.saveItemId).html(this.oldLeftContent)
$(this.oldRightId).find('#itemsRightText_' + this.saveItemIdRight).html(this.oldRightContent) $(this.oldRightId).find('#itemsRightText_' + this.saveItemIdRight).html(this.oldRightContent)
} }
this.saveItemIdRight = item.itemsId this.saveItemIdRight = item.itemsId
this.saveRightId = item.id
this.itemRightIndex = index this.itemRightIndex = index
@@ -287,6 +299,7 @@ export default {
this.rightName = item.itemsNum + ' ' + item.itemsName this.rightName = item.itemsNum + ' ' + item.itemsName
this.saveItemId = this.resLeftMapList[item.targetStand].itemsId this.saveItemId = this.resLeftMapList[item.targetStand].itemsId
this.saveLeftId = this.resLeftMapList[item.targetStand].id
let scrollToContainer = mainContainer.find(`.children:eq(${item.targetStand})`)// 滚动到<div id="thisMainPanel">中类名为son-panel的第六个处 let scrollToContainer = mainContainer.find(`.children:eq(${item.targetStand})`)// 滚动到<div id="thisMainPanel">中类名为son-panel的第六个处
this.leftName = scrollToContainer.children('div:nth-child(2)').html() this.leftName = scrollToContainer.children('div:nth-child(2)').html()
@@ -507,6 +520,7 @@ export default {
}, },
handleLeftTreeClick(treeId, treeNode) { handleLeftTreeClick(treeId, treeNode) {
console.log(treeNode.id)
const domId = `left_${treeNode.id}` const domId = `left_${treeNode.id}`
function getElementTop(element) { function getElementTop(element) {
var el = (typeof element == "string") ? document.getElementById(element) : element; var el = (typeof element == "string") ? document.getElementById(element) : element;
@@ -520,7 +534,8 @@ export default {
}, },
handleRightTreeClick(treeId, treeNode) { handleRightTreeClick(treeId, treeNode) {
const domId = `right_${treeNode.id}` console.log(treeNode.id)
const domId = `right_${treeNode.id}`
function getElementTop(element) { function getElementTop(element) {
var el = (typeof element == "string") ? document.getElementById(element) : element; var el = (typeof element == "string") ? document.getElementById(element) : element;
if (el.parentNode === null || el.style.display == 'none') { if (el.parentNode === null || el.style.display == 'none') {