|
@@ -121,7 +121,7 @@
|
|
|
},
|
|
|
watch: {
|
|
|
'$route': function (newRoute) {
|
|
|
- console.log("新的路由",newRoute)
|
|
|
+ //console.log("新的路由",newRoute)
|
|
|
this.activePage = newRoute.fullPath
|
|
|
if (!this.multipage) {
|
|
|
this.linkList = [newRoute.fullPath]
|
|
@@ -137,9 +137,9 @@
|
|
|
this.linkList.push(newRoute.fullPath)
|
|
|
this.pageList.push(Object.assign({}, newRoute))
|
|
|
// update-begin-author:sunjianlei date:20200103 for: 如果新增的页面配置了缓存路由,那么就强制刷新一遍
|
|
|
- if (newRoute.meta.keepAlive) {
|
|
|
- this.routeReload()
|
|
|
- }
|
|
|
+ // if (newRoute.meta.keepAlive) {
|
|
|
+ // this.routeReload()
|
|
|
+ // }
|
|
|
// update-end-author:sunjianlei date:20200103 for: 如果新增的页面配置了缓存路由,那么就强制刷新一遍
|
|
|
} else if (this.linkList.indexOf(newRoute.fullPath) >= 0) {
|
|
|
let oldIndex = this.linkList.indexOf(newRoute.fullPath)
|
|
@@ -148,8 +148,7 @@
|
|
|
meta: oldPositionRoute.meta
|
|
|
}))
|
|
|
}
|
|
|
- // 快手的批量处理标签
|
|
|
- if(!this.linkList.includes("/account/stepForm")){
|
|
|
+ if (!this.linkList.includes("/account/stepForm")) {
|
|
|
localStorage.removeItem("step")
|
|
|
localStorage.removeItem("campaignId")
|
|
|
localStorage.removeItem("pans")
|
|
@@ -164,21 +163,12 @@
|
|
|
localStorage.removeItem("originality")
|
|
|
localStorage.removeItem("originalityKey")
|
|
|
}
|
|
|
-
|
|
|
- // 头条的批量处理tab标签
|
|
|
- // console.log(this.activePage,this.linkList)
|
|
|
- // if(!this.linkList.includes('/modules/BatchCreate/newGroup')&&!this.linkList.includes('/modules/BatchCreate/newPlan')&&!this.linkList.includes('/modules/BatchCreate/newCreate')){
|
|
|
- // localStorage.setItem("planInfo",'')
|
|
|
- // localStorage.setItem("groupInfo",'')
|
|
|
-
|
|
|
- // }
|
|
|
-
|
|
|
},
|
|
|
'activePage': function (key) {
|
|
|
let index = this.linkList.lastIndexOf(key)
|
|
|
let waitRouter = this.pageList[index]
|
|
|
this.$router.push(Object.assign({}, waitRouter));
|
|
|
- this.changeTitle(waitRouter.meta.title)
|
|
|
+ // this.changeTitle(waitRouter.meta.title)
|
|
|
},
|
|
|
'multipage': function (newVal) {
|
|
|
if (this.reloadFlag) {
|
|
@@ -237,15 +227,12 @@
|
|
|
this[action](key)
|
|
|
},
|
|
|
remove(key) {
|
|
|
- // console.log(this.pageList)
|
|
|
-
|
|
|
if (key == indexKey) {
|
|
|
this.$message.warning('首页不能关闭!')
|
|
|
return
|
|
|
}
|
|
|
- console.log(this.pageList,this.linkList)
|
|
|
if (this.pageList.length === 1) {
|
|
|
- // this.$message.warning('这是最后一页,不能再关闭了啦')
|
|
|
+ this.$message.warning('这是最后一页,不能再关闭了啦')
|
|
|
return
|
|
|
}
|
|
|
console.log("this.pageList ", this.pageList);
|
|
@@ -270,48 +257,62 @@
|
|
|
if (key == "/modules/material/materialList") {
|
|
|
localStorage.removeItem("key")
|
|
|
}
|
|
|
- if(key=='/modules/BatchCreate/TouTiaoBatch'&&!(this.linkList.includes('/modules/BatchCreate/newCreate') || this.linkList.includes('/modules/BatchCreate/newPlan') ||this.linkList.includes('/modules/BatchCreate/newGroup') )){
|
|
|
- localStorage.setItem('accountInfo','')
|
|
|
- localStorage.setItem("groupInfo",'')
|
|
|
- localStorage.setItem("planInfo",'')
|
|
|
+ if (key == "/account/accountIndex") {
|
|
|
+ this.routeReload()
|
|
|
}
|
|
|
- // if(!this.linkList.includes('/modules/BatchCreate/newGroup')&&!this.linkList.includes('/modules/BatchCreate/newPlan')&&!this.linkList.includes('/modules/BatchCreate/newCreate')){
|
|
|
+
|
|
|
+ if (key == '/modules/BatchCreate/TouTiaoBatch' && !(this.linkList.includes('/modules/BatchCreate/newCreate') ||
|
|
|
+ this.linkList.includes('/modules/BatchCreate/newPlan') || this.linkList.includes(
|
|
|
+ '/modules/BatchCreate/newGroup'))) {
|
|
|
+ localStorage.setItem('accountInfo', '')
|
|
|
+ localStorage.setItem("groupInfo", '')
|
|
|
+ localStorage.setItem("planInfo", '')
|
|
|
+ }
|
|
|
+ // if(!this.linkList.includes('/modules/BatchCreate/newGroup')&&!this.linkList.includes('/modules/BatchCreate/newPlan')&&!this.linkList.includes('/modules/BatchCreate/newCreate')){
|
|
|
// localStorage.setItem("planInfo",'')
|
|
|
// localStorage.setItem("groupInfo",'')
|
|
|
-
|
|
|
+
|
|
|
// }
|
|
|
- if(key=='/modules/BatchCreate/newGroup'&&!(this.linkList.includes('/modules/BatchCreate/newCreate') || this.linkList.includes('/modules/BatchCreate/newPlan') ||this.linkList.includes('/modules/BatchCreate/TouTiaoBatch') )){
|
|
|
+ if (key == '/modules/BatchCreate/newGroup' && !(this.linkList.includes('/modules/BatchCreate/newCreate') || this
|
|
|
+ .linkList.includes('/modules/BatchCreate/newPlan') || this.linkList.includes(
|
|
|
+ '/modules/BatchCreate/TouTiaoBatch'))) {
|
|
|
console.log('newGroup')
|
|
|
- localStorage.setItem('accountInfo','')
|
|
|
- localStorage.setItem("groupInfo",'')
|
|
|
+ localStorage.setItem('accountInfo', '')
|
|
|
+ localStorage.setItem("groupInfo", '')
|
|
|
}
|
|
|
- if(key=='/modules/BatchCreate/newPlan'&&!(this.linkList.includes('/modules/BatchCreate/newCreate') || this.linkList.includes('/modules/BatchCreate/newGroup') ||this.linkList.includes('/modules/BatchCreate/TouTiaoBatch') )){
|
|
|
+ if (key == '/modules/BatchCreate/newPlan' && !(this.linkList.includes('/modules/BatchCreate/newCreate') || this
|
|
|
+ .linkList.includes('/modules/BatchCreate/newGroup') || this.linkList.includes(
|
|
|
+ '/modules/BatchCreate/TouTiaoBatch'))) {
|
|
|
console.log('newPlan')
|
|
|
- localStorage.setItem('accountInfo','')
|
|
|
- localStorage.setItem("groupInfo",'')
|
|
|
- localStorage.setItem("planInfo",'')
|
|
|
+ localStorage.setItem('accountInfo', '')
|
|
|
+ localStorage.setItem("groupInfo", '')
|
|
|
+ localStorage.setItem("planInfo", '')
|
|
|
}
|
|
|
- if(key=='/modules/BatchCreate/newCreate'&&!(this.linkList.includes('/modules/BatchCreate/TouTiaoBatch') || this.linkList.includes('/modules/BatchCreate/newPlan') ||this.linkList.includes('/modules/BatchCreate/newGroup') )){
|
|
|
+ if (key == '/modules/BatchCreate/newCreate' && !(this.linkList.includes('/modules/BatchCreate/TouTiaoBatch') ||
|
|
|
+ this.linkList.includes('/modules/BatchCreate/newPlan') || this.linkList.includes(
|
|
|
+ '/modules/BatchCreate/newGroup'))) {
|
|
|
console.log('newCreate')
|
|
|
- localStorage.setItem('accountInfo','')
|
|
|
- localStorage.setItem("groupInfo",'')
|
|
|
- localStorage.setItem("planInfo",'')
|
|
|
+ localStorage.setItem('accountInfo', '')
|
|
|
+ localStorage.setItem("groupInfo", '')
|
|
|
+ localStorage.setItem("planInfo", '')
|
|
|
}
|
|
|
-
|
|
|
+ // this.pageList = this.pageList.filter(item => item.fullPath !== key)
|
|
|
+ // let index = this.linkList.indexOf(key)
|
|
|
+ // this.linkList = this.linkList.filter(item => item !== key)
|
|
|
+ // index = index >= this.linkList.length ? this.linkList.length - 1 : index
|
|
|
+ // this.activePage = this.linkList[index]
|
|
|
|
|
|
|
|
|
this.pageList = this.pageList.filter(item => item.fullPath !== key)
|
|
|
let index = this.linkList.indexOf(key)
|
|
|
this.linkList = this.linkList.filter(item => item !== key)
|
|
|
index = index >= this.linkList.length ? this.linkList.length - 1 : index
|
|
|
- // console.log('index',index)
|
|
|
- if(index!=-1){
|
|
|
- this.activePage = this.linkList[index]
|
|
|
- }else{
|
|
|
- // console.log(this.$route.fullPath)
|
|
|
- this.activePage = this.$route.fullPath
|
|
|
+ if (index != -1) {
|
|
|
+ this.activePage = this.linkList[index]
|
|
|
+ } else {
|
|
|
+ this.activePage = this.$route.fullPath
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
},
|
|
|
onContextmenu(e) {
|
|
|
const pagekey = this.getPageKey(e.target)
|