processDefinitionList.vue 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <template>
  2. <scroll-view :style="{height: `calc(${processDefinitionHeight}px - 0rpx)`}" class="di-scroll" scroll-y @scrolltolower="handleOnreachBottom" :refresher-triggered="triggered"
  3. refresher-enabled @refresherrefresh="handlePullDownRefresh"
  4. refresher-background="#F3F4F6"
  5. >
  6. <view class="di-scroll-list">
  7. <!-- 右滑 -->
  8. <u-swipe-action
  9. v-for="(item, index) in list"
  10. :show="activeIndex === item[primaryKey]"
  11. :key="index"
  12. :index='item.id'
  13. :options="actionOptions"
  14. @content-click="(id) => handle2StartFlow(item)"
  15. @click="handleActionClick"
  16. @open="handleActiveSwipeAction">
  17. <di-descriptions value-col="12" :border-bottom="true" >
  18. <di-descriptions-item :value="item.name" :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 list from '@/mixins/list'
  27. export default {
  28. mixins: [list],
  29. data() {
  30. return {
  31. baseApi: '/mobile/workflow/processDefinition',
  32. listApi: 'getAuthorizedProcDefList',
  33. actionOptions: [{
  34. text: '流程图',
  35. type: 'handleViewDiagram',
  36. style: {
  37. backgroundColor: this.$color.warning
  38. }
  39. }]
  40. };
  41. },
  42. created() {
  43. this.activeIndex = -100
  44. this.getList()
  45. },
  46. methods: {
  47. handleViewDiagram(id) {
  48. uni.navigateTo({
  49. url: `/pages/workflowTask/webviewPages/flowDiagram?id=${id}`
  50. })
  51. },
  52. handle2StartFlow(item) {
  53. uni.navigateTo({
  54. url: `/pages/workflowTask/webviewPages/startFlow?id=${item.id}&processInstanceId=${item.processInstanceId}&defaultTitle=${item.defaultTitle}&name=${item.name}`
  55. })
  56. }
  57. },
  58. watch: {
  59. category: {
  60. handler: function (val) {
  61. this.list = []
  62. delete this.queryParam['name']
  63. this.queryParam['category'] = val
  64. this.handlePullDownRefresh()
  65. }
  66. },
  67. searchKeyWord: {
  68. handler: function (val) {
  69. this.list = []
  70. this.queryParam['name'] = val
  71. this.handlePullDownRefresh()
  72. }
  73. }
  74. },
  75. props: {
  76. category: {
  77. type: String,
  78. default: ''
  79. },
  80. processDefinitionHeight: {
  81. type: Number,
  82. default: 0
  83. },
  84. searchKeyWord: {
  85. type: String,
  86. default: ''
  87. }
  88. }
  89. }
  90. </script>
  91. <style lang="scss">
  92. </style>