diff --git a/src/components/Table/TableFormatters/DiscoverConfirmFormatter.vue b/src/components/Table/TableFormatters/DiscoverConfirmFormatter.vue index ce3806be4..26070f1a5 100644 --- a/src/components/Table/TableFormatters/DiscoverConfirmFormatter.vue +++ b/src/components/Table/TableFormatters/DiscoverConfirmFormatter.vue @@ -6,7 +6,7 @@ <i class="fa fa-check" /> </el-button> <el-dropdown-menu slot="dropdown"> - <el-dropdown-item v-for="item of iActions" :key="item.name" :command="item.name"> + <el-dropdown-item v-for="item of iActions" :key="item.name" :command="item.name" :disabled="item.disabled"> {{ item.label }} </el-dropdown-item> </el-dropdown-menu> @@ -123,17 +123,20 @@ export default { { name: 'delete_remote', label: this.$t('DeleteRemoteAccount'), - has: this.row.remote_present + has: this.row.remote_present, + disabled: this.$store.getters.currentOrgIsRoot }, { name: 'add_account', label: this.$t('AddAccount'), - has: !this.row.present + has: !this.row.present, + disabled: this.$store.getters.currentOrgIsRoot }, { name: 'change_password_add', label: this.$t('AddAccountAfterChangingPassword'), - has: !this.row.present + has: !this.row.present, + disabled: this.$store.getters.currentOrgIsRoot } ] return actions.filter(action => { diff --git a/src/views/accounts/const.js b/src/views/accounts/const.js index 24828a705..a33f38c25 100644 --- a/src/views/accounts/const.js +++ b/src/views/accounts/const.js @@ -1,5 +1,6 @@ import { toSafeLocalDateStr } from '@/utils/time' import { ActionsFormatter, DetailFormatter, DiscoverConfirmFormatter } from '@/components/Table/TableFormatters' + export const statusMap = { pending: '0', confirmed: '1', @@ -135,7 +136,7 @@ export const gatherAccountHeaderActions = (vm) => { type: 'primary', icon: 'fa fa-check', can: ({ selectedRows }) => { - return selectedRows.length > 0 && vm.$hasPerm('accounts.add_account') + return selectedRows.length > 0 && vm.$hasPerm('accounts.add_account') && !vm.$store.getters.currentOrgIsRoot }, callback: function({ selectedRows }) { const ids = selectedRows.map(v => { @@ -157,7 +158,7 @@ export const gatherAccountHeaderActions = (vm) => { type: 'primary', icon: 'fa fa-exchange', can: ({ selectedRows }) => { - return selectedRows.length > 0 && vm.$hasPerm('accounts.remove_account') + return selectedRows.length > 0 && vm.$hasPerm('accounts.remove_account') && !vm.$store.getters.currentOrgIsRoot }, callback: function({ selectedRows }) { vm.gatherAccounts = selectedRows