wl-design-mobile 0.8.13 → 0.8.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -6
- package/api/doc.js +25 -25
- package/api/x1.js +56 -56
- package/btn/components/lambo-info-btn.vue +123 -123
- package/btn/components/lambo-primary-btn.vue +117 -117
- package/btn/components/lambo-text-btn.vue +116 -116
- package/btn/lambo-btn-divide.vue +35 -35
- package/btn/lambo-btn-group.vue +46 -46
- package/btn/lambo-btn-split-line.vue +41 -41
- package/btn/lambo-btn.vue +68 -68
- package/btn/lambo-extend-btn.vue +121 -121
- package/btn/lambo-icon-btn.vue +82 -82
- package/card-item/card-row-icon.vue +71 -71
- package/card-item/filtrate-row.vue +73 -73
- package/card-item/lambo-card-footer.vue +40 -40
- package/card-item/lambo-card-head.vue +66 -66
- package/card-item/lambo-card-row.vue +59 -59
- package/collapse/lambo-collapse.vue +93 -93
- package/config/config.js +14 -14
- package/detail/lambo-detail-grid.vue +58 -58
- package/detail/lambo-detail-row.vue +59 -59
- package/doc/file/compoents/lambo-file-list.vue +42 -42
- package/doc/file/compoents/lambo-file-row.vue +77 -77
- package/doc/file/lambo-file-upload-collapse.vue +107 -107
- package/doc/file-type/file-type.js +286 -286
- package/doc/img/comonents/lambo-img-grid.vue +109 -109
- package/doc/img/lambo-img-upload-collapse.vue +107 -109
- package/doc/img/styles/css/index.css +3 -3
- package/edit/list/Lambo-edit-list.vue +87 -87
- package/edit/list/lambo-edit-card-group.vue +100 -100
- package/edit/list/styles/css/index.css +39 -39
- package/edit/select/lambo-edit-date-range.vue +147 -147
- package/edit/select/lambo-edit-date-time.vue +122 -122
- package/edit/select/lambo-edit-date.vue +120 -120
- package/edit/select/lambo-edit-input-textarea.vue +91 -91
- package/edit/select/lambo-edit-input.vue +91 -91
- package/edit/select/lambo-edit-multi-select.vue +168 -168
- package/edit/select/lambo-edit-search-single-select.vue +186 -186
- package/edit/select/lambo-edit-single-select.vue +162 -162
- package/edit/select/styles/css/index.css +133 -133
- package/flow/approval/flow-approval.vue +552 -552
- package/flow/comps/flow-attachment-list.vue +230 -230
- package/flow/comps/flow-attachment-modal.vue +194 -194
- package/flow/comps/flow-copy-users.vue +358 -358
- package/flow/comps/flow-node-card.vue +150 -150
- package/flow/comps/flow-node-header.vue +172 -172
- package/flow/comps/flow-util.js +156 -156
- package/flow/comps/icons/approved.svg +11 -11
- package/flow/comps/icons/canceled.svg +11 -11
- package/flow/comps/icons/rejected.svg +11 -11
- package/flow/comps/icons/underway.svg +11 -11
- package/flow/detail/flow-detail.vue +467 -467
- package/flow/index.js +51 -51
- package/flow/lambo-flow-detail.vue +912 -912
- package/flow/lambo-flow-edit.vue +15 -15
- package/flow/submit/flow-submit.vue +383 -383
- package/icon/lambo-required-red-star.vue +47 -47
- package/icon/lambo-vector-icon.vue +71 -71
- package/list/lambo-list.vue +412 -294
- package/nav/lambo-top-nav.vue +81 -81
- package/order/comps/icons/approved.svg +10 -10
- package/order/comps/icons/underway.svg +10 -10
- package/order/comps/order-attachment-list.vue +228 -228
- package/order/comps/order-attachment-modal.vue +194 -194
- package/order/comps/order-node-card.vue +126 -126
- package/order/comps/order-node-header.vue +133 -133
- package/order/comps/order-util.js +132 -132
- package/order/detail/order-detail.vue +432 -432
- package/order/handle/order-handle.vue +517 -517
- package/order/index.js +33 -33
- package/package.json +1 -1
- package/search/lambo-date-range-page.vue +196 -196
- package/search/lambo-date-range.vue +111 -111
- package/search/lambo-date.vue +105 -105
- package/search/lambo-input.vue +74 -74
- package/search/lambo-multi-select.vue +129 -129
- package/search/lambo-org-select-page.vue +109 -109
- package/search/lambo-search-box.vue +61 -61
- package/search/lambo-search-single-select.vue +152 -152
- package/search/lambo-single-select.vue +123 -123
- package/search/lambo-week-date-select.vue +521 -521
- package/search/styles/css/index.css +138 -138
- package/styles/base.less +77 -77
- package/styles/components/btn.less +7 -7
- package/styles/components/search.less +33 -33
- package/styles/components/tag.less +181 -181
- package/styles/index.less +4 -4
- package/table/lambo-ag-table.vue +228 -227
- package/tag/lambo-tag.vue +23 -23
- package/title/lambo-title1.vue +151 -151
- package/title/lambo-title2.vue +37 -37
- package/title/lambo-title3.vue +77 -77
- package/util/assist.js +43 -43
- package/util/axios/cacheconf.js +19 -19
- package/util/axios/index.js +11 -11
- package/util/axios/interceptors.js +101 -101
- package/util/bus.js +4 -4
- package/util/jssdk-sczy.js +104 -104
- package/util/jssdk.js +565 -565
- package/util/math.js +76 -76
- package/util/token.js +36 -36
|
@@ -1,383 +1,383 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="flow-submit-container">
|
|
3
|
-
<!-- 流程头部信息 -->
|
|
4
|
-
<div class="flow-header" v-if="showHeader">
|
|
5
|
-
<div class="flow-title">
|
|
6
|
-
<span class="flow-name">{{ flowInfo.flowName || '审批流程提交' }}</span>
|
|
7
|
-
</div>
|
|
8
|
-
<FlowCopyUsers
|
|
9
|
-
:copy-users="copyUsers"
|
|
10
|
-
:available-users="availableCopyUsers"
|
|
11
|
-
:editable="copyUsersEditable"
|
|
12
|
-
@change="handleCopyUsersChange"
|
|
13
|
-
/>
|
|
14
|
-
</div>
|
|
15
|
-
|
|
16
|
-
<!-- 流程节点时间线 -->
|
|
17
|
-
<div class="flow-timeline">
|
|
18
|
-
<div v-for="(item, index) in sortedFlowNodes" :key="index" class="timeline-item">
|
|
19
|
-
<!-- 左侧时间线 -->
|
|
20
|
-
<div class="timeline-col">
|
|
21
|
-
<div class="timeline-dot" :class="'dot-' + getStatusClass(item.status)">
|
|
22
|
-
<van-icon :name="getStatusIcon(item.status)" size="14"></van-icon>
|
|
23
|
-
</div>
|
|
24
|
-
<div class="timeline-line" v-if="index !== sortedFlowNodes.length - 1"></div>
|
|
25
|
-
</div>
|
|
26
|
-
|
|
27
|
-
<!-- 右侧内容 -->
|
|
28
|
-
<div class="content-col">
|
|
29
|
-
<!-- 节点头部信息 -->
|
|
30
|
-
<FlowNodeHeader
|
|
31
|
-
:node-info="item"
|
|
32
|
-
:node-index="index"
|
|
33
|
-
/>
|
|
34
|
-
|
|
35
|
-
<!-- 第一个节点:申请描述输入 + 附件上传 -->
|
|
36
|
-
<div v-if="index === 0" class="submit-card">
|
|
37
|
-
<div class="submit-label">申请描述</div>
|
|
38
|
-
<van-field
|
|
39
|
-
v-model="applyDescription"
|
|
40
|
-
type="textarea"
|
|
41
|
-
:rows="4"
|
|
42
|
-
maxlength="200"
|
|
43
|
-
show-word-limit
|
|
44
|
-
placeholder="请输入申请描述..."
|
|
45
|
-
/>
|
|
46
|
-
|
|
47
|
-
<!-- 附件上传 -->
|
|
48
|
-
<FlowAttachmentList
|
|
49
|
-
:attachments="attachments"
|
|
50
|
-
:show-title="true"
|
|
51
|
-
:editable="true"
|
|
52
|
-
@click="handleAttachmentClick"
|
|
53
|
-
@upload-success="handleUploadSuccess"
|
|
54
|
-
@remove="removeAttachment"
|
|
55
|
-
/>
|
|
56
|
-
|
|
57
|
-
<div class="submit-actions">
|
|
58
|
-
<van-button type="primary" @click="handleSubmit" :loading="submitting" block>
|
|
59
|
-
提交审批
|
|
60
|
-
</van-button>
|
|
61
|
-
</div>
|
|
62
|
-
</div>
|
|
63
|
-
|
|
64
|
-
<!-- 其他节点:显示待审批提示 -->
|
|
65
|
-
<div v-else class="pending-tip">
|
|
66
|
-
<van-icon name="clock-o" size="14" color="#ff976a"></van-icon>
|
|
67
|
-
<span>等待审批中...</span>
|
|
68
|
-
</div>
|
|
69
|
-
</div>
|
|
70
|
-
</div>
|
|
71
|
-
|
|
72
|
-
<!-- 空状态 -->
|
|
73
|
-
<div v-if="sortedFlowNodes.length === 0" class="flow-empty">
|
|
74
|
-
<van-icon name="info-o" size="48" color="#ccc"></van-icon>
|
|
75
|
-
<p>暂无流程节点信息</p>
|
|
76
|
-
</div>
|
|
77
|
-
</div>
|
|
78
|
-
|
|
79
|
-
<!-- 附件预览弹窗 -->
|
|
80
|
-
<FlowAttachmentModal
|
|
81
|
-
:visible.sync="previewModalVisible"
|
|
82
|
-
:file-url="previewFileUrl"
|
|
83
|
-
:file-name="previewFileName"
|
|
84
|
-
:modal-width="previewModalWidth"
|
|
85
|
-
/>
|
|
86
|
-
</div>
|
|
87
|
-
</template>
|
|
88
|
-
|
|
89
|
-
<script>
|
|
90
|
-
import FlowNodeHeader from '../comps/flow-node-header.vue'
|
|
91
|
-
import FlowAttachmentList from '../comps/flow-attachment-list.vue'
|
|
92
|
-
import FlowAttachmentModal from '../comps/flow-attachment-modal.vue'
|
|
93
|
-
import FlowCopyUsers from '../comps/flow-copy-users.vue'
|
|
94
|
-
import { fileGetUrl } from '../../api/doc'
|
|
95
|
-
import {
|
|
96
|
-
getStatusIcon,
|
|
97
|
-
getStatusClass
|
|
98
|
-
} from '../comps/flow-util.js'
|
|
99
|
-
|
|
100
|
-
export default {
|
|
101
|
-
name: 'FlowSubmit',
|
|
102
|
-
components: {
|
|
103
|
-
FlowNodeHeader,
|
|
104
|
-
FlowAttachmentList,
|
|
105
|
-
FlowAttachmentModal,
|
|
106
|
-
FlowCopyUsers
|
|
107
|
-
},
|
|
108
|
-
props: {
|
|
109
|
-
/**
|
|
110
|
-
* 流程基本信息
|
|
111
|
-
* @property {string} flowName - 流程名称
|
|
112
|
-
*/
|
|
113
|
-
flowInfo: {
|
|
114
|
-
type: Object,
|
|
115
|
-
default: () => ({})
|
|
116
|
-
},
|
|
117
|
-
/**
|
|
118
|
-
* 流程节点数组
|
|
119
|
-
* @property {number} seq - 节点序号
|
|
120
|
-
* @property {string} taskName - 节点任务名称
|
|
121
|
-
* @property {string} auditUserName - 审批人姓名
|
|
122
|
-
* @property {string} auditUserAvatar - 审批人头像
|
|
123
|
-
* @property {string} status - 节点状态
|
|
124
|
-
*/
|
|
125
|
-
flowNodes: {
|
|
126
|
-
type: Array,
|
|
127
|
-
default: () => []
|
|
128
|
-
},
|
|
129
|
-
/**
|
|
130
|
-
* 是否显示头部区域
|
|
131
|
-
* @default true
|
|
132
|
-
*/
|
|
133
|
-
showHeader: {
|
|
134
|
-
type: Boolean,
|
|
135
|
-
default: true
|
|
136
|
-
},
|
|
137
|
-
initAttachments: {
|
|
138
|
-
type: Array,
|
|
139
|
-
default: () => []
|
|
140
|
-
},
|
|
141
|
-
copyUsersEditable: {
|
|
142
|
-
type: Boolean,
|
|
143
|
-
default: true
|
|
144
|
-
},
|
|
145
|
-
/**
|
|
146
|
-
* 抄送人列表
|
|
147
|
-
* @property {string} id - 抄送人ID
|
|
148
|
-
* @property {string} name - 抄送人姓名
|
|
149
|
-
* @property {string} avatar - 抄送人头像地址
|
|
150
|
-
*/
|
|
151
|
-
copyUsers: {
|
|
152
|
-
type: Array,
|
|
153
|
-
default: () => []
|
|
154
|
-
},
|
|
155
|
-
/**
|
|
156
|
-
* 可选抄送人列表
|
|
157
|
-
*/
|
|
158
|
-
availableCopyUsers: {
|
|
159
|
-
type: Array,
|
|
160
|
-
default: () => [
|
|
161
|
-
{ id: '1', name: '张三' },
|
|
162
|
-
{ id: '2', name: '李四' },
|
|
163
|
-
{ id: '3', name: '王五' },
|
|
164
|
-
{ id: '4', name: '赵六' },
|
|
165
|
-
{ id: '5', name: '钱七' },
|
|
166
|
-
{ id: '6', name: '孙八' }
|
|
167
|
-
]
|
|
168
|
-
}
|
|
169
|
-
},
|
|
170
|
-
data() {
|
|
171
|
-
return {
|
|
172
|
-
applyDescription: '',
|
|
173
|
-
submitting: false,
|
|
174
|
-
attachments: [...this.initAttachments],
|
|
175
|
-
previewModalVisible: false,
|
|
176
|
-
previewFileUrl: '',
|
|
177
|
-
previewFileName: '',
|
|
178
|
-
previewModalWidth: '320px'
|
|
179
|
-
}
|
|
180
|
-
},
|
|
181
|
-
computed: {
|
|
182
|
-
sortedFlowNodes() {
|
|
183
|
-
return [...this.flowNodes].sort((a, b) => (a.seq || 0) - (b.seq || 0))
|
|
184
|
-
}
|
|
185
|
-
},
|
|
186
|
-
watch: {
|
|
187
|
-
initAttachments: {
|
|
188
|
-
deep: true,
|
|
189
|
-
handler(val) {
|
|
190
|
-
this.attachments = [...val]
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
},
|
|
194
|
-
methods: {
|
|
195
|
-
getStatusIcon,
|
|
196
|
-
getStatusClass,
|
|
197
|
-
handleCopyUsersChange(users) {
|
|
198
|
-
this.$emit('update:copyUsers', users)
|
|
199
|
-
},
|
|
200
|
-
handleUploadSuccess(fileData) {
|
|
201
|
-
this.attachments.push(fileData)
|
|
202
|
-
},
|
|
203
|
-
removeAttachment(index) {
|
|
204
|
-
this.attachments.splice(index, 1)
|
|
205
|
-
},
|
|
206
|
-
handleAttachmentClick(file) {
|
|
207
|
-
if (!file || !file.fileName) return
|
|
208
|
-
const previewUrl = file.fileUrl || (file.fileId ? fileGetUrl + file.fileId : '')
|
|
209
|
-
if (!previewUrl) return
|
|
210
|
-
this.previewFileUrl = previewUrl
|
|
211
|
-
this.previewFileName = file.fileName
|
|
212
|
-
this.previewModalVisible = true
|
|
213
|
-
},
|
|
214
|
-
handleSubmit() {
|
|
215
|
-
// if (!this.applyDescription.trim()) {
|
|
216
|
-
// this.$toast({ message: '请输入申请描述', position: 'middle' })
|
|
217
|
-
// return
|
|
218
|
-
// }
|
|
219
|
-
this.submitting = true
|
|
220
|
-
this.$emit('submit', {
|
|
221
|
-
applyDescription: this.applyDescription,
|
|
222
|
-
flowInfo: this.flowInfo,
|
|
223
|
-
flowNodes: this.sortedFlowNodes,
|
|
224
|
-
copyUsers: this.copyUsers,
|
|
225
|
-
attachments: this.attachments
|
|
226
|
-
})
|
|
227
|
-
this.submitting = false
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
</script>
|
|
232
|
-
|
|
233
|
-
<style scoped>
|
|
234
|
-
.flow-submit-container {
|
|
235
|
-
border-radius: 4px;
|
|
236
|
-
padding: 16px;
|
|
237
|
-
background: #fff;
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
.flow-header {
|
|
241
|
-
border-bottom: 1px solid #f0f0f0;
|
|
242
|
-
margin-bottom: 16px;
|
|
243
|
-
padding-bottom: 12px;
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
.flow-title {
|
|
247
|
-
margin-bottom: 8px;
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
.flow-name {
|
|
251
|
-
font-size: 16px;
|
|
252
|
-
font-weight: 600;
|
|
253
|
-
color: #262626;
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
.flow-timeline {
|
|
257
|
-
position: relative;
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
.timeline-item {
|
|
261
|
-
display: flex;
|
|
262
|
-
margin-bottom: 16px;
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
.timeline-item:last-child {
|
|
266
|
-
margin-bottom: 0;
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
.timeline-col {
|
|
270
|
-
display: flex;
|
|
271
|
-
flex-direction: column;
|
|
272
|
-
align-items: center;
|
|
273
|
-
margin-right: 12px;
|
|
274
|
-
width: 28px;
|
|
275
|
-
flex-shrink: 0;
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
.timeline-dot {
|
|
279
|
-
width: 28px;
|
|
280
|
-
height: 28px;
|
|
281
|
-
border-radius: 50%;
|
|
282
|
-
display: flex;
|
|
283
|
-
align-items: center;
|
|
284
|
-
justify-content: center;
|
|
285
|
-
background: #f0f0f0;
|
|
286
|
-
color: #999;
|
|
287
|
-
border: 2px solid #fff;
|
|
288
|
-
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
|
|
289
|
-
z-index: 2;
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
.timeline-dot.dot-success {
|
|
293
|
-
background: #07c160;
|
|
294
|
-
color: #fff;
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
.timeline-dot.dot-process {
|
|
298
|
-
background: #1989fa;
|
|
299
|
-
color: #fff;
|
|
300
|
-
animation: pulse 2s infinite;
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
.timeline-dot.dot-error {
|
|
304
|
-
background: #ee0a24;
|
|
305
|
-
color: #fff;
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
.timeline-dot.dot-warning {
|
|
309
|
-
background: #ff976a;
|
|
310
|
-
color: #fff;
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
.timeline-dot.dot-wait {
|
|
314
|
-
background: #f0f0f0;
|
|
315
|
-
color: #999;
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
@keyframes pulse {
|
|
319
|
-
0%,
|
|
320
|
-
100% {
|
|
321
|
-
box-shadow: 0 0 0 0 rgba(25, 137, 250, 0.4);
|
|
322
|
-
}
|
|
323
|
-
50% {
|
|
324
|
-
box-shadow: 0 0 0 8px rgba(25, 137, 250, 0);
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
.timeline-line {
|
|
329
|
-
width: 2px;
|
|
330
|
-
flex: 1;
|
|
331
|
-
min-height: 24px;
|
|
332
|
-
background: #e8e8e8;
|
|
333
|
-
margin-top: 4px;
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
.content-col {
|
|
337
|
-
flex: 1;
|
|
338
|
-
min-width: 0;
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
.submit-card {
|
|
342
|
-
border-radius: 4px;
|
|
343
|
-
padding: 12px;
|
|
344
|
-
border: 1px solid #e8e8e8;
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
.submit-label {
|
|
348
|
-
font-size: 13px;
|
|
349
|
-
font-weight: 500;
|
|
350
|
-
color: #595959;
|
|
351
|
-
margin-bottom: 8px;
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
.submit-actions {
|
|
355
|
-
margin-top: 16px;
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
.pending-tip {
|
|
359
|
-
display: flex;
|
|
360
|
-
align-items: center;
|
|
361
|
-
gap: 6px;
|
|
362
|
-
padding: 8px 12px;
|
|
363
|
-
background: #fff7e8;
|
|
364
|
-
border: 1px solid #ffd9b3;
|
|
365
|
-
border-radius: 4px;
|
|
366
|
-
font-size: 13px;
|
|
367
|
-
color: #ff976a;
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
.flow-empty {
|
|
371
|
-
display: flex;
|
|
372
|
-
flex-direction: column;
|
|
373
|
-
align-items: center;
|
|
374
|
-
justify-content: center;
|
|
375
|
-
padding: 60px 20px;
|
|
376
|
-
color: #999;
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
.flow-empty p {
|
|
380
|
-
margin: 12px 0 0 0;
|
|
381
|
-
font-size: 14px;
|
|
382
|
-
}
|
|
383
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div class="flow-submit-container">
|
|
3
|
+
<!-- 流程头部信息 -->
|
|
4
|
+
<div class="flow-header" v-if="showHeader">
|
|
5
|
+
<div class="flow-title">
|
|
6
|
+
<span class="flow-name">{{ flowInfo.flowName || '审批流程提交' }}</span>
|
|
7
|
+
</div>
|
|
8
|
+
<FlowCopyUsers
|
|
9
|
+
:copy-users="copyUsers"
|
|
10
|
+
:available-users="availableCopyUsers"
|
|
11
|
+
:editable="copyUsersEditable"
|
|
12
|
+
@change="handleCopyUsersChange"
|
|
13
|
+
/>
|
|
14
|
+
</div>
|
|
15
|
+
|
|
16
|
+
<!-- 流程节点时间线 -->
|
|
17
|
+
<div class="flow-timeline">
|
|
18
|
+
<div v-for="(item, index) in sortedFlowNodes" :key="index" class="timeline-item">
|
|
19
|
+
<!-- 左侧时间线 -->
|
|
20
|
+
<div class="timeline-col">
|
|
21
|
+
<div class="timeline-dot" :class="'dot-' + getStatusClass(item.status)">
|
|
22
|
+
<van-icon :name="getStatusIcon(item.status)" size="14"></van-icon>
|
|
23
|
+
</div>
|
|
24
|
+
<div class="timeline-line" v-if="index !== sortedFlowNodes.length - 1"></div>
|
|
25
|
+
</div>
|
|
26
|
+
|
|
27
|
+
<!-- 右侧内容 -->
|
|
28
|
+
<div class="content-col">
|
|
29
|
+
<!-- 节点头部信息 -->
|
|
30
|
+
<FlowNodeHeader
|
|
31
|
+
:node-info="item"
|
|
32
|
+
:node-index="index"
|
|
33
|
+
/>
|
|
34
|
+
|
|
35
|
+
<!-- 第一个节点:申请描述输入 + 附件上传 -->
|
|
36
|
+
<div v-if="index === 0" class="submit-card">
|
|
37
|
+
<div class="submit-label">申请描述</div>
|
|
38
|
+
<van-field
|
|
39
|
+
v-model="applyDescription"
|
|
40
|
+
type="textarea"
|
|
41
|
+
:rows="4"
|
|
42
|
+
maxlength="200"
|
|
43
|
+
show-word-limit
|
|
44
|
+
placeholder="请输入申请描述..."
|
|
45
|
+
/>
|
|
46
|
+
|
|
47
|
+
<!-- 附件上传 -->
|
|
48
|
+
<FlowAttachmentList
|
|
49
|
+
:attachments="attachments"
|
|
50
|
+
:show-title="true"
|
|
51
|
+
:editable="true"
|
|
52
|
+
@click="handleAttachmentClick"
|
|
53
|
+
@upload-success="handleUploadSuccess"
|
|
54
|
+
@remove="removeAttachment"
|
|
55
|
+
/>
|
|
56
|
+
|
|
57
|
+
<div class="submit-actions">
|
|
58
|
+
<van-button type="primary" @click="handleSubmit" :loading="submitting" block>
|
|
59
|
+
提交审批
|
|
60
|
+
</van-button>
|
|
61
|
+
</div>
|
|
62
|
+
</div>
|
|
63
|
+
|
|
64
|
+
<!-- 其他节点:显示待审批提示 -->
|
|
65
|
+
<div v-else class="pending-tip">
|
|
66
|
+
<van-icon name="clock-o" size="14" color="#ff976a"></van-icon>
|
|
67
|
+
<span>等待审批中...</span>
|
|
68
|
+
</div>
|
|
69
|
+
</div>
|
|
70
|
+
</div>
|
|
71
|
+
|
|
72
|
+
<!-- 空状态 -->
|
|
73
|
+
<div v-if="sortedFlowNodes.length === 0" class="flow-empty">
|
|
74
|
+
<van-icon name="info-o" size="48" color="#ccc"></van-icon>
|
|
75
|
+
<p>暂无流程节点信息</p>
|
|
76
|
+
</div>
|
|
77
|
+
</div>
|
|
78
|
+
|
|
79
|
+
<!-- 附件预览弹窗 -->
|
|
80
|
+
<FlowAttachmentModal
|
|
81
|
+
:visible.sync="previewModalVisible"
|
|
82
|
+
:file-url="previewFileUrl"
|
|
83
|
+
:file-name="previewFileName"
|
|
84
|
+
:modal-width="previewModalWidth"
|
|
85
|
+
/>
|
|
86
|
+
</div>
|
|
87
|
+
</template>
|
|
88
|
+
|
|
89
|
+
<script>
|
|
90
|
+
import FlowNodeHeader from '../comps/flow-node-header.vue'
|
|
91
|
+
import FlowAttachmentList from '../comps/flow-attachment-list.vue'
|
|
92
|
+
import FlowAttachmentModal from '../comps/flow-attachment-modal.vue'
|
|
93
|
+
import FlowCopyUsers from '../comps/flow-copy-users.vue'
|
|
94
|
+
import { fileGetUrl } from '../../api/doc'
|
|
95
|
+
import {
|
|
96
|
+
getStatusIcon,
|
|
97
|
+
getStatusClass
|
|
98
|
+
} from '../comps/flow-util.js'
|
|
99
|
+
|
|
100
|
+
export default {
|
|
101
|
+
name: 'FlowSubmit',
|
|
102
|
+
components: {
|
|
103
|
+
FlowNodeHeader,
|
|
104
|
+
FlowAttachmentList,
|
|
105
|
+
FlowAttachmentModal,
|
|
106
|
+
FlowCopyUsers
|
|
107
|
+
},
|
|
108
|
+
props: {
|
|
109
|
+
/**
|
|
110
|
+
* 流程基本信息
|
|
111
|
+
* @property {string} flowName - 流程名称
|
|
112
|
+
*/
|
|
113
|
+
flowInfo: {
|
|
114
|
+
type: Object,
|
|
115
|
+
default: () => ({})
|
|
116
|
+
},
|
|
117
|
+
/**
|
|
118
|
+
* 流程节点数组
|
|
119
|
+
* @property {number} seq - 节点序号
|
|
120
|
+
* @property {string} taskName - 节点任务名称
|
|
121
|
+
* @property {string} auditUserName - 审批人姓名
|
|
122
|
+
* @property {string} auditUserAvatar - 审批人头像
|
|
123
|
+
* @property {string} status - 节点状态
|
|
124
|
+
*/
|
|
125
|
+
flowNodes: {
|
|
126
|
+
type: Array,
|
|
127
|
+
default: () => []
|
|
128
|
+
},
|
|
129
|
+
/**
|
|
130
|
+
* 是否显示头部区域
|
|
131
|
+
* @default true
|
|
132
|
+
*/
|
|
133
|
+
showHeader: {
|
|
134
|
+
type: Boolean,
|
|
135
|
+
default: true
|
|
136
|
+
},
|
|
137
|
+
initAttachments: {
|
|
138
|
+
type: Array,
|
|
139
|
+
default: () => []
|
|
140
|
+
},
|
|
141
|
+
copyUsersEditable: {
|
|
142
|
+
type: Boolean,
|
|
143
|
+
default: true
|
|
144
|
+
},
|
|
145
|
+
/**
|
|
146
|
+
* 抄送人列表
|
|
147
|
+
* @property {string} id - 抄送人ID
|
|
148
|
+
* @property {string} name - 抄送人姓名
|
|
149
|
+
* @property {string} avatar - 抄送人头像地址
|
|
150
|
+
*/
|
|
151
|
+
copyUsers: {
|
|
152
|
+
type: Array,
|
|
153
|
+
default: () => []
|
|
154
|
+
},
|
|
155
|
+
/**
|
|
156
|
+
* 可选抄送人列表
|
|
157
|
+
*/
|
|
158
|
+
availableCopyUsers: {
|
|
159
|
+
type: Array,
|
|
160
|
+
default: () => [
|
|
161
|
+
{ id: '1', name: '张三' },
|
|
162
|
+
{ id: '2', name: '李四' },
|
|
163
|
+
{ id: '3', name: '王五' },
|
|
164
|
+
{ id: '4', name: '赵六' },
|
|
165
|
+
{ id: '5', name: '钱七' },
|
|
166
|
+
{ id: '6', name: '孙八' }
|
|
167
|
+
]
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
data() {
|
|
171
|
+
return {
|
|
172
|
+
applyDescription: '',
|
|
173
|
+
submitting: false,
|
|
174
|
+
attachments: [...this.initAttachments],
|
|
175
|
+
previewModalVisible: false,
|
|
176
|
+
previewFileUrl: '',
|
|
177
|
+
previewFileName: '',
|
|
178
|
+
previewModalWidth: '320px'
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
computed: {
|
|
182
|
+
sortedFlowNodes() {
|
|
183
|
+
return [...this.flowNodes].sort((a, b) => (a.seq || 0) - (b.seq || 0))
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
watch: {
|
|
187
|
+
initAttachments: {
|
|
188
|
+
deep: true,
|
|
189
|
+
handler(val) {
|
|
190
|
+
this.attachments = [...val]
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
},
|
|
194
|
+
methods: {
|
|
195
|
+
getStatusIcon,
|
|
196
|
+
getStatusClass,
|
|
197
|
+
handleCopyUsersChange(users) {
|
|
198
|
+
this.$emit('update:copyUsers', users)
|
|
199
|
+
},
|
|
200
|
+
handleUploadSuccess(fileData) {
|
|
201
|
+
this.attachments.push(fileData)
|
|
202
|
+
},
|
|
203
|
+
removeAttachment(index) {
|
|
204
|
+
this.attachments.splice(index, 1)
|
|
205
|
+
},
|
|
206
|
+
handleAttachmentClick(file) {
|
|
207
|
+
if (!file || !file.fileName) return
|
|
208
|
+
const previewUrl = file.fileUrl || (file.fileId ? fileGetUrl + file.fileId : '')
|
|
209
|
+
if (!previewUrl) return
|
|
210
|
+
this.previewFileUrl = previewUrl
|
|
211
|
+
this.previewFileName = file.fileName
|
|
212
|
+
this.previewModalVisible = true
|
|
213
|
+
},
|
|
214
|
+
handleSubmit() {
|
|
215
|
+
// if (!this.applyDescription.trim()) {
|
|
216
|
+
// this.$toast({ message: '请输入申请描述', position: 'middle' })
|
|
217
|
+
// return
|
|
218
|
+
// }
|
|
219
|
+
this.submitting = true
|
|
220
|
+
this.$emit('submit', {
|
|
221
|
+
applyDescription: this.applyDescription,
|
|
222
|
+
flowInfo: this.flowInfo,
|
|
223
|
+
flowNodes: this.sortedFlowNodes,
|
|
224
|
+
copyUsers: this.copyUsers,
|
|
225
|
+
attachments: this.attachments
|
|
226
|
+
})
|
|
227
|
+
this.submitting = false
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
</script>
|
|
232
|
+
|
|
233
|
+
<style scoped>
|
|
234
|
+
.flow-submit-container {
|
|
235
|
+
border-radius: 4px;
|
|
236
|
+
padding: 16px;
|
|
237
|
+
background: #fff;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
.flow-header {
|
|
241
|
+
border-bottom: 1px solid #f0f0f0;
|
|
242
|
+
margin-bottom: 16px;
|
|
243
|
+
padding-bottom: 12px;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.flow-title {
|
|
247
|
+
margin-bottom: 8px;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
.flow-name {
|
|
251
|
+
font-size: 16px;
|
|
252
|
+
font-weight: 600;
|
|
253
|
+
color: #262626;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
.flow-timeline {
|
|
257
|
+
position: relative;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
.timeline-item {
|
|
261
|
+
display: flex;
|
|
262
|
+
margin-bottom: 16px;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
.timeline-item:last-child {
|
|
266
|
+
margin-bottom: 0;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
.timeline-col {
|
|
270
|
+
display: flex;
|
|
271
|
+
flex-direction: column;
|
|
272
|
+
align-items: center;
|
|
273
|
+
margin-right: 12px;
|
|
274
|
+
width: 28px;
|
|
275
|
+
flex-shrink: 0;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
.timeline-dot {
|
|
279
|
+
width: 28px;
|
|
280
|
+
height: 28px;
|
|
281
|
+
border-radius: 50%;
|
|
282
|
+
display: flex;
|
|
283
|
+
align-items: center;
|
|
284
|
+
justify-content: center;
|
|
285
|
+
background: #f0f0f0;
|
|
286
|
+
color: #999;
|
|
287
|
+
border: 2px solid #fff;
|
|
288
|
+
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
|
|
289
|
+
z-index: 2;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
.timeline-dot.dot-success {
|
|
293
|
+
background: #07c160;
|
|
294
|
+
color: #fff;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
.timeline-dot.dot-process {
|
|
298
|
+
background: #1989fa;
|
|
299
|
+
color: #fff;
|
|
300
|
+
animation: pulse 2s infinite;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
.timeline-dot.dot-error {
|
|
304
|
+
background: #ee0a24;
|
|
305
|
+
color: #fff;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
.timeline-dot.dot-warning {
|
|
309
|
+
background: #ff976a;
|
|
310
|
+
color: #fff;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
.timeline-dot.dot-wait {
|
|
314
|
+
background: #f0f0f0;
|
|
315
|
+
color: #999;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
@keyframes pulse {
|
|
319
|
+
0%,
|
|
320
|
+
100% {
|
|
321
|
+
box-shadow: 0 0 0 0 rgba(25, 137, 250, 0.4);
|
|
322
|
+
}
|
|
323
|
+
50% {
|
|
324
|
+
box-shadow: 0 0 0 8px rgba(25, 137, 250, 0);
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
.timeline-line {
|
|
329
|
+
width: 2px;
|
|
330
|
+
flex: 1;
|
|
331
|
+
min-height: 24px;
|
|
332
|
+
background: #e8e8e8;
|
|
333
|
+
margin-top: 4px;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
.content-col {
|
|
337
|
+
flex: 1;
|
|
338
|
+
min-width: 0;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
.submit-card {
|
|
342
|
+
border-radius: 4px;
|
|
343
|
+
padding: 12px;
|
|
344
|
+
border: 1px solid #e8e8e8;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
.submit-label {
|
|
348
|
+
font-size: 13px;
|
|
349
|
+
font-weight: 500;
|
|
350
|
+
color: #595959;
|
|
351
|
+
margin-bottom: 8px;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
.submit-actions {
|
|
355
|
+
margin-top: 16px;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
.pending-tip {
|
|
359
|
+
display: flex;
|
|
360
|
+
align-items: center;
|
|
361
|
+
gap: 6px;
|
|
362
|
+
padding: 8px 12px;
|
|
363
|
+
background: #fff7e8;
|
|
364
|
+
border: 1px solid #ffd9b3;
|
|
365
|
+
border-radius: 4px;
|
|
366
|
+
font-size: 13px;
|
|
367
|
+
color: #ff976a;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
.flow-empty {
|
|
371
|
+
display: flex;
|
|
372
|
+
flex-direction: column;
|
|
373
|
+
align-items: center;
|
|
374
|
+
justify-content: center;
|
|
375
|
+
padding: 60px 20px;
|
|
376
|
+
color: #999;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
.flow-empty p {
|
|
380
|
+
margin: 12px 0 0 0;
|
|
381
|
+
font-size: 14px;
|
|
382
|
+
}
|
|
383
|
+
</style>
|