Commit 7a3d5122 by 冒粤蓉

fix

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