Detail.vue 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <template>
  2. <detail
  3. :data="data"
  4. :onManager="onManager"
  5. :base-info="baseInfo"
  6. :extra-info="extraInfo"
  7. :nameRules="[{ required: true, message: '请输入名称' }]" />
  8. </template>
  9. <script>
  10. import {
  11. getEnabledTableColumn,
  12. getBrandTableColumn,
  13. } from '@/utils/common/tableColumn'
  14. export default {
  15. name: 'CloudregionDetail',
  16. props: {
  17. data: {
  18. type: Object,
  19. required: true,
  20. },
  21. onManager: {
  22. type: Function,
  23. required: true,
  24. },
  25. },
  26. data () {
  27. return {
  28. baseInfo: [
  29. getEnabledTableColumn({ title: this.$t('cloudenv.text_97') }),
  30. getBrandTableColumn({ field: 'provider' }),
  31. {
  32. field: 'zone_count',
  33. title: this.$t('cloudenv.text_370'),
  34. slots: {
  35. default: ({ row }) => {
  36. return row.zone_count > 0 ? [<a onClick={ () => this.$emit('tab-change', 'zone-list') }>{ row.zone_count }</a>] : 0
  37. },
  38. },
  39. },
  40. {
  41. field: 'vpc_count',
  42. title: this.$t('cloudenv.text_371'),
  43. slots: {
  44. default: ({ row }) => {
  45. return row.vpc_count > 0 ? [<a onClick={ () => this.$emit('tab-change', 'v-p-c-list') }>{ row.vpc_count }</a>] : 0
  46. },
  47. },
  48. },
  49. {
  50. field: 'network_count',
  51. title: this.$t('cloudenv.text_372'),
  52. slots: {
  53. default: ({ row }) => {
  54. return row.network_count > 0 ? [<a onClick={ () => this.$emit('tab-change', 'network-list') }>{ row.network_count }</a>] : 0
  55. },
  56. },
  57. },
  58. {
  59. field: 'guest_count',
  60. title: this.$t('cloudenv.text_373', [this.$t('dictionary.server')]),
  61. },
  62. ],
  63. extraInfo: [
  64. {
  65. title: this.$t('cloudenv.text_359'),
  66. items: [
  67. {
  68. field: 'location',
  69. title: this.$t('cloudenv.text_374'),
  70. },
  71. ],
  72. },
  73. ],
  74. }
  75. },
  76. }
  77. </script>