Vpc.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <template>
  2. <div>
  3. <page-list
  4. :hideRowselect="true"
  5. :list="list"
  6. :columns="columns"
  7. :group-actions="groupActions"
  8. :single-actions="singleActions" />
  9. </div>
  10. </template>
  11. <script>
  12. import * as R from 'ramda'
  13. import {
  14. getCopyWithContentTableColumn,
  15. getRegionTableColumn,
  16. getBrandTableColumn,
  17. getAccountTableColumn,
  18. } from '@/utils/common/tableColumn'
  19. import {
  20. getRegionFilter,
  21. getAccountFilter,
  22. getCloudProviderFilter,
  23. } from '@/utils/common/tableFilter'
  24. import WindowsMixin from '@/mixins/windows'
  25. export default {
  26. name: 'vpcListForVpcPeerConnectSidePage',
  27. mixins: [WindowsMixin],
  28. props: {
  29. resId: String,
  30. data: {
  31. type: Object,
  32. required: true,
  33. },
  34. getParams: [Function, Object],
  35. },
  36. data () {
  37. return {
  38. list: this.$list.createList(this, {
  39. id: 'vpcListForVpcPeerConnectSidePage',
  40. resource: 'vpcs',
  41. getParams: this.getParam,
  42. filterOptions: {
  43. name: {
  44. label: this.$t('network.text_21'),
  45. filter: true,
  46. formatter: val => {
  47. return `name.contains("${val}")`
  48. },
  49. },
  50. cidr_block: {
  51. label: this.$t('network.vpc.cidr_block.ipv4.label'),
  52. },
  53. region: getRegionFilter(),
  54. cloudaccount: getAccountFilter(),
  55. manager: getCloudProviderFilter(),
  56. },
  57. }),
  58. columns: [
  59. getCopyWithContentTableColumn({
  60. field: 'name',
  61. title: this.$t('table.title.name'),
  62. sortable: true,
  63. }),
  64. getCopyWithContentTableColumn({
  65. field: 'cidr_block',
  66. title: this.$t('network.vpc.cidr_block.ipv4.label'),
  67. sortable: true,
  68. }),
  69. getRegionTableColumn(),
  70. getBrandTableColumn(),
  71. getAccountTableColumn(),
  72. ],
  73. groupActions: [],
  74. singleActions: [],
  75. }
  76. },
  77. created () {
  78. this.initSidePageTab('vpc-detail')
  79. this.list.fetchData()
  80. },
  81. methods: {
  82. handleOpenSidepage (row) {
  83. this.sidePageTriggerHandle(this, 'VpcSidePage', {
  84. id: row.id,
  85. resource: 'vpcs',
  86. getParams: this.getParam,
  87. }, {
  88. list: this.list,
  89. })
  90. },
  91. getParam () {
  92. const ret = {
  93. ...(R.is(Function, this.getParams) ? this.getParams() : this.getParams),
  94. }
  95. return ret
  96. },
  97. },
  98. }
  99. </script>