fix: 全局组织系统用户详情页中禁用添加资产 (#694)

* fix: 去掉组织创建保存并继续按钮

* fix: 全局组织系统用户详情页中禁用添加资产

* fix: 全局组织系统用户详情页中禁用添加资产

* fix: 修复bugs

* fix: 修复bugs

Co-authored-by: Orange <orangemtony@gmail.com>
This commit is contained in:
fit2bot 2021-03-18 20:41:42 +08:00 committed by GitHub
parent 4eb5155aed
commit b88c90bb75
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 13 additions and 6 deletions

View File

@ -8,7 +8,7 @@
</tr>
<tr>
<td colspan="2">
<el-button :type="type" size="small" @click="addObjects">{{ $t('common.Add') }}</el-button>
<el-button :type="type" size="small" :disabled="disabled" @click="addObjects">{{ $t('common.Add') }}</el-button>
</td>
</tr>
</table>

View File

@ -1,5 +1,5 @@
<template>
<el-button ref="deleteButton" size="mini" type="danger" :disabled="canDelete" @click="onDelete(col, row, cellValue, reload)">
<el-button ref="deleteButton" size="mini" type="danger" :disabled="iDisabled" @click="onDelete(col, row, cellValue, reload)">
<i class="fa fa-minus" />
</el-button>
</template>
@ -11,8 +11,9 @@ export default {
name: 'DeleteActionFormatter',
extends: BaseFormatter,
computed: {
canDelete() {
return this.iCanDelete()
iDisabled() {
//
return (this.disabled() || this.$store.getters.currentOrgIsRoot)
}
},
methods: {
@ -32,7 +33,7 @@ export default {
this.defaultOnDelete(col, row, cellValue, reload)
}
},
iCanDelete() {
disabled() {
if (this.col.objects === 'all') {
return false
}

View File

@ -77,6 +77,7 @@ export default {
name: 'Delete',
title: this.$t('common.Delete'),
type: 'danger',
can: !this.$store.getters.currentOrgIsRoot,
callback: (val) => {
this.$axios.delete(`/api/v1/assets/system-users-assets-relations/${val.row.id}/`).then(() => {
this.$message.success(this.$t('common.deleteSuccessMsg'))
@ -190,6 +191,7 @@ export default {
assetRelationConfig: {
icon: 'fa-edit',
title: this.$t('xpack.ChangeAuthPlan.AddAsset'),
disabled: this.$store.getters.currentOrgIsRoot,
performAdd: (items, that) => {
const relationUrl = `/api/v1/assets/system-users-assets-relations/`
const data = [

View File

@ -63,6 +63,7 @@ export default {
remoteAppRelationConfig: {
icon: 'fa-edit',
title: this.$t('perms.addApplicationToThisPermission'),
disabled: this.$store.getters.currentOrgIsRoot,
objectsAjax: {
url: `/api/v1/applications/applications/?category=${this.object.category}&type=${this.object.type}`,
transformOption: (item) => {

View File

@ -70,6 +70,7 @@ export default {
icon: 'fa-edit',
title: this.$t('perms.addAssetToThisPermission'),
hasObjectsId: this.object.assets,
disabled: this.$store.getters.currentOrgIsRoot,
canSelect: (row, index) => {
return this.object.assets.indexOf(row.id) === -1
},

View File

@ -7,7 +7,7 @@ export const CUSTOM = 'custom'
export const REMOTEAPP_CATEGORY = 'remote_app'
function hasLicence() {
return store.getters.hasLicence
return store.getters.hasValidLicense
}
export const REMOTE_APP = [

View File

@ -73,6 +73,7 @@ export default {
assetRelationConfig: {
icon: 'fa-edit',
title: this.$t('xpack.ChangeAuthPlan.AddAsset'),
disabled: this.$store.getters.currentOrgIsRoot,
canSelect: (row, index) => {
return this.object.assets.indexOf(row.id) === -1
},
@ -99,6 +100,7 @@ export default {
return { label: item.full_value, value: item.id }
}
},
disabled: this.$store.getters.currentOrgIsRoot,
hasObjectsId: this.object.nodes,
performAdd: (items, that) => {
const relationUrl = `/api/v1/xpack/change-auth-plan/plan/${this.object.id}/`