diff --git a/README.md b/README.md index a4b1c4dd..99c43cdf 100644 --- a/README.md +++ b/README.md @@ -362,6 +362,13 @@ const mindMap = new MindMap({ 兔子快跑 +
{{ title }}
- -点击我会变色
-
- // `
- // return el
- // }
})
this.loadPlugins()
this.mindMap.keyCommand.addShortcut('Control+s', () => {
@@ -649,7 +484,6 @@ export default {
})
})
this.bindSaveEvent()
- this.testDynamicCreateNodes()
// 如果应用被接管,那么抛出事件传递思维导图实例
if (window.takeOverApp) {
this.$bus.$emit('app_inited', this.mindMap)
@@ -666,93 +500,12 @@ export default {
}
// 协同测试
this.cooperateTest()
- // 销毁
- // setTimeout(() => {
- // console.log('销毁')
- // this.mindMap.destroy()
- // }, 10000)
- // 测试
- // setTimeout(() => {
- // console.log(this.mindMap.renderer.root.getRect())
- // console.log(this.mindMap.renderer.root.getRectInSvg())
- // }, 5000);
- // setTimeout(() => {
- // this.mindMap.renderer.renderTree.data.fillColor = 'red'
- // this.mindMap.render()
- // this.mindMap.reRender()
- // this.mindMap.render()
- // }, 5000)
},
// 加载相关插件
loadPlugins() {
if (this.openNodeRichText) this.addRichTextPlugin()
if (this.isShowScrollbar) this.addScrollbarPlugin()
- if (typeof HandDrawnLikeStyle !== 'undefined') {
- this.$store.commit('setSupportHandDrawnLikeStyle', true)
- if (this.isUseHandDrawnLikeStyle) this.addHandDrawnLikeStylePlugin()
- }
- if (typeof Momentum !== 'undefined') {
- this.$store.commit('setSupportMomentum', true)
- if (this.isUseMomentum) this.addMomentumPlugin()
- }
- if (typeof Notation !== 'undefined') {
- this.mindMap.addPlugin(Notation)
- this.$store.commit('setSupportMark', true)
- }
- if (typeof Numbers !== 'undefined') {
- this.mindMap.addPlugin(Numbers)
- this.$store.commit('setSupportNumbers', true)
- }
- if (typeof Freemind !== 'undefined') {
- this.mindMap.addPlugin(Freemind)
- this.$store.commit('setSupportFreemind', true)
- Vue.prototype.Freemind = Freemind
- }
- if (typeof Excel !== 'undefined') {
- this.mindMap.addPlugin(Excel)
- this.$store.commit('setSupportExcel', true)
- Vue.prototype.Excel = Excel
- }
- if (typeof Checkbox !== 'undefined') {
- this.mindMap.addPlugin(Checkbox)
- this.$store.commit('setSupportCheckbox', true)
- }
- if (typeof LineFlow !== 'undefined') {
- this.mindMap.addPlugin(LineFlow)
- this.$store.commit('setSupportLineFlow', true)
- }
- if (typeof RightFishbone !== 'undefined') {
- this.mindMap.addPlugin(RightFishbone)
- this.$store.commit('setSupportRightFishbone', true)
- }
- if (typeof NodeLink !== 'undefined') {
- this.mindMap.addPlugin(NodeLink)
- this.$store.commit('setSupportNodeLink', true)
- }
- if (typeof MoreShapes !== 'undefined') {
- this.mindMap.addPlugin(MoreShapes)
- this.$store.commit('setSupportMoreShapes', true)
- }
- // 扩展侧边主题列表
- if (typeof MoreThemes !== 'undefined') {
- const extendThemeGroupList = [
- {
- name: this.$t('edit.withBg'), // 主题组名称
- // 主题列表
- list: [...MoreThemes.lightList, ...MoreThemes.darkList].map(
- item => {
- return {
- ...item,
- img: MoreThemes.themeImgMap[item.value]
- }
- }
- )
- }
- ]
- this.$store.commit('setExtendThemeGroupList', extendThemeGroupList)
- this.$store.commit('setBgList', MoreThemes.bgList)
- }
},
// url中是否存在要打开的文件
@@ -812,21 +565,6 @@ export default {
this.mindMap.updateConfig(data)
},
- // 显示新特性提示
- showNewFeatureInfo() {
- let showed = localStorage.getItem('SIMPLE_MIND_MAP_NEW_FEATURE_TIP_1')
- if (!showed) {
- this.$notify.info({
- title: this.$t('edit.newFeatureNoticeTitle'),
- message: this.$t('edit.newFeatureNoticeMessage'),
- duration: 0,
- onClose: () => {
- localStorage.setItem('SIMPLE_MIND_MAP_NEW_FEATURE_TIP_1', true)
- }
- })
- }
- },
-
// 加载节点富文本编辑插件
addRichTextPlugin() {
if (!this.mindMap) return
@@ -849,153 +587,6 @@ export default {
this.mindMap.removePlugin(ScrollbarPlugin)
},
- // 加载手绘风格插件
- addHandDrawnLikeStylePlugin() {
- try {
- if (!this.mindMap) return
- this.mindMap.addPlugin(HandDrawnLikeStyle)
- this.mindMap.reRender()
- } catch (error) {
- console.log('手绘风格插件不存在')
- }
- },
-
- // 移除手绘风格插件
- removeHandDrawnLikeStylePlugin() {
- try {
- this.mindMap.removePlugin(HandDrawnLikeStyle)
- this.mindMap.reRender()
- } catch (error) {
- console.log('手绘风格插件不存在')
- }
- },
-
- // 加载动量效果插件
- addMomentumPlugin() {
- try {
- if (!this.mindMap) return
- this.mindMap.addPlugin(Momentum)
- } catch (error) {
- console.log('动量效果插件不存在')
- }
- },
-
- // 移除动量效果插件
- removeMomentumPlugin() {
- try {
- this.mindMap.removePlugin(Momentum)
- } catch (error) {
- console.log('动量效果插件不存在')
- }
- },
-
- // 测试动态插入节点
- testDynamicCreateNodes() {
- // return
- setTimeout(() => {
- // 动态给指定节点添加子节点
- // this.mindMap.execCommand(
- // 'INSERT_CHILD_NODE',
- // false,
- // null,
- // {
- // text: '自定义内容'
- // },
- // [
- // {
- // data: {
- // text: '自定义子节点'
- // }
- // }
- // ]
- // )
- // 动态给指定节点添加同级节点
- // this.mindMap.execCommand(
- // 'INSERT_NODE',
- // false,
- // null,
- // {
- // text: '自定义内容'
- // },
- // [
- // {
- // data: {
- // text: '自定义同级节点'
- // },
- // children: [
- // {
- // data: {
- // text: '自定义同级节点2'
- // },
- // children: []
- // }
- // ]
- // }
- // ]
- // )
- // 动态插入多个子节点
- // this.mindMap.execCommand('INSERT_MULTI_CHILD_NODE', null, [
- // {
- // data: {
- // text: '自定义节点1'
- // },
- // children: [
- // {
- // data: {
- // text: '自定义节点1-1'
- // },
- // children: []
- // }
- // ]
- // },
- // {
- // data: {
- // text: '自定义节点2'
- // },
- // children: [
- // {
- // data: {
- // text: '自定义节点2-1'
- // },
- // children: []
- // }
- // ]
- // }
- // ])
- // 动态插入多个同级节点
- // this.mindMap.execCommand('INSERT_MULTI_NODE', null, [
- // {
- // data: {
- // text: '自定义节点1'
- // },
- // children: [
- // {
- // data: {
- // text: '自定义节点1-1'
- // },
- // children: []
- // }
- // ]
- // },
- // {
- // data: {
- // text: '自定义节点2'
- // },
- // children: [
- // {
- // data: {
- // text: '自定义节点2-1'
- // },
- // children: []
- // }
- // ]
- // }
- // ])
- // 动态删除指定节点
- // this.mindMap.execCommand('REMOVE_NODE', this.mindMap.renderer.root.children[0])
- }, 5000)
- },
-
// 协同测试
cooperateTest() {
if (this.mindMap.cooperate && this.$route.query.userName) {
@@ -1022,9 +613,11 @@ export default {
if (!this.enableDragImport || this.isDragOutlineTreeNode) return
this.showDragMask = true
},
+
onDragleave() {
this.showDragMask = false
},
+
onDrop(e) {
if (!this.enableDragImport) return
this.showDragMask = false
@@ -1034,30 +627,18 @@ export default {
this.$bus.$emit('importFile', file)
},
- // 网页版功能试用提示
- onVipCheckClick(e) {
- const el = getParentWithClass(e.target, 'vip')
- if (el) {
- const className = el.classList.value.split(/\s+/).join('_')
- const storageKey = 'VIP_USAGE_TIP'
- let data = localStorage.getItem(storageKey)
- if (data) {
- data = JSON.parse(data)
- } else {
- data = {}
- }
- if (!data[className]) {
- data[className] = 0
- }
- data[className]++
- if (data[className] > 3) {
- this.showDownloadTip(
- this.$t('edit.tryTipTitle'),
- this.$t('edit.tryTipDesc')
- )
- }
- localStorage.setItem(storageKey, JSON.stringify(data))
+ // 网页版试用提示
+ webTip() {
+ const storageKey = 'webUseTip'
+ const data = localStorage.getItem(storageKey)
+ if (data) {
+ return
}
+ this.showDownloadTip(
+ '重要提示',
+ '网页版已暂停更新,部分功能缺失,请下载客户端获得完整体验~'
+ )
+ localStorage.setItem(storageKey, 1)
},
showDownloadTip(title, desc) {
@@ -1065,7 +646,15 @@ export default {
this.$msgbox({
title,
message: h('div', null, [
- h('p', null, desc),
+ h(
+ 'p',
+ {
+ style: {
+ marginBottom: '12px'
+ }
+ },
+ desc
+ ),
h('div', null, [
h(
'a',
@@ -1137,11 +726,6 @@ export default {
top: 0px;
width: 100%;
height: 100%;
-
- // left: 100px;
- // top: 100px;
- // right: 100px;
- // bottom: 100px;
}
}
diff --git a/web/src/pages/Edit/components/Export.vue b/web/src/pages/Edit/components/Export.vue
index bc8e5740..2e6daca0 100644
--- a/web/src/pages/Edit/components/Export.vue
+++ b/web/src/pages/Edit/components/Export.vue
@@ -21,8 +21,7 @@
v-for="item in downTypeList"
:key="item.type"
:class="{
- active: exportType === item.type,
- vip: ['mm', 'xlsx'].includes(item.type)
+ active: exportType === item.type
}"
@click="exportType = item.type"
>
@@ -80,7 +79,6 @@
{{ $t('export.format') }}