flow-done.vue
1.7 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
68
69
70
71
72
73
74
75
76
77
78
<template>
<workbench-card title="已办事宜" subtitle="累计已办流程" icon="el-icon-circle-check" tone="purple" :loading="loading">
<div class="done">
<div class="done__icon"><i class="el-icon-circle-check" /></div>
<div class="done__num">{{ flowDone }}</div>
<div class="done__label">累计已办流程</div>
<el-button type="primary" plain size="mini" @click="goMore">查看已办</el-button>
</div>
</workbench-card>
</template>
<script>
import WorkbenchCard from '../workbench-card.vue'
import { fetchFlowWorkbenchCounts } from '../flow-counts'
export default {
name: 'WidgetFlowDone',
components: { WorkbenchCard },
data() {
return { loading: false, flowDone: 0 }
},
mounted() {
this.load()
},
methods: {
async load() {
this.loading = true
try {
const d = await fetchFlowWorkbenchCounts()
this.flowDone = d.flowDone || 0
} catch (e) {
this.flowDone = 0
} finally {
this.loading = false
}
},
goMore() {
this.$router.push('/workFlow/flowDone').catch(() => {})
}
}
}
</script>
<style lang="scss" scoped>
.done {
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
text-align: center;
padding: 8px 0;
}
.done__icon {
width: 40px;
height: 40px;
border-radius: 12px;
background: #f5f3ff;
color: #8b5cf6;
display: flex;
align-items: center;
justify-content: center;
font-size: 20px;
margin-bottom: 8px;
}
.done__num {
font-size: 32px;
font-weight: 700;
color: #1e293b;
line-height: 1.1;
letter-spacing: -0.02em;
}
.done__label {
margin: 6px 0 14px;
font-size: 13px;
color: #64748b;
}
</style>