|
|
@ -1,5 +1,16 @@ |
|
|
|
<template> |
|
|
|
<div class="g-wrr"> |
|
|
|
<div class="g-bread"> |
|
|
|
<el-breadcrumb separator-class="el-icon-arrow-right"> |
|
|
|
<el-breadcrumb-item v-for="item in breadList" :key="item.path" :to="{ path: item.path }"> |
|
|
|
{{ item.meta.title }} |
|
|
|
</el-breadcrumb-item> |
|
|
|
|
|
|
|
</el-breadcrumb> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="g-cpt"> |
|
|
|
|
|
|
|
<div class="g-l"> |
|
|
|
<div class="m-people"> |
|
|
|
<cpt-card> |
|
|
@ -383,6 +394,7 @@ |
|
|
|
:icResiUserId="userId" |
|
|
|
@close="topic.showedInfo = false" /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
@ -399,6 +411,7 @@ export default { |
|
|
|
name: "HomeMap", |
|
|
|
data () { |
|
|
|
return { |
|
|
|
breadList: [], |
|
|
|
showedMoreInfo: false, |
|
|
|
showedDemandInfo: false, |
|
|
|
|
|
|
@ -516,7 +529,12 @@ export default { |
|
|
|
incidentInfo, |
|
|
|
topicInfo, |
|
|
|
}, |
|
|
|
|
|
|
|
beforeRouteEnter(to, from, next) { |
|
|
|
const arr = [ {...from }, { ...to, meta: { title: '人员图谱'}}] |
|
|
|
next((vm) =>{ |
|
|
|
vm.breadList = [ ...arr ] |
|
|
|
}) |
|
|
|
}, |
|
|
|
watch: { |
|
|
|
uid (id) { |
|
|
|
this.userId = id; |
|
|
@ -525,14 +543,52 @@ export default { |
|
|
|
this.getApiData(); |
|
|
|
window.scrollTo(0, 0); |
|
|
|
}, |
|
|
|
$route(route) { |
|
|
|
// if you go to the redirect page, do not update the breadcrumbs |
|
|
|
if (route.path.startsWith('/redirect/')) { |
|
|
|
return |
|
|
|
} |
|
|
|
// this.getBreadcrumb() |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
async mounted () { |
|
|
|
this.userId = this.uid; |
|
|
|
this.getApiData(); |
|
|
|
}, |
|
|
|
deactivated() { |
|
|
|
this.breadList = [] |
|
|
|
console.log('breadList-----', this.breadList) |
|
|
|
}, |
|
|
|
destroyed() { |
|
|
|
|
|
|
|
this.breadList = [] |
|
|
|
console.log('breadList-----', this.breadList) |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
getBreadcrumb() { |
|
|
|
// only show routes with meta.title |
|
|
|
console.log('routest----', this.$route) |
|
|
|
let matched = this.$route.matched.filter( |
|
|
|
(item) => item.meta && item.meta.title |
|
|
|
) |
|
|
|
const first = matched[0] |
|
|
|
|
|
|
|
if (!this.isDashboard(first)) { |
|
|
|
matched = [{ path: '/home', meta: { title: '首页' } }].concat(matched) |
|
|
|
} |
|
|
|
|
|
|
|
this.breadList = matched.filter( |
|
|
|
(item) => item.meta && item.meta.title && item.meta.breadcrumb !== false |
|
|
|
) |
|
|
|
}, |
|
|
|
isDashboard(route) { |
|
|
|
const name = route && route.name |
|
|
|
if (!name) { |
|
|
|
return false |
|
|
|
} |
|
|
|
return name.trim().toLocaleLowerCase() === 'Home'.toLocaleLowerCase() |
|
|
|
}, |
|
|
|
handleSearch () { }, |
|
|
|
|
|
|
|
async getApiData () { |
|
|
@ -722,5 +778,19 @@ export default { |
|
|
|
<style |
|
|
|
lang="scss" |
|
|
|
src="@/assets/scss/modules/visual/people.scss" |
|
|
|
scoped |
|
|
|
></style> |
|
|
|
scoped> |
|
|
|
</style> |
|
|
|
<style |
|
|
|
lang="scss" |
|
|
|
scoped> |
|
|
|
.g-bread { |
|
|
|
padding: 10px 20px; |
|
|
|
::v-deep .el-breadcrumb__item { |
|
|
|
font-size: 16px; |
|
|
|
.el-breadcrumb__inner { |
|
|
|
color: #fff; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
</style> |
|
|
|