From 94478fe9f3e641f84ad317005637f8c954f9a9f5 Mon Sep 17 00:00:00 2001
From: wanglin2 <1013335014@qq.com>
Date: Sat, 12 Aug 2023 11:12:11 +0800
Subject: [PATCH] =?UTF-8?q?Demo:=E4=BF=AE=E5=A4=8D=E5=BC=80=E5=90=AF?=
=?UTF-8?q?=E8=BE=93=E5=85=A5=E8=87=AA=E5=8A=A8=E8=BF=9B=E5=85=A5=E6=96=87?=
=?UTF-8?q?=E6=9C=AC=E7=BC=96=E8=BE=91=E6=A8=A1=E5=BC=8F=E5=92=8C=E5=85=B6?=
=?UTF-8?q?=E4=BB=96=E8=BE=93=E5=85=A5=E6=A1=86=E5=86=B2=E7=AA=81=E7=9A=84?=
=?UTF-8?q?=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../src/constants/defaultOptions.js | 3 +-
web/src/pages/Edit/components/BaseStyle.vue | 173 ++++++++++++++----
web/src/pages/Edit/components/Edit.vue | 3 +-
web/src/pages/Edit/components/Export.vue | 3 +
.../pages/Edit/components/NodeHyperlink.vue | 8 +-
web/src/pages/Edit/components/NodeImage.vue | 3 +-
web/src/pages/Edit/components/NodeNote.vue | 2 +-
web/src/pages/Edit/components/NodeTag.vue | 1 +
web/src/pages/Edit/components/Search.vue | 2 +
9 files changed, 156 insertions(+), 42 deletions(-)
diff --git a/simple-mind-map/src/constants/defaultOptions.js b/simple-mind-map/src/constants/defaultOptions.js
index d144a5a2..f4e9004c 100644
--- a/simple-mind-map/src/constants/defaultOptions.js
+++ b/simple-mind-map/src/constants/defaultOptions.js
@@ -128,7 +128,8 @@ export const defaultOpt = {
// 拖拽元素时,指示元素新位置的块的最大高度
nodeDragPlaceholderMaxSize: 20,
// 是否在存在一个激活节点时,当按下中文、英文、数字按键时自动进入文本编辑模式
- enableAutoEnterTextEditWhenKeydown: true,
+ // 开启该特性后,需要给你的输入框绑定keydown事件,并禁止冒泡
+ enableAutoEnterTextEditWhenKeydown: false,
// 设置富文本节点编辑框和节点大小一致,形成伪原地编辑的效果
// 需要注意的是,只有当节点内只有文本、且形状是矩形才会有比较好的效果
richTextEditFakeInPlace: false
diff --git a/web/src/pages/Edit/components/BaseStyle.vue b/web/src/pages/Edit/components/BaseStyle.vue
index b3f99296..d068ca7d 100644
--- a/web/src/pages/Edit/components/BaseStyle.vue
+++ b/web/src/pages/Edit/components/BaseStyle.vue
@@ -277,7 +277,9 @@
- {{ $t('baseStyle.associativeLineActiveColor') }}
+ {{
+ $t('baseStyle.associativeLineActiveColor')
+ }}
- {{ $t('baseStyle.associativeLineActiveWidth') }}
+ {{
+ $t('baseStyle.associativeLineActiveWidth')
+ }}
{{ $t('baseStyle.nodeBorderType') }}
- {
update('nodeUseLineStyle', value)
}
- ">{{ $t('baseStyle.nodeUseLineStyle') }}
+ "
+ >{{ $t('baseStyle.nodeUseLineStyle') }}
@@ -520,7 +528,11 @@
- {{ $t('baseStyle.showWatermark') }}
+ {{ $t('baseStyle.showWatermark') }}
@@ -528,7 +540,12 @@
{{ $t('baseStyle.watermarkText') }}
-
+
@@ -543,10 +560,12 @@
{
- watermarkConfig.textStyle.color = value
- updateWatermarkConfig()
- }"
+ @change="
+ value => {
+ watermarkConfig.textStyle.color = value
+ updateWatermarkConfig()
+ }
+ "
>
@@ -555,35 +574,72 @@
{{ $t('baseStyle.watermarkTextOpacity') }}
-
+
- {{ $t('baseStyle.watermarkTextFontSize') }}
-
+ {{
+ $t('baseStyle.watermarkTextFontSize')
+ }}
+
{{ $t('baseStyle.watermarkAngle') }}
-
+
{{ $t('baseStyle.watermarkLineSpacing') }}
-
+
{{ $t('baseStyle.watermarkTextSpacing') }}
-
+
@@ -592,17 +648,25 @@
- {
updateOtherConfig('enableFreeDrag', value)
}
- ">{{ $t('baseStyle.enableFreeDrag') }}
+ "
+ >{{ $t('baseStyle.enableFreeDrag') }}
- {{ $t('baseStyle.isEnableNodeRichText') }}
+ {{ $t('baseStyle.isEnableNodeRichText') }}
@@ -620,15 +684,23 @@
}
"
>
-
-
+
+
- {{ $t('baseStyle.mousewheelZoomActionReverse') }}
+ {{
+ $t('baseStyle.mousewheelZoomActionReverse')
+ }}
-
-
+
+
@@ -652,7 +730,16 @@
@@ -958,7 +1057,7 @@ export default {
.row {
.rowItem {
.name {
- color: hsla(0,0%,100%,.6);
+ color: hsla(0, 0%, 100%, 0.6);
}
}
}
diff --git a/web/src/pages/Edit/components/Edit.vue b/web/src/pages/Edit/components/Edit.vue
index a7ad8040..e77fa748 100644
--- a/web/src/pages/Edit/components/Edit.vue
+++ b/web/src/pages/Edit/components/Edit.vue
@@ -275,7 +275,8 @@ export default {
...(config || {}),
iconList: icon,
useLeftKeySelectionRightKeyDrag: this.useLeftKeySelectionRightKeyDrag,
- customInnerElsAppendTo: null
+ customInnerElsAppendTo: null,
+ enableAutoEnterTextEditWhenKeydown: true,
// isUseCustomNodeContent: true,
// 示例1:组件里用到了router、store、i18n等实例化vue组件时需要用到的东西
// customCreateNodeContent: (node) => {
diff --git a/web/src/pages/Edit/components/Export.vue b/web/src/pages/Edit/components/Export.vue
index 60fb8852..35f45957 100644
--- a/web/src/pages/Edit/components/Export.vue
+++ b/web/src/pages/Edit/components/Export.vue
@@ -16,6 +16,7 @@
style="width: 300px"
v-model="fileName"
size="mini"
+ @keydown.native.stop
>
{{
$t('export.paddingY')
@@ -43,6 +45,7 @@
v-model="paddingY"
size="mini"
@change="onPaddingChange"
+ @keydown.native.stop
>
{{ $t('nodeHyperlink.name') }}
-
+