Demo:增加节点标签显示位置的配置
This commit is contained in:
parent
38769c3b55
commit
4e1db01f44
@ -72,7 +72,10 @@ export default {
|
|||||||
watermarkAngle: 'Angle',
|
watermarkAngle: 'Angle',
|
||||||
watermarkTextOpacity: 'Text opacity',
|
watermarkTextOpacity: 'Text opacity',
|
||||||
watermarkTextFontSize: 'Font size',
|
watermarkTextFontSize: 'Font size',
|
||||||
belowNode: 'Display below nodes'
|
belowNode: 'Display below nodes',
|
||||||
|
tagPosition: 'Node tag position',
|
||||||
|
tagPositionRight: 'Text right',
|
||||||
|
tagPositionBottom: 'Text bottom'
|
||||||
},
|
},
|
||||||
color: {
|
color: {
|
||||||
moreColor: 'More color'
|
moreColor: 'More color'
|
||||||
|
|||||||
@ -70,7 +70,10 @@ export default {
|
|||||||
watermarkAngle: '旋转角度',
|
watermarkAngle: '旋转角度',
|
||||||
watermarkTextOpacity: '文字透明度',
|
watermarkTextOpacity: '文字透明度',
|
||||||
watermarkTextFontSize: '文字字号',
|
watermarkTextFontSize: '文字字号',
|
||||||
belowNode: '显示在节点下方'
|
belowNode: '显示在节点下方',
|
||||||
|
tagPosition: '节点标签显示的位置',
|
||||||
|
tagPositionRight: '文本右侧',
|
||||||
|
tagPositionBottom: '文本下面'
|
||||||
},
|
},
|
||||||
color: {
|
color: {
|
||||||
moreColor: '更多颜色'
|
moreColor: '更多颜色'
|
||||||
|
|||||||
@ -40,7 +40,10 @@ export default {
|
|||||||
edge: '邊緣',
|
edge: '邊緣',
|
||||||
rainbowLines: '彩虹線條',
|
rainbowLines: '彩虹線條',
|
||||||
notUseRainbowLines: '不使用彩虹線條',
|
notUseRainbowLines: '不使用彩虹線條',
|
||||||
outerFramePadding: '外框內距'
|
outerFramePadding: '外框內距',
|
||||||
|
tagPosition: '節點標簽顯示的位置',
|
||||||
|
tagPositionRight: '文本右側',
|
||||||
|
tagPositionBottom: '文本下面'
|
||||||
},
|
},
|
||||||
setting: {
|
setting: {
|
||||||
title: '設置',
|
title: '設置',
|
||||||
|
|||||||
@ -177,6 +177,38 @@
|
|||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- 是否开启文本编辑时实时更新节点大小 -->
|
||||||
|
<div class="row">
|
||||||
|
<div class="rowItem">
|
||||||
|
<el-checkbox
|
||||||
|
v-model="config.openRealtimeRenderOnNodeTextEdit"
|
||||||
|
@change="
|
||||||
|
updateOtherConfig('openRealtimeRenderOnNodeTextEdit', $event)
|
||||||
|
"
|
||||||
|
>{{ $t('setting.openRealtimeRenderOnNodeTextEdit') }}</el-checkbox
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- 是否显示滚动条 -->
|
||||||
|
<div class="row">
|
||||||
|
<div class="rowItem">
|
||||||
|
<el-checkbox
|
||||||
|
v-model="localConfigs.isShowScrollbar"
|
||||||
|
@change="updateLocalConfig('isShowScrollbar', $event)"
|
||||||
|
>{{ $t('setting.isShowScrollbar') }}</el-checkbox
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- 是否开启手绘风格 -->
|
||||||
|
<div class="row" v-if="supportHandDrawnLikeStyle">
|
||||||
|
<div class="rowItem">
|
||||||
|
<el-checkbox
|
||||||
|
v-model="localConfigs.isUseHandDrawnLikeStyle"
|
||||||
|
@change="updateLocalConfig('isUseHandDrawnLikeStyle', $event)"
|
||||||
|
>{{ $t('setting.isUseHandDrawnLikeStyle') }}</el-checkbox
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<!-- 配置鼠标滚轮行为 -->
|
<!-- 配置鼠标滚轮行为 -->
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="rowItem">
|
<div class="rowItem">
|
||||||
@ -258,36 +290,30 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- 是否开启文本编辑时实时更新节点大小 -->
|
<!-- 标签显示的位置 -->
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="rowItem">
|
<div class="rowItem">
|
||||||
<el-checkbox
|
<span class="name">{{ $t('setting.tagPosition') }}</span>
|
||||||
v-model="config.openRealtimeRenderOnNodeTextEdit"
|
<el-select
|
||||||
|
size="mini"
|
||||||
|
style="width: 120px"
|
||||||
|
v-model="config.tagPosition"
|
||||||
|
placeholder=""
|
||||||
@change="
|
@change="
|
||||||
updateOtherConfig('openRealtimeRenderOnNodeTextEdit', $event)
|
value => {
|
||||||
|
updateOtherConfig('tagPosition', value)
|
||||||
|
}
|
||||||
"
|
"
|
||||||
>{{ $t('setting.openRealtimeRenderOnNodeTextEdit') }}</el-checkbox
|
|
||||||
>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!-- 是否显示滚动条 -->
|
|
||||||
<div class="row">
|
|
||||||
<div class="rowItem">
|
|
||||||
<el-checkbox
|
|
||||||
v-model="localConfigs.isShowScrollbar"
|
|
||||||
@change="updateLocalConfig('isShowScrollbar', $event)"
|
|
||||||
>{{ $t('setting.isShowScrollbar') }}</el-checkbox
|
|
||||||
>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!-- 是否开启手绘风格 -->
|
|
||||||
<div class="row" v-if="supportHandDrawnLikeStyle">
|
|
||||||
<div class="rowItem">
|
|
||||||
<el-checkbox
|
|
||||||
v-model="localConfigs.isUseHandDrawnLikeStyle"
|
|
||||||
@change="updateLocalConfig('isUseHandDrawnLikeStyle', $event)"
|
|
||||||
>{{ $t('setting.isUseHandDrawnLikeStyle') }}</el-checkbox
|
|
||||||
>
|
>
|
||||||
|
<el-option
|
||||||
|
:label="$t('setting.tagPositionRight')"
|
||||||
|
value="right"
|
||||||
|
></el-option>
|
||||||
|
<el-option
|
||||||
|
:label="$t('setting.tagPositionBottom')"
|
||||||
|
value="bottom"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -322,6 +348,7 @@ export default {
|
|||||||
mousewheelAction: 'zoom',
|
mousewheelAction: 'zoom',
|
||||||
mousewheelZoomActionReverse: false,
|
mousewheelZoomActionReverse: false,
|
||||||
createNewNodeBehavior: 'default',
|
createNewNodeBehavior: 'default',
|
||||||
|
tagPosition: 'right',
|
||||||
openRealtimeRenderOnNodeTextEdit: true
|
openRealtimeRenderOnNodeTextEdit: true
|
||||||
},
|
},
|
||||||
watermarkConfig: {
|
watermarkConfig: {
|
||||||
@ -373,14 +400,7 @@ export default {
|
|||||||
|
|
||||||
// 初始化其他配置
|
// 初始化其他配置
|
||||||
initConfig() {
|
initConfig() {
|
||||||
;[
|
Object.keys(this.config).forEach(key => {
|
||||||
'openPerformance',
|
|
||||||
'enableFreeDrag',
|
|
||||||
'mousewheelAction',
|
|
||||||
'mousewheelZoomActionReverse',
|
|
||||||
'createNewNodeBehavior',
|
|
||||||
'openRealtimeRenderOnNodeTextEdit'
|
|
||||||
].forEach(key => {
|
|
||||||
this.config[key] = this.mindMap.getConfig(key)
|
this.config[key] = this.mindMap.getConfig(key)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@ -417,6 +437,9 @@ export default {
|
|||||||
storeConfig({
|
storeConfig({
|
||||||
config: this.data.config
|
config: this.data.config
|
||||||
})
|
})
|
||||||
|
if (key === 'tagPosition') {
|
||||||
|
this.mindMap.reRender()
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// 更新水印配置
|
// 更新水印配置
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user