组织树tootip问题修复

This commit is contained in:
wuhongjian 2022-12-08 11:48:10 +08:00
parent 7a096d5dc1
commit 2b00dd9130
1 changed files with 45 additions and 38 deletions

View File

@ -39,7 +39,7 @@
fill="#0058e1"
></path>
</svg>
<a-tooltip>
<a-tooltip @mouseenter="showToolTip">
<template #title>{{ val.title }}</template>
<span class="name">
{{ val.title }}
@ -88,7 +88,7 @@
fill="#0058e1"
></path>
</svg>
<a-tooltip>
<a-tooltip @mouseenter="showToolTip">
<template #title>{{ child.title }}</template>
<span class="name">
{{ child.title }}
@ -128,11 +128,11 @@
title: 'name',
}
const store = useStore()
//
const user = ref({
deptName: store.getters['user/deptName'],
deptId: store.getters['user/deptId'],
})
//
const user = ref({
deptName: store.getters['user/deptName'],
deptId: store.getters['user/deptId'],
})
const showKey = ref(0)
const treeData = ref([])
const init = () => {
@ -145,7 +145,7 @@
if (select === '123') {
select = ''
}
console.log(
'获取url中的select=====================>',
router.currentRoute.value.query.select
@ -186,33 +186,33 @@
return sortArr.indexOf(a.key) - sortArr.indexOf(b.key)
})
//
// let deptId=user.value.deptId
// treeData.value.forEach((child) => {
// let childern=child.children
// childern.forEach((childs) => {//
// if(childs.key==deptId ){
// childs.show=true
// child.show=true
// mybus.emit('paramsGetResources', [childs.key])
// selectId.value =childs.key
// }
// if(childs.children && childs.children.length>0){//
// let qu=childs.children
// qu.forEach((qu) => {
// if(qu.key==deptId ){
// qu.show=true
// childs.show=true
// child.show=true
// mybus.emit('paramsGetResources', [qu.key])
// selectId.value = qu.key
// }
// })
// }
// })
// })
// let deptId=user.value.deptId
// treeData.value.forEach((child) => {
// let childern=child.children
// childern.forEach((childs) => {//
// if(childs.key==deptId ){
// childs.show=true
// child.show=true
// mybus.emit('paramsGetResources', [childs.key])
// selectId.value =childs.key
// }
// if(childs.children && childs.children.length>0){//
// let qu=childs.children
// qu.forEach((qu) => {
// if(qu.key==deptId ){
// qu.show=true
// childs.show=true
// child.show=true
// mybus.emit('paramsGetResources', [qu.key])
// selectId.value = qu.key
// }
// })
// }
// })
// })
console.log('左侧树结构数据======================>', treeData.value)
showKey.value++
})
}
@ -222,7 +222,6 @@
})
// children
const generateChildren = (val, obj) => {
if (val.dataList.length > 0) {
val.dataList.forEach((child) => {
let children = {
@ -232,14 +231,20 @@
total: child.deptCount,
key: child.deptId,
}
obj.children.push(children)
})
}
}
const showToolTip = (e) => {
console.log('鼠标移入', e, e.target.clientWidth, e.target.scrollWidth)
debugger
if (e.target.clientWidth < 200) {
e.target.style.pointerEvents = 'none' //
}
}
//
const generateChildren2 = (val, obj) => {
if (val.dataList.length > 0) {
val.dataList.forEach((dis) => {
let children = {
@ -259,7 +264,7 @@
select: false,
key: child.deptId,
}
children.children.push(children2)
})
}
@ -382,6 +387,7 @@
showBottom,
showDown,
selectId,
showToolTip,
}
},
beforeUnmount() {
@ -498,6 +504,7 @@
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
word-break: break-all;
max-width: 200px;
}
}
.up:hover {