|
@@ -13,13 +13,14 @@
|
|
|
@click.middle.native="!isAffix(tag)?closeSelectedTag(tag):''"
|
|
|
@contextmenu.prevent.native="openMenu(tag,$event)"
|
|
|
>
|
|
|
- {{ tag.title }}
|
|
|
- <span v-if="!isAffix(tag)" class="el-icon-close" @click.prevent.stop="closeSelectedTag(tag)" />
|
|
|
+ {{ getMenuName(tag.meta) }}
|
|
|
+ <span v-if="!isAffix(tag)" class="el-icon-close" @click.prevent.stop="closeSelectedTag(tag)"/>
|
|
|
</router-link>
|
|
|
</scroll-pane>
|
|
|
<ul v-show="visible" :style="{left:left+'px',top:top+'px'}" class="contextmenu">
|
|
|
<li @click="refreshSelectedTag(selectedTag)"><i class="el-icon-refresh-right"></i> 刷新页面</li>
|
|
|
- <li v-if="!isAffix(selectedTag)" @click="closeSelectedTag(selectedTag)"><i class="el-icon-close"></i> 关闭当前</li>
|
|
|
+ <li v-if="!isAffix(selectedTag)" @click="closeSelectedTag(selectedTag)"><i class="el-icon-close"></i> 关闭当前
|
|
|
+ </li>
|
|
|
<li @click="closeOthersTags"><i class="el-icon-circle-close"></i> 关闭其他</li>
|
|
|
<li v-if="!isFirstView()" @click="closeLeftTags"><i class="el-icon-back"></i> 关闭左侧</li>
|
|
|
<li v-if="!isLastView()" @click="closeRightTags"><i class="el-icon-right"></i> 关闭右侧</li>
|
|
@@ -31,9 +32,11 @@
|
|
|
<script>
|
|
|
import ScrollPane from './ScrollPane'
|
|
|
import path from 'path'
|
|
|
+import MetaI18n from "@/layout/components/MetaI18n";
|
|
|
|
|
|
export default {
|
|
|
- components: { ScrollPane },
|
|
|
+ components: {ScrollPane},
|
|
|
+ mixins: [MetaI18n],
|
|
|
data() {
|
|
|
return {
|
|
|
visible: false,
|
|
@@ -108,7 +111,7 @@ export default {
|
|
|
fullPath: tagPath,
|
|
|
path: tagPath,
|
|
|
name: route.name,
|
|
|
- meta: { ...route.meta }
|
|
|
+ meta: {...route.meta}
|
|
|
})
|
|
|
}
|
|
|
if (route.children) {
|
|
@@ -130,7 +133,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
addTags() {
|
|
|
- const { name } = this.$route
|
|
|
+ const {name} = this.$route
|
|
|
if (name) {
|
|
|
this.$store.dispatch('tagsView/addView', this.$route)
|
|
|
if (this.$route.meta.link) {
|
|
@@ -161,7 +164,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
closeSelectedTag(view) {
|
|
|
- this.$tab.closePage(view).then(({ visitedViews }) => {
|
|
|
+ this.$tab.closePage(view).then(({visitedViews}) => {
|
|
|
if (this.isActive(view)) {
|
|
|
this.toLastView(visitedViews, view)
|
|
|
}
|
|
@@ -182,13 +185,14 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
closeOthersTags() {
|
|
|
- this.$router.push(this.selectedTag.fullPath).catch(()=>{});
|
|
|
+ this.$router.push(this.selectedTag.fullPath).catch(() => {
|
|
|
+ });
|
|
|
this.$tab.closeOtherPage(this.selectedTag).then(() => {
|
|
|
this.moveToCurrentTag()
|
|
|
})
|
|
|
},
|
|
|
closeAllTags(view) {
|
|
|
- this.$tab.closeAllPage().then(({ visitedViews }) => {
|
|
|
+ this.$tab.closeAllPage().then(({visitedViews}) => {
|
|
|
if (this.affixTags.some(tag => tag.path === this.$route.path)) {
|
|
|
return
|
|
|
}
|
|
@@ -204,7 +208,7 @@ export default {
|
|
|
// you can adjust it according to your needs.
|
|
|
if (view.name === 'Dashboard') {
|
|
|
// to reload home page
|
|
|
- this.$router.replace({ path: '/redirect' + view.fullPath })
|
|
|
+ this.$router.replace({path: '/redirect' + view.fullPath})
|
|
|
} else {
|
|
|
this.$router.push('/')
|
|
|
}
|
|
@@ -244,6 +248,7 @@ export default {
|
|
|
background: #fff;
|
|
|
border-bottom: 1px solid #d8dce5;
|
|
|
box-shadow: 0 1px 3px 0 rgba(0, 0, 0, .12), 0 0 3px 0 rgba(0, 0, 0, .04);
|
|
|
+
|
|
|
.tags-view-wrapper {
|
|
|
.tags-view-item {
|
|
|
display: inline-block;
|
|
@@ -258,16 +263,20 @@ export default {
|
|
|
font-size: 12px;
|
|
|
margin-left: 5px;
|
|
|
margin-top: 4px;
|
|
|
+
|
|
|
&:first-of-type {
|
|
|
margin-left: 15px;
|
|
|
}
|
|
|
+
|
|
|
&:last-of-type {
|
|
|
margin-right: 15px;
|
|
|
}
|
|
|
+
|
|
|
&.active {
|
|
|
background-color: #42b983;
|
|
|
color: #fff;
|
|
|
border-color: #42b983;
|
|
|
+
|
|
|
&::before {
|
|
|
content: '';
|
|
|
background: #fff;
|
|
@@ -281,6 +290,7 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
.contextmenu {
|
|
|
margin: 0;
|
|
|
background: #fff;
|
|
@@ -293,10 +303,12 @@ export default {
|
|
|
font-weight: 400;
|
|
|
color: #333;
|
|
|
box-shadow: 2px 2px 3px 0 rgba(0, 0, 0, .3);
|
|
|
+
|
|
|
li {
|
|
|
margin: 0;
|
|
|
padding: 7px 16px;
|
|
|
cursor: pointer;
|
|
|
+
|
|
|
&:hover {
|
|
|
background: #eee;
|
|
|
}
|
|
@@ -317,11 +329,13 @@ export default {
|
|
|
text-align: center;
|
|
|
transition: all .3s cubic-bezier(.645, .045, .355, 1);
|
|
|
transform-origin: 100% 50%;
|
|
|
+
|
|
|
&:before {
|
|
|
transform: scale(.6);
|
|
|
display: inline-block;
|
|
|
vertical-align: -3px;
|
|
|
}
|
|
|
+
|
|
|
&:hover {
|
|
|
background-color: #b4bccc;
|
|
|
color: #fff;
|