columns.js 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. import {
  2. getNameDescriptionTableColumn,
  3. getStatusTableColumn,
  4. getTimeTableColumn,
  5. getProjectTableColumn,
  6. getBrandTableColumn,
  7. getRegionTableColumn,
  8. } from '@/utils/common/tableColumn'
  9. import i18n from '@/locales'
  10. export default {
  11. created () {
  12. this.columns = [
  13. getNameDescriptionTableColumn({
  14. onManager: this.onManager,
  15. hideField: true,
  16. title: i18n.t('network.text_21'),
  17. edit: false,
  18. editDesc: false,
  19. slotCallback: row => {
  20. return (
  21. <side-page-trigger onTrigger={() => this.handleOpenSidepage(row)}>{row.name}</side-page-trigger>
  22. )
  23. },
  24. }),
  25. getStatusTableColumn({ statusModule: 'ipv6_gateway', title: i18n.t('network.text_27'), vm: this }),
  26. {
  27. field: 'vpc',
  28. title: 'VPC',
  29. minWidth: 100,
  30. formatter: ({ row }) => {
  31. return row.vpc || '-'
  32. },
  33. hidden: this.$store.getters.isProjectMode,
  34. },
  35. {
  36. field: 'instance_type',
  37. title: i18n.t('network.text_268'),
  38. },
  39. getBrandTableColumn(),
  40. {
  41. field: 'account',
  42. title: i18n.t('network.text_196'),
  43. minWidth: 120,
  44. slots: {
  45. default: ({ row }) => {
  46. const ret = []
  47. ret.push(
  48. <list-body-cell-wrap hide-field copy field='account' row={row}>
  49. <span style={{ color: '#0A1F44' }}>{row.account}</span>
  50. </list-body-cell-wrap>,
  51. )
  52. if (row.manager) {
  53. ret.push(
  54. <list-body-cell-wrap hide-field copy field='manager' row={row}>
  55. <span style={{ color: '#53627C' }}>{row.manager}</span>
  56. </list-body-cell-wrap>,
  57. )
  58. }
  59. return ret
  60. },
  61. },
  62. hidden: this.$store.getters.isProjectMode,
  63. },
  64. getProjectTableColumn(),
  65. getRegionTableColumn({ showOverflow: false }),
  66. getTimeTableColumn(),
  67. ]
  68. },
  69. }