todoList.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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. taskCategory: 'todo',
  36. },
  37. categoryMap: {
  38. todo: {
  39. label: '待办',
  40. type: 'primary'
  41. },
  42. hold: {
  43. label: '暂存',
  44. type: 'warning'
  45. },
  46. cc: {
  47. label: '抄送',
  48. type: 'success'
  49. }
  50. }
  51. }
  52. },
  53. methods: {
  54. async handleClickContext (id, item) {
  55. /* if (!item.assignee) {
  56. await this.claim(item.id)
  57. } */
  58. this.handle2ProcessTask(id, item.procInstId, item.category, item.procDefId, true)
  59. },
  60. async claim (taskId) {
  61. await this.$dibootApi.put('/workflow/task/taskOperate', {
  62. taskId,
  63. taskOperate: 'claim'
  64. })
  65. }
  66. }
  67. }
  68. </script>
  69. <style lang="scss">
  70. .di-scroll-list {
  71. background: none;
  72. }
  73. </style>