Skip to content

Commit

Permalink
fix:missing outline tree eyes icon (#900)
Browse files Browse the repository at this point in the history
* fix: 修复大纲树显示隐藏按钮重叠问题

* fix: 调整大纲树眼睛控制状态
  • Loading branch information
lichunn authored Nov 11, 2024
1 parent 5279ef1 commit 2b2b685
Showing 1 changed file with 19 additions and 12 deletions.
31 changes: 19 additions & 12 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 v-show="!data.row.show" 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,6 +105,7 @@ export default {
const translateChild = (data) => {
data.forEach((item) => {
item.show = pageState.nodesStatus[item.id] !== false
item.showEye = !item.show
const child = item.children
if (typeOf(child) !== 'array') {
delete item.children
Expand Down Expand Up @@ -171,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 @@ -312,16 +312,23 @@ export default {
padding-top: 12px;
border-top: 1px solid var(--ti-lowcode-tree-border-color);
.tree-handle svg {
color: var(--ti-lowcode-tree-icon-color);
.tree-handle {
svg {
color: var(--ti-lowcode-tree-icon-color);
&:hover {
color: var(--ti-lowcode-tree-hover-icon-color);
&:hover {
color: var(--ti-lowcode-tree-hover-icon-color);
}
}
}
}
:deep(.tiny-grid) {
background-color: unset;
.tree-box {
display: flex;
width: 200px;
justify-content: space-between;
}
.tiny-grid-tree-wrapper {
margin-right: 8px;
Expand Down

0 comments on commit 2b2b685

Please sign in to comment.