|
@@ -1,16 +1,11 @@
|
|
|
<template>
|
|
|
<div id="tags-view-container" class="tags-view-container">
|
|
|
<scroll-pane ref="scrollPane" class="tags-view-wrapper" @scroll="handleScroll">
|
|
|
- <div
|
|
|
- v-for="(tag, index) in visitedViews"
|
|
|
- ref="tag"
|
|
|
- :key="tag.path + index"
|
|
|
+ <div v-for="(tag, index) in visitedViews" ref="tag" :key="tag.path + index"
|
|
|
:class="['tags-view-item', isActive(tag) ? 'active' : '']"
|
|
|
:data="JSON.stringify({ path: tag.path, query: tag.query, fullPath: tag.fullPath })"
|
|
|
- @click="djclick({ path: tag.path, query: tag.query, fullPath: tag.fullPath })"
|
|
|
- @dblclick="sjclick(tag)"
|
|
|
- @contextmenu.prevent="openMenu(tag, $event)"
|
|
|
- >
|
|
|
+ @click="djclick({ path: tag.path, query: tag.query, fullPath: tag.fullPath })" @dblclick="sjclick(tag)"
|
|
|
+ @contextmenu.prevent="openMenu(tag, $event)">
|
|
|
{{ tag.title }}
|
|
|
<span v-if="!isAffix(tag)" class="el-icon-close" @click.prevent.stop="closeSelectedTag(tag)" />
|
|
|
</div>
|
|
@@ -111,10 +106,24 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
addTags() {
|
|
|
- const { name,params } = this.$route
|
|
|
- const {pageType,pageCode,pagePam} =params
|
|
|
+ const { name, meta, params } = this.$route
|
|
|
+ const { pageName, pageType, pageCode, pagePam } = params
|
|
|
if (name) {
|
|
|
- this.$store.dispatch('tagsView/addView', {...this.$route, nameKey:`${name}_${pageType}_${pageCode}_${pagePam}_${Math.floor(Date.now() / 1000)}`})
|
|
|
+ this.$store.dispatch('tagsView/addView', {
|
|
|
+ ...this.$route,
|
|
|
+ meta: {
|
|
|
+ ...meta,
|
|
|
+ ...(() => {
|
|
|
+ if (pageName) {
|
|
|
+ return {
|
|
|
+ title: `${meta.title}-${pageName}`
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return {}
|
|
|
+ })(),
|
|
|
+ },
|
|
|
+ nameKey: `${name}_${pageType}_${pageCode}_${pagePam}_${Math.floor(Date.now() / 1000)}`,
|
|
|
+ })
|
|
|
}
|
|
|
return false
|
|
|
},
|
|
@@ -213,6 +222,7 @@ export default {
|
|
|
background: #fff;
|
|
|
border-bottom: 1px solid #d8dce5;
|
|
|
box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.12), 0 0 3px 0 rgba(0, 0, 0, 0.04);
|
|
|
+
|
|
|
.tags-view-wrapper {
|
|
|
.tags-view-item {
|
|
|
user-select: none;
|
|
@@ -228,16 +238,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;
|
|
@@ -251,6 +265,7 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
.contextmenu {
|
|
|
margin: 0;
|
|
|
background: #fff;
|
|
@@ -263,10 +278,12 @@ export default {
|
|
|
font-weight: 400;
|
|
|
color: #333;
|
|
|
box-shadow: 2px 2px 3px 0 rgba(0, 0, 0, 0.3);
|
|
|
+
|
|
|
li {
|
|
|
margin: 0;
|
|
|
padding: 7px 16px;
|
|
|
cursor: pointer;
|
|
|
+
|
|
|
&:hover {
|
|
|
background: #eee;
|
|
|
}
|
|
@@ -286,11 +303,13 @@ export default {
|
|
|
text-align: center;
|
|
|
transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
|
|
|
transform-origin: 100% 50%;
|
|
|
+
|
|
|
&:before {
|
|
|
transform: scale(0.6);
|
|
|
display: inline-block;
|
|
|
vertical-align: -3px;
|
|
|
}
|
|
|
+
|
|
|
&:hover {
|
|
|
background-color: #b4bccc;
|
|
|
color: #fff;
|