index.vue 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <template>
  2. <base-side-page
  3. @cancel="cancelSidePage"
  4. :title="$t('dictionary.notify-topic')"
  5. icon="res-notify-topic"
  6. :res-name="resName"
  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 :is="params.windowData.currentTab" :id="listId" :res-id="data.id" :data="detailData" :onManager="onManager" :getParams="getParams" />
  16. </base-side-page>
  17. </template>
  18. <script>
  19. import { mapGetters } from 'vuex'
  20. import Subscriber from '@IAM/views/notify-subscriber/components/List'
  21. import { NOTIFY_TOPIC_NAMES_MAP } from '@IAM/constants'
  22. import ColumnsMixin from '../mixins/columns'
  23. import SingleActionsMixin from '../mixins/singleActions'
  24. import TopicDetail from './Detail'
  25. import SidePageMixin from '@/mixins/sidePage'
  26. import WindowsMixin from '@/mixins/windows'
  27. import Actions from '@/components/PageList/Actions'
  28. export default {
  29. name: 'NotifyTopicSidePage',
  30. components: {
  31. Subscriber,
  32. TopicDetail,
  33. Actions,
  34. },
  35. mixins: [SidePageMixin, WindowsMixin, ColumnsMixin, SingleActionsMixin],
  36. data () {
  37. return {
  38. detailTabs: [
  39. { label: this.$t('system.text_159'), key: 'topic-detail' },
  40. { label: this.$t('system.notify.topic.receiver.management'), key: 'subscriber' },
  41. { label: this.$t('system.text_17'), key: 'event-drawer' },
  42. ],
  43. }
  44. },
  45. computed: {
  46. ...mapGetters(['isAdminMode']),
  47. listId () {
  48. switch (this.params.windowData.currentTab) {
  49. case 'subscriber':
  50. return 'Subscriber'
  51. case 'event-drawer':
  52. return 'EventListForNotifySidePage'
  53. default:
  54. return ''
  55. }
  56. },
  57. resName () {
  58. return NOTIFY_TOPIC_NAMES_MAP[this.detailData.name] || this.detailData.name || '-'
  59. },
  60. getParams () {
  61. return null
  62. },
  63. },
  64. created () {
  65. if (this.params.tab) this.handleTabChange(this.params.tab)
  66. },
  67. }
  68. </script>
  69. <style scoped>
  70. </style>