Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
micro-customization-system
/
system
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 2195b72a
authored
Jun 03, 2021
by
胡悦
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'master' of 192.168.3.233:micro-customization-system/system
2 parents
9fb2b8f0
f424f4f4
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
29 deletions
src/App.vue
src/main.js
src/routes/index.js
src/App.vue
View file @
2195b72
...
@@ -35,8 +35,35 @@ export default {
...
@@ -35,8 +35,35 @@ export default {
isQiankun
:
window
.
__POWERED_BY_QIANKUN__
,
isQiankun
:
window
.
__POWERED_BY_QIANKUN__
,
}
}
},
},
watch
:
{
$route
(
to
,
from
)
{
if
(
this
.
isQiankun
)
{
this
.
getBreadcrumb
();
}
}
},
methods
:
{
methods
:
{
...
mapMutations
([
'updateBaseURL'
]),
...
mapMutations
([
'updateBaseURL'
]),
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
=
'/system#'
;
let
breadcrumb
=
[];
if
(
meta
)
{
const
{
title
,
pushState
}
=
meta
;
if
(
pushState
&&
title
)
{
breadcrumb
.
push
({
name
:
title
,
path
:
basePath
+
path
})
history
.
state
.
pushState
=
pushState
;
history
.
state
.
breadcrumb
=
[...
curBreadCrumb
,
breadcrumb
[
0
]];
// this.$root.parentVuex.dispatch('menu/setBreadCrumb', [...curBreadCrumb, breadcrumb[0]]);
}
}
},
goToPage
(
path
)
{
goToPage
(
path
)
{
this
.
$root
.
parentRouter
.
push
(
path
);
this
.
$root
.
parentRouter
.
push
(
path
);
}
}
...
...
src/main.js
View file @
2195b72
...
@@ -39,27 +39,6 @@ function render({ data = {} , container } = {}) {
...
@@ -39,27 +39,6 @@ function render({ data = {} , container } = {}) {
},
},
render
:
h
=>
h
(
App
),
render
:
h
=>
h
(
App
),
}).
$mount
(
container
?
container
.
querySelector
(
'#glsx-sub-system'
)
:
'#glsx-sub-system'
);
}).
$mount
(
container
?
container
.
querySelector
(
'#glsx-sub-system'
)
:
'#glsx-sub-system'
);
router
.
beforeEach
((
to
,
from
,
next
)
=>
{
const
metaTitle
=
to
.
meta
.
title
;
const
thisBreadCrumb
=
data
.
store
.
getters
.
curBreadCrumb
;
if
(
metaTitle
)
{
if
(
thisBreadCrumb
)
{
let
nextChildren
=
{};
nextChildren
=
{
active
:
true
,
menuName
:
metaTitle
,
path
:
'/system#'
+
to
.
path
,
params
:
to
.
params
};
thisBreadCrumb
.
children
.
children
=
nextChildren
;
}
}
else
{
thisBreadCrumb
.
children
.
children
=
''
;
}
data
.
store
.
dispatch
(
'menu/setBreadCrumb'
,
thisBreadCrumb
);
next
();
})
}
}
if
(
!
window
.
__POWERED_BY_QIANKUN__
)
{
if
(
!
window
.
__POWERED_BY_QIANKUN__
)
{
...
...
src/routes/index.js
View file @
2195b72
import
Vue
from
'vue'
import
Vue
from
'vue'
import
VueRouter
from
'vue-router'
import
VueRouter
from
'vue-router'
import
Home
from
'../views/Home.vue'
Vue
.
use
(
VueRouter
)
Vue
.
use
(
VueRouter
)
const
routes
=
[
const
routes
=
[
{
{
path
:
'/'
,
path
:
'/'
,
name
:
'User'
,
name
:
'user'
,
meta
:
{
title
:
'用户管理'
},
component
:
()
=>
import
(
'../views/user/index.vue'
)
component
:
()
=>
import
(
'../views/user/index.vue'
)
},
},
{
{
path
:
'/user'
,
path
:
'/user'
,
name
:
'User'
,
name
:
'user'
,
meta
:
{
title
:
'用户管理'
},
component
:
()
=>
import
(
'../views/user/index.vue'
)
component
:
()
=>
import
(
'../views/user/index.vue'
)
},
},
{
{
path
:
'/role'
,
path
:
'/role'
,
name
:
'Role'
,
name
:
'role'
,
meta
:
{
title
:
'角色管理'
},
component
:
()
=>
import
(
'../views/role/index.vue'
)
component
:
()
=>
import
(
'../views/role/index.vue'
)
},
},
{
{
path
:
'/orginizaManage'
,
path
:
'/orginizaManage'
,
name
:
'OrginizaManage'
,
name
:
'orginizaManage'
,
meta
:
{
title
:
'组织管理'
},
component
:
()
=>
import
(
'../views/orginizaManage/index.vue'
)
component
:
()
=>
import
(
'../views/orginizaManage/index.vue'
)
},
},
{
{
path
:
'/menuManage'
,
path
:
'/menuManage'
,
name
:
'MenuManage'
,
name
:
'menuManage'
,
meta
:
{
title
:
'菜单管理'
},
component
:
()
=>
import
(
'../views/menuManage/index.vue'
)
component
:
()
=>
import
(
'../views/menuManage/index.vue'
)
},
},
{
{
path
:
'/dictionaryManage'
,
path
:
'/dictionaryManage'
,
name
:
'DictionaryManage'
,
name
:
'dictionaryManage'
,
meta
:
{
title
:
'字典管理'
},
component
:
()
=>
import
(
'../views/dictionaryManage/index.vue'
)
component
:
()
=>
import
(
'../views/dictionaryManage/index.vue'
)
},
},
{
{
path
:
'/dictionaryManage/dictionaryData'
,
path
:
'/dictionaryManage/dictionaryData'
,
name
:
'dictionaryData'
,
name
:
'dictionaryData'
,
meta
:
{
title
:
'字典数据'
},
meta
:
{
title
:
'字典数据'
,
pushState
:
true
},
component
:
()
=>
import
(
'../views/dictionaryManage/dictionaryData/index.vue'
)
component
:
()
=>
import
(
'../views/dictionaryManage/dictionaryData/index.vue'
)
},
},
{
{
path
:
'/workLog'
,
path
:
'/workLog'
,
name
:
'workLog'
,
name
:
'workLog'
,
meta
:
{
title
:
'操作日志'
},
component
:
()
=>
import
(
'../views/workLog/index.vue'
)
component
:
()
=>
import
(
'../views/workLog/index.vue'
)
}
}
]
]
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment