思绪思维导图
\ No newline at end of file
+思绪思维导图
\ No newline at end of file
diff --git a/web/src/pages/Doc/catalogList.js b/web/src/pages/Doc/catalogList.js
index b709769d..ec15f6c1 100644
--- a/web/src/pages/Doc/catalogList.js
+++ b/web/src/pages/Doc/catalogList.js
@@ -36,6 +36,9 @@ let APIList = [
'markdown',
'utils'
]
+let helpList = new Array(1).fill(0).map((_, index) => {
+ return 'help' + (index + 1)
+})
const createList = (lang, list) => {
let langRouter = routerList.find(item => {
@@ -62,28 +65,39 @@ export default {
zh: [
{
groupName: '开始',
+ type: 'doc',
list: createList('zh', StartList)
},
{
groupName: '教程',
+ type: 'doc',
list: createList('zh', CourseList)
},
{
groupName: 'API',
+ type: 'doc',
list: createList('zh', APIList)
+ },
+ {
+ groupName: '使用帮助',
+ type: 'help',
+ list: createList('zh', helpList)
}
],
en: [
{
groupName: 'Start',
+ type: 'doc',
list: createList('en', StartList)
},
{
groupName: 'Course',
+ type: 'doc',
list: createList('zh', CourseList)
},
{
groupName: 'API',
+ type: 'doc',
list: createList('en', APIList)
}
]
diff --git a/web/src/pages/Doc/components/CatalogBar.vue b/web/src/pages/Doc/components/CatalogBar.vue
index 9399ef6a..d6106ade 100644
--- a/web/src/pages/Doc/components/CatalogBar.vue
+++ b/web/src/pages/Doc/components/CatalogBar.vue
@@ -66,18 +66,18 @@ export default {
methods: {
// 获取当前语言
initLang() {
- let lang = /^\/doc\/([^\/]+)\//.exec(this.$route.path)
- if (lang && lang[1]) {
- this.lang = lang[1]
+ let lang = /^\/(doc|help)\/([^\/]+)\//.exec(this.$route.path)
+ if (lang && lang[2]) {
+ this.lang = lang[2]
}
},
// 初始化二级标题目录
initCatalogList(newPath, oldPath) {
- let newPathRes = /^\/doc\/[^\/]+\/([^\/]+)/.exec(newPath)
- let oldPathRes = /^\/doc\/[^\/]+\/([^\/]+)/.exec(oldPath)
+ let newPathRes = /^\/(doc|help)\/[^\/]+\/([^\/]+)/.exec(newPath)
+ let oldPathRes = /^\/(doc|help)\/[^\/]+\/([^\/]+)/.exec(oldPath)
// 语言变了、章节变了,需要重新获取二级标题目录
- if ((!newPath && !oldPath) || newPathRes[1] !== oldPathRes[1]) {
+ if ((!newPath && !oldPath) || newPathRes[2] !== oldPathRes[2]) {
this.$emit('scroll', 0)
this.resetActive()
let container = document.getElementById('doc')
@@ -93,9 +93,9 @@ export default {
// 如果url中存在二级标题,那么滚动到该标题所在位置
scrollToCatalog() {
- let url = /^\/doc\/[^\/]+\/[^\/]+\/([^\/]+)($|\/)/.exec(this.$route.path)
- if (url && url[1]) {
- let h = decodeURIComponent(url[1])
+ let url = /^\/(doc|help)\/[^\/]+\/[^\/]+\/([^\/]+)($|\/)/.exec(this.$route.path)
+ if (url && url[2]) {
+ let h = decodeURIComponent(url[2])
let item = this.list.find(item => {
return item.title === h
})
@@ -126,15 +126,15 @@ export default {
let path = this.$route.path
let url = ''
if (!title) {
- url = path.replace(/^(\/doc\/[^\/]+\/[^\/]+)($|\/|.*)$/, '$1')
- } else if (/^\/doc\/[^\/]+\/[^\/]+($|\/)$/.test(path)) {
+ url = path.replace(/^(\/(doc|help)\/[^\/]+\/[^\/]+)($|\/|.*)$/, '$1')
+ } else if (/^\/(doc|help)\/[^\/]+\/[^\/]+($|\/)$/.test(path)) {
url = path.replace(
- /^(\/doc\/[^\/]+\/[^\/]+)($|\/)$/,
+ /^(\/(doc|help)\/[^\/]+\/[^\/]+)($|\/)$/,
'$1/' + encodeURIComponent(title)
)
} else {
url = path.replace(
- /^(\/doc\/[^\/]+\/[^\/]+\/)([^\/]+)($|\/)/,
+ /^(\/(doc|help)\/[^\/]+\/[^\/]+\/)([^\/]+)($|\/)/,
(...args) => {
return args[1] + encodeURIComponent(title)
}
diff --git a/web/src/pages/Doc/components/Sidebar.vue b/web/src/pages/Doc/components/Sidebar.vue
index 4482aa3c..c9a16725 100644
--- a/web/src/pages/Doc/components/Sidebar.vue
+++ b/web/src/pages/Doc/components/Sidebar.vue
@@ -31,7 +31,8 @@ export default {
return {
groupList: [],
lang: '',
- currentPath: ''
+ currentPath: '',
+ type: ''// doc、help
}
},
created() {
@@ -47,20 +48,24 @@ export default {
if (item.path === this.currentPath) {
return
}
- this.$router.push(`/doc/${this.lang}/${item.path}`)
+ this.$router.push(`/${this.type}/${this.lang}/${item.path}`)
},
initCatalog() {
// 目录列表
- let lang = /^\/doc\/([^\/]+)\//.exec(this.$route.path)
- if (lang && lang[1]) {
- this.lang = lang[1]
- this.groupList = catalogList[this.lang]
+ let lang = /^\/(doc|help)\/([^\/]+)\//.exec(this.$route.path)
+ if (lang && lang[2]) {
+ this.type = lang[1]// 判断是开发文档还是帮助文档
+ this.lang = lang[2]
+ // 过滤出对应文档的章节
+ this.groupList = catalogList[this.lang].filter((item) => {
+ return item.type === this.type
+ })
}
// 当前所在路径
- let path = /^\/doc\/[^\/]+\/([^\/]+)(\/|$)/.exec(this.$route.path)
- if (path && path[1]) {
- this.currentPath = path[1]
+ let path = /^\/(doc|help)\/[^\/]+\/([^\/]+)(\/|$)/.exec(this.$route.path)
+ if (path && path[2]) {
+ this.currentPath = path[2]
}
}
}
diff --git a/web/src/pages/Doc/en/deploy/index.md b/web/src/pages/Doc/en/deploy/index.md
index 4a8d593f..44f11bb9 100644
--- a/web/src/pages/Doc/en/deploy/index.md
+++ b/web/src/pages/Doc/en/deploy/index.md
@@ -1 +1,66 @@
-# Deploy
\ No newline at end of file
+# Deploy
+
+The 'web' directory of this project provides a complete project developed based on the 'simple mind map' library, 'Vue2. x', and 'ElementUI'. The data is stored locally on the computer by default, and can also be manipulated locally on the computer. Originally intended as an online 'demo', it can also be directly used as an online version of the mind map application, online address: [https://wanglin2.github.io/mind-map/](https://wanglin2.github.io/mind-map/).
+
+If your network environment is slow to access the 'GitHub' service, you can also deploy it to your server.
+
+## Deploying to a static file server
+
+The project itself does not rely on the backend, so it can be deployed to a static file server. The following commands can be executed in sequence:
+
+```bash
+git clone https://github.com/wanglin2/mind-map.git
+cd mind-map
+cd simple-mind-map
+npm i
+npm link
+cd ..
+cd web
+npm i
+npm link simple-mind-map
+```
+
+Then you can choose to start the local service:
+
+```bash
+npm run serve
+```
+
+You can also directly package and generate construction products:
+
+```bash
+npm run build
+```
+
+The packaged entry page 'index.html' can be found in the project root directory, and the corresponding static resources are located in the 'dist' directory under the root directory. The 'html' file will access the resources in the 'dist' directory through relative paths, such as 'dist/xxx'. You can directly upload these two files or directories to your static file server. In fact, this project is deployed to 'GitHub Pages' in this way.
+
+If you do not have any code modification requirements, it is also possible to directly copy these files from this repository.
+
+If you want to package 'index.html' into the 'dist' directory as well, you can modify the 'scripts.build' command in the 'web/package.json' file to delete '&& node ../copy.js' from 'vue-cli-service build && node ../copy.js'.
+
+If you want to modify the directory for packaging output, you can modify the 'outputDir' configuration of the 'web/vue.config.js' file to the path you want to output.
+
+If you want to modify the path of the 'index. html' file referencing static resources, you can modify the 'publicPath' configuration of the 'web/vue.config.js' file.
+
+In addition, the default route used is 'hash ', which means that there will be '#'in the path. If you want to use the 'history' route, you can modify the 'web/src/router.js' file to:
+
+```js
+const router = new VueRouter({
+ routes
+})
+```
+
+Change to:
+
+```js
+const router = new VueRouter({
+ mode: 'history',
+ routes
+})
+```
+
+However, this requires backend support, as our application is a single page client application. If the backend is not properly configured, users will return 404 when accessing sub routes directly in the browser. Therefore, you need to add a candidate resource on the server that covers all situations: if the 'URL' cannot match any static resources, the same 'index. html' page should be returned.
+
+## Docker
+
+In writing...
\ No newline at end of file
diff --git a/web/src/pages/Doc/en/deploy/index.vue b/web/src/pages/Doc/en/deploy/index.vue
new file mode 100644
index 00000000..b12696d2
--- /dev/null
+++ b/web/src/pages/Doc/en/deploy/index.vue
@@ -0,0 +1,55 @@
+
+
+
Deploy
+
The 'web' directory of this project provides a complete project developed based on the 'simple mind map' library, 'Vue2. x', and 'ElementUI'. The data is stored locally on the computer by default, and can also be manipulated locally on the computer. Originally intended as an online 'demo', it can also be directly used as an online version of the mind map application, online address: https://wanglin2.github.io/mind-map/.
+
If your network environment is slow to access the 'GitHub' service, you can also deploy it to your server.
+
Deploying to a static file server
+
The project itself does not rely on the backend, so it can be deployed to a static file server. The following commands can be executed in sequence:
+
git clone https://github.com/wanglin2/mind-map.git
+cd mind-map
+cd simple-mind-map
+npm i
+npm link
+cd ..
+cd web
+npm i
+npm link simple-mind-map
+
+
Then you can choose to start the local service:
+
npm run serve
+
+
You can also directly package and generate construction products:
+
npm run build
+
+
The packaged entry page 'index.html' can be found in the project root directory, and the corresponding static resources are located in the 'dist' directory under the root directory. The 'html' file will access the resources in the 'dist' directory through relative paths, such as 'dist/xxx'. You can directly upload these two files or directories to your static file server. In fact, this project is deployed to 'GitHub Pages' in this way.
+
If you do not have any code modification requirements, it is also possible to directly copy these files from this repository.
+
If you want to package 'index.html' into the 'dist' directory as well, you can modify the 'scripts.build' command in the 'web/package.json' file to delete '&& node ../copy.js' from 'vue-cli-service build && node ../copy.js'.
+
If you want to modify the directory for packaging output, you can modify the 'outputDir' configuration of the 'web/vue.config.js' file to the path you want to output.
+
If you want to modify the path of the 'index. html' file referencing static resources, you can modify the 'publicPath' configuration of the 'web/vue.config.js' file.
+
In addition, the default route used is 'hash ', which means that there will be '#'in the path. If you want to use the 'history' route, you can modify the 'web/src/router.js' file to:
However, this requires backend support, as our application is a single page client application. If the backend is not properly configured, users will return 404 when accessing sub routes directly in the browser. Therefore, you need to add a candidate resource on the server that covers all situations: if the 'URL' cannot match any static resources, the same 'index. html' page should be returned.
import { colorList } from '@/config'
+import { mapState } from 'vuex'
/**
* @Author: 王林
@@ -42,6 +43,9 @@ export default {
selectColor: ''
}
},
+ computed: {
+ ...mapState(['isDark']),
+ },
watch: {
color() {
this.selectColor = this.color
@@ -73,6 +77,14 @@ export default {
-
+
diff --git a/web/src/pages/Edit/components/Theme.vue b/web/src/pages/Edit/components/Theme.vue
index 6b2ed70d..b294e411 100644
--- a/web/src/pages/Edit/components/Theme.vue
+++ b/web/src/pages/Edit/components/Theme.vue
@@ -21,7 +21,7 @@
import Sidebar from './Sidebar'
import { themeList } from 'simple-mind-map/src/constants/constant'
import { storeConfig } from '@/api'
-import { mapState } from 'vuex'
+import { mapState, mapMutations } from 'vuex'
import { themeMap } from '@/config/constant.js'
import customThemeList from '@/customThemes'
@@ -54,13 +54,20 @@ export default {
activeSidebar(val) {
if (val === 'theme') {
this.theme = this.mindMap.getTheme()
+ this.handleDark()
this.$refs.sidebar.show = true
} else {
this.$refs.sidebar.show = false
}
}
},
+ created () {
+ this.theme = this.mindMap.getTheme()
+ this.handleDark()
+ },
methods: {
+ ...mapMutations(['setIsDark']),
+
/**
* @Author: 王林
* @Date: 2021-06-24 23:04:38
@@ -68,6 +75,7 @@ export default {
*/
useTheme(theme) {
this.theme = theme.value
+ this.handleDark()
this.mindMap.setTheme(theme.value)
storeConfig({
theme: {
@@ -75,6 +83,13 @@ export default {
config: this.mindMap.getCustomThemeConfig()
}
})
+ },
+
+ handleDark() {
+ let target = themeList.find((item) => {
+ return item.value === this.theme
+ })
+ this.setIsDark(target.dark)
}
}
}
From 8871d8727b6f673ba5c7318e0d2cfadbc483643f Mon Sep 17 00:00:00 2001
From: wanglin2 <1013335014@qq.com>
Date: Mon, 24 Jul 2023 11:21:09 +0800
Subject: [PATCH 08/43] Doc: update
---
web/src/pages/Doc/catalogList.js | 4 +--
web/src/pages/Doc/en/changelog/index.md | 8 +++++
web/src/pages/Doc/en/changelog/index.vue | 4 +++
web/src/pages/Doc/en/render/index.md | 20 +++++++++++-
web/src/pages/Doc/en/render/index.vue | 15 +++++++++
web/src/pages/Doc/en/utils/index.md | 15 +++++++++
web/src/pages/Doc/en/utils/index.vue | 13 ++++++++
web/src/pages/Doc/routerList.js | 4 ++-
web/src/pages/Doc/zh/changelog/index.md | 8 +++++
web/src/pages/Doc/zh/changelog/index.vue | 4 +++
web/src/pages/Doc/zh/course10/index.md | 2 ++
web/src/pages/Doc/zh/course10/index.vue | 3 ++
web/src/pages/Doc/zh/course20/index.md | 18 ++++++++++-
web/src/pages/Doc/zh/course20/index.vue | 18 ++++++++++-
web/src/pages/Doc/zh/course21/index.md | 40 +++++++++++++++++++++++
web/src/pages/Doc/zh/course21/index.vue | 41 ++++++++++++++++++++++++
web/src/pages/Doc/zh/help2/index.md | 26 +++++++++++++++
web/src/pages/Doc/zh/help2/index.vue | 28 ++++++++++++++++
web/src/pages/Doc/zh/render/index.md | 20 +++++++++++-
web/src/pages/Doc/zh/render/index.vue | 15 +++++++++
web/src/pages/Doc/zh/utils/index.md | 15 +++++++++
web/src/pages/Doc/zh/utils/index.vue | 13 ++++++++
22 files changed, 327 insertions(+), 7 deletions(-)
create mode 100644 web/src/pages/Doc/zh/course21/index.md
create mode 100644 web/src/pages/Doc/zh/course21/index.vue
create mode 100644 web/src/pages/Doc/zh/help2/index.md
create mode 100644 web/src/pages/Doc/zh/help2/index.vue
diff --git a/web/src/pages/Doc/catalogList.js b/web/src/pages/Doc/catalogList.js
index ec15f6c1..c48114f6 100644
--- a/web/src/pages/Doc/catalogList.js
+++ b/web/src/pages/Doc/catalogList.js
@@ -11,7 +11,7 @@ let langList = [
}
]
let StartList = ['introduction', 'start', 'deploy', 'client', 'translate', 'changelog']
-let CourseList = new Array(20).fill(0).map((_, index) => {
+let CourseList = new Array(21).fill(0).map((_, index) => {
return 'course' + (index + 1)
})
let APIList = [
@@ -36,7 +36,7 @@ let APIList = [
'markdown',
'utils'
]
-let helpList = new Array(1).fill(0).map((_, index) => {
+let helpList = new Array(2).fill(0).map((_, index) => {
return 'help' + (index + 1)
})
diff --git a/web/src/pages/Doc/en/changelog/index.md b/web/src/pages/Doc/en/changelog/index.md
index 509a39d9..46429b41 100644
--- a/web/src/pages/Doc/en/changelog/index.md
+++ b/web/src/pages/Doc/en/changelog/index.md
@@ -1,5 +1,13 @@
# Changelog
+## 0.6.8
+
+Fix: 1.Change the shortcut key for inserting a summary to Ctrl+G to avoid conflicts with the save shortcut key. 2.Fix the issue of abnormal switching between rich text editing configuration input boxes while nodes are being edited.
+
+New: 1.Modify the copy, cut, and paste logic, and support pasting data from the clipboard.
+
+Demo: 1.Fix the issue of not saving the outer margin of the basic style setting node. 2.Supports automatic switching to dark mode based on the theme.
+
## 0.6.7
Fix: 1.Fixed the issue of missing placeholder elements for the expand and collapse button after node collapse and expansion. 2.Fixed the issue of being able to scale images in read-only mode.
diff --git a/web/src/pages/Doc/en/changelog/index.vue b/web/src/pages/Doc/en/changelog/index.vue
index 1ee49304..25fb9efb 100644
--- a/web/src/pages/Doc/en/changelog/index.vue
+++ b/web/src/pages/Doc/en/changelog/index.vue
@@ -1,6 +1,10 @@
Changelog
+
0.6.8
+
Fix: 1.Change the shortcut key for inserting a summary to Ctrl+G to avoid conflicts with the save shortcut key. 2.Fix the issue of abnormal switching between rich text editing configuration input boxes while nodes are being edited.
+
New: 1.Modify the copy, cut, and paste logic, and support pasting data from the clipboard.
+
Demo: 1.Fix the issue of not saving the outer margin of the basic style setting node. 2.Supports automatic switching to dark mode based on the theme.
0.6.7
Fix: 1.Fixed the issue of missing placeholder elements for the expand and collapse button after node collapse and expansion. 2.Fixed the issue of being able to scale images in read-only mode.
New: 1.Support locating to a node based on node instance or node uid. 2.Modify the creation method of node uids and export data to add node uids.
diff --git a/web/src/pages/Doc/en/render/index.md b/web/src/pages/Doc/en/render/index.md
index 41ca1e2e..82f871cb 100644
--- a/web/src/pages/Doc/en/render/index.md
+++ b/web/src/pages/Doc/en/render/index.md
@@ -109,4 +109,22 @@ Expand to the node of the specified uid.
- `uid`: uid of node
-Find the corresponding node instance based on the uid.
\ No newline at end of file
+Find the corresponding node instance based on the uid.
+
+### copy()
+
+> v0.6.8+
+
+Copy nodes. After calling this method, the current activated node data will be stored. Multiple activated nodes will only operate on the first node, and subsequent calls to the 'paste()' method can be pasted.
+
+### cut()
+
+> v0.6.8+
+
+Cut a node. After calling this method, the currently active node will be cut and the node data will be stored. Multiple nodes will only operate on the first node, and subsequent calls to the 'paste()' method can be pasted.
+
+### paste()
+
+> v0.6.8+
+
+Pasting nodes can be done by calling the 'copy()' or 'cut()' method after calling it. This method does not support pasting data from the user's clipboard. Please use the built-in 'Ctrl+v' shortcut key.
\ No newline at end of file
diff --git a/web/src/pages/Doc/en/render/index.vue b/web/src/pages/Doc/en/render/index.vue
index cc61846d..34956eb1 100644
--- a/web/src/pages/Doc/en/render/index.vue
+++ b/web/src/pages/Doc/en/render/index.vue
@@ -83,6 +83,21 @@ is an object, e.g. {text: 'I am new text'}
uid: uid of node
Find the corresponding node instance based on the uid.
+
copy()
+
+
v0.6.8+
+
+
Copy nodes. After calling this method, the current activated node data will be stored. Multiple activated nodes will only operate on the first node, and subsequent calls to the 'paste()' method can be pasted.
+
cut()
+
+
v0.6.8+
+
+
Cut a node. After calling this method, the currently active node will be cut and the node data will be stored. Multiple nodes will only operate on the first node, and subsequent calls to the 'paste()' method can be pasted.
+
paste()
+
+
v0.6.8+
+
+
Pasting nodes can be done by calling the 'copy()' or 'cut()' method after calling it. This method does not support pasting data from the user's clipboard. Please use the built-in 'Ctrl+v' shortcut key.
diff --git a/web/src/pages/Doc/en/utils/index.md b/web/src/pages/Doc/en/utils/index.md
index b6dd1037..a2610595 100644
--- a/web/src/pages/Doc/en/utils/index.md
+++ b/web/src/pages/Doc/en/utils/index.md
@@ -181,6 +181,21 @@ Get the size of image, return:
}
```
+#### loadImage(imgFile)
+
+> v0.6.8+
+
+- `imgFile`: File object of image type
+
+Load image, return:
+
+```js
+{
+ url,// DataUrl
+ size// { width, height } width and height of image
+}
+```
+
## Simulate CSS background in Canvas
Import:
diff --git a/web/src/pages/Doc/en/utils/index.vue b/web/src/pages/Doc/en/utils/index.vue
index e09a2070..8d53434b 100644
--- a/web/src/pages/Doc/en/utils/index.vue
+++ b/web/src/pages/Doc/en/utils/index.vue
@@ -121,6 +121,19 @@ and copying the data of the data object, example:
height
}
+
loadImage(imgFile)
+
+
v0.6.8+
+
+
+
imgFile: File object of image type
+
+
Load image, return:
+
{
+ url,// DataUrl
+ size// { width, height } width and height of image
+}
+