From deaa50b9dfe1a5c61c93f95d579f3a49068ae1c0 Mon Sep 17 00:00:00 2001 From: liyang <1711467488@qq.com> Date: Sat, 14 Jul 2018 22:16:44 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=80=E5=8C=96=E5=A4=9A=E6=A0=87=E7=AD=BE?= =?UTF-8?q?=E9=A1=B5=E6=8E=A7=E5=88=B6=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Former-commit-id: 76c3cbdfdc65a7a7083732c3ea144eb1c9a6ef0d [formerly 76c3cbdfdc65a7a7083732c3ea144eb1c9a6ef0d [formerly 76c3cbdfdc65a7a7083732c3ea144eb1c9a6ef0d [formerly 76c3cbdfdc65a7a7083732c3ea144eb1c9a6ef0d [formerly 21f366a0e65ed26e148da67be444c3efb3e43db4 [formerly 2a257cadf2f0c020f653c759cfa944b2e709f7cc]]]]] Former-commit-id: 961f08a504afd013f483db5d741358cee9c3051e Former-commit-id: 38ba1cad1aedded0c54efaad40d5f3df0998b8a4 Former-commit-id: 1663df81d9f2bd756565134ef57459ac6f1d80d1 [formerly 363bd5fd5de0892b79dfc23c0ff40d16e0c9eaab] Former-commit-id: c2bcaa4221746c7e5ceb68686e7387b1b3241125 Former-commit-id: db5964b51d118c5b8d4a1a60bd120ae3c43810a8 Former-commit-id: e4999f6f0235f8f969037e61c411107476a964fa Former-commit-id: 8626f736d0b0a642bd48208984e892f007b45bc1 Former-commit-id: 0f1b3a032686ae5c9b0224f1f3cad9855594c5d3 --- .../core/d2-multiple-page-control/index.vue | 74 +++---------------- src/store/modules/d2admin.js.REMOVED.git-id | 2 +- 2 files changed, 11 insertions(+), 65 deletions(-) diff --git a/src/components/core/d2-multiple-page-control/index.vue b/src/components/core/d2-multiple-page-control/index.vue index 79d2d2e9..cf050854 100644 --- a/src/components/core/d2-multiple-page-control/index.vue +++ b/src/components/core/d2-multiple-page-control/index.vue @@ -74,16 +74,16 @@ export default { handleControlItemClick (command) { switch (command) { case 'left': - this.handleCloseAllTagLeft() + this.d2adminTagCloseLeft() break case 'right': - this.handleCloseAllTagRight() + this.d2adminTagCloseRight() break case 'other': - this.handleCloseAllTagOther() + this.d2adminTagCloseOther() break case 'all': - this.handleCloseAllTag() + this.d2adminTagCloseAll(this) break default: this.$message.error('无效的操作') @@ -94,7 +94,7 @@ export default { * @description 接收点击关闭控制上按钮的事件 暂时这个按钮还只有关闭全部标签的功能 */ handleControlBtnClick () { - this.closeAllTag() + this.d2adminTagCloseAll(this) }, /** * @description 接收点击 tab 标签的事件 @@ -110,68 +110,14 @@ export default { } }, /** - * @description 点击 tab 上的删除按钮后首先触发这里 + * @description 点击 tab 上的删除按钮后首先触发这里 首页的删除按钮已经隐藏 因此这里不用判断是 index */ handleTabsEdit (tagName, action) { if (action === 'remove') { - // 首页的删除按钮已经隐藏 因此这里不用判断是 index - this.closeTag(tagName) - } - }, - /** - * @description 关闭左侧的 tag - */ - handleCloseAllTagLeft () { - this.d2adminTagCloseLeft() - }, - /** - * @description 关闭右侧的 tag - */ - handleCloseAllTagRight () { - this.d2adminTagCloseRight() - }, - /** - * @description 关闭其它的 tag - */ - handleCloseAllTagOther () { - this.d2adminTagCloseOther() - }, - /** - * @description 关闭全部的 tag - */ - handleCloseAllTag () { - this.d2adminTagCloseAll(this) - }, - /** - * @description 关闭一个指定的 tag - */ - closeTag (tagName) { - // 下个新的页面 - let newPage = this.pageOpenedList[0] - // 如果关闭的页面就是当前显示的页面 - if (this.pageCurrent === tagName) { - // 去找一个新的页面 - let len = this.pageOpenedList.length - for (let i = 1; i < len; i++) { - if (this.pageOpenedList[i].name === tagName) { - if (i < len - 1) { - newPage = this.pageOpenedList[i + 1] - } else { - newPage = this.pageOpenedList[i - 1] - } - break - } - } - } - this.$store.commit('d2adminTagClose', tagName) - if (this.pageCurrent === tagName) { - const { name = '', argu = {}, query = {} } = newPage - let routerObj = { - name, - params: argu, - query - } - this.$router.push(routerObj) + this.$store.commit('d2adminTagClose', { + tagName, + vm: this + }) } } } diff --git a/src/store/modules/d2admin.js.REMOVED.git-id b/src/store/modules/d2admin.js.REMOVED.git-id index 9f53826f..5105e385 100644 --- a/src/store/modules/d2admin.js.REMOVED.git-id +++ b/src/store/modules/d2admin.js.REMOVED.git-id @@ -1 +1 @@ -4f701e92fa6fa2aa8e42fbc80cc090a70336e10a \ No newline at end of file +7b00c68fab8dc619a65443ffe19bba7dee9daaed \ No newline at end of file