[Update] 修改列表页一些字段显示问题

This commit is contained in:
jym503558564 2020-04-03 15:56:48 +08:00
parent 5d0f221f92
commit ffa21acfba
8 changed files with 52 additions and 25 deletions

View File

@ -18,6 +18,7 @@ const cn = {
'name': '名称', 'name': '名称',
'Name': '名称', 'Name': '名称',
'action': '动作', 'action': '动作',
'Action': '动作',
'role': '角色', 'role': '角色',
'username': '用户名', 'username': '用户名',
'Language': '语言', 'Language': '语言',

View File

@ -28,7 +28,8 @@ export default {
}, },
{ {
prop: 'asset_info', prop: 'asset_info',
label: this.$t('applications.asset') label: this.$t('applications.asset'),
formatter: row => (<span>{row.asset_info.hostname}</span>)
}, },
{ {
prop: 'comment', prop: 'comment',

View File

@ -27,7 +27,7 @@ export default {
label: this.$t('common.username') label: this.$t('common.username')
}, },
{ {
prop: 'assets', prop: 'assets_amount',
label: this.$t('assets.asset') label: this.$t('assets.asset')
}, },
{ {

View File

@ -4,7 +4,7 @@
<script> <script>
import { GenericListPage } from '@/layout/components' import { GenericListPage } from '@/layout/components'
import { DetailFormatter, ActionsFormatter } from '@/components/DataTable/formatters/index' import { DetailFormatter, ActionsFormatter, ChoicesFormatter } from '@/components/DataTable/formatters/index'
export default { export default {
components: { components: {
@ -32,7 +32,8 @@ export default {
}, },
{ {
prop: 'reachable', prop: 'reachable',
label: this.$t('assets.reachable') label: this.$t('assets.reachable'),
formatter: ChoicesFormatter
}, },
{ {
prop: 'id', prop: 'id',

View File

@ -24,11 +24,13 @@ export default {
}, },
{ {
prop: 'rules', prop: 'rules',
label: this.$t('assets.rules') label: this.$t('assets.rules'),
formatter: row => (<span>{row.rules.length}</span>)
}, },
{ {
prop: 'system_users', prop: 'system_users',
label: this.$t('assets.systemUser') label: this.$t('assets.systemUser'),
formatter: row => (<span>{row.system_users.length}</span>)
}, },
{ {
prop: 'comment', prop: 'comment',

View File

@ -4,7 +4,7 @@
<script> <script>
import { GenericListPage } from '@/layout/components' import { GenericListPage } from '@/layout/components'
import { DetailFormatter, ActionsFormatter } from '@/components/DataTable/formatters/index' import { DetailFormatter, ActionsFormatter, ChoicesFormatter } from '@/components/DataTable/formatters/index'
export default { export default {
components: { components: {
@ -24,27 +24,35 @@ export default {
}, },
{ {
prop: 'users', prop: 'users',
label: this.$t('perms.user') label: this.$t('perms.user'),
formatter: row => (<span>{row.users.length}</span>)
}, },
{ {
prop: 'user_groups', prop: 'user_groups',
label: this.$t('perms.userGroup') label: this.$t('perms.userGroup'),
formatter: row => (<span>{row.user_groups.length}</span>)
}, },
{ {
prop: 'assets', prop: 'assets',
label: this.$t('perms.asset') label: this.$t('perms.asset'),
formatter: row => (<span>{row.assets.length}</span>)
}, },
{ {
prop: 'nodes', prop: 'nodes',
label: this.$t('perms.node') label: this.$t('perms.node'),
formatter: row => (<span>{row.nodes.length}</span>)
}, },
{ {
prop: 'system_users', prop: 'system_users',
label: this.$t('perms.systemUser') label: this.$t('perms.systemUser'),
formatter: row => (<span>{row.system_users.length}</span>)
}, },
{ {
prop: 'is_active', prop: 'is_active',
label: this.$t('perms.validity') label: this.$t('perms.validity'),
formatter: ChoicesFormatter,
align: 'center',
width: '80px'
}, },
{ {
prop: 'id', prop: 'id',

View File

@ -4,7 +4,7 @@
<script> <script>
import { GenericListPage } from '@/layout/components' import { GenericListPage } from '@/layout/components'
import { DetailFormatter, ActionsFormatter } from '@/components/DataTable/formatters/index' import { DetailFormatter, ActionsFormatter, ChoicesFormatter } from '@/components/DataTable/formatters/index'
export default { export default {
components: { components: {
@ -24,23 +24,30 @@ export default {
}, },
{ {
prop: 'users', prop: 'users',
label: this.$t('perms.user') label: this.$t('perms.user'),
formatter: row => (<span>{row.users.length}</span>)
}, },
{ {
prop: 'user_groups', prop: 'user_groups',
label: this.$t('perms.userGroup') label: this.$t('perms.userGroup'),
formatter: row => (<span>{row.user_groups.length}</span>)
}, },
{ {
prop: 'database_apps', prop: 'database_apps',
label: this.$t('perms.DatabaseApp') label: this.$t('perms.DatabaseApp'),
formatter: row => (<span>{row.database_apps.length}</span>)
}, },
{ {
prop: 'system_users', prop: 'system_users',
label: this.$t('perms.systemUser') label: this.$t('perms.systemUser'),
formatter: row => (<span>{row.system_users.length}</span>)
}, },
{ {
prop: 'is_valid', prop: 'is_valid',
label: this.$t('perms.validity') label: this.$t('perms.validity'),
formatter: ChoicesFormatter,
align: 'center',
width: '80px'
}, },
{ {
prop: 'id', prop: 'id',

View File

@ -4,7 +4,7 @@
<script> <script>
import { GenericListPage } from '@/layout/components' import { GenericListPage } from '@/layout/components'
import { DetailFormatter, ActionsFormatter } from '@/components/DataTable/formatters/index' import { DetailFormatter, ActionsFormatter, ChoicesFormatter } from '@/components/DataTable/formatters/index'
export default { export default {
components: { components: {
@ -24,23 +24,30 @@ export default {
}, },
{ {
prop: 'users', prop: 'users',
label: this.$t('perms.user') label: this.$t('perms.user'),
formatter: row => (<span>{row.users.length}</span>)
}, },
{ {
prop: 'user_groups', prop: 'user_groups',
label: this.$t('perms.userGroup') label: this.$t('perms.userGroup'),
formatter: row => (<span>{row.user_groups.length}</span>)
}, },
{ {
prop: 'remote_apps', prop: 'remote_apps',
label: this.$t('perms.RemoteApp') label: this.$t('perms.RemoteApp'),
formatter: row => (<span>{row.remote_apps.length}</span>)
}, },
{ {
prop: 'system_users', prop: 'system_users',
label: this.$t('perms.systemUser') label: this.$t('perms.systemUser'),
formatter: row => (<span>{row.system_users.length}</span>)
}, },
{ {
prop: 'is_valid', prop: 'is_valid',
label: this.$t('perms.validity') label: this.$t('perms.validity'),
formatter: ChoicesFormatter,
align: 'center',
width: '80px'
}, },
{ {
prop: 'id', prop: 'id',