mirror of
https://github.com/jumpserver/lina.git
synced 2025-08-01 07:01:26 +00:00
fix: 全局组织系统用户详情页中禁用添加资产 (#694)
* fix: 去掉组织创建保存并继续按钮 * fix: 全局组织系统用户详情页中禁用添加资产 * fix: 全局组织系统用户详情页中禁用添加资产 * fix: 修复bugs * fix: 修复bugs Co-authored-by: Orange <orangemtony@gmail.com>
This commit is contained in:
parent
4eb5155aed
commit
b88c90bb75
@ -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>
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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 = [
|
||||
|
@ -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) => {
|
||||
|
@ -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
|
||||
},
|
||||
|
@ -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 = [
|
||||
|
@ -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}/`
|
||||
|
Loading…
Reference in New Issue
Block a user