todoList.vue 2.2 KB

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