diff --git a/src/views/perms/AssetPermission/AssetPermissionDetail/AssetPermissionDetail.vue b/src/views/perms/AssetPermission/AssetPermissionDetail/AssetPermissionDetail.vue index 467784699..a623ea8bb 100644 --- a/src/views/perms/AssetPermission/AssetPermissionDetail/AssetPermissionDetail.vue +++ b/src/views/perms/AssetPermission/AssetPermissionDetail/AssetPermissionDetail.vue @@ -13,6 +13,7 @@ import DetailCard from '@/components/DetailCard' import QuickActions from '@/components/QuickActions' import { toSafeLocalDateStr } from '@/utils/common' +import { ACTIONS_FIELDS_MAP } from './const' export default { name: 'AssetPermissionDetail', @@ -78,6 +79,14 @@ export default { key: this.$t('perms.systemUserCount'), value: this.object.system_users_amount }, + { + key: this.$t('perms.Actions'), + value: this.object.actions, + formatter(row, value) { + const actionMap = value.map(item => ACTIONS_FIELDS_MAP[item].action).join(',') + return {actionMap} + } + }, { key: this.$t('perms.dateStart'), value: toSafeLocalDateStr(this.object.date_start) diff --git a/src/views/perms/AssetPermission/AssetPermissionDetail/const.js b/src/views/perms/AssetPermission/AssetPermissionDetail/const.js new file mode 100644 index 000000000..c02684e0e --- /dev/null +++ b/src/views/perms/AssetPermission/AssetPermissionDetail/const.js @@ -0,0 +1,46 @@ +import i18n from '@/i18n/i18n' + +export const ALL = 'all' +export const CONNECT = 'connect' +export const UPLOAD_FILE = 'upload_file' +export const DOWNLOAD_FILE = 'download_file' +export const UNDOWNLOAD = 'updownload' +export const CLIPBOARD_COPY = 'clipboard_copy' +export const CLIPBOARD_PASTE = 'clipboard_paste' +export const CLIPBOARD_COPY_PASTE = 'clipboard_copy_paste' + +export const ACTIONS_FIELDS_MAP = { + [ALL]: { + name: ALL, + action: i18n.t('perms.all') + }, + [CONNECT]: { + name: CONNECT, + action: i18n.t('perms.connect') + }, + [UPLOAD_FILE]: { + name: UPLOAD_FILE, + action: i18n.t('perms.uploadFile') + }, + [DOWNLOAD_FILE]: { + name: DOWNLOAD_FILE, + action: i18n.t('perms.downloadFile') + }, + [UNDOWNLOAD]: { + name: UNDOWNLOAD, + action: i18n.t('perms.upDownload') + }, + [CLIPBOARD_COPY]: { + name: CLIPBOARD_COPY, + action: i18n.t('perms.clipboardCopy') + }, + [CLIPBOARD_PASTE]: { + name: CLIPBOARD_PASTE, + action: i18n.t('perms.clipboardPaste') + }, + [CLIPBOARD_COPY_PASTE]: { + name: CLIPBOARD_COPY_PASTE, + action: i18n.t('perms.clipboardCopyPaste') + } +} +