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() { mounted() {
// console.log('Method: ', this.method)
this.optionUrlMetaAndGenerateColumns() this.optionUrlMetaAndGenerateColumns()
}, },
methods: { methods: {

View File

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

View File

@ -13,7 +13,9 @@
<span>{{ account.name }}({{ account.username }})</span> <span>{{ account.name }}({{ account.username }})</span>
</div> </div>
</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> </el-popover>
</template> </template>

View File

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

View File

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

View File

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

View File

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

View File

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