Detail.vue 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <template>
  2. <detail
  3. :on-manager="onManager"
  4. :data="data"
  5. :base-info="baseInfo"
  6. :extra-info="extraInfo"
  7. resource="vpcs"
  8. statusModule="vpc"
  9. auto-hidden-columns-key="vpc_hidden_columns" />
  10. </template>
  11. <script>
  12. import {
  13. getBrandTableColumn,
  14. getPublicScopeTableColumn,
  15. } from '@/utils/common/tableColumn'
  16. import {
  17. getUserTagColumn,
  18. getExtTagColumn,
  19. } from '@/utils/common/detailColumn'
  20. import WindowsMixin from '@/mixins/windows'
  21. export default {
  22. name: 'VPCDetail',
  23. mixins: [WindowsMixin],
  24. props: {
  25. data: {
  26. type: Object,
  27. required: true,
  28. },
  29. onManager: {
  30. type: Function,
  31. required: true,
  32. },
  33. columns: Array,
  34. },
  35. data () {
  36. return {
  37. baseInfo: [
  38. getUserTagColumn({
  39. onManager: this.onManager,
  40. resource: 'vpc',
  41. columns: () => this.columns,
  42. tipName: this.$t('dictionary.vpc'),
  43. editCheck: (row) => (row.provider || '').toLowerCase() !== 'bingocloud',
  44. }),
  45. getExtTagColumn({
  46. onManager: this.onManager,
  47. resource: 'vpc',
  48. columns: () => this.columns,
  49. tipName: this.$t('dictionary.vpc'),
  50. editCheck: (row) => (row.provider || '').toLowerCase() !== 'bingocloud',
  51. }),
  52. getPublicScopeTableColumn({ vm: this, resource: 'vpcs' }),
  53. getBrandTableColumn(),
  54. {
  55. field: 'cidr_block',
  56. title: this.$t('network.vpc.cidr_block.ipv4.label'),
  57. },
  58. {
  59. field: 'wire_count',
  60. title: this.$t('network.text_691'),
  61. },
  62. {
  63. field: 'routetable_count',
  64. title: this.$t('network.text_692'),
  65. },
  66. {
  67. field: 'network_count',
  68. title: this.$t('network.text_682'),
  69. slots: {
  70. default: ({ row }) => {
  71. if (!row.network_count) return '-'
  72. return [<a onClick={ () => this.$emit('tab-change', 'network-list') }>{row.network_count}</a>]
  73. },
  74. },
  75. },
  76. {
  77. field: 'natgateway_count',
  78. title: this.$t('network.text_693'),
  79. },
  80. {
  81. field: 'external_access_mode',
  82. title: this.$t('network.external_access_mode_label'),
  83. formatter: ({ row }) => {
  84. if (row.external_access_mode === 'none') return this.$t('status.enabled.false')
  85. return this.$t('status.enabled.true')
  86. },
  87. },
  88. ],
  89. extraInfo: [],
  90. }
  91. },
  92. }
  93. </script>