index.vue 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <template>
  2. <base-side-page
  3. @cancel="cancelSidePage"
  4. :title="$t('dictionary.role')"
  5. icon="res-role"
  6. :res-name="detailData.name"
  7. :actions="params.actions"
  8. :current-tab="params.windowData.currentTab"
  9. :tabs="detailTabs"
  10. :loaded="loaded"
  11. @tab-change="handleTabChange">
  12. <template v-slot:actions>
  13. <actions :options="singleActions" :row="detailData" button-type="link" button-size="small" />
  14. </template>
  15. <component
  16. :is="params.windowData.currentTab"
  17. :res-id="data.id"
  18. :id="listId"
  19. :data="detailData"
  20. :onManager="onManager"
  21. :getParams="getParams"
  22. :columns="columns"
  23. :single-refresh-role="singleRefresh"
  24. @tab-change="handleTabChange" />
  25. </base-side-page>
  26. </template>
  27. <script>
  28. import SidePageMixin from '@/mixins/sidePage'
  29. import WindowsMixin from '@/mixins/windows'
  30. import Actions from '@/components/PageList/Actions'
  31. import ColumnsMixin from '../mixins/columns'
  32. import SingleActionsMixin from '../mixins/singleActions'
  33. import RoleDetail from './Detail'
  34. import PoliciesListForRoleSidepage from './Policies'
  35. export default {
  36. name: 'RoleSidePage',
  37. components: {
  38. RoleDetail,
  39. Actions,
  40. PoliciesListForRoleSidepage,
  41. },
  42. mixins: [SidePageMixin, WindowsMixin, ColumnsMixin, SingleActionsMixin],
  43. data () {
  44. return {
  45. detailTabs: [
  46. { label: this.$t('system.text_159'), key: 'role-detail' },
  47. { label: this.$t('res.policy'), key: 'policies-list-for-role-sidepage' },
  48. { label: this.$t('system.text_17'), key: 'event-drawer' },
  49. ],
  50. }
  51. },
  52. computed: {
  53. getParams () {
  54. return null
  55. },
  56. listId () {
  57. switch (this.params.windowData.currentTab) {
  58. case 'event-drawer':
  59. return 'EventListForRoleSidePage'
  60. case 'policies-list-for-role-sidepage':
  61. return 'PoliciesListForRoleSidepage'
  62. default:
  63. return ''
  64. }
  65. },
  66. hiddenActions () {
  67. return this.params.hiddenActions || []
  68. },
  69. },
  70. created () {
  71. if (this.params.tab) this.handleTabChange(this.params.tab)
  72. },
  73. }
  74. </script>