mirror of
https://github.com/wanglin2/mind-map.git
synced 2026-02-17 14:04:47 +08:00
Demo:优化代码,去除无用的注释、去除组件name、引入vue组件添加后缀
This commit is contained in:
@@ -17,11 +17,7 @@ const createFullData = () => {
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @Author: 王林
|
||||
* @Date: 2021-04-15 22:23:24
|
||||
* @Desc: 节点较多示例数据
|
||||
*/
|
||||
// 节点较多示例数据
|
||||
const data1 = {
|
||||
"root": {
|
||||
"data": {
|
||||
|
||||
@@ -6,8 +6,7 @@
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'App',
|
||||
components: {}
|
||||
name: 'App'
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -9,11 +9,7 @@ const SIMPLE_MIND_MAP_LOCAL_CONFIG = 'SIMPLE_MIND_MAP_LOCAL_CONFIG'
|
||||
|
||||
let mindMapData = null
|
||||
|
||||
/**
|
||||
* @Author: 王林
|
||||
* @Date: 2021-08-01 10:10:49
|
||||
* @Desc: 获取缓存的思维导图数据
|
||||
*/
|
||||
// 获取缓存的思维导图数据
|
||||
export const getData = () => {
|
||||
if (window.takeOverApp) {
|
||||
mindMapData = window.takeOverAppMethods.getMindMapData()
|
||||
@@ -34,11 +30,7 @@ export const getData = () => {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @Author: 王林
|
||||
* @Date: 2021-08-01 10:14:28
|
||||
* @Desc: 存储思维导图数据
|
||||
*/
|
||||
// 存储思维导图数据
|
||||
export const storeData = data => {
|
||||
try {
|
||||
let originData = null
|
||||
@@ -64,11 +56,7 @@ export const storeData = data => {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @Author: 王林
|
||||
* @Date: 2021-08-01 10:24:56
|
||||
* @Desc: 存储思维导图配置数据
|
||||
*/
|
||||
// 存储思维导图配置数据
|
||||
export const storeConfig = config => {
|
||||
try {
|
||||
let originData = null
|
||||
@@ -97,12 +85,7 @@ export const storeConfig = config => {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* javascript comment
|
||||
* @Author: 王林
|
||||
* @Date: 2022-11-05 14:36:50
|
||||
* @Desc: 存储语言
|
||||
*/
|
||||
// 存储语言
|
||||
export const storeLang = lang => {
|
||||
if (window.takeOverApp) {
|
||||
window.takeOverAppMethods.saveLanguage(lang)
|
||||
@@ -111,12 +94,7 @@ export const storeLang = lang => {
|
||||
localStorage.setItem(SIMPLE_MIND_MAP_LANG, lang)
|
||||
}
|
||||
|
||||
/**
|
||||
* javascript comment
|
||||
* @Author: 王林
|
||||
* @Date: 2022-11-05 14:37:36
|
||||
* @Desc: 获取存储的语言
|
||||
*/
|
||||
// 获取存储的语言
|
||||
export const getLang = () => {
|
||||
if (window.takeOverApp) {
|
||||
return window.takeOverAppMethods.getLanguage() || 'zh'
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'ImgUpload',
|
||||
model: {
|
||||
prop: 'value',
|
||||
event: 'change'
|
||||
@@ -47,32 +46,20 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* @Author: 王林
|
||||
* @Date: 2019-12-22 19:47:19
|
||||
* @Desc: 图片选择事件
|
||||
*/
|
||||
// 图片选择事件
|
||||
onImgUploadInputChange(e) {
|
||||
let file = e.target.files[0]
|
||||
this.selectImg(file)
|
||||
},
|
||||
|
||||
/**
|
||||
* @Author: 王林
|
||||
* @Date: 2019-12-22 20:32:31
|
||||
* @Desc: 拖动上传图片
|
||||
*/
|
||||
// 拖动上传图片
|
||||
onDrop(e) {
|
||||
let dt = e.dataTransfer
|
||||
let file = dt.files && dt.files[0]
|
||||
this.selectImg(file)
|
||||
},
|
||||
|
||||
/**
|
||||
* @Author: 王林
|
||||
* @Date: 2021-06-06 16:56:14
|
||||
* @Desc: 选择图片
|
||||
*/
|
||||
// 选择图片
|
||||
selectImg(file) {
|
||||
this.file = file
|
||||
let fr = new FileReader()
|
||||
@@ -82,11 +69,7 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* @Author: 王林
|
||||
* @Date: 2021-06-22 23:03:46
|
||||
* @Desc: 获取图片大小
|
||||
*/
|
||||
// 获取图片大小
|
||||
getSize() {
|
||||
return new Promise(resolve => {
|
||||
let img = new Image()
|
||||
@@ -106,11 +89,7 @@ export default {
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* @Author: 王林
|
||||
* @Date: 2021-06-06 21:59:57
|
||||
* @Desc: 删除图片
|
||||
*/
|
||||
// 删除图片
|
||||
deleteImg() {
|
||||
this.$emit('change', '')
|
||||
this.file = null
|
||||
|
||||
@@ -11,13 +11,12 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Toolbar from './components/Toolbar'
|
||||
import Edit from './components/Edit'
|
||||
import Toolbar from './components/Toolbar.vue'
|
||||
import Edit from './components/Edit.vue'
|
||||
import { mapState, mapActions, mapMutations } from 'vuex'
|
||||
import { getLocalConfig } from '@/api'
|
||||
|
||||
export default {
|
||||
name: 'Index',
|
||||
components: {
|
||||
Toolbar,
|
||||
Edit
|
||||
@@ -54,11 +53,7 @@ export default {
|
||||
...mapActions(['getUserMindMapData']),
|
||||
...mapMutations(['setLocalConfig']),
|
||||
|
||||
/**
|
||||
* @Author: 王林25
|
||||
* @Date: 2022-11-14 19:07:03
|
||||
* @Desc: 初始化本地配置
|
||||
*/
|
||||
// 初始化本地配置
|
||||
initLocalConfig() {
|
||||
let config = getLocalConfig()
|
||||
if (config) {
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Sidebar from './Sidebar'
|
||||
import Sidebar from './Sidebar.vue'
|
||||
import { mapState } from 'vuex'
|
||||
import { createUid } from 'simple-mind-map/src/utils'
|
||||
import MarkdownIt from 'markdown-it'
|
||||
|
||||
@@ -209,28 +209,15 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Sidebar from './Sidebar'
|
||||
import Color from './Color'
|
||||
import Sidebar from './Sidebar.vue'
|
||||
import Color from './Color.vue'
|
||||
import {
|
||||
lineWidthList,
|
||||
lineStyleList,
|
||||
backgroundRepeatList,
|
||||
backgroundPositionList,
|
||||
backgroundSizeList,
|
||||
fontFamilyList,
|
||||
fontSizeList,
|
||||
rootLineKeepSameInCurveList,
|
||||
lineStyleMap,
|
||||
borderDasharrayList
|
||||
} from '@/config'
|
||||
import { mapState, mapMutations } from 'vuex'
|
||||
import {
|
||||
supportLineStyleLayoutsMap,
|
||||
supportLineRadiusLayouts,
|
||||
supportNodeUseLineStyleLayouts,
|
||||
supportRootLineKeepSameInCurveLayouts,
|
||||
rainbowLinesOptions
|
||||
} from '@/config/constant'
|
||||
|
||||
const defaultStyle = {
|
||||
associativeLineColor: '',
|
||||
@@ -244,7 +231,6 @@ const defaultStyle = {
|
||||
}
|
||||
|
||||
export default {
|
||||
name: 'BaseStyle',
|
||||
components: {
|
||||
Sidebar,
|
||||
Color
|
||||
|
||||
@@ -804,8 +804,8 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Sidebar from './Sidebar'
|
||||
import Color from './Color'
|
||||
import Sidebar from './Sidebar.vue'
|
||||
import Color from './Color.vue'
|
||||
import {
|
||||
lineWidthList,
|
||||
lineStyleList,
|
||||
@@ -818,9 +818,9 @@ import {
|
||||
lineStyleMap,
|
||||
borderDasharrayList
|
||||
} from '@/config'
|
||||
import ImgUpload from '@/components/ImgUpload'
|
||||
import ImgUpload from '@/components/ImgUpload/index.vue'
|
||||
import { storeConfig } from '@/api'
|
||||
import { mapState, mapMutations } from 'vuex'
|
||||
import { mapState } from 'vuex'
|
||||
import {
|
||||
supportLineStyleLayoutsMap,
|
||||
supportLineRadiusLayouts,
|
||||
@@ -829,13 +829,8 @@ import {
|
||||
rainbowLinesOptions
|
||||
} from '@/config/constant'
|
||||
|
||||
/**
|
||||
* @Author: 王林
|
||||
* @Date: 2021-06-24 22:52:56
|
||||
* @Desc: 基础样式
|
||||
*/
|
||||
// 基础样式
|
||||
export default {
|
||||
name: 'BaseStyle',
|
||||
components: {
|
||||
Sidebar,
|
||||
Color,
|
||||
|
||||
@@ -26,13 +26,8 @@
|
||||
import { colorList } from '@/config'
|
||||
import { mapState } from 'vuex'
|
||||
|
||||
/**
|
||||
* @Author: 王林
|
||||
* @Date: 2021-06-24 22:53:10
|
||||
* @Desc: 颜色选择器
|
||||
*/
|
||||
// 颜色选择器
|
||||
export default {
|
||||
name: 'Color',
|
||||
props: {
|
||||
color: {
|
||||
type: String,
|
||||
@@ -59,20 +54,12 @@ export default {
|
||||
this.selectColor = this.color
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* @Author: 王林
|
||||
* @Date: 2021-05-05 09:38:06
|
||||
* @Desc: 点击预设颜色
|
||||
*/
|
||||
// 点击预设颜色
|
||||
clickColorItem(color) {
|
||||
this.$emit('change', color)
|
||||
},
|
||||
|
||||
/**
|
||||
* @Author: 王林
|
||||
* @Date: 2021-05-05 10:17:26
|
||||
* @Desc: 修改颜色
|
||||
*/
|
||||
// 修改颜色
|
||||
changeColor() {
|
||||
this.$emit('change', this.selectColor)
|
||||
}
|
||||
|
||||
@@ -224,13 +224,8 @@ import { transformToTxt } from 'simple-mind-map/src/parse/toTxt'
|
||||
import { setDataToClipboard, setImgToClipboard, copy } from '@/utils'
|
||||
import { numberTypeList, numberLevelList } from '@/config'
|
||||
|
||||
/**
|
||||
* @Author: 王林
|
||||
* @Date: 2021-06-24 22:53:10
|
||||
* @Desc: 右键菜单
|
||||
*/
|
||||
// 右键菜单
|
||||
export default {
|
||||
name: 'Contextmenu',
|
||||
props: {
|
||||
mindMap: {
|
||||
type: Object
|
||||
|
||||
@@ -14,15 +14,9 @@
|
||||
<script>
|
||||
import { mapState } from 'vuex'
|
||||
|
||||
/**
|
||||
* @Author: 王林
|
||||
* @Date: 2021-06-24 22:53:10
|
||||
* @Desc: 字数及节点数量统计
|
||||
*/
|
||||
|
||||
// 字数及节点数量统计
|
||||
let countEl = document.createElement('div')
|
||||
export default {
|
||||
name: 'Count',
|
||||
props: {
|
||||
mindMap: {
|
||||
type: Object
|
||||
@@ -50,11 +44,7 @@ export default {
|
||||
this.$bus.$off('data_change', this.onDataChange)
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* @Author: 王林25
|
||||
* @Date: 2022-11-14 19:20:20
|
||||
* @Desc: 监听数据变化
|
||||
*/
|
||||
// 监听数据变化
|
||||
onDataChange(data) {
|
||||
this.textStr = ''
|
||||
this.words = 0
|
||||
@@ -64,11 +54,7 @@ export default {
|
||||
this.words = countEl.textContent.length
|
||||
},
|
||||
|
||||
/**
|
||||
* @Author: 王林
|
||||
* @Date: 2021-06-30 22:13:07
|
||||
* @Desc: 遍历
|
||||
*/
|
||||
// 遍历
|
||||
walk(data) {
|
||||
if (!data) return
|
||||
this.num++
|
||||
|
||||
@@ -96,16 +96,16 @@ import Checkbox from 'simple-mind-map-plugin-checkbox'
|
||||
import LineFlow from 'simple-mind-map-plugin-lineflow'
|
||||
import Momentum from 'simple-mind-map-plugin-momentum'
|
||||
// npm link simple-mind-map-plugin-excel simple-mind-map-plugin-freemind simple-mind-map-plugin-numbers simple-mind-map-plugin-notation simple-mind-map-plugin-handdrawnlikestyle simple-mind-map-plugin-checkbox simple-mind-map simple-mind-map-plugin-themes simple-mind-map-plugin-lineflow simple-mind-map-plugin-momentum
|
||||
import OutlineSidebar from './OutlineSidebar'
|
||||
import Style from './Style'
|
||||
import BaseStyle from './BaseStyle'
|
||||
import Theme from './Theme'
|
||||
import Structure from './Structure'
|
||||
import Count from './Count'
|
||||
import NavigatorToolbar from './NavigatorToolbar'
|
||||
import ShortcutKey from './ShortcutKey'
|
||||
import Contextmenu from './Contextmenu'
|
||||
import RichTextToolbar from './RichTextToolbar'
|
||||
import OutlineSidebar from './OutlineSidebar.vue'
|
||||
import Style from './Style.vue'
|
||||
import BaseStyle from './BaseStyle.vue'
|
||||
import Theme from './Theme.vue'
|
||||
import Structure from './Structure.vue'
|
||||
import Count from './Count.vue'
|
||||
import NavigatorToolbar from './NavigatorToolbar.vue'
|
||||
import ShortcutKey from './ShortcutKey.vue'
|
||||
import Contextmenu from './Contextmenu.vue'
|
||||
import RichTextToolbar from './RichTextToolbar.vue'
|
||||
import NodeNoteContentShow from './NodeNoteContentShow.vue'
|
||||
import { getData, storeData, storeConfig } from '@/api'
|
||||
import Navigator from './Navigator.vue'
|
||||
@@ -163,7 +163,6 @@ MindMap.usePlugin(MiniMap)
|
||||
Themes.init(MindMap)
|
||||
|
||||
export default {
|
||||
name: 'Edit',
|
||||
components: {
|
||||
OutlineSidebar,
|
||||
Style,
|
||||
|
||||
@@ -121,14 +121,9 @@ import { downTypeList } from '@/config'
|
||||
import { isMobile } from 'simple-mind-map/src/utils/index'
|
||||
import MarkdownIt from 'markdown-it'
|
||||
|
||||
/**
|
||||
* @Author: 王林
|
||||
* @Date: 2021-06-24 22:53:54
|
||||
* @Desc: 导出
|
||||
*/
|
||||
// 导出
|
||||
let md = null
|
||||
export default {
|
||||
name: 'Export',
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
@@ -193,20 +188,10 @@ export default {
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* @Author: 王林
|
||||
* @Date: 2021-06-22 22:08:11
|
||||
* @Desc: 取消
|
||||
*/
|
||||
cancel() {
|
||||
this.dialogVisible = false
|
||||
},
|
||||
|
||||
/**
|
||||
* @Author: 王林
|
||||
* @Date: 2021-06-06 22:28:20
|
||||
* @Desc: 确定
|
||||
*/
|
||||
confirm() {
|
||||
this.setExtraTextOnExport(this.extraText)
|
||||
if (this.exportType === 'svg') {
|
||||
|
||||
@@ -31,12 +31,11 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Sidebar from './Sidebar'
|
||||
import Sidebar from './Sidebar.vue'
|
||||
import { mapState, mapMutations } from 'vuex'
|
||||
import { formulaList } from '@/config/constant'
|
||||
|
||||
export default {
|
||||
name: 'FormulaSidebar',
|
||||
components: {
|
||||
Sidebar
|
||||
},
|
||||
|
||||
@@ -22,13 +22,8 @@
|
||||
<script>
|
||||
import { fullscrrenEvent, fullScreen } from '@/utils'
|
||||
|
||||
/**
|
||||
* @Author: 王林
|
||||
* @Date: 2021-06-24 22:53:10
|
||||
* @Desc: 全屏
|
||||
*/
|
||||
// 全屏
|
||||
export default {
|
||||
name: 'Fullscreen',
|
||||
props: {
|
||||
mindMap: {
|
||||
type: Object
|
||||
|
||||
@@ -62,13 +62,8 @@ import markdown from 'simple-mind-map/src/parse/markdown.js'
|
||||
import { mapMutations, mapState } from 'vuex'
|
||||
import Vue from 'vue'
|
||||
|
||||
/**
|
||||
* @Author: 王林
|
||||
* @Date: 2021-06-24 22:53:54
|
||||
* @Desc: 导入
|
||||
*/
|
||||
// 导入
|
||||
export default {
|
||||
name: 'Import',
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
|
||||
@@ -22,13 +22,8 @@
|
||||
<script>
|
||||
import { mapState, mapMutations } from 'vuex'
|
||||
|
||||
/**
|
||||
* @Author: 王林
|
||||
* @Date: 2021-06-24 22:53:10
|
||||
* @Desc: 鼠标操作设置
|
||||
*/
|
||||
// 鼠标操作设置
|
||||
export default {
|
||||
name: 'MouseAction',
|
||||
props: {
|
||||
mindMap: {
|
||||
type: Object
|
||||
|
||||
@@ -109,8 +109,8 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Scale from './Scale'
|
||||
import Fullscreen from './Fullscreen'
|
||||
import Scale from './Scale.vue'
|
||||
import Fullscreen from './Fullscreen.vue'
|
||||
import MouseAction from './MouseAction.vue'
|
||||
import { langList } from '@/config'
|
||||
import i18n from '@/i18n'
|
||||
@@ -119,13 +119,8 @@ import { mapState, mapMutations } from 'vuex'
|
||||
import pkg from 'simple-mind-map/package.json'
|
||||
import Demonstrate from './Demonstrate.vue'
|
||||
|
||||
/**
|
||||
* @Author: 王林
|
||||
* @Date: 2021-06-24 22:53:10
|
||||
* @Desc: 导航器工具栏
|
||||
*/
|
||||
// 导航器工具栏
|
||||
export default {
|
||||
name: 'NavigatorToolbar',
|
||||
components: {
|
||||
Scale,
|
||||
Fullscreen,
|
||||
|
||||
@@ -108,7 +108,7 @@
|
||||
|
||||
<script>
|
||||
import { lineWidthList } from '@/config'
|
||||
import Color from './Color'
|
||||
import Color from './Color.vue'
|
||||
|
||||
const defaultConfig = {
|
||||
type: 'circle',
|
||||
|
||||
@@ -44,13 +44,8 @@
|
||||
<script>
|
||||
import { isMobile } from 'simple-mind-map/src/utils/index'
|
||||
|
||||
/**
|
||||
* @Author: 王林
|
||||
* @Date: 2021-06-24 22:53:17
|
||||
* @Desc: 节点超链接内容设置
|
||||
*/
|
||||
// 节点超链接内容设置
|
||||
export default {
|
||||
name: 'NodeHyperlink',
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
@@ -103,20 +98,10 @@ export default {
|
||||
this.dialogVisible = true
|
||||
},
|
||||
|
||||
/**
|
||||
* @Author: 王林
|
||||
* @Date: 2021-06-22 22:08:11
|
||||
* @Desc: 取消
|
||||
*/
|
||||
cancel() {
|
||||
this.dialogVisible = false
|
||||
},
|
||||
|
||||
/**
|
||||
* @Author: 王林
|
||||
* @Date: 2021-06-06 22:28:20
|
||||
* @Desc: 确定
|
||||
*/
|
||||
confirm() {
|
||||
this.activeNodes.forEach(node => {
|
||||
node.setHyperlink(
|
||||
|
||||
@@ -27,13 +27,8 @@
|
||||
import { nodeIconList } from 'simple-mind-map/src/svg/icons'
|
||||
import icon from '@/config/icon'
|
||||
|
||||
/**
|
||||
* @Author: 王林
|
||||
* @Date: 2021-06-24 22:53:33
|
||||
* @Desc: 节点图标内容设置
|
||||
*/
|
||||
// 节点图标内容设置
|
||||
export default {
|
||||
name: 'NodeIcon',
|
||||
data() {
|
||||
return {
|
||||
nodeIconList: [...nodeIconList, ...icon],
|
||||
@@ -69,11 +64,6 @@ export default {
|
||||
return /^<svg/.test(icon) ? icon : `<img src="${icon}" />`
|
||||
},
|
||||
|
||||
/**
|
||||
* @Author: 王林
|
||||
* @Date: 2021-06-23 23:16:56
|
||||
* @Desc: 设置icon
|
||||
*/
|
||||
setIcon(type, name) {
|
||||
let key = type + '_' + name
|
||||
let index = this.iconList.findIndex(item => {
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Sidebar from './Sidebar'
|
||||
import Sidebar from './Sidebar.vue'
|
||||
import { mapState } from 'vuex'
|
||||
import { nodeIconList } from 'simple-mind-map/src/svg/icons'
|
||||
import { mergerIconList } from 'simple-mind-map/src/utils/index'
|
||||
@@ -63,7 +63,6 @@ import icon from '@/config/icon'
|
||||
import image from '@/config/image'
|
||||
|
||||
export default {
|
||||
name: 'NodeIconSidebar',
|
||||
components: {
|
||||
Sidebar
|
||||
},
|
||||
|
||||
@@ -19,10 +19,6 @@ import { mapState, mapMutations } from 'vuex'
|
||||
const allIconList = [..._nodeIconList, ...icon]
|
||||
|
||||
export default {
|
||||
name: 'NodeIconToolbar',
|
||||
components: {
|
||||
|
||||
},
|
||||
props: {
|
||||
mindMap: {
|
||||
type: Object
|
||||
|
||||
@@ -37,16 +37,11 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import ImgUpload from '@/components/ImgUpload'
|
||||
import ImgUpload from '@/components/ImgUpload/index.vue'
|
||||
import { getImageSize, isMobile } from 'simple-mind-map/src/utils/index'
|
||||
|
||||
/**
|
||||
* @Author: 王林
|
||||
* @Date: 2021-06-24 22:53:45
|
||||
* @Desc: 节点图片内容设置
|
||||
*/
|
||||
// 节点图片内容设置
|
||||
export default {
|
||||
name: 'NodeImage',
|
||||
components: {
|
||||
ImgUpload
|
||||
},
|
||||
|
||||
@@ -22,11 +22,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState, mapMutations } from 'vuex'
|
||||
|
||||
export default {
|
||||
name: 'NodeImgPlacementToolbar',
|
||||
components: {},
|
||||
props: {
|
||||
mindMap: {
|
||||
type: Object
|
||||
|
||||
@@ -29,11 +29,7 @@ import Editor from '@toast-ui/editor'
|
||||
import '@toast-ui/editor/dist/toastui-editor.css' // Editor's Style
|
||||
import { isMobile } from 'simple-mind-map/src/utils/index'
|
||||
|
||||
/**
|
||||
* @Author: 王林
|
||||
* @Date: 2021-06-24 22:53:54
|
||||
* @Desc: 节点备注内容设置
|
||||
*/
|
||||
// 节点备注内容设置
|
||||
export default {
|
||||
name: 'NodeNote',
|
||||
data() {
|
||||
|
||||
@@ -18,13 +18,8 @@
|
||||
import Viewer from '@toast-ui/editor/dist/toastui-editor-viewer'
|
||||
import '@toast-ui/editor/dist/toastui-editor-viewer.css'
|
||||
|
||||
/**
|
||||
* @Author: 王林
|
||||
* @Date: 2021-06-24 22:53:54
|
||||
* @Desc: 节点备注内容显示
|
||||
*/
|
||||
// 节点备注内容显示
|
||||
export default {
|
||||
name: 'NodeNoteContentShow',
|
||||
props: {
|
||||
mindMap: {
|
||||
type: Object,
|
||||
|
||||
@@ -132,7 +132,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Color from './Color'
|
||||
import Color from './Color.vue'
|
||||
import { mapState } from 'vuex'
|
||||
import { lineWidthList, borderDasharrayList } from '@/config'
|
||||
|
||||
|
||||
@@ -45,13 +45,8 @@ import {
|
||||
isMobile
|
||||
} from 'simple-mind-map/src/utils/index'
|
||||
|
||||
/**
|
||||
* @Author: 王林
|
||||
* @Date: 2021-06-24 22:54:03
|
||||
* @Desc: 节点标签内容设置
|
||||
*/
|
||||
// 节点标签内容设置
|
||||
export default {
|
||||
name: 'NodeTag',
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
@@ -96,11 +91,6 @@ export default {
|
||||
this.dialogVisible = true
|
||||
},
|
||||
|
||||
/**
|
||||
* @Author: 王林
|
||||
* @Date: 2021-06-24 21:48:14
|
||||
* @Desc: 添加
|
||||
*/
|
||||
add() {
|
||||
const text = this.tag.trim()
|
||||
if (!text) return
|
||||
@@ -108,29 +98,14 @@ export default {
|
||||
this.tag = ''
|
||||
},
|
||||
|
||||
/**
|
||||
* @Author: 王林
|
||||
* @Date: 2021-06-24 21:57:53
|
||||
* @Desc: 删除
|
||||
*/
|
||||
del(index) {
|
||||
this.tagArr.splice(index, 1)
|
||||
},
|
||||
|
||||
/**
|
||||
* @Author: 王林
|
||||
* @Date: 2021-06-22 22:08:11
|
||||
* @Desc: 取消
|
||||
*/
|
||||
cancel() {
|
||||
this.dialogVisible = false
|
||||
},
|
||||
|
||||
/**
|
||||
* @Author: 王林
|
||||
* @Date: 2021-06-06 22:28:20
|
||||
* @Desc: 确定
|
||||
*/
|
||||
confirm() {
|
||||
this.activeNodes.forEach(node => {
|
||||
node.setTag(this.tagArr)
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Color from './Color'
|
||||
import Color from './Color.vue'
|
||||
import { mapState } from 'vuex'
|
||||
|
||||
export default {
|
||||
|
||||
@@ -50,7 +50,6 @@ import {
|
||||
|
||||
// 大纲树
|
||||
export default {
|
||||
name: 'Outline',
|
||||
props: {
|
||||
mindMap: {
|
||||
type: Object
|
||||
|
||||
@@ -78,7 +78,6 @@ import { printOutline } from '@/utils'
|
||||
|
||||
// 大纲侧边栏
|
||||
export default {
|
||||
name: 'OutlineEdit',
|
||||
props: {
|
||||
mindMap: {
|
||||
type: Object
|
||||
|
||||
@@ -36,14 +36,13 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Sidebar from './Sidebar'
|
||||
import Sidebar from './Sidebar.vue'
|
||||
import { mapState, mapMutations } from 'vuex'
|
||||
import Outline from './Outline.vue'
|
||||
import { printOutline } from '@/utils'
|
||||
|
||||
// 大纲侧边栏
|
||||
export default {
|
||||
name: 'OutlineSidebar',
|
||||
components: {
|
||||
Sidebar,
|
||||
Outline
|
||||
|
||||
@@ -139,11 +139,10 @@
|
||||
|
||||
<script>
|
||||
import { fontFamilyList, fontSizeList, alignList } from '@/config'
|
||||
import Color from './Color'
|
||||
import Color from './Color.vue'
|
||||
import { mapState } from 'vuex'
|
||||
|
||||
export default {
|
||||
name: 'RichTextToolbar',
|
||||
components: {
|
||||
Color
|
||||
},
|
||||
|
||||
@@ -32,13 +32,8 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
/**
|
||||
* @Author: 王林
|
||||
* @Date: 2021-06-24 22:53:10
|
||||
* @Desc: 放大缩小
|
||||
*/
|
||||
// 放大缩小
|
||||
export default {
|
||||
name: 'Scale',
|
||||
props: {
|
||||
mindMap: {
|
||||
type: Object
|
||||
|
||||
@@ -78,7 +78,6 @@ import { isUndef, getTextFromHtml } from 'simple-mind-map/src/utils/index'
|
||||
|
||||
// 搜索替换
|
||||
export default {
|
||||
name: 'Search',
|
||||
props: {
|
||||
mindMap: {
|
||||
type: Object
|
||||
|
||||
@@ -392,10 +392,10 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Sidebar from './Sidebar'
|
||||
import Sidebar from './Sidebar.vue'
|
||||
import { storeConfig } from '@/api'
|
||||
import { mapState, mapMutations } from 'vuex'
|
||||
import Color from './Color'
|
||||
import Color from './Color.vue'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
|
||||
@@ -20,17 +20,12 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Sidebar from './Sidebar'
|
||||
import Sidebar from './Sidebar.vue'
|
||||
import { shortcutKeyList } from '@/config'
|
||||
import { mapState } from 'vuex'
|
||||
|
||||
/**
|
||||
* @Author: 王林
|
||||
* @Date: 2021-06-24 22:54:14
|
||||
* @Desc: 快捷键
|
||||
*/
|
||||
// 快捷键
|
||||
export default {
|
||||
name: 'ShortcutKey',
|
||||
components: {
|
||||
Sidebar
|
||||
},
|
||||
|
||||
@@ -19,13 +19,8 @@
|
||||
import { store } from '@/config'
|
||||
import { mapState, mapMutations } from 'vuex'
|
||||
|
||||
/**
|
||||
* @Author: 王林
|
||||
* @Date: 2021-06-24 22:54:25
|
||||
* @Desc: 侧边栏容器
|
||||
*/
|
||||
// 侧边栏容器
|
||||
export default {
|
||||
name: 'Sidebar',
|
||||
props: {
|
||||
title: {
|
||||
type: String,
|
||||
|
||||
@@ -27,13 +27,8 @@
|
||||
import { mapState, mapMutations } from 'vuex'
|
||||
import { sidebarTriggerList } from '@/config'
|
||||
|
||||
/**
|
||||
* @Author: 王林
|
||||
* @Date: 2021-06-24 22:54:25
|
||||
* @Desc: 侧边栏触发器
|
||||
*/
|
||||
// 侧边栏触发器
|
||||
export default {
|
||||
name: 'SidebarTrigger',
|
||||
data() {
|
||||
return {
|
||||
show: true,
|
||||
|
||||
@@ -58,7 +58,6 @@
|
||||
|
||||
<script>
|
||||
import { mapState, mapMutations } from 'vuex'
|
||||
import { storeData } from '@/api'
|
||||
import CodeMirror from 'codemirror'
|
||||
import 'codemirror/mode/javascript/javascript'
|
||||
import 'codemirror/lib/codemirror.css'
|
||||
@@ -68,7 +67,6 @@ let editor = null
|
||||
|
||||
// 源码编辑
|
||||
export default {
|
||||
name: 'SourceCodeEdit',
|
||||
props: {
|
||||
mindMap: {
|
||||
type: Object
|
||||
|
||||
@@ -18,19 +18,14 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Sidebar from './Sidebar'
|
||||
import Sidebar from './Sidebar.vue'
|
||||
import { layoutList } from 'simple-mind-map/src/constants/constant'
|
||||
import { storeConfig } from '@/api'
|
||||
import { mapState } from 'vuex'
|
||||
import { layoutImgMap } from '@/config/constant.js'
|
||||
|
||||
/**
|
||||
* @Author: 王林
|
||||
* @Date: 2021-06-24 22:54:14
|
||||
* @Desc: 结构
|
||||
*/
|
||||
// 结构
|
||||
export default {
|
||||
name: 'Structure',
|
||||
components: {
|
||||
Sidebar
|
||||
},
|
||||
@@ -63,11 +58,6 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* @Author: 王林
|
||||
* @Date: 2021-06-24 23:04:38
|
||||
* @Desc: 使用主题
|
||||
*/
|
||||
useLayout(layout) {
|
||||
this.layout = layout.value
|
||||
this.mindMap.setLayout(layout.value)
|
||||
|
||||
@@ -551,8 +551,8 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Sidebar from './Sidebar'
|
||||
import Color from './Color'
|
||||
import Sidebar from './Sidebar.vue'
|
||||
import Color from './Color.vue'
|
||||
import {
|
||||
fontFamilyList,
|
||||
fontSizeList,
|
||||
@@ -566,13 +566,8 @@ import {
|
||||
} from '@/config'
|
||||
import { mapState } from 'vuex'
|
||||
|
||||
/**
|
||||
* @Author: 王林
|
||||
* @Date: 2021-06-24 22:54:47
|
||||
* @Desc: 节点样式设置
|
||||
*/
|
||||
// 节点样式设置
|
||||
export default {
|
||||
name: 'Style',
|
||||
components: {
|
||||
Sidebar,
|
||||
Color
|
||||
@@ -658,11 +653,7 @@ export default {
|
||||
this.$bus.$off('node_active', this.onNodeActive)
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* @Author: 王林25
|
||||
* @Date: 2022-11-14 19:16:21
|
||||
* @Desc: 监听节点激活事件
|
||||
*/
|
||||
// 监听节点激活事件
|
||||
onNodeActive(...args) {
|
||||
this.$nextTick(() => {
|
||||
this.activeNodes = [...args[1]]
|
||||
@@ -670,11 +661,7 @@ export default {
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* @Author: 王林
|
||||
* @Date: 2021-05-05 09:48:52
|
||||
* @Desc: 初始节点样式
|
||||
*/
|
||||
// 初始节点样式
|
||||
initNodeStyle() {
|
||||
if (this.activeNodes.length <= 0) {
|
||||
return
|
||||
@@ -702,11 +689,7 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* @Author: 王林
|
||||
* @Date: 2021-05-04 22:08:16
|
||||
* @Desc: 修改样式
|
||||
*/
|
||||
// 修改样式
|
||||
update(prop) {
|
||||
if (prop === 'linearGradientDir') {
|
||||
const target = this.linearGradientDirList.find(item => {
|
||||
@@ -725,11 +708,7 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* @Author: 王林
|
||||
* @Date: 2021-05-05 09:41:34
|
||||
* @Desc: 切换加粗样式
|
||||
*/
|
||||
// 切换加粗样式
|
||||
toggleFontWeight() {
|
||||
if (this.style.fontWeight === 'bold') {
|
||||
this.style.fontWeight = 'normal'
|
||||
@@ -739,11 +718,7 @@ export default {
|
||||
this.update('fontWeight')
|
||||
},
|
||||
|
||||
/**
|
||||
* @Author: 王林
|
||||
* @Date: 2021-05-05 09:46:39
|
||||
* @Desc: 切换字体样式
|
||||
*/
|
||||
// 切换字体样式
|
||||
toggleFontStyle() {
|
||||
if (this.style.fontStyle === 'italic') {
|
||||
this.style.fontStyle = 'normal'
|
||||
@@ -753,61 +728,37 @@ export default {
|
||||
this.update('fontStyle')
|
||||
},
|
||||
|
||||
/**
|
||||
* @Author: 王林
|
||||
* @Date: 2021-05-05 10:18:59
|
||||
* @Desc: 修改字体颜色
|
||||
*/
|
||||
// 修改字体颜色
|
||||
changeFontColor(color) {
|
||||
this.style.color = color
|
||||
this.update('color')
|
||||
},
|
||||
|
||||
/**
|
||||
* @Author: 王林
|
||||
* @Date: 2021-05-05 10:18:59
|
||||
* @Desc: 修改边框颜色
|
||||
*/
|
||||
// 修改边框颜色
|
||||
changeBorderColor(color) {
|
||||
this.style.borderColor = color
|
||||
this.update('borderColor')
|
||||
},
|
||||
|
||||
/**
|
||||
* @Author: flydreame
|
||||
* @Date: 2022-09-17 10:18:15
|
||||
* @Desc: 修改线条颜色
|
||||
*/
|
||||
// 修改线条颜色
|
||||
changeLineColor(color) {
|
||||
this.style.lineColor = color
|
||||
this.update('lineColor')
|
||||
},
|
||||
|
||||
/**
|
||||
* @Author: 王林
|
||||
* @Date: 2021-05-05 10:18:59
|
||||
* @Desc: 修改背景颜色
|
||||
*/
|
||||
// 修改背景颜色
|
||||
changeFillColor(color) {
|
||||
this.style.fillColor = color
|
||||
this.update('fillColor')
|
||||
},
|
||||
|
||||
/**
|
||||
* @Author: lxr_cel
|
||||
* @Date: 2024-01-02 11:09:27
|
||||
* @Desc: 切换渐变开始颜色
|
||||
*/
|
||||
// 切换渐变开始颜色
|
||||
changeStartColor(color) {
|
||||
this.style.startColor = color
|
||||
this.update('startColor')
|
||||
},
|
||||
|
||||
/**
|
||||
* @Author: lxr_cel
|
||||
* @Date: 2024-01-02 10:10:34
|
||||
* @Desc: 切换渐变结束颜色
|
||||
*/
|
||||
// 切换渐变结束颜色
|
||||
changeEndColor(color) {
|
||||
this.style.endColor = color
|
||||
this.update('endColor')
|
||||
|
||||
@@ -26,19 +26,14 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Sidebar from './Sidebar'
|
||||
import Sidebar from './Sidebar.vue'
|
||||
import { storeConfig } from '@/api'
|
||||
import { mapState, mapMutations } from 'vuex'
|
||||
import themeImgMap from 'simple-mind-map-plugin-themes/themeImgMap'
|
||||
import themeList from 'simple-mind-map-plugin-themes/themeList'
|
||||
|
||||
/**
|
||||
* @Author: 王林
|
||||
* @Date: 2021-06-24 22:53:04
|
||||
* @Desc: 主题
|
||||
*/
|
||||
// 主题
|
||||
export default {
|
||||
name: 'Theme',
|
||||
components: {
|
||||
Sidebar
|
||||
},
|
||||
|
||||
@@ -143,13 +143,13 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import NodeImage from './NodeImage'
|
||||
import NodeHyperlink from './NodeHyperlink'
|
||||
import NodeIcon from './NodeIcon'
|
||||
import NodeNote from './NodeNote'
|
||||
import NodeTag from './NodeTag'
|
||||
import Export from './Export'
|
||||
import Import from './Import'
|
||||
import NodeImage from './NodeImage.vue'
|
||||
import NodeHyperlink from './NodeHyperlink.vue'
|
||||
import NodeIcon from './NodeIcon.vue'
|
||||
import NodeNote from './NodeNote.vue'
|
||||
import NodeTag from './NodeTag.vue'
|
||||
import Export from './Export.vue'
|
||||
import Import from './Import.vue'
|
||||
import { mapState } from 'vuex'
|
||||
import { Notification } from 'element-ui'
|
||||
import exampleData from 'simple-mind-map/example/exampleData'
|
||||
@@ -157,11 +157,7 @@ import { getData } from '../../../api'
|
||||
import ToolbarNodeBtnList from './ToolbarNodeBtnList.vue'
|
||||
import { throttle, isMobile } from 'simple-mind-map/src/utils/index'
|
||||
|
||||
/**
|
||||
* @Author: 王林
|
||||
* @Date: 2021-06-24 22:54:58
|
||||
* @Desc: 工具栏
|
||||
*/
|
||||
// 工具栏
|
||||
let fileHandle = null
|
||||
const defaultBtnList = [
|
||||
'back',
|
||||
@@ -185,7 +181,6 @@ const defaultBtnList = [
|
||||
]
|
||||
|
||||
export default {
|
||||
name: 'Toolbar',
|
||||
components: {
|
||||
NodeImage,
|
||||
NodeHyperlink,
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
/**
|
||||
* @Author: 王林
|
||||
* @Date: 2021-07-11 21:38:09
|
||||
* @Desc: 全屏事件检测
|
||||
*/
|
||||
// 全屏事件检测
|
||||
const getOnfullscreEnevt = () => {
|
||||
if (document.documentElement.requestFullScreen) {
|
||||
return 'onfullscreenchange'
|
||||
@@ -17,11 +13,7 @@ const getOnfullscreEnevt = () => {
|
||||
|
||||
export const fullscrrenEvent = getOnfullscreEnevt()
|
||||
|
||||
/**
|
||||
* @Author: 王林
|
||||
* @Date: 2021-07-11 21:45:06
|
||||
* @Desc: 全屏
|
||||
*/
|
||||
// 全屏
|
||||
export const fullScreen = element => {
|
||||
if (element.requestFullScreen) {
|
||||
element.requestFullScreen()
|
||||
@@ -32,12 +24,7 @@ export const fullScreen = element => {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* javascript comment
|
||||
* @Author: 王林25
|
||||
* @Date: 2022-10-24 14:16:18
|
||||
* @Desc: 文件转buffer
|
||||
*/
|
||||
// 文件转buffer
|
||||
export const fileToBuffer = file => {
|
||||
return new Promise(r => {
|
||||
const reader = new FileReader()
|
||||
|
||||
Reference in New Issue
Block a user