Skip to content

Commit

Permalink
fix: 调整大纲树眼睛控制状态
Browse files Browse the repository at this point in the history
  • Loading branch information
lichunn committed Nov 8, 2024
1 parent ea7e630 commit 8aa1ec7
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions packages/plugins/tree/src/Main.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@
class="tree-box"
:schemaId="data.row?.id"
:type="data.row.componentName"
@mouseover="mouseover(data.row, $event)"
@mouseleave="mouseleave(data.row, $event)"
@mouseover="mouseover(data.row)"
@mouseleave="mouseleave(data.row)"
@click="checkElement(data.row)"
>
<span class="tree-content">
Expand All @@ -57,7 +57,7 @@
</span> -->
<span>{{ data.row.componentName }}</span>
</span>
<span class="tree-handle" @mouseup="showNode(data.row)">
<span v-show="data.row.showEye" class="tree-handle" @mouseup="showNode(data.row)">
<icon-eyeopen v-show="data.row.show"></icon-eyeopen>
<icon-eyeclose v-show="!data.row.show"></icon-eyeclose>
</span>
Expand Down Expand Up @@ -105,7 +105,7 @@ export default {
const translateChild = (data) => {
data.forEach((item) => {
item.show = pageState.nodesStatus[item.id] !== false
item.showEye = item.show === false
item.showEye = !item.show
const child = item.children
if (typeOf(child) !== 'array') {
delete item.children
Expand Down Expand Up @@ -172,23 +172,22 @@ export default {
return component.icon || 'IconAssociation'
}
const mouseover = (data, event) => {
const mouseover = (data) => {
if (state.isLock) {
return
}
const { hoverNode } = useCanvas().canvasApi.value
hoverNode(data.id)
const handleEl = event.target.querySelector('.tree-handle')
handleEl && (handleEl.style.display = 'block')
data.showEye = true
}
const mouseleave = (data, event) => {
const mouseleave = (data) => {
if (data && !data.show) {
return
}
event.target.querySelector('.tree-handle').style.display = 'none'
data.showEye = false
}
const checkElement = (row) => {
Expand Down Expand Up @@ -314,7 +313,6 @@ export default {
border-top: 1px solid var(--ti-lowcode-tree-border-color);
.tree-handle {
display: none;
svg {
color: var(--ti-lowcode-tree-icon-color);
Expand Down

0 comments on commit 8aa1ec7

Please sign in to comment.