ActivitieList.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <template>
  2. <page-list
  3. :list="list"
  4. :columns="columns"
  5. :single-actions="singleActions"
  6. :showSearchbox="showSearchbox" />
  7. </template>
  8. <script>
  9. import { getStatusTableColumn, getTimeTableColumn, getCopyWithContentTableColumn } from '@/utils/common/tableColumn'
  10. import { getStatusFilter } from '@/utils/common/tableFilter'
  11. import expectStatus from '@/constants/expectStatus'
  12. import WindowsMixin from '@/mixins/windows'
  13. import GlobalSearchMixin from '@/mixins/globalSearch'
  14. import ListMixin from '@/mixins/list'
  15. export default {
  16. name: 'ScalingGroupActivitieListSidePage',
  17. mixins: [WindowsMixin, ListMixin, GlobalSearchMixin],
  18. props: {
  19. id: String,
  20. getParams: {
  21. type: [Function, Object],
  22. },
  23. data: {
  24. type: Object,
  25. },
  26. },
  27. data () {
  28. return {
  29. list: this.$list.createList(this, {
  30. id: 'ActivitieListForScalingGroupSidePage',
  31. resource: 'scalingactivities',
  32. apiVersion: 'v1',
  33. getParams: this.getParams,
  34. steadyStatus: Object.values(expectStatus.scalingactivitie).flat(),
  35. filterOptions: {
  36. status: getStatusFilter('scalingactivitie'),
  37. },
  38. }),
  39. columns: [
  40. getCopyWithContentTableColumn({
  41. field: 'id',
  42. title: 'ID',
  43. }),
  44. getStatusTableColumn({ statusModule: 'scalingactivitie', minWidth: 100 }),
  45. {
  46. field: 'trigger_desc',
  47. title: this.$t('compute.text_956'),
  48. minWidth: 200,
  49. },
  50. {
  51. field: 'action_desc',
  52. title: this.$t('compute.text_957'),
  53. minWidth: 200,
  54. },
  55. getTimeTableColumn({
  56. field: 'start_time',
  57. title: this.$t('compute.text_230'),
  58. sortable: true,
  59. }),
  60. getTimeTableColumn({
  61. field: 'end_time',
  62. title: this.$t('compute.text_231'),
  63. sortable: true,
  64. }),
  65. ],
  66. singleActions: [
  67. {
  68. label: this.$t('compute.text_958'),
  69. action: (row) => {
  70. this.createDialog('EventLogDialog', {
  71. data: row.reason,
  72. })
  73. },
  74. },
  75. ],
  76. }
  77. },
  78. created () {
  79. this.list.fetchData()
  80. },
  81. }
  82. </script>