index.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <template>
  2. <base-side-page
  3. @cancel="cancelSidePage"
  4. :title="$t('dictionary.vpc_network')"
  5. icon="res-vpc-network"
  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. :on-manager="onManager"
  21. :columns="columns"
  22. :getParams="getParams"
  23. taskResource="compute-tasks"
  24. @side-page-trigger-handle="sidePageTriggerHandle"
  25. @init-side-page-tab="initSidePageTab"
  26. @refresh="refresh"
  27. @single-refresh="singleRefresh"
  28. @tab-change="handleTabChange" />
  29. </base-side-page>
  30. </template>
  31. <script>
  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 Detail from './Detail'
  38. import Vpc from './Vpc'
  39. import RouteSet from './RouteSet'
  40. export default {
  41. name: 'VpcNetworkSidePage',
  42. components: {
  43. Detail,
  44. Vpc,
  45. RouteSet,
  46. Actions,
  47. },
  48. mixins: [SidePageMixin, WindowsMixin, ColumnsMixin, SingleActionsMixin],
  49. data () {
  50. return {
  51. }
  52. },
  53. computed: {
  54. detailTabs () {
  55. const tabs = [
  56. { label: this.$t('network.text_67'), key: 'detail' },
  57. { label: 'VPC', key: 'vpc' },
  58. { label: this.$t('network.vpc_network.route'), key: 'route-set' },
  59. { label: this.$t('table.title.task'), key: 'task-drawer' },
  60. { label: this.$t('network.text_150'), key: 'event-drawer' },
  61. ]
  62. return tabs
  63. },
  64. getParams () {
  65. if (this.params.windowData.currentTab === 'vpc') {
  66. return { details: true, inter_vpc_network_id: this.detailData.id }
  67. }
  68. return null
  69. },
  70. listId () {
  71. switch (this.params.windowData.currentTab) {
  72. case 'event-drawer':
  73. return 'EventListForVpcSidePage'
  74. default:
  75. return ''
  76. }
  77. },
  78. },
  79. created () {
  80. if (this.params.tab) {
  81. this.handleTabChange(this.params.tab)
  82. }
  83. },
  84. }
  85. </script>