Detail.vue 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <template>
  2. <detail
  3. :on-manager="onManager"
  4. :data="data"
  5. :base-info="baseInfo"
  6. :extra-info="extraInfo"
  7. :hiddenKeys="['name']"
  8. statusModule="billtasks" />
  9. </template>
  10. <script>
  11. import WindowsMixin from '@/mixins/windows'
  12. import {
  13. getAccountTableColumn,
  14. getTimeTableColumn,
  15. getTimeDurationColumn,
  16. // getStatusTableColumn,
  17. } from '@/utils/common/tableColumn'
  18. export default {
  19. name: 'BilltaskDetail',
  20. mixins: [WindowsMixin],
  21. props: {
  22. data: {
  23. type: Object,
  24. required: true,
  25. },
  26. onManager: {
  27. type: Function,
  28. required: true,
  29. },
  30. },
  31. data () {
  32. return {
  33. baseInfo: [
  34. {
  35. title: this.$t('cloudenv.task_type'),
  36. field: 'task_type',
  37. formatter: ({ row }) => {
  38. return this.$te(`cloudenv.task_type.${row.task_type}`) ? this.$t(`cloudenv.task_type.${row.task_type}`) : row.task_type || '-'
  39. },
  40. },
  41. {
  42. field: 'mode',
  43. title: this.$t('cloudenv.bill_task.task_mode'),
  44. formatter: ({ row }) => {
  45. return this.$te(`cloudenv.bill_task.task_mode.${row.mode}`) ? this.$t(`cloudenv.bill_task.task_mode.${row.mode}`) : '-'
  46. },
  47. },
  48. // getStatusTableColumn({ statusModule: 'billtasks' }),
  49. getAccountTableColumn(),
  50. {
  51. field: 'month',
  52. title: this.$t('cloudenv.month'),
  53. formatter: ({ row }) => {
  54. if (!row.month) return '-'
  55. return this.$moment(row.month + '').format('YYYY-MM')
  56. },
  57. },
  58. getTimeTableColumn({ field: 'started_at', title: this.$t('cloudenv.text_461') }),
  59. getTimeTableColumn({ field: 'ended_at', title: this.$t('cloudenv.text_462') }),
  60. getTimeDurationColumn({
  61. field: 'time_duration',
  62. title: this.$t('cloudenv.time_duration'),
  63. start_field: 'started_at',
  64. end_field: 'ended_at',
  65. }),
  66. ],
  67. }
  68. },
  69. methods: {
  70. },
  71. }
  72. </script>