|
@@ -78,8 +78,13 @@ export default {
|
|
|
// 设置标签
|
|
|
setTags(route) {
|
|
|
const isExist = this.tagsList.some((item) => {
|
|
|
+ if (route.path.indexOf('viewDetail') > -1 || route.path.indexOf('installplanView') > -1) {
|
|
|
+ let itemfullpath = this.setFullPath(item.path);
|
|
|
+ return itemfullpath === route.fullPath;
|
|
|
+ }
|
|
|
return item.path === route.fullPath;
|
|
|
});
|
|
|
+ // debugger
|
|
|
if (!isExist) {
|
|
|
if (route.path === '/') {
|
|
|
return;
|
|
@@ -87,10 +92,32 @@ export default {
|
|
|
if (this.tagsList.length >= 8) {
|
|
|
this.tagsList.shift();
|
|
|
}
|
|
|
- this.tagsList.push({
|
|
|
- title: route.title || route.meta.title,
|
|
|
- path: route.fullPath
|
|
|
- });
|
|
|
+ if (route.path.indexOf('viewDetail') > -1) {
|
|
|
+ this.tagsList.push({
|
|
|
+ title: route.query.deviceNo || route.meta.title,
|
|
|
+ path: { path: route.path, query: { deviceId: route.query.deviceId || '', deviceNo: route.query.deviceNo || '' } }
|
|
|
+ });
|
|
|
+ } else if (route.path.indexOf('installplanView') > -1) {
|
|
|
+ this.tagsList.push({
|
|
|
+ title: route.query.planName,
|
|
|
+ path: { path: route.path, query: { planName: route.query.planName || '', planId: route.query.planId || '' } }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+
|
|
|
+ let tagArr = {
|
|
|
+ title: route.title || route.meta.title,
|
|
|
+ path: route.fullPath
|
|
|
+ };
|
|
|
+ if (!!route.name) {
|
|
|
+ tagArr = {
|
|
|
+ title: route.title || route.meta.title,
|
|
|
+ path: route.fullPath,
|
|
|
+ name: route.name
|
|
|
+ };
|
|
|
+ }
|
|
|
+
|
|
|
+ this.tagsList.push(tagArr);
|
|
|
+ }
|
|
|
this.$store.dispatch('tags', this.tagsList);
|
|
|
}
|
|
|
}
|