mirror of
https://github.com/jumpserver/lina.git
synced 2025-08-30 12:55:37 +00:00
pref(permission): 资产授权详情页添加动作字段 (#353)
* pref(permission): 资产授权详情页添加动作字段 * pref(permission): 修改翻译 Co-authored-by: jym503558564 <503558564@qq.com>
This commit is contained in:
parent
f6a8e5634b
commit
72ee5f60b9
@ -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 <span>{actionMap}</span>
|
||||
}
|
||||
},
|
||||
{
|
||||
key: this.$t('perms.dateStart'),
|
||||
value: toSafeLocalDateStr(this.object.date_start)
|
||||
|
@ -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')
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user