index.vue 2.0 KB

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