fix: 授权规则支持通过 from_ticket 工单过滤

This commit is contained in:
Michael Bai
2021-09-13 20:10:27 +08:00
committed by Jiangjie.Bai
parent 555c8fd2d6
commit 060781443f
4 changed files with 39 additions and 2 deletions

View File

@@ -536,6 +536,7 @@
"downloadFile": "下载文件",
"hostName": "主机名",
"isValid": "有效",
"fromTicket": "来自工单",
"isEffective": "起作用的",
"nodeCount": "节点数量",
"refreshFail": "刷新失败",

View File

@@ -527,6 +527,7 @@
"downloadFile": "Download file",
"hostName": "Hostname",
"isValid": "Validity",
"fromTicket": "From ticket",
"isEffective": "Effective",
"nodeCount": "Node count",
"refreshFail": "Refresh fail",

View File

@@ -53,7 +53,7 @@ export default {
'name', 'type_display', 'category_display',
'users_amount', 'user_groups_amount',
'applications_amount', 'system_users_amount',
'date_expired', 'is_valid',
'date_expired', 'is_valid', 'from_ticket',
'created_by', 'date_created', 'comment', 'org_name', 'actions'
],
columnsShow: {
@@ -119,6 +119,15 @@ export default {
}
}
},
from_ticket: {
formatter(row) {
if (row.from_ticket) {
return vm.$t('common.Yes')
} else {
return vm.$t('common.No')
}
}
},
actions: {
formatterArgs: {
onUpdate: ({ row }) => {

View File

@@ -11,6 +11,7 @@ export default {
GenericTreeListPage
},
data() {
const vm = this
return {
treeSetting: {
showMenu: false,
@@ -31,7 +32,10 @@ export default {
],
columnsShow: {
min: ['name', 'actions'],
default: ['name', 'users_amount', 'user_groups_amount', 'assets_amount', 'nodes_amount', 'system_users_amount', 'is_valid', 'from_ticket', 'actions']
default: [
'name', 'users_amount', 'user_groups_amount', 'assets_amount', 'nodes_amount', 'system_users_amount',
'is_valid', 'actions'
]
},
columnsMeta: {
name: {
@@ -52,6 +56,15 @@ export default {
}
}
},
from_ticket: {
formatter(row) {
if (row.from_ticket) {
return vm.$t('common.Yes')
} else {
return vm.$t('common.No')
}
}
},
user_groups_amount: {
label: this.$t('perms.UserGroups'),
width: '100px',
@@ -129,6 +142,19 @@ export default {
}
]
},
{
label: this.$t('perms.fromTicket'), value: 'from_ticket',
children: [
{
value: '1',
label: this.$t('common.Yes')
},
{
value: '0',
label: this.$t('common.No')
}
]
},
{
label: this.$t('perms.isEffective'), value: 'is_effective',
children: [