index.vue 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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 { WorkflowStateInfo } from '@/constant'
  16. import { getAuditWorkflows } from '@/api/workflow'
  17. export default {
  18. name: 'WorkflowList',
  19. data () {
  20. return {
  21. schema: {
  22. listeners: {
  23. 'row-click': this.onAudit
  24. },
  25. props: {
  26. 'row-class-name': 'u-pointer'
  27. },
  28. list: getAuditWorkflows,
  29. cols: [
  30. { type: 'refresh' },
  31. { label: '当前节点', render: ({ currentSeveralReviewed }) => WorkflowStateInfo[currentSeveralReviewed], width: 100, align: 'center' },
  32. { prop: 'flowDesc', label: '优先级', width: 100, align: 'center' },
  33. { prop: 'flowName', label: '上播内容' },
  34. { prop: 'createUser', label: '申请人', width: 160, align: 'center' },
  35. { prop: 'createTime', label: '提交时间', width: 160, align: 'center' },
  36. { type: 'invoke', render: [
  37. { label: '审核', on: this.onAudit }
  38. ] }
  39. ]
  40. }
  41. }
  42. },
  43. activated () {
  44. this.$refs.table.pageTo()
  45. },
  46. methods: {
  47. onAudit ({ id }) {
  48. this.$router.push({
  49. name: 'workflow-audit',
  50. params: { id }
  51. })
  52. }
  53. }
  54. }
  55. </script>