diff --git a/src/components/FormFields/JSONManyToManySelect/index.vue b/src/components/FormFields/JSONManyToManySelect/index.vue index 5686b8807..b2c910728 100644 --- a/src/components/FormFields/JSONManyToManySelect/index.vue +++ b/src/components/FormFields/JSONManyToManySelect/index.vue @@ -46,6 +46,10 @@ export default { attrs: { type: Array, default: () => ([]) + }, + resource: { + type: String, + default: '' } }, data() { @@ -86,8 +90,8 @@ export default { iValue: Object.assign({ type: 'all' }, this.value), ids: this.value.ids || [], types: [ - { name: 'all', label: '全部' }, - { name: 'ids', label: '指定' }, + { name: 'all', label: '全部' + this.resource }, + { name: 'ids', label: '指定' + this.resource }, { name: 'attrs', label: '属性选择' } ], tableConfig: { diff --git a/src/views/acl/AssetAcl/AssetAclCreateUpdate.vue b/src/views/acl/AssetAcl/AssetAclCreateUpdate.vue index a987f0d9d..3373c1b66 100644 --- a/src/views/acl/AssetAcl/AssetAclCreateUpdate.vue +++ b/src/views/acl/AssetAcl/AssetAclCreateUpdate.vue @@ -6,6 +6,8 @@ import GenericCreateUpdatePage from '@/layout/components/GenericCreateUpdatePage' import rules from '@/components/DataForm/rules' import { cleanFormValueForHandleUserAssetAccount } from '../common' +import { userJSONSelectMeta } from '@/views/users/const' +import { assetJSONSelectMeta } from '@/views/assets/const' export default { name: 'AclCreateUpdate', @@ -16,24 +18,19 @@ export default { return { initial: {}, fields: [ - [this.$t('common.Basic'), ['name', 'priority']], + [this.$t('common.Basic'), ['name']], [this.$t('acl.users'), ['users']], [this.$t('acl.host'), ['assets']], [this.$t('acl.account'), ['accounts']], [this.$t('acl.action'), ['action', 'reviewers']], - [this.$t('common.Other'), ['is_active', 'comment']] + [this.$t('common.Other'), ['priority', 'is_active', 'comment']] ], fieldsMeta: { priority: { rules: [rules.Required] }, - assets: { - fields: ['name_group', 'address_group'] - }, - users: { - fields: ['username_group'], - fieldsMeta: {} - }, + assets: assetJSONSelectMeta(this), + users: userJSONSelectMeta(this), accounts: { fields: ['username_group'] }, diff --git a/src/views/acl/CommandAcl/CommandFilterAcl/CommandFilterAclCreateUpdate.vue b/src/views/acl/CommandAcl/CommandFilterAcl/CommandFilterAclCreateUpdate.vue index c1dcfa94c..321cccafc 100644 --- a/src/views/acl/CommandAcl/CommandFilterAcl/CommandFilterAclCreateUpdate.vue +++ b/src/views/acl/CommandAcl/CommandFilterAcl/CommandFilterAclCreateUpdate.vue @@ -10,9 +10,10 @@