|
@@ -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]
|
|
@@ -172,10 +172,7 @@
|
|
|
// localStorage.setItem("groupInfo",'')
|
|
|
|
|
|
// }
|
|
|
- // if(this.linkList.includes('/modules/BatchCreate/newDirectedPackage')){
|
|
|
- // localStorage.setItem("accountInfo",'')
|
|
|
-
|
|
|
- // }
|
|
|
+
|
|
|
},
|
|
|
'activePage': function (key) {
|
|
|
let index = this.linkList.lastIndexOf(key)
|
|
@@ -240,12 +237,15 @@
|
|
|
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,11 +270,47 @@
|
|
|
if (key == "/modules/material/materialList") {
|
|
|
localStorage.removeItem("key")
|
|
|
}
|
|
|
+ if(key=='/modules/BatchCreate/TouTiaoBatch'){
|
|
|
+ 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/newPlan')){
|
|
|
+
|
|
|
+ localStorage.setItem('accountInfo','')
|
|
|
+ localStorage.setItem("groupInfo",'')
|
|
|
+ }
|
|
|
+ if(key=='/modules/BatchCreate/newPlan'&&!this.linkList.includes('/modules/BatchCreate/newCreate')){
|
|
|
+ console.log(1)
|
|
|
+ localStorage.setItem('accountInfo','')
|
|
|
+ localStorage.setItem("groupInfo",'')
|
|
|
+ localStorage.setItem("planInfo",'')
|
|
|
+ }
|
|
|
+ if(key=='/modules/BatchCreate/newCreate'){
|
|
|
+ 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]
|
|
|
+ // console.log('index',index)
|
|
|
+ if(index!=-1){
|
|
|
+ this.activePage = this.linkList[index]
|
|
|
+ }else{
|
|
|
+ // console.log(this.$route.fullPath)
|
|
|
+ this.activePage = this.$route.fullPath
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
onContextmenu(e) {
|
|
|
const pagekey = this.getPageKey(e.target)
|