Detail.vue 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <template>
  2. <detail
  3. :on-manager="onManager"
  4. :data="data"
  5. resource="eips"
  6. statusModule="eip"
  7. :base-info="baseInfo"
  8. :extra-info="extraInfo"
  9. auto-hidden-columns-key="eip_hidden_columns" />
  10. </template>
  11. <script>
  12. import { getBrandTableColumn } from '@/utils/common/tableColumn'
  13. import {
  14. getUserTagColumn,
  15. getExtTagColumn,
  16. } from '@/utils/common/detailColumn'
  17. import { sizestr } from '@/utils/utils'
  18. import WindowsMixin from '@/mixins/windows'
  19. import { getAssociateNameTableColumn, getIPWithBgpTypeTableColumn } from '../utils/columns'
  20. export default {
  21. name: 'EipDetail',
  22. mixins: [WindowsMixin],
  23. props: {
  24. onManager: {
  25. type: Function,
  26. required: true,
  27. },
  28. data: {
  29. type: Object,
  30. required: true,
  31. },
  32. },
  33. data () {
  34. return {
  35. baseInfo: [
  36. getUserTagColumn({ onManager: this.onManager, resource: 'eip', columns: () => this.columns, tipName: this.$t('dictionary.eip') }),
  37. getExtTagColumn({ onManager: this.onManager, resource: 'eip', columns: () => this.columns, tipName: this.$t('dictionary.eip') }),
  38. getBrandTableColumn(),
  39. getAssociateNameTableColumn(this),
  40. // {
  41. // field: 'ip_addr',
  42. // title: 'IP',
  43. // },
  44. getIPWithBgpTypeTableColumn(),
  45. {
  46. field: 'bandwidth',
  47. title: this.$t('network.text_195'),
  48. formatter: ({ cellValue, row }) => {
  49. if (!cellValue) return '-'
  50. return sizestr(cellValue, 'M', 1024)
  51. },
  52. },
  53. {
  54. field: 'charge_type',
  55. title: this.$t('network.text_192'),
  56. formatter: ({ cellValue }) => {
  57. const type = {
  58. traffic: this.$t('network.text_193'),
  59. bandwidth: this.$t('network.text_194'),
  60. }
  61. return type[cellValue]
  62. },
  63. },
  64. ],
  65. extraInfo: [],
  66. }
  67. },
  68. }
  69. </script>