This commit is contained in:
mike-lsadigital 2026-02-04 14:49:38 -05:00 committed by GitHub
commit 32211b57d6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 72 additions and 3 deletions

View File

@ -758,6 +758,47 @@ class AssociativeLine {
this.mindMap.deleteEditNodeClass(ASSOCIATIVE_LINE_TEXT_EDIT_WRAP)
this.unBindEvent()
}
// Toggle visibility of all associative lines
// Returns the new visibility state (true = visible, false = hidden)
toggleAllLinesVisibility() {
if (this._linesHidden) {
this.showAllLines()
return true
} else {
this.hideAllLines()
return false
}
}
// Hide all associative lines and their labels
hideAllLines() {
this._linesHidden = true
this.lineList.forEach(line => {
line[0].hide() // path
line[1].hide() // clickPath
line[2].hide() // text
})
this.hideControls()
this.mindMap.emit('associative_line_visibility_change', false)
}
// Show all associative lines and their labels
showAllLines() {
this._linesHidden = false
this.lineList.forEach(line => {
line[0].show() // path
line[1].show() // clickPath
line[2].show() // text
})
this.showControls()
this.mindMap.emit('associative_line_visibility_change', true)
}
// Get current visibility state
getLinesVisibility() {
return !this._linesHidden
}
}
AssociativeLine.instanceName = 'associativeLine'

View File

@ -216,7 +216,9 @@ export default {
downloadClient: 'Download client',
site: 'Official website',
current: 'Current:',
downloadDesc: 'You can download it from the following address:'
downloadDesc: 'You can download it from the following address:',
showAssociativeLines: 'Show associative lines',
hideAssociativeLines: 'Hide associative lines'
},
nodeHyperlink: {
title: 'Link',

View File

@ -210,7 +210,9 @@ export default {
downloadClient: '下载客户端',
site: '官方网站',
current: '当前:',
downloadDesc: '可从如下地址下载:'
downloadDesc: '可从如下地址下载:',
showAssociativeLines: '显示关联线',
hideAssociativeLines: '隐藏关联线'
},
nodeHyperlink: {
title: '超链接',

View File

@ -43,6 +43,23 @@
<div class="btn iconfont icondaohang1" @click="toggleMiniMap"></div>
</el-tooltip>
</div>
<div class="item">
<el-tooltip
effect="dark"
:content="
showAssociativeLines
? $t('navigatorToolbar.hideAssociativeLines')
: $t('navigatorToolbar.showAssociativeLines')
"
placement="top"
>
<div
class="btn iconfont iconlianjiexian"
:style="{ opacity: showAssociativeLines ? 1 : 0.4 }"
@click="toggleAssociativeLines"
></div>
</el-tooltip>
</div>
<div class="item">
<!-- <el-switch
v-model="isReadonly"
@ -156,7 +173,8 @@ export default {
version: pkg.version,
langList,
lang: '',
openMiniMap: false
openMiniMap: false,
showAssociativeLines: true
}
},
computed: {
@ -245,6 +263,12 @@ export default {
a.click()
},
toggleAssociativeLines() {
if (this.mindMap && this.mindMap.associativeLine) {
this.showAssociativeLines = this.mindMap.associativeLine.toggleAllLinesVisibility()
}
},
backToRoot() {
this.mindMap.renderer.setRootNodeCenter()
},