processDefinitionList.vue 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <template>
  2. <scroll-view :style="{height: `calc(${processDefinitionHeight}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. :options="actionOptions"
  12. @content-click="(id) => handle2StartFlow(item)"
  13. @click="handleActionClick"
  14. @open="handleActiveSwipeAction">
  15. <di-descriptions value-col="12" :border-bottom="true" >
  16. <di-descriptions-item :value="item.name" :ellipsis="true"/>
  17. </di-descriptions>
  18. </u-swipe-action>
  19. </view>
  20. <u-loadmore v-if="!triggered" :status="status" :loadText='loadText' margin-top="24" margin-bottom="20" />
  21. </scroll-view>
  22. </template>
  23. <script>
  24. import list from '@/mixins/list'
  25. export default {
  26. mixins: [list],
  27. data() {
  28. return {
  29. baseApi: '/mobile/workflow/processDefinition',
  30. listApi: 'getAuthorizedProcDefList',
  31. actionOptions: [{
  32. text: '流程图',
  33. type: 'handleViewDiagram',
  34. style: {
  35. backgroundColor: this.$color.warning
  36. }
  37. }]
  38. };
  39. },
  40. created() {
  41. this.activeIndex = -100
  42. this.getList()
  43. },
  44. methods: {
  45. handleViewDiagram(id) {
  46. uni.navigateTo({
  47. url: `/pages/workflowTask/webviewPages/flowDiagram?id=${id}`
  48. })
  49. },
  50. handle2StartFlow(item) {
  51. uni.navigateTo({
  52. url: `/pages/workflowTask/webviewPages/startFlow?id=${item.id}&processInstanceId=${item.processInstanceId}&defaultTitle=${item.defaultTitle}&name=${item.name}`
  53. })
  54. }
  55. },
  56. watch: {
  57. category: {
  58. handler: function (val) {
  59. this.list = []
  60. delete this.queryParam['name']
  61. this.queryParam['category'] = val
  62. this.handlePullDownRefresh()
  63. }
  64. },
  65. searchKeyWord: {
  66. handler: function (val) {
  67. this.list = []
  68. this.queryParam['name'] = val
  69. this.handlePullDownRefresh()
  70. }
  71. }
  72. },
  73. props: {
  74. category: {
  75. type: String,
  76. default: ''
  77. },
  78. processDefinitionHeight: {
  79. type: Number,
  80. default: 0
  81. },
  82. searchKeyWord: {
  83. type: String,
  84. default: ''
  85. }
  86. }
  87. }
  88. </script>
  89. <style lang="scss">
  90. </style>