diff --git a/src/pages/src/language/en.json b/src/pages/src/language/en.json index bdbf06957..0c8ca166d 100644 --- a/src/pages/src/language/en.json +++ b/src/pages/src/language/en.json @@ -486,6 +486,9 @@ "等": "", "请选择租户或输入租户ID": "Please select a tenant or enter a tenant ID", "当前租户未启用账密登录,无法修改密码": "The current tenant has not enabled password login and cannot change the password", + "非本地数据源,无法重置密码": "Non local data source, unable to reset password", + "非本地数据源,无法移动至组织": "Non local data source, unable to move to organization", + "非本地数据源,无法删除": "Non local data source, unable to delete", "停用成功": "Deactivation successful", "启用成功": "Activation successful", "唯一的管理员不能停用": "The only administrator cannot be deactivated", diff --git a/src/pages/src/language/zh.json b/src/pages/src/language/zh.json index 19dfd6bb4..65a334043 100644 --- a/src/pages/src/language/zh.json +++ b/src/pages/src/language/zh.json @@ -486,6 +486,9 @@ "等": "等", "请选择租户或输入租户ID": "请选择租户或输入租户ID", "当前租户未启用账密登录,无法修改密码": "当前租户未启用账密登录,无法修改密码", + "非本地数据源,无法重置密码": "非本地数据源,无法重置密码", + "非本地数据源,无法移动至组织": "非本地数据源,无法移动至组织", + "非本地数据源,无法删除": "非本地数据源,无法删除", "停用成功": "停用成功", "启用成功": "启用成功", "唯一的管理员不能停用": "唯一的管理员不能停用", diff --git a/src/pages/src/views/organization/components/batch-operation.vue b/src/pages/src/views/organization/components/batch-operation.vue index 975e64116..2267e8589 100644 --- a/src/pages/src/views/organization/components/batch-operation.vue +++ b/src/pages/src/views/organization/components/batch-operation.vue @@ -19,7 +19,7 @@ :key="item" :class="{ 'disabled': item.disabled }" v-bk-tooltips="{ - content: $t('当前租户未启用账密登录,无法修改密码'), + content: item.tips, disabled: !item.disabled }" @click.prevent="() => { @@ -89,7 +89,7 @@ {{ item.text }} @@ -142,7 +142,7 @@ import { clickoutside as vClickoutside, InfoBox, Message } from 'bkui-vue'; import { AngleDown } from 'bkui-vue/lib/icon'; import dayjs from 'dayjs'; -import { onMounted, reactive, ref, watch } from 'vue'; +import { computed, onMounted, reactive, ref, watch } from 'vue'; import CustomFields from '@/components/custom-fields/index.vue'; import passwordInput from '@/components/passwordInput.vue'; @@ -163,6 +163,11 @@ const props = defineProps({ }, }); +/** 是否为本地数据源 */ +const isLocalDataSource = computed(() => { + return appStore.currentTenant?.data_source?.plugin_id === 'local'; +}); + const formData = ref({ newPassword: '', confirmPassword: '', @@ -193,6 +198,8 @@ const dropdownList = ref([ { label: t('移动至组织'), isShow: true, + disabled: !isLocalDataSource.value, + tips: t('非本地数据源,无法移动至组织'), confirmFn: batchCreate, handle: (item: any) => { emits('moveOrg', item); @@ -201,7 +208,8 @@ const dropdownList = ref([ { label: t('重置密码'), key: 'password', - disabled: !props.isEnabledPassword, + disabled: !props.isEnabledPassword && !isLocalDataSource.value, + tips: !props.isEnabledPassword ? t('当前租户未启用账密登录,无法修改密码') : !isLocalDataSource.value ? t('非本地数据源,无法重置密码') : '', handle: () => { const userIds = props.selectList.map(item => item.id); batchPasswordDialogShow.value = true; @@ -238,6 +246,8 @@ const dropdownList = ref([ { label: t('删除'), isShow: true, + disabled: !isLocalDataSource.value, + tips: t('非本地数据源,无法删除'), handle: () => { confirmBatchAction('delete'); }, @@ -245,8 +255,8 @@ const dropdownList = ref([ ]); const userInfoOptions = ref([ - { text: t('续期'), type: 'date', selected: false }, - { text: t('直属上级'), type: 'leader', selected: false }, + { text: t('续期'), type: 'date', selected: false, disabled: false }, + { text: t('直属上级'), type: 'leader', selected: false, disabled: !isLocalDataSource.value }, ]); onMounted(async () => { @@ -270,6 +280,10 @@ watch(infoFormData, (val) => { }, { deep: true, immediate: true }); const selectOption = (selectedItem) => { + if (selectedItem.disabled) { + userInfoVisible.value = false; + return; + } userInfoOptions.value.forEach(item => item.selected = false); selectedItem.selected = true; userInfoVisible.value = false; @@ -431,6 +445,15 @@ const confirmBatchAction = (actionType) => { justify-content: space-between; align-items: center; } + +.is-disabled { + color: #c4c6cc !important; + cursor: not-allowed; + display: flex; + justify-content: space-between; + align-items: center; +} + .icon-check-line { font-size: 14px }