mirror of
https://github.com/jumpserver/lina.git
synced 2025-08-02 07:27:01 +00:00
perf: update permission action (#4765)
Co-authored-by: ibuler <ibuler@qq.com>
This commit is contained in:
parent
dd1a4a5c18
commit
e9bb18ec2f
@ -89,6 +89,7 @@ export default {
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
// console.log('Method: ', this.method)
|
||||
this.optionUrlMetaAndGenerateColumns()
|
||||
},
|
||||
methods: {
|
||||
|
@ -47,6 +47,9 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
iValue() {
|
||||
if (!this.value) {
|
||||
return []
|
||||
}
|
||||
return this.value.map(item => {
|
||||
if (item.value) {
|
||||
return item.value
|
||||
|
@ -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>
|
||||
|
||||
|
@ -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'
|
||||
|
@ -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'
|
||||
},
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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">
|
||||
|
@ -103,6 +103,7 @@ export default {
|
||||
}
|
||||
},
|
||||
org_id: {
|
||||
label: this.$t('Organization'),
|
||||
component: Select2,
|
||||
el: {
|
||||
multiple: false,
|
||||
|
Loading…
Reference in New Issue
Block a user