Commit 7a3d5122 by 冒粤蓉

fix

1 parent ff878714
......@@ -75,26 +75,21 @@ export default {
},
methods: {
getBreadcrumb() {
const { getters: {curBreadCrumb}} = this.$root.parentVuex;
let matched = this.$route.matched.filter(item => item.name); // this.$route.matched 可以获取到一个数组,包含当前路由的所有嵌套路径片段的路由记录
const first = matched[0];
const { meta, path } = first;
const basePath = '/oEshield#';
let breadcrumb = [];
if(meta) {
const { title, parentTitle, parentPath } = meta;
if(parentTitle) {
breadcrumb.push({
name: parentTitle,
path: basePath + parentPath
})
}
if(title) {
const { title, pushState } = meta;
if(pushState && title) {
breadcrumb.push({
name: title,
path: basePath + path
})
this.$root.parentVuex.dispatch('menu/setBreadCrumb', [...curBreadCrumb, breadcrumb[0]]);
}
this.$root.parentVuex.dispatch('menu/setBreadCrumb', breadcrumb);
}
},
toggle(){
......
......@@ -820,7 +820,8 @@ export default{
message: '提交成功',
type: 'success'
});
this.$router.push({path:"fenceManagement"})
history.go(-1);
// this.$router.push({path:"fenceManagement"})
} else {
this.$message({
message: res.message,
......@@ -840,7 +841,8 @@ export default{
});
}
this.submitting = false;
this.$router.push({path:"fenceManagement"})
history.go(-1);
// this.$router.push({path:"fenceManagement"})
});
}
......@@ -851,7 +853,8 @@ export default{
},
cancel(){
this.$router.push({path:"fenceManagement"})
window.history.go(-1);
// this.$router.push({path:"fenceManagement"})
},
getParams(){
const form = this.form;
......
......@@ -239,9 +239,8 @@ const routes = [
path: 'editFence',
name: 'editFence',
meta: {
title:'新增围栏',
parentTitle: '试驶线路管理',
parentPath: '/monitor/fenceManagement'
title:'新增围栏',
pushState: true
},
component: editFence,
notMenu: true,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!