|
@@ -50,7 +50,7 @@ export default {
|
|
|
top: 0,
|
|
|
left: 0,
|
|
|
selectedTag: {},
|
|
|
- affixTags: []
|
|
|
+ affixTags: [],
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
@@ -59,7 +59,7 @@ export default {
|
|
|
},
|
|
|
routes() {
|
|
|
return this.$store.state.permission.routes;
|
|
|
- }
|
|
|
+ },
|
|
|
},
|
|
|
watch: {
|
|
|
$route() {
|
|
@@ -97,7 +97,7 @@ export default {
|
|
|
},
|
|
|
async "$route.meta.title"(val) {
|
|
|
await this.$store.dispatch("tagsView/addVisitedView", this.$route);
|
|
|
- }
|
|
|
+ },
|
|
|
},
|
|
|
mounted() {
|
|
|
this.initTags();
|
|
@@ -112,14 +112,14 @@ export default {
|
|
|
},
|
|
|
filterAffixTags(routes, basePath = "/") {
|
|
|
let tags = [];
|
|
|
- routes.forEach(route => {
|
|
|
+ routes.forEach((route) => {
|
|
|
if (route.meta && route.meta.affix) {
|
|
|
const tagPath = path.resolve(basePath, route.path);
|
|
|
tags.push({
|
|
|
fullPath: tagPath,
|
|
|
path: tagPath,
|
|
|
name: route.name,
|
|
|
- meta: { ...route.meta }
|
|
|
+ meta: { ...route.meta },
|
|
|
});
|
|
|
}
|
|
|
if (route.children) {
|
|
@@ -160,7 +160,7 @@ export default {
|
|
|
return keyName;
|
|
|
},
|
|
|
syncTagViewAndSaveForm() {
|
|
|
- const keys = this.$store.state.tagsView.visitedViews.map(item => {
|
|
|
+ const keys = this.$store.state.tagsView.visitedViews.map((item) => {
|
|
|
// (item)
|
|
|
return item.path;
|
|
|
});
|
|
@@ -216,27 +216,32 @@ export default {
|
|
|
const { fullPath } = view;
|
|
|
this.$nextTick(() => {
|
|
|
this.$router.replace({
|
|
|
- path: "/redirect" + fullPath
|
|
|
+ path: "/redirect" + fullPath,
|
|
|
});
|
|
|
});
|
|
|
});
|
|
|
},
|
|
|
closeSelectedTag(view) {
|
|
|
+ console.log(view, "closeSelectedTag");
|
|
|
+ // 为了处理拦截问题
|
|
|
+ if (view.path == "/process/create-ticket") {
|
|
|
+ this.$confirm("您的申请尚未提交,是否确认返回?", "提示", {
|
|
|
+ confirmButtonText: "确认",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ }).then(() => {
|
|
|
+ sessionStorage.setItem("create_ticket_status", 1);
|
|
|
+ setTimeout(() => {
|
|
|
+ this.selectCloseTag(view);
|
|
|
+ }, 20);
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.selectCloseTag(view);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ selectCloseTag(view) {
|
|
|
const searchs = new Searchs();
|
|
|
searchs.remove(this.$route.path);
|
|
|
- // this.$store
|
|
|
- // .dispatch("delVisitedViews", { ...view, dontNeedSave: true })
|
|
|
- // .then(views => {
|
|
|
- // if (this.isActive(view)) {
|
|
|
- // const latestView = views.slice(-1)[0];
|
|
|
- // if (latestView) {
|
|
|
- // this.$router.push(latestView.fullPath);
|
|
|
- // } else {
|
|
|
- // let firstMenuUrl = localStorage.getItem("firstMenuUrl");
|
|
|
- // this.$router.push(firstMenuUrl || "/");
|
|
|
- // }
|
|
|
- // }
|
|
|
- // });
|
|
|
this.$store
|
|
|
.dispatch("tagsView/delView", view)
|
|
|
.then(({ visitedViews }) => {
|
|
@@ -263,7 +268,7 @@ export default {
|
|
|
},
|
|
|
closeAllTags(view) {
|
|
|
this.$store.dispatch("tagsView/delAllViews").then(({ visitedViews }) => {
|
|
|
- if (this.affixTags.some(tag => tag.path === view.path)) {
|
|
|
+ if (this.affixTags.some((tag) => tag.path === view.path)) {
|
|
|
return;
|
|
|
}
|
|
|
this.toLastView(visitedViews, view);
|
|
@@ -303,8 +308,8 @@ export default {
|
|
|
},
|
|
|
closeMenu() {
|
|
|
this.visible = false;
|
|
|
- }
|
|
|
- }
|
|
|
+ },
|
|
|
+ },
|
|
|
};
|
|
|
</script>
|
|
|
|