todoList.vue 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <template>
  2. <scroll-view :style="{height: `calc(${approveListHeight}px - 20rpx)`}" class="di-scroll" scroll-y @scrolltolower="handleOnreachBottom" :refresher-triggered="triggered"
  3. refresher-enabled @refresherrefresh="handlePullDownRefresh">
  4. <view class="di-scroll-list">
  5. <!-- 右滑 -->
  6. <u-swipe-action
  7. v-for="(item, index) in list"
  8. :show="activeIndex === item[primaryKey]"
  9. :key="index"
  10. :index='item.id'
  11. @content-click="(id) => handleClickContext(id, item)">
  12. <di-descriptions :title="item.processInstanceName" label-col="3" value-col="9" :border-bottom="true" >
  13. <template slot="right" v-if="categoryMap[item.category]">
  14. <u-tag size="mini" :text="categoryMap[item.category].label" :type="categoryMap[item.category].type" mode="light" />
  15. </template>
  16. <di-descriptions-item label="节点名称" :value="item.name" :ellipsis="true"/>
  17. <di-descriptions-item label="开始时间" :value="item.createTime" :ellipsis="true"/>
  18. </di-descriptions>
  19. </u-swipe-action>
  20. </view>
  21. <u-loadmore v-if="!triggered" :status="status" :loadText='loadText' margin-top="24" margin-bottom="20" />
  22. </scroll-view>
  23. </template>
  24. <script>
  25. import approveList from './approveList'
  26. export default {
  27. mixins: [approveList],
  28. data() {
  29. return {
  30. baseApi: '/workflow',
  31. listApi: 'task/runTaskList',
  32. customQueryParam: {
  33. category: 'todo'
  34. },
  35. categoryMap: {
  36. todo: {
  37. label: '待办',
  38. type: 'primary'
  39. },
  40. hold: {
  41. label: '暂存',
  42. type: 'warning'
  43. },
  44. cc: {
  45. label: '抄送',
  46. type: 'success'
  47. }
  48. }
  49. }
  50. },
  51. methods: {
  52. async handleClickContext (id, item) {
  53. if (!item.assignee) {
  54. await this.claim(item.id)
  55. }
  56. this.handle2ProcessTask(id, item.procInstId, item.category, item.procDefId, true)
  57. },
  58. async claim (taskId) {
  59. await this.$dibootApi.put('/workflow/task/taskOperate', {
  60. taskId,
  61. taskOperate: 'claim'
  62. })
  63. }
  64. }
  65. }
  66. </script>
  67. <style lang="scss">
  68. </style>