index.vue 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <template>
  2. <wrapper
  3. fill
  4. margin
  5. padding
  6. background
  7. >
  8. <schema-table
  9. ref="table"
  10. :schema="schema"
  11. />
  12. </wrapper>
  13. </template>
  14. <script>
  15. import { getPublishWorkflows } from '@/api/workflow'
  16. import { State } from '@/constant'
  17. import { transformCalendarRelease } from '@/views/screen/review/utils'
  18. export default {
  19. name: 'WorkflowList',
  20. data () {
  21. return {
  22. schema: {
  23. condition: { status: State.SUBMITTED },
  24. list: getPublishWorkflows,
  25. transform: this.transform,
  26. cols: [
  27. { type: 'refresh' },
  28. { prop: 'priority', label: '优先级', width: 80, align: 'center' },
  29. { prop: 'priorityInfo', label: '', width: 80, align: 'center' },
  30. { prop: 'targetInfo', label: '内容', width: 80, align: 'center' },
  31. { prop: 'targetName', label: '', 'min-width': 100 },
  32. { prop: 'createBy', label: '申请人' },
  33. { prop: 'updateTime', label: '提交时间', 'min-width': 100 },
  34. { type: 'invoke', render: [
  35. { label: '审核', on: this.onReview }
  36. ] }
  37. ]
  38. }
  39. }
  40. },
  41. activated () {
  42. this.$refs.table.pageTo()
  43. },
  44. methods: {
  45. transform (item) {
  46. const { id, status, updateTime, calendarRelease } = item
  47. return {
  48. workflowId: id,
  49. status,
  50. updateTime,
  51. ...transformCalendarRelease(calendarRelease)
  52. }
  53. },
  54. onReview (item) {
  55. this.$router.push({
  56. name: 'workflow-detail',
  57. params: { id: item.workflowId }
  58. })
  59. }
  60. }
  61. }
  62. </script>