index.vue 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <template>
  2. <base-side-page
  3. @cancel="cancelSidePage"
  4. :title="$t('dictionary.access_group')"
  5. icon="res-access-group"
  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
  14. :options="singleActions"
  15. :row="detailData"
  16. button-type="link"
  17. button-size="small" />
  18. </template>
  19. <component
  20. :is="params.windowData.currentTab"
  21. :id="listId"
  22. :res-id="detailData.id"
  23. :res-type="resType"
  24. :data="detailData"
  25. :getParams="getParams"
  26. :on-manager="onManager"
  27. @side-page-trigger-handle="sidePageTriggerHandle"
  28. @init-side-page-tab="initSidePageTab"
  29. @refresh="refresh"
  30. @single-refresh="singleRefresh"
  31. @tab-change="handleTabChange" />
  32. </base-side-page>
  33. </template>
  34. <script>
  35. import SidePageMixin from '@/mixins/sidePage'
  36. import WindowsMixin from '@/mixins/windows'
  37. import Actions from '@/components/PageList/Actions'
  38. import SingleActionsMixin from '../mixins/singleActions'
  39. import ColumnsMixin from '../mixins/columns'
  40. import AccessGroupDetail from './Detail'
  41. import AccessGroupRule from './Rule'
  42. export default {
  43. name: 'AccessGroupSidePage',
  44. components: {
  45. AccessGroupDetail,
  46. AccessGroupRule,
  47. Actions,
  48. },
  49. mixins: [SidePageMixin, WindowsMixin, ColumnsMixin, SingleActionsMixin],
  50. data () {
  51. return {
  52. detailTabs: [
  53. { label: this.$t('storage.text_81'), key: 'access-group-detail' },
  54. { label: this.$t('dictionary.access_group_rule'), key: 'access-group-rule' },
  55. { label: this.$t('dictionary.actions'), key: 'event-drawer' },
  56. ],
  57. }
  58. },
  59. computed: {
  60. getParams () {
  61. return {
  62. id: this.data.id,
  63. }
  64. },
  65. resType () {
  66. switch (this.params.windowData.currentTab) {
  67. case 'event-drawer':
  68. return 'access_group'
  69. default:
  70. return ''
  71. }
  72. },
  73. listId () {
  74. switch (this.params.windowData.currentTab) {
  75. case 'event-drawer':
  76. return 'EventListForNasSidePage'
  77. default:
  78. return ''
  79. }
  80. },
  81. },
  82. }
  83. </script>