index.vue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <template>
  2. <base-side-page
  3. @cancel="cancelSidePage"
  4. :title="$t('compute.pci.passthrough_device_type')"
  5. icon="passthrough"
  6. :res-name="detailData.dev_type"
  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. :on-manager="onManager"
  21. :getParams="getParams"
  22. @refresh="refresh"
  23. @single-refresh="singleRefresh"
  24. @tab-change="handleTabChange" />
  25. </base-side-page>
  26. </template>
  27. <script>
  28. import SingleActionsMixin from '../mixins/singleActions'
  29. import ColumnsMixin from '../mixins/columns'
  30. import PciDetail from './Detail'
  31. import SidePageMixin from '@/mixins/sidePage'
  32. import WindowsMixin from '@/mixins/windows'
  33. import Actions from '@/components/PageList/Actions'
  34. export default {
  35. name: 'PciSidePage',
  36. components: {
  37. PciDetail,
  38. Actions,
  39. },
  40. mixins: [SidePageMixin, WindowsMixin, ColumnsMixin, SingleActionsMixin],
  41. data () {
  42. return {
  43. detailTabs: [
  44. { label: this.$t('compute.text_238'), key: 'pci-detail' },
  45. { label: this.$t('compute.text_240'), key: 'event-drawer' },
  46. ],
  47. }
  48. },
  49. computed: {
  50. getParams () {
  51. return null
  52. },
  53. listId () {
  54. switch (this.params.windowData.currentTab) {
  55. case 'event-drawer':
  56. return 'EventListForPciSidePage'
  57. default:
  58. return ''
  59. }
  60. },
  61. },
  62. created () {
  63. this.initChangeTab()
  64. },
  65. methods: {
  66. initChangeTab () {
  67. if (this.params.tab) {
  68. this.handleTabChange(this.params.tab)
  69. }
  70. },
  71. },
  72. }
  73. </script>