workFlow_1.vue
5.37 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
<template>
<view class="workFlow-v">
<mescroll-body ref="mescrollRef" @down="downCallback" :sticky="true" :up="upOption" :bottombar="false">
<view class="search-box_sticky">
<view class="tabs u-flex">
<navigator url="/pages/workFlow/flowLaunch/index" hover-class="none"
class="tabs-item u-flex-col u-col-center">
<text class="icon-ym icon-ym-flowLaunch-app u-font-40 tabs-icon launch" />
<text class="u-font-24">我发起的</text>
</navigator>
<navigator url="/pages/workFlow/flowTodo/index" hover-class="none"
class="tabs-item u-flex-col u-col-center">
<text class="icon-ym icon-ym-flowTodo-app u-font-40 tabs-icon todo" />
<text class="u-font-24">待办事宜</text>
</navigator>
<navigator url="/pages/workFlow/flowDone/index" hover-class="none"
class="tabs-item u-flex-col u-col-center">
<text class="icon-ym icon-ym-flowDone-app u-font-40 tabs-icon done" />
<text class="u-font-24">已办事宜</text>
</navigator>
<navigator url="/pages/workFlow/flowCopy/index" hover-class="none"
class="tabs-item u-flex-col u-col-center">
<text class="icon-ym icon-ym-flowCopy-app u-font-40 tabs-icon copy" />
<text class="u-font-24">抄送我的</text>
</navigator>
</view>
</view>
<view class="workFlow-list">
<view class="part">
<view class="caption">常用应用</view>
<view class="u-flex u-flex-wrap">
<view class="item u-flex-col u-col-center" v-for="(item,i) in usualList" :key="i"
@click="handelClick(item)">
<text class="u-font-40 item-icon" :class="item.icon"
:style="{'background':item.iconBackground||'#008cff'}" />
<text class="u-font-24 u-line-1 item-text">{{item.fullName}}</text>
</view>
<view class="item u-flex-col u-col-center" @click="moreApp">
<text class="u-font-40 item-icon more">+</text>
<text class="u-font-24 u-line-1 item-text">更多应用</text>
</view>
</view>
</view>
<view class="part" v-for="(item,i) in flowEngineList" :key="i">
<view class="caption u-line-1">{{item.fullName}}</view>
<view class="u-flex u-flex-wrap">
<view class="item u-flex-col u-col-center" v-for="(child,ii) in item.children" :key="ii"
@click="handelClick(child)">
<text class="u-font-40 item-icon" :class="child.icon"
:style="{'background':child.iconBackground||'#008cff'}" />
<text class="u-font-24 u-line-1 item-text">{{child.fullName}}</text>
</view>
</view>
</view>
</view>
</mescroll-body>
</view>
</template>
<script>
import {
FlowEngineListAll
} from '@/api/workFlow/flowEngine'
import {
getUsualList
} from '@/api/apply/apply.js'
import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
import IndexMixin from './mixin.js'
export default {
mixins: [MescrollMixin, IndexMixin],
data() {
return {
usualList: [],
flowEngineList: [],
upOption: {
use: false
}
}
},
onLoad() {
uni.$on('updateUsualList', data => {
this.getUsualList()
})
},
onUnload() {
uni.$off('updateUsualList')
},
methods: {
getUsualList() {
getUsualList(1).then(res => {
this.usualList = res.data.list.map(o => {
const objectData = o.objectData ? JSON.parse(o.objectData) : {}
return {
...o,
...objectData
}
})
})
},
downCallback() {
this.getUsualList()
FlowEngineListAll().then(res => {
this.flowEngineList = res.data.list
this.mescroll.endSuccess(res.data.list.length, false);
}).catch(() => {
this.mescroll.endErr();
})
},
moreApp() {
uni.navigateTo({
url: '/pages/workFlow/allApp/index'
})
},
handelClick(item) {
const config = {
id: '',
enCode: item.enCode,
flowId: item.id,
formType: item.formType,
opType: '-1',
taskNodeId: '',
fullName: item.fullName
}
uni.navigateTo({
url: '/pages/workFlow/flowBefore/index?config=' + encodeURIComponent(JSON.stringify(config))
})
}
}
}
</script>
<style lang="scss">
page {
background-color: #f0f2f6;
}
.workFlow-v {
.tabs {
height: 190rpx;
background: #fff;
padding: 0 16rpx;
box-shadow: 0 2rpx 8rpx #e1e5ec;
.tabs-item {
width: 25%;
.tabs-icon {
width: 88rpx;
height: 88rpx;
margin-bottom: 8rpx;
line-height: 88rpx;
text-align: center;
border-radius: 20rpx;
background: #5094F3;
color: #fff;
&.launch {
background: #5094F3;
}
&.todo {
background: #B849C9;
}
&.done {
background: #3FAC6B;
}
&.copy {
background: #EE8331;
}
}
}
}
.workFlow-list {
padding: 20rpx 16rpx 0;
.part {
background: #fff;
border-radius: 8rpx;
margin-bottom: 20rpx;
.caption {
padding-left: 32rpx;
font-size: 36rpx;
line-height: 100rpx;
font-weight: bold;
}
.item {
margin-bottom: 32rpx;
width: 25%;
.item-icon {
width: 88rpx;
height: 88rpx;
margin-bottom: 8rpx;
line-height: 88rpx;
text-align: center;
border-radius: 20rpx;
color: #fff;
&.more {
background: #ECECEC;
color: #666666;
font-size: 50rpx;
}
}
.item-text {
width: 100%;
text-align: center;
padding: 0 16rpx;
}
}
}
}
}
</style>