index.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <template>
  2. <base-side-page
  3. @cancel="cancelSidePage"
  4. :title="$t('monitor.text_17')"
  5. icon="res-alertresource"
  6. :res-name="detailData.name"
  7. :current-tab="params.windowData.currentTab"
  8. :tabs="detailTabs"
  9. :loaded="loaded"
  10. @tab-change="handleTabChange">
  11. <!-- <template v-slot:actions>
  12. <actions
  13. :options="singleActions"
  14. :row="detailData"
  15. button-type="link"
  16. button-size="small" />
  17. </template> -->
  18. <component
  19. :is="params.windowData.currentTab"
  20. :listId="listId"
  21. :id="listId"
  22. :resId="data.id"
  23. :alertId="data.id"
  24. :data="detailData"
  25. :resource="resource"
  26. :on-manager="onManager"
  27. :getParams="getParams" />
  28. </base-side-page>
  29. </template>
  30. <script>
  31. import AlertrecortList from '@Monitor/views/alertrecord/components/List'
  32. import SidePageMixin from '@/mixins/sidePage'
  33. import WindowsMixin from '@/mixins/windows'
  34. import Actions from '@/components/PageList/Actions'
  35. // import SingleActionsMixin from '../mixins/singleActions'
  36. import ColumnsMixin from '../mixins/columns'
  37. import CommonalertDetail from './Detail'
  38. export default {
  39. name: 'AlertResourceSidePage',
  40. components: {
  41. CommonalertDetail,
  42. Actions,
  43. AlertrecortList,
  44. },
  45. mixins: [SidePageMixin, WindowsMixin, ColumnsMixin],
  46. computed: {
  47. listId () {
  48. switch (this.params.windowData.currentTab) {
  49. case 'event-drawer':
  50. return 'EventListForHostSidePage'
  51. case 'commonalert-detail':
  52. return 'CommonalertDetailSidePage'
  53. case 'AlertrecortList':
  54. return 'AlertrecortListSidePage'
  55. default:
  56. return ''
  57. }
  58. },
  59. detailTabs () {
  60. const tabs = [
  61. { label: this.$t('sidepage.tab.label.detail'), key: 'commonalert-detail' },
  62. ]
  63. if (this.data.id) {
  64. tabs.splice(1, 0, { label: this.$t('monitor.text_10'), key: 'AlertrecortList' })
  65. }
  66. return tabs
  67. },
  68. getParams () {
  69. const param = {
  70. alert_id: this.params.options.alert_id,
  71. }
  72. if (this.params.windowData.currentTab === 'AlertrecortList') {
  73. param.res_id = this.data.id
  74. }
  75. return param
  76. },
  77. },
  78. }
  79. </script>