Demo:支持扩展节点形状列表
This commit is contained in:
parent
0146e43815
commit
f9eff11a27
@ -15,7 +15,7 @@
|
|||||||
<Navigator v-if="mindMap" :mindMap="mindMap"></Navigator>
|
<Navigator v-if="mindMap" :mindMap="mindMap"></Navigator>
|
||||||
<NavigatorToolbar :mindMap="mindMap" v-if="!isZenMode"></NavigatorToolbar>
|
<NavigatorToolbar :mindMap="mindMap" v-if="!isZenMode"></NavigatorToolbar>
|
||||||
<OutlineSidebar :mindMap="mindMap"></OutlineSidebar>
|
<OutlineSidebar :mindMap="mindMap"></OutlineSidebar>
|
||||||
<Style v-if="!isZenMode"></Style>
|
<Style v-if="mindMap && !isZenMode" :mindMap="mindMap"></Style>
|
||||||
<BaseStyle
|
<BaseStyle
|
||||||
:data="mindMapData"
|
:data="mindMapData"
|
||||||
:configData="mindMapConfig"
|
:configData="mindMapConfig"
|
||||||
@ -102,8 +102,9 @@ import Checkbox from 'simple-mind-map-plugin-checkbox'
|
|||||||
import LineFlow from 'simple-mind-map-plugin-lineflow'
|
import LineFlow from 'simple-mind-map-plugin-lineflow'
|
||||||
import Momentum from 'simple-mind-map-plugin-momentum'
|
import Momentum from 'simple-mind-map-plugin-momentum'
|
||||||
import RightFishbone from 'simple-mind-map-plugin-right-fishbone'
|
import RightFishbone from 'simple-mind-map-plugin-right-fishbone'
|
||||||
|
import MoreShapes from 'simple-mind-map-plugin-more-shapes'
|
||||||
import MoreThemes from 'simple-mind-map-plugin-more-themes'
|
import MoreThemes from 'simple-mind-map-plugin-more-themes'
|
||||||
// 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 simple-mind-map-plugin-right-fishbone simple-mind-map-plugin-more-themes
|
// 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 simple-mind-map-plugin-right-fishbone simple-mind-map-plugin-more-themes simple-mind-map-plugin-more-shapes
|
||||||
import OutlineSidebar from './OutlineSidebar.vue'
|
import OutlineSidebar from './OutlineSidebar.vue'
|
||||||
import Style from './Style.vue'
|
import Style from './Style.vue'
|
||||||
import BaseStyle from './BaseStyle.vue'
|
import BaseStyle from './BaseStyle.vue'
|
||||||
@ -702,6 +703,10 @@ export default {
|
|||||||
this.mindMap.addPlugin(LineFlow)
|
this.mindMap.addPlugin(LineFlow)
|
||||||
this.$store.commit('setSupportLineFlow', true)
|
this.$store.commit('setSupportLineFlow', true)
|
||||||
}
|
}
|
||||||
|
if (typeof MoreShapes !== 'undefined') {
|
||||||
|
this.mindMap.addPlugin(MoreShapes)
|
||||||
|
this.$store.commit('setSupportMoreShapes', true)
|
||||||
|
}
|
||||||
// 扩展侧边主题列表
|
// 扩展侧边主题列表
|
||||||
if (typeof MoreThemes !== 'undefined') {
|
if (typeof MoreThemes !== 'undefined') {
|
||||||
const extendThemeGroupList = [
|
const extendThemeGroupList = [
|
||||||
|
|||||||
@ -316,8 +316,13 @@
|
|||||||
:key="item.value"
|
:key="item.value"
|
||||||
:label="item.name"
|
:label="item.name"
|
||||||
:value="item.value"
|
:value="item.value"
|
||||||
|
style="display: flex; justify-content: center; align-items: center;"
|
||||||
>
|
>
|
||||||
<svg width="60" height="26" style="margin-top: 5px">
|
<svg
|
||||||
|
:width="item.width || 60"
|
||||||
|
:height="item.height || 26"
|
||||||
|
style="margin-top: 5px"
|
||||||
|
>
|
||||||
<path
|
<path
|
||||||
:d="shapeListMap[item.value]"
|
:d="shapeListMap[item.value]"
|
||||||
fill="none"
|
fill="none"
|
||||||
@ -572,6 +577,11 @@ export default {
|
|||||||
Sidebar,
|
Sidebar,
|
||||||
Color
|
Color
|
||||||
},
|
},
|
||||||
|
props: {
|
||||||
|
mindMap: {
|
||||||
|
type: Object
|
||||||
|
}
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
fontSizeList,
|
fontSizeList,
|
||||||
@ -623,10 +633,27 @@ export default {
|
|||||||
return borderDasharrayList[this.$i18n.locale] || borderDasharrayList.zh
|
return borderDasharrayList[this.$i18n.locale] || borderDasharrayList.zh
|
||||||
},
|
},
|
||||||
shapeList() {
|
shapeList() {
|
||||||
return shapeList[this.$i18n.locale] || shapeList.zh
|
return [
|
||||||
|
...(shapeList[this.$i18n.locale] || shapeList.zh),
|
||||||
|
...this.mindMap.extendShapeList.map(item => {
|
||||||
|
return {
|
||||||
|
width: '40px',
|
||||||
|
name: item.nameShow,
|
||||||
|
value: item.name
|
||||||
|
}
|
||||||
|
})
|
||||||
|
]
|
||||||
},
|
},
|
||||||
shapeListMap() {
|
shapeListMap() {
|
||||||
return shapeListMap[this.$i18n.locale] || shapeListMap.zh
|
const map = shapeListMap[this.$i18n.locale] || shapeListMap.zh
|
||||||
|
const map2 = {}
|
||||||
|
this.mindMap.extendShapeList.forEach(item => {
|
||||||
|
map2[item.name] = item.path
|
||||||
|
})
|
||||||
|
return {
|
||||||
|
...map,
|
||||||
|
...map2
|
||||||
|
}
|
||||||
},
|
},
|
||||||
linearGradientDirList() {
|
linearGradientDirList() {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@ -38,6 +38,7 @@ const store = new Vuex.Store({
|
|||||||
supportCheckbox: false, // 是否支持Checkbox插件
|
supportCheckbox: false, // 是否支持Checkbox插件
|
||||||
supportLineFlow: false, // 是否支持LineFlow插件
|
supportLineFlow: false, // 是否支持LineFlow插件
|
||||||
supportMomentum: false, // 是否支持Momentum插件
|
supportMomentum: false, // 是否支持Momentum插件
|
||||||
|
supportMoreShapes: false,// 是否支持MoreShapes插件
|
||||||
isDragOutlineTreeNode: false, // 当前是否正在拖拽大纲树的节点
|
isDragOutlineTreeNode: false, // 当前是否正在拖拽大纲树的节点
|
||||||
aiConfig: {
|
aiConfig: {
|
||||||
api: 'http://ark.cn-beijing.volces.com/api/v3/chat/completions',
|
api: 'http://ark.cn-beijing.volces.com/api/v3/chat/completions',
|
||||||
@ -138,6 +139,11 @@ const store = new Vuex.Store({
|
|||||||
state.supportMomentum = data
|
state.supportMomentum = data
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 设置是否支持MoreShapes插件
|
||||||
|
setSupportMoreShapes(state, data) {
|
||||||
|
state.supportMoreShapes = data
|
||||||
|
},
|
||||||
|
|
||||||
// 设置树节点拖拽
|
// 设置树节点拖拽
|
||||||
setIsDragOutlineTreeNode(state, data) {
|
setIsDragOutlineTreeNode(state, data) {
|
||||||
state.isDragOutlineTreeNode = data
|
state.isDragOutlineTreeNode = data
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user