my-flow-launch.vue
1.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<template>
<workbench-card title="我发起的流程" subtitle="本人发起单据" icon="el-icon-s-promotion" tone="blue" :loading="loading">
<template #extra>
<el-button type="text" size="mini" @click="goMore">更多</el-button>
</template>
<div v-if="list.length" class="wb-list">
<div
v-for="(item, i) in list"
:key="item.id || i"
class="wb-list-item"
@click="goMore"
>
<div class="wb-list-item__left">
<span class="wb-list-item__dot" />
<span class="wb-list-item__title">{{ item.fullName || item.flowName || '无' }}</span>
</div>
<span class="wb-list-item__meta">{{ (item.creatorTime || item.startTime) | toDate('yyyy-MM-dd') }}</span>
</div>
</div>
<div v-else class="wb-empty">
<div class="wb-empty__circle"><i class="el-icon-s-promotion" /></div>
<div class="wb-empty__title">暂无发起记录</div>
<div class="wb-empty__desc">发起流程后会显示在这里</div>
</div>
</workbench-card>
</template>
<script>
import { FlowLaunchList } from '@/api/workFlow/FlowLaunch'
import WorkbenchCard from '../workbench-card.vue'
export default {
name: 'WidgetMyFlowLaunch',
components: { WorkbenchCard },
data() {
return { loading: false, list: [] }
},
mounted() {
this.load()
},
methods: {
async load() {
this.loading = true
try {
const res = await FlowLaunchList({
currentPage: 1,
pageSize: 4,
sort: 'desc',
sidx: ''
})
this.list = (res.data && res.data.list) || []
} catch (e) {
this.list = []
} finally {
this.loading = false
}
},
goMore() {
this.$router.push('/workFlow/flowLaunch').catch(() => {})
}
}
}
</script>
<style lang="scss" scoped>
@import '../widget-common.scss';
</style>