diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index 0e899682..5ad8e324 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -52,7 +52,7 @@ module.exports = { '/zh/guide/': sideBarGuide('指南'), '/zh/plugins/': sideBarPlugins('插件'), '/zh/components/': sideBarComponents('组件'), - '/zh/article/': sideBarArticle('版本更新'), + '/zh/article/': sideBarArticle('Cookbook', '版本更新'), '/zh/others/': sideBarOthers('其它') } } @@ -109,13 +109,20 @@ function sideBarComponents (title) { ] } -function sideBarArticle (titleUpdate) { +function sideBarArticle (titleCookBook, titleUpdate) { return [ + { + title: titleCookBook, + collapsable: false, + children: [ + 'cookbook/what-is-cookbook', + 'cookbook/combinable-questionnaire', + ] + }, { title: titleUpdate, collapsable: false, children: [ - '', 'update/1.1.5', 'update/1.1.4', 'update/0.0.0' diff --git a/docs/zh/article/README.md b/docs/zh/article/README.md index 9dc383cc..37a1c102 100644 --- a/docs/zh/article/README.md +++ b/docs/zh/article/README.md @@ -1,3 +1,3 @@ -# 章节介绍 +# 文章 -这个章节下收录关于 D2Admin 的一些介绍,用法,以及每次发布新版本时的推广文章,也是每篇新文章的首发地址。 \ No newline at end of file +请在侧边栏目录选择文章阅读 \ No newline at end of file diff --git a/docs/zh/article/cookbook/combinable-questionnaire.md.REMOVED.git-id b/docs/zh/article/cookbook/combinable-questionnaire.md.REMOVED.git-id new file mode 100644 index 00000000..0b0e820e --- /dev/null +++ b/docs/zh/article/cookbook/combinable-questionnaire.md.REMOVED.git-id @@ -0,0 +1 @@ +19d478d2f8f1eaf254a2f27de23d407916d28d0d \ No newline at end of file diff --git a/docs/zh/article/cookbook/what-is-cookbook.md b/docs/zh/article/cookbook/what-is-cookbook.md new file mode 100644 index 00000000..53c4758c --- /dev/null +++ b/docs/zh/article/cookbook/what-is-cookbook.md @@ -0,0 +1,3 @@ +# 什么是 Cookbook + +计算机领域的 Cookbook 指的是实用经典案例的意思,是对一些普遍性问题的解决方案的总结和整理。 \ No newline at end of file diff --git a/package.json b/package.json index 1e3cb758..5c936831 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "d2-admin", - "version": "1.1.5", + "version": "1.1.6", "private": true, "scripts": { "serve": "vue-cli-service serve --open", diff --git a/src/layout/header-aside/components/contextmenu/components/contentmenuList/index.vue b/src/layout/header-aside/components/contextmenu/components/contentmenuList/index.vue new file mode 100644 index 00000000..d3ce5f40 --- /dev/null +++ b/src/layout/header-aside/components/contextmenu/components/contentmenuList/index.vue @@ -0,0 +1,61 @@ + + + + + diff --git a/src/layout/header-aside/components/contextmenu/index.vue b/src/layout/header-aside/components/contextmenu/index.vue new file mode 100644 index 00000000..422b93b2 --- /dev/null +++ b/src/layout/header-aside/components/contextmenu/index.vue @@ -0,0 +1,71 @@ + + + + + diff --git a/src/layout/header-aside/components/tabs/index.vue b/src/layout/header-aside/components/tabs/index.vue index 8c31778f..c6e7ea53 100644 --- a/src/layout/header-aside/components/tabs/index.vue +++ b/src/layout/header-aside/components/tabs/index.vue @@ -2,23 +2,34 @@
+ + + + @edit="handleTabsEdit" + @contextmenu.native="handleContextmenu"> - + :name="page.name"/>
-
+
import { mapState, mapMutations } from 'vuex' export default { + components: { + D2Contextmenu: () => import('../contextmenu'), + D2ContextmenuList: () => import('../contextmenu/components/contentmenuList') + }, + data () { + return { + contextmenuFlag: false, + contentmenuX: 0, + contentmenuY: 0, + contextmenuListIndex: [ + { icon: 'times-circle', title: '关闭全部', value: 'all' } + ], + contextmenuList: [ + { icon: 'arrow-left', title: '关闭左侧', value: 'left' }, + { icon: 'arrow-right', title: '关闭右侧', value: 'right' }, + { icon: 'times', title: '关闭其它', value: 'other' }, + { icon: 'times-circle', title: '关闭全部', value: 'all' } + ], + tagName: 'index' + } + }, computed: { ...mapState({ pageOpenedList: state => state.d2admin.pageOpenedList, @@ -63,19 +95,46 @@ export default { 'd2adminTagCloseOther', 'd2adminTagCloseAll' ]), + /** + * @description 右键菜单功能点击 + */ + handleContextmenu (event) { + let target = event.target + if (target.className.indexOf('el-tabs__item') > -1 || target.parentNode.className.indexOf('el-tabs__item') > -1) { + event.preventDefault() + event.stopPropagation() + this.contentmenuX = event.clientX + this.contentmenuY = event.clientY + this.tagName = target.getAttribute('aria-controls').slice(5) + this.contextmenuFlag = true + } + }, + /** + * @description 右键菜单的row-click事件 + */ + contextmenuClick (command) { + this.handleControlItemClick(command, this.tagName) + }, /** * @description 接收点击关闭控制上选项的事件 */ - handleControlItemClick (command) { + handleControlItemClick (command, tagName = null) { + if (tagName) { + this.contextmenuFlag = false + } + const params = { + pageSelect: tagName, + vm: this + } switch (command) { case 'left': - this.d2adminTagCloseLeft() + this.d2adminTagCloseLeft(params) break case 'right': - this.d2adminTagCloseRight() + this.d2adminTagCloseRight(params) break case 'other': - this.d2adminTagCloseOther() + this.d2adminTagCloseOther(params) break case 'all': this.d2adminTagCloseAll(this) diff --git a/src/store/modules/d2admin.js.REMOVED.git-id b/src/store/modules/d2admin.js.REMOVED.git-id index 3afd8c33..2ea59ae8 100644 --- a/src/store/modules/d2admin.js.REMOVED.git-id +++ b/src/store/modules/d2admin.js.REMOVED.git-id @@ -1 +1 @@ -2b2ad59e01ff445075c4b6d63e425cba12153aec \ No newline at end of file +f6b747b5dbf484da5c8b5876c9d54212c90c3550 \ No newline at end of file