mirror of
https://github.com/wanglin2/mind-map.git
synced 2026-02-17 14:04:47 +08:00
Demo:切换是否开启富文本的设置增加二次提示
This commit is contained in:
@@ -77,7 +77,12 @@ export default {
|
||||
tagPositionRight: 'Text right',
|
||||
tagPositionBottom: 'Text bottom',
|
||||
alwaysShowExpandBtn: 'Always show expand btn',
|
||||
enableAutoEnterTextEditWhenKeydown: 'Auto enter text edit when keydown'
|
||||
enableAutoEnterTextEditWhenKeydown: 'Auto enter text edit when keydown',
|
||||
confirm: 'Confirm',
|
||||
cancel: 'Cancel',
|
||||
changeRichTextTip: 'This operation will clear all historical modification records and modify the mind map data. Do you want to continue?',
|
||||
changeRichTextTip2: 'Do you want to switch to rich text mode?',
|
||||
changeRichTextTip3: 'Do you want to switch to non rich text mode?'
|
||||
},
|
||||
color: {
|
||||
moreColor: 'More color'
|
||||
|
||||
@@ -75,7 +75,12 @@ export default {
|
||||
tagPositionRight: '文本右侧',
|
||||
tagPositionBottom: '文本下面',
|
||||
alwaysShowExpandBtn: '是否一直显示展开收起按钮',
|
||||
enableAutoEnterTextEditWhenKeydown: '键盘输入时自动进入文本编辑'
|
||||
enableAutoEnterTextEditWhenKeydown: '键盘输入时自动进入文本编辑',
|
||||
confirm: '确定',
|
||||
cancel: '取消',
|
||||
changeRichTextTip: '该操作会清空所有历史修改记录,并且修改思维导图数据,是否继续?',
|
||||
changeRichTextTip2: '是否切换为富文本模式?',
|
||||
changeRichTextTip3: '是否切换为非富文本模式?'
|
||||
},
|
||||
color: {
|
||||
moreColor: '更多颜色'
|
||||
|
||||
@@ -76,7 +76,12 @@ export default {
|
||||
watermarkAngle: '旋轉角度',
|
||||
watermarkTextOpacity: '文字透明度',
|
||||
watermarkTextFontSize: '字型大小',
|
||||
belowNode: '顯示在節點下方'
|
||||
belowNode: '顯示在節點下方',
|
||||
confirm: '確定',
|
||||
cancel: '取消',
|
||||
changeRichTextTip: '該操作會清空所有曆史修改記錄,並且修改思維導圖數據,是否繼續?',
|
||||
changeRichTextTip2: '是否切換爲富文本模式?',
|
||||
changeRichTextTip3: '是否切換爲非富文本模式?'
|
||||
},
|
||||
color: {
|
||||
moreColor: '更多顏色'
|
||||
|
||||
@@ -212,7 +212,7 @@ export default {
|
||||
if (!targetNode) return
|
||||
this.notHandleDataChange = true
|
||||
if (richText) {
|
||||
targetNode.setText(textToNodeRichTextWithWrap(text), true, true)
|
||||
targetNode.setText(textToNodeRichTextWithWrap(text), true)
|
||||
} else {
|
||||
targetNode.setText(text)
|
||||
}
|
||||
|
||||
@@ -149,7 +149,6 @@ export default {
|
||||
const richText = node.data.data.richText
|
||||
const text = richText ? e.target.innerHTML : e.target.innerText
|
||||
node.data.data.text = richText ? textToNodeRichTextWithWrap(text) : text
|
||||
if (richText) node.data.data.resetRichText = true
|
||||
node.data.textCache = e.target.innerHTML
|
||||
this.save()
|
||||
},
|
||||
@@ -170,9 +169,6 @@ export default {
|
||||
},
|
||||
children: []
|
||||
}
|
||||
if (richText) {
|
||||
data.data.resetRichText = true
|
||||
}
|
||||
if (e.keyCode === 13 && !e.shiftKey) {
|
||||
e.preventDefault()
|
||||
if (node.data.root) {
|
||||
|
||||
@@ -214,7 +214,9 @@
|
||||
<div class="rowItem">
|
||||
<el-checkbox
|
||||
v-model="config.enableAutoEnterTextEditWhenKeydown"
|
||||
@change="updateOtherConfig('enableAutoEnterTextEditWhenKeydown', $event)"
|
||||
@change="
|
||||
updateOtherConfig('enableAutoEnterTextEditWhenKeydown', $event)
|
||||
"
|
||||
>{{ $t('setting.enableAutoEnterTextEditWhenKeydown') }}</el-checkbox
|
||||
>
|
||||
</div>
|
||||
@@ -496,10 +498,26 @@ export default {
|
||||
|
||||
// 切换是否开启节点富文本编辑
|
||||
enableNodeRichTextChange(e) {
|
||||
this.mindMap.renderer.textEdit.hideEditTextBox()
|
||||
this.setLocalConfig({
|
||||
openNodeRichText: e
|
||||
})
|
||||
this.$confirm(
|
||||
this.$t('setting.changeRichTextTip'),
|
||||
e
|
||||
? this.$t('setting.changeRichTextTip2')
|
||||
: this.$t('setting.changeRichTextTip3'),
|
||||
{
|
||||
confirmButtonText: this.$t('setting.confirm'),
|
||||
cancelButtonText: this.$t('setting.cancel'),
|
||||
type: 'warning'
|
||||
}
|
||||
)
|
||||
.then(() => {
|
||||
this.mindMap.renderer.textEdit.hideEditTextBox()
|
||||
this.setLocalConfig({
|
||||
openNodeRichText: e
|
||||
})
|
||||
})
|
||||
.catch(() => {
|
||||
this.enableNodeRichText = !this.enableNodeRichText
|
||||
})
|
||||
},
|
||||
|
||||
// 本地配置
|
||||
|
||||
Reference in New Issue
Block a user