1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- <template>
- <scroll-view :style="{height: `calc(${processDefinitionHeight}px - 0rpx)`}" class="di-scroll" scroll-y @scrolltolower="handleOnreachBottom" :refresher-triggered="triggered"
- refresher-enabled @refresherrefresh="handlePullDownRefresh"
- refresher-background="#F3F4F6"
- >
- <view class="di-scroll-list">
- <!-- 右滑 -->
- <u-swipe-action
- v-for="(item, index) in list"
- :show="activeIndex === item[primaryKey]"
- :key="index"
- :index='item.id'
- :options="actionOptions"
- @content-click="(id) => handle2StartFlow(item)"
- @click="handleActionClick"
- @open="handleActiveSwipeAction">
- <di-descriptions value-col="12" :border-bottom="true" >
- <di-descriptions-item :value="item.name" :ellipsis="true"/>
- </di-descriptions>
- </u-swipe-action>
- </view>
- <u-loadmore v-if="!triggered" :status="status" :loadText='loadText' margin-top="24" margin-bottom="20" />
- </scroll-view>
- </template>
- <script>
- import list from '@/mixins/list'
- export default {
- mixins: [list],
- data() {
- return {
- baseApi: '/mobile/workflow/processDefinition',
- listApi: 'getAuthorizedProcDefList',
- actionOptions: [{
- text: '流程图',
- type: 'handleViewDiagram',
- style: {
- backgroundColor: this.$color.warning
- }
- }]
- };
- },
- created() {
- this.activeIndex = -100
- this.getList()
- },
- methods: {
- handleViewDiagram(id) {
- uni.navigateTo({
- url: `/pages/workflowTask/webviewPages/flowDiagram?id=${id}`
- })
- },
- handle2StartFlow(item) {
- uni.navigateTo({
- url: `/pages/workflowTask/webviewPages/startFlow?id=${item.id}&processInstanceId=${item.processInstanceId}&defaultTitle=${item.defaultTitle}&name=${item.name}`
- })
- }
- },
- watch: {
- category: {
- handler: function (val) {
- this.list = []
- delete this.queryParam['name']
- this.queryParam['category'] = val
- this.handlePullDownRefresh()
- }
- },
- searchKeyWord: {
- handler: function (val) {
- this.list = []
- this.queryParam['name'] = val
- this.handlePullDownRefresh()
- }
- }
- },
- props: {
- category: {
- type: String,
- default: ''
- },
- processDefinitionHeight: {
- type: Number,
- default: 0
- },
- searchKeyWord: {
- type: String,
- default: ''
- }
- }
- }
- </script>
- <style lang="scss">
- </style>
|