perf: update permission action (#4765)

Co-authored-by: ibuler <ibuler@qq.com>
This commit is contained in:
fit2bot 2025-03-12 10:23:54 +08:00 committed by GitHub
parent dd1a4a5c18
commit e9bb18ec2f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 38 additions and 15 deletions

View File

@ -89,6 +89,7 @@ export default {
}
},
mounted() {
// console.log('Method: ', this.method)
this.optionUrlMetaAndGenerateColumns()
},
methods: {

View File

@ -47,6 +47,9 @@ export default {
},
computed: {
iValue() {
if (!this.value) {
return []
}
return this.value.map(item => {
if (item.value) {
return item.value

View File

@ -13,7 +13,9 @@
<span>{{ account.name }}({{ account.username }})</span>
</div>
</div>
<el-button slot="reference" class="link-btn" size="mini" type="text">{{ $t('View') }}</el-button>
<el-button slot="reference" class="link-btn" plain size="mini" type="primary">
{{ $t('View') }} <i class="el-icon-arrow-down" />
</el-button>
</el-popover>
</template>

View File

@ -134,7 +134,14 @@ export default {
//
submitMethod: {
type: [Function, String],
default: ''
default: function() {
const params = this.$route.params
if (params.id) {
return 'put'
} else {
return 'post'
}
}
},
// url function
getUrl: {
@ -273,7 +280,7 @@ export default {
action: '',
actionId: '',
row: {},
method: ''
method: 'post'
}
},
computed: {
@ -299,6 +306,7 @@ export default {
this.$log.debug('Object init is: ', this.object, this.method)
await this.setDrawerMeta()
this.setMethod()
// console.log('Set method: ', this.method, this.action)
try {
const values = await this.getFormValue()
@ -312,7 +320,7 @@ export default {
methods: {
async setDrawerMeta() {
const drawActionMeta = await this.$store.dispatch('common/getDrawerActionMeta')
if (drawActionMeta) {
if (drawActionMeta && drawActionMeta.action) {
this.drawer = true
this.action = drawActionMeta.action
this.row = drawActionMeta.row
@ -325,6 +333,7 @@ export default {
} else {
this.method = this.submitMethod
}
// console.log('Drawer: ', this.drawer, this.submitMethod)
if (this.drawer && !this.submitMethod) {
if (this.action === 'clone' || this.action === 'create') {
this.method = 'post'

View File

@ -6,6 +6,7 @@ import automations from './automations'
import integrations from './integrations'
import security from './security'
import activity from './activity'
import store from '@/store'
export default {
path: '/pam/',
@ -16,7 +17,9 @@ export default {
title: i18n.t('PAM'),
icon: 'pam',
type: 'view',
showNavSwitcher: true,
showNavSwitcher: () => {
return store.getters.consoleOrgs.length > 0
},
permissions: [],
view: 'pam'
},

View File

@ -599,15 +599,15 @@ li.rmenu i.fa {
}
.link-btn {
span {
color: var(--color-link);
}
&:hover, &:focus {
color: var(--color-link);
}
}
//.link-btn {
// span {
// color: var(--color-link);
// }
//
// &:hover, &:focus {
// color: var(--color-link);
// }
//}
.el-table__row {
::-webkit-scrollbar {
@ -664,6 +664,10 @@ li.rmenu i.fa {
.el-form {
margin-top: 20px;
margin-right: 80px;
form {
margin-top: 0;
}
}
}

View File

@ -1,6 +1,6 @@
<template>
<Page>
<div v-if="this.$hasPerm('rbac.view_console')">
<div v-if="$hasPerm('rbac.view_console')">
<Announcement />
<div class="summary-container">

View File

@ -103,6 +103,7 @@ export default {
}
},
org_id: {
label: this.$t('Organization'),
component: Select2,
el: {
multiple: false,