TaskHistory.vue 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <template>
  2. <page-list
  3. :list="list"
  4. :columns="columns"
  5. :single-actions="singleActions" />
  6. </template>
  7. <script>
  8. import {
  9. getStatusTableColumn,
  10. getTimeTableColumn,
  11. } from '@/utils/common/tableColumn'
  12. import WindowsMixin from '@/mixins/windows'
  13. import ListMixin from '@/mixins/list'
  14. export default {
  15. name: 'TaskHistoryForScheduledtaskSidePage',
  16. mixins: [WindowsMixin, ListMixin],
  17. props: {
  18. resId: String,
  19. data: {
  20. type: Object,
  21. required: true,
  22. },
  23. },
  24. data () {
  25. return {
  26. list: this.$list.createList(this, {
  27. id: this.id,
  28. resource: 'scheduledtaskactivities',
  29. apiVersion: 'v1',
  30. getParams: { details: true, scheduled_task: this.resId },
  31. filterOptions: {
  32. name: {
  33. label: this.$t('cloudenv.text_95'),
  34. filter: true,
  35. formatter: val => {
  36. return `name.contains("${val}")`
  37. },
  38. },
  39. },
  40. }),
  41. columns: [
  42. {
  43. field: 'id',
  44. title: 'ID',
  45. minWidth: '200',
  46. },
  47. getStatusTableColumn({ statusModule: 'scheduledtaskactivity' }),
  48. getTimeTableColumn({ title: this.$t('cloudenv.text_461') }),
  49. getTimeTableColumn({ field: 'end_time', title: this.$t('cloudenv.text_462') }),
  50. ],
  51. singleActions: [
  52. {
  53. label: this.$t('cloudenv.text_463'),
  54. action: (row) => {
  55. this.createDialog('EventLogDialog', {
  56. data: row.reason,
  57. })
  58. },
  59. },
  60. ],
  61. }
  62. },
  63. created () {
  64. this.list.fetchData()
  65. },
  66. }
  67. </script>