List.vue 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <template>
  2. <vxe-grid :data="responseData.data || []" :columns="columns" resizable />
  3. </template>
  4. <script>
  5. import WindowsMixin from '@/mixins/windows'
  6. import { getStatusTableColumn } from '@/utils/common/tableColumn'
  7. export default {
  8. name: 'VmReleaseAnsibleplaybookSidepage',
  9. mixins: [WindowsMixin],
  10. props: {
  11. responseData: {
  12. type: Object,
  13. default: () => ({ data: [] }),
  14. },
  15. },
  16. data () {
  17. return {
  18. columns: [
  19. {
  20. field: 'name',
  21. title: this.$t('helm.text_16'),
  22. minWidth: 100,
  23. slots: {
  24. default: ({ row }) => {
  25. const text = row.name || '-'
  26. return [
  27. <list-body-cell-wrap copy hideField={true} field='name' row={row} message={text}>
  28. <side-page-trigger name='K8sAnsibleplaybookSidePage' id='test' vm={this} options={{ output: row.externalInfo.output }}>{text}</side-page-trigger>
  29. </list-body-cell-wrap>,
  30. ]
  31. },
  32. },
  33. },
  34. getStatusTableColumn({ statusModule: 'vmReleaseAnsibleplaybook', sortable: false }),
  35. // {
  36. // field: 'vcpuCount',
  37. // title: 'CPU',
  38. // formatter: ({ row }) => `${row.vcpuCount} 核`,
  39. // },
  40. // {
  41. // field: 'vmemSizeGB',
  42. // title: '内存',
  43. // formatter: ({ row }) => `${row.vmemSizeGB} GB`,
  44. // },
  45. ],
  46. }
  47. },
  48. }
  49. </script>