Detail.vue 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <template>
  2. <detail
  3. :onManager="onManager"
  4. :data="data"
  5. :base-info="baseInfo"
  6. :isEditName="false" />
  7. </template>
  8. <script>
  9. import WindowsMixin from '@/mixins/windows'
  10. import {
  11. getPublicScopeTableColumn,
  12. } from '@/utils/common/tableColumn'
  13. export default {
  14. name: 'RoleDetail',
  15. mixins: [WindowsMixin],
  16. props: {
  17. data: {
  18. type: Object,
  19. required: true,
  20. },
  21. onManager: {
  22. type: Function,
  23. required: true,
  24. },
  25. },
  26. data () {
  27. return {
  28. baseInfo: [
  29. // {
  30. // field: 'match_policies',
  31. // title: this.$t('system.text_559'),
  32. // slots: {
  33. // default: ({ row }) => {
  34. // const matchPolicies = row.match_policies || []
  35. // if (matchPolicies.length <= 0) {
  36. // return '-'
  37. // }
  38. // return matchPolicies.map((item, idx) => {
  39. // return [
  40. // <list-body-cell-wrap copy field={item} row={row} hideField message={item}>
  41. // <side-page-trigger
  42. // permission='policies_get'
  43. // name='PolicySidePage'
  44. // id={item}
  45. // vm={this}>{ item }</side-page-trigger>
  46. // </list-body-cell-wrap>,
  47. // ]
  48. // })
  49. // },
  50. // },
  51. // },
  52. {
  53. field: 'match_policies',
  54. title: this.$t('system.text_11'),
  55. slots: {
  56. default: ({ row }) => {
  57. return (
  58. <a onClick={ () => this.$emit('tab-change', 'policies-list-for-role-sidepage') }>{ (row.match_policies && row.match_policies.length) || 0 }</a>
  59. )
  60. },
  61. },
  62. },
  63. {
  64. field: 'user_count',
  65. title: this.$t('system.text_11'),
  66. formatter: ({ cellValue }) => `${cellValue}`,
  67. },
  68. {
  69. field: 'group_count',
  70. title: this.$t('system.role.groups'),
  71. formatter: ({ cellValue }) => `${cellValue}`,
  72. },
  73. {
  74. field: 'project_count',
  75. title: this.$t('system.role.projects'),
  76. formatter: ({ cellValue }) => `${cellValue}`,
  77. },
  78. getPublicScopeTableColumn({ vm: this, resource: 'roles' }),
  79. ],
  80. }
  81. },
  82. }
  83. </script>