Compare commits

...

2 Commits

Author SHA1 Message Date
“huailei000”
6644778cd3 fix: 修复左侧菜单英文翻译问题 2022-06-22 16:22:31 +08:00
“huailei000”
f3978263f8 fix: 修复全局组织下不能创建判断;平台列表全局组织可以创建、克隆判断 2022-06-16 15:02:13 +08:00
3 changed files with 15 additions and 6 deletions

View File

@@ -84,15 +84,21 @@ export default {
extraQuery: this.extraQuery extraQuery: this.extraQuery
}) })
const formatterArgs = { const formatterArgs = {
'columnsMeta.actions.formatterArgs.canUpdate': 'change', 'columnsMeta.actions.formatterArgs.canUpdate': () => {
return this.hasActionPerm('change') && !this.currentOrgIsRoot
},
'columnsMeta.actions.formatterArgs.canDelete': 'delete', 'columnsMeta.actions.formatterArgs.canDelete': 'delete',
'columnsMeta.actions.formatterArgs.canClone': 'add', 'columnsMeta.actions.formatterArgs.canClone': () => {
return this.hasActionPerm('add') && !this.currentOrgIsRoot
},
'columnsMeta.name.formatterArgs.can': 'view' 'columnsMeta.name.formatterArgs.can': 'view'
} }
for (const [arg, action] of Object.entries(formatterArgs)) { for (const [arg, action] of Object.entries(formatterArgs)) {
const notSet = _.get(config, arg) === undefined const notSet = _.get(config, arg) === undefined
const isFunction = typeof action === 'function'
if (notSet) { if (notSet) {
_.set(config, arg, this.hasActionPerm(action)) const hasActionPerm = isFunction ? action() : this.hasActionPerm(action)
_.set(config, arg, hasActionPerm)
} }
} }
this.$log.debug('Header actions', this.headerActions) this.$log.debug('Header actions', this.headerActions)

View File

@@ -692,7 +692,7 @@
"AssetPermissionUpdate": "Asset permissions update", "AssetPermissionUpdate": "Asset permissions update",
"AssetUpdate": "Asset update", "AssetUpdate": "Asset update",
"Assets": "Assets", "Assets": "Assets",
"LogsAudits": "Logs audit", "LogsAudit": "Logs audit",
"SessionsAudit": "Sessions audit", "SessionsAudit": "Sessions audit",
"SessionList": "Session list", "SessionList": "Session list",
"BatchCommand": "Batch Command", "BatchCommand": "Batch Command",

View File

@@ -23,7 +23,7 @@ export default {
}, },
actions: { actions: {
formatterArgs: { formatterArgs: {
canClone: vm.$hasPerm('assets.add_platform'), canClone: () => vm.$hasPerm('assets.add_platform'),
canUpdate: ({ row }) => !row.internal && vm.$hasPerm('assets.change_platform'), canUpdate: ({ row }) => !row.internal && vm.$hasPerm('assets.change_platform'),
canDelete: ({ row }) => !row.internal && vm.$hasPerm('assets.delete_platform') canDelete: ({ row }) => !row.internal && vm.$hasPerm('assets.delete_platform')
} }
@@ -34,7 +34,10 @@ export default {
hasRightActions: true, hasRightActions: true,
hasMoreActions: false, hasMoreActions: false,
hasBulkDelete: false, hasBulkDelete: false,
createRoute: 'PlatformCreate' createRoute: 'PlatformCreate',
canCreate: () => {
return this.$hasPerm('assets.add_platform')
}
} }
} }
} }