diff --git a/web/src/lang/en_us.js b/web/src/lang/en_us.js index 9fd92dc3..22157e28 100644 --- a/web/src/lang/en_us.js +++ b/web/src/lang/en_us.js @@ -253,7 +253,12 @@ export default { arrowDir: 'Arrow dir', arrowDirStart: 'Start', arrowDirEnd: 'End', - direction: 'Direction' + direction: 'Direction', + selectNodeTip: 'Please select a node', + openLineFlow: 'Open line flow', + lineFlowDuration: 'Line flow duration', + forward: 'Forward', + reverse: 'Reverse' }, theme: { title: 'Theme', diff --git a/web/src/lang/zh_cn.js b/web/src/lang/zh_cn.js index 44645ce6..4ee38b48 100644 --- a/web/src/lang/zh_cn.js +++ b/web/src/lang/zh_cn.js @@ -249,7 +249,12 @@ export default { arrowDir: '箭头位置', arrowDirStart: '头部', arrowDirEnd: '尾部', - direction: '方向' + direction: '方向', + selectNodeTip: '请选择一个节点', + openLineFlow: '开启流动效果', + lineFlowDuration: '一个流动周期的时间', + forward: '正向', + reverse: '反向' }, theme: { title: '主题', diff --git a/web/src/lang/zh_tw.js b/web/src/lang/zh_tw.js index c871226e..cd92b4f4 100644 --- a/web/src/lang/zh_tw.js +++ b/web/src/lang/zh_tw.js @@ -249,7 +249,12 @@ export default { endColor: '結束', arrowDir: '箭頭位置', arrowDirStart: '頭部', - arrowDirEnd: '尾部' + arrowDirEnd: '尾部', + selectNodeTip: '請選擇壹個節點', + openLineFlow: '開啓流動效果', + lineFlowDuration: '一個流動周期的時間', + forward: '正向', + reverse: '反向' }, theme: { title: '主題', diff --git a/web/src/pages/Edit/components/BaseStyle.vue b/web/src/pages/Edit/components/BaseStyle.vue index 4fc8b5ec..5871f5f8 100644 --- a/web/src/pages/Edit/components/BaseStyle.vue +++ b/web/src/pages/Edit/components/BaseStyle.vue @@ -273,6 +273,61 @@ > + +
+
+ {{ $t('style.openLineFlow') }} + +
+
+ {{ $t('style.direction') }} + + + + +
+
+
+
+ {{ $t('style.lineFlowDuration') }} + +
+
{{ $t('baseStyle.rainbowLines') }}
@@ -811,6 +866,9 @@ export default { rootLineKeepSameInCurve: '', rootLineStartPositionKeepSameInCurve: '', lineRadius: 0, + lineFlow: false, + lineFlowForward: true, + lineFlowDuration: 1, generalizationLineWidth: '', generalizationLineColor: '', associativeLineColor: '', @@ -847,7 +905,8 @@ export default { ...mapState({ activeSidebar: state => state.activeSidebar, localConfig: state => state.localConfig, - isDark: state => state.localConfig.isDark + isDark: state => state.localConfig.isDark, + supportLineFlow: state => state.supportLineFlow }), lineStyleList() { return lineStyleList[this.$i18n.locale] || lineStyleList.zh @@ -947,36 +1006,7 @@ export default { // 初始样式 initStyle() { - ;[ - 'backgroundColor', - 'lineWidth', - 'lineStyle', - 'showLineMarker', - 'rootLineKeepSameInCurve', - 'rootLineStartPositionKeepSameInCurve', - 'lineRadius', - 'lineColor', - 'generalizationLineWidth', - 'generalizationLineColor', - 'associativeLineColor', - 'associativeLineWidth', - 'associativeLineActiveWidth', - 'associativeLineDasharray', - 'associativeLineActiveColor', - 'associativeLineTextFontSize', - 'associativeLineTextColor', - 'associativeLineTextFontFamily', - 'paddingX', - 'paddingY', - 'imgMaxWidth', - 'imgMaxHeight', - 'iconSize', - 'backgroundImage', - 'backgroundRepeat', - 'backgroundPosition', - 'backgroundSize', - 'nodeUseLineStyle' - ].forEach(key => { + Object.keys(this.style).forEach(key => { this.style[key] = this.mindMap.getThemeConfig(key) if (key === 'backgroundImage' && this.style[key] === 'none') { this.style[key] = '' diff --git a/web/src/pages/Edit/components/Edit.vue b/web/src/pages/Edit/components/Edit.vue index 8d468436..60738ace 100644 --- a/web/src/pages/Edit/components/Edit.vue +++ b/web/src/pages/Edit/components/Edit.vue @@ -75,14 +75,15 @@ import OuterFrame from 'simple-mind-map/src/plugins/OuterFrame.js' import Themes from 'simple-mind-map-plugin-themes' // 协同编辑插件 // import Cooperate from 'simple-mind-map/src/plugins/Cooperate.js' -// 以下插件为付费插件,详情请查看开发文档。依次为:手绘风格插件、标记插件、编号插件、Freemind软件格式导入导出插件、Excel软件格式导入导出插件、待办插件 +// 以下插件为付费插件,详情请查看开发文档。依次为:手绘风格插件、标记插件、编号插件、Freemind软件格式导入导出插件、Excel软件格式导入导出插件、待办插件、节点连线流动效果插件 // import HandDrawnLikeStyle from 'simple-mind-map-plugin-handdrawnlikestyle' // import Notation from 'simple-mind-map-plugin-notation' // import Numbers from 'simple-mind-map-plugin-numbers' // import Freemind from 'simple-mind-map-plugin-freemind' // import Excel from 'simple-mind-map-plugin-excel' // import Checkbox from 'simple-mind-map-plugin-checkbox' -// 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 +// import LineFlow from 'simple-mind-map-plugin-lineflow' +// 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 import OutlineSidebar from './OutlineSidebar' import Style from './Style' import BaseStyle from './BaseStyle' @@ -581,6 +582,10 @@ export default { this.mindMap.addPlugin(Checkbox) this.$store.commit('setSupportCheckbox', true) } + if (typeof LineFlow !== 'undefined') { + this.mindMap.addPlugin(LineFlow) + this.$store.commit('setSupportLineFlow', true) + } this.mindMap.keyCommand.addShortcut('Control+s', () => { this.manualSave() }) diff --git a/web/src/pages/Edit/components/Style.vue b/web/src/pages/Edit/components/Style.vue index 2edb830c..f4a82095 100644 --- a/web/src/pages/Edit/components/Style.vue +++ b/web/src/pages/Edit/components/Style.vue @@ -415,6 +415,49 @@
+ +
+
+ {{ $t('style.openLineFlow') }} + +
+
+ {{ $t('style.direction') }} + + + + +
+
+
+
+ {{ $t('style.lineFlowDuration') }} + +
+
{{ $t('style.nodePadding') }}
@@ -441,7 +484,7 @@
-
请选择一个节点
+
{{ $t('style.selectNodeTip') }}
@@ -500,14 +543,18 @@ export default { gradientStyle: false, startColor: '', endColor: '', - linearGradientDir: '' + linearGradientDir: '', + lineFlow: false, + lineFlowForward: true, + lineFlowDuration: 1 } } }, computed: { ...mapState({ isDark: state => state.localConfig.isDark, - activeSidebar: state => state.activeSidebar + activeSidebar: state => state.activeSidebar, + supportLineFlow: state => state.supportLineFlow }), fontFamilyList() { return fontFamilyList[this.$i18n.locale] || fontFamilyList.zh @@ -564,29 +611,7 @@ export default { if (this.activeNodes.length <= 0) { return } - ;[ - 'shape', - 'paddingX', - 'paddingY', - 'color', - 'fontFamily', - 'fontSize', - 'textDecoration', - 'fontWeight', - 'fontStyle', - 'borderWidth', - 'borderColor', - 'fillColor', - 'borderDasharray', - 'borderRadius', - 'lineColor', - 'lineDasharray', - 'lineWidth', - 'lineMarkerDir', - 'gradientStyle', - 'startColor', - 'endColor' - ].forEach(item => { + Object.keys(this.style).forEach(item => { this.style[item] = this.activeNodes[0].getStyle(item, false) }) this.initLinearGradientDir() diff --git a/web/src/store.js b/web/src/store.js index 9adc970c..4e000067 100644 --- a/web/src/store.js +++ b/web/src/store.js @@ -34,6 +34,7 @@ const store = new Vuex.Store({ supportFreemind: false, // 是否支持Freemind插件 supportExcel: false, // 是否支持Excel插件 supportCheckbox: false, // 是否支持Checkbox插件 + supportLineFlow: false, // 是否支持LineFlow插件 isDragOutlineTreeNode: false // 当前是否正在拖拽大纲树的节点 }, mutations: { @@ -111,6 +112,11 @@ const store = new Vuex.Store({ state.supportCheckbox = data }, + // 设置是否支持Lineflow插件 + setSupportLineFlow(state, data) { + state.supportLineFlow = data + }, + // 设置树节点拖拽 setIsDragOutlineTreeNode(state, data) { state.isDragOutlineTreeNode = data