Commit f6d550cb by 李少勇

处理路由报错问题

parent e476c783
......@@ -297,33 +297,36 @@ export default {
return newObj;
},
setDefaultTabs() {
// 页签拷贝
this.defaultTabList.forEach((item, index) => {
let newItem = this.deepCloneObj(item);
if (item.path == "/home") {
newItem["width"] = this.homeTagWidth;
newItem["hidden"] = false;
}
this.tabList.push(newItem);
});
// 处理刷新页签不显示问题
let curRoute = this.$route
let flag = this.defaultTabList.some((item) => {
return item.path == curRoute.path
})
if (curRoute.meta.keepAlive && !flag) {
this.defaultTabList.push({
this.tabList.push({
name: curRoute.name,
path: curRoute.fullPath,
text: curRoute.meta.title || 'no-title',
hidden: false,
routePath: curRoute.path,
routeName: curRoute.name
routeName: curRoute.name,
route: curRoute
})
}
// 页签拷贝
this.defaultTabList.forEach((item, index) => {
let newItem = this.deepCloneObj(item);
if (item.path == "/home") {
newItem["width"] = this.homeTagWidth;
newItem["hidden"] = false;
}
this.tabList.push(newItem);
if (item.path != "/home") {
this.tabList.map((ite, index) => {
if (ite.path != "/home") {
this.calcTagsWidth(index, "+", true);
}
});
})
this.$store.commit("setTagsArry", this.tabList);
},
calcTagsWidth(index, calc, callback) {
......
......@@ -581,8 +581,10 @@ export default {
let orgObj = this.header.orgList.find(item => item.id === param)
let roleObj = this.header.roleTypeList.find(item => item.key === this.header.curRole.id+"")
this.initRoleList(orgObj);
if(this.header.roleList && this.header.roleList.length>0 && ((orgObj.departmentNumber==="1000" && roleObj.value!=="HEAD")
||(orgObj.departmentNumber!=="1000" && roleObj.value==="HEAD"))){
if(this.header.roleList &&
this.header.roleList.length>0 &&
((orgObj.departmentNumber==="1000" && roleObj && roleObj.value!=="HEAD") || (orgObj.departmentNumber!=="1000" && (roleObj && roleObj.value==="HEAD")))
){
this.changeRoles(this.header.roleList[0].id);
sessionStorage.setItem('curRole', JSON.stringify(this.header.roleList[0]));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment