fix: 修复审计员可以点击dashboard页面的资产/用户总数的问题

This commit is contained in:
Bai
2021-07-13 13:42:37 +08:00
committed by Jiangjie.Bai
parent 41c5ac5f12
commit fef38ea007
2 changed files with 16 additions and 3 deletions

View File

@@ -10,7 +10,10 @@
</div>
<slot>
<h1 class="no-margins">
<router-link :to="body.route">
<span v-if="body.noLink">
{{ body.count }}
</span>
<router-link v-else :to="body.route">
<span>{{ body.count }}</span>
</router-link>
</h1>

View File

@@ -8,6 +8,8 @@
<script>
import SummaryCard from '@/components/SummaryCard'
import rolc from '@/utils/role'
import { mapGetters } from 'vuex'
export default {
name: 'ResourceSummary',
@@ -23,6 +25,12 @@ export default {
}
},
computed: {
...mapGetters([
'currentOrgRoles'
]),
isOrgAuditor() {
return rolc.getRolesDisplay(this.currentOrgRoles).includes('OrgAuditor') || rolc.getRolesDisplay(this.currentOrgRoles).includes('Auditor')
},
summaryItems() {
return [
{
@@ -34,7 +42,8 @@ export default {
body: {
route: `/users/users`,
count: this.counter.total_count_users,
comment: 'All users'
comment: 'All users',
noLink: this.isOrgAuditor
}
},
{
@@ -46,7 +55,8 @@ export default {
body: {
route: `/assets/assets`,
count: this.counter.total_count_assets,
comment: 'All assets'
comment: 'All assets',
noLink: this.isOrgAuditor
}
},
{