wl-design-mobile 0.8.19 → 0.8.21

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.
Files changed (101) hide show
  1. package/README.md +6 -6
  2. package/api/doc.js +25 -25
  3. package/api/x1.js +56 -56
  4. package/btn/components/lambo-info-btn.vue +123 -123
  5. package/btn/components/lambo-primary-btn.vue +117 -117
  6. package/btn/components/lambo-text-btn.vue +116 -116
  7. package/btn/lambo-btn-divide.vue +35 -120
  8. package/btn/lambo-btn-group.vue +46 -46
  9. package/btn/lambo-btn-split-line.vue +41 -41
  10. package/btn/lambo-btn.vue +68 -68
  11. package/btn/lambo-extend-btn.vue +121 -121
  12. package/btn/lambo-icon-btn.vue +82 -82
  13. package/card-item/card-row-icon.vue +71 -71
  14. package/card-item/filtrate-row.vue +73 -73
  15. package/card-item/lambo-card-footer.vue +40 -40
  16. package/card-item/lambo-card-head.vue +66 -66
  17. package/card-item/lambo-card-row.vue +59 -59
  18. package/collapse/lambo-collapse.vue +93 -93
  19. package/config/config.js +14 -14
  20. package/detail/lambo-detail-grid.vue +58 -58
  21. package/detail/lambo-detail-row.vue +59 -59
  22. package/doc/file/compoents/lambo-file-list.vue +42 -42
  23. package/doc/file/compoents/lambo-file-row.vue +77 -77
  24. package/doc/file/lambo-file-upload-collapse.vue +107 -107
  25. package/doc/file-type/file-type.js +286 -286
  26. package/doc/img/comonents/lambo-img-grid.vue +109 -109
  27. package/doc/img/lambo-img-upload-collapse.vue +107 -107
  28. package/doc/img/styles/css/index.css +3 -3
  29. package/edit/list/Lambo-edit-list.vue +87 -87
  30. package/edit/list/lambo-edit-card-group.vue +100 -100
  31. package/edit/list/styles/css/index.css +39 -39
  32. package/edit/select/lambo-edit-date-range.vue +147 -147
  33. package/edit/select/lambo-edit-date-time.vue +122 -122
  34. package/edit/select/lambo-edit-date.vue +120 -120
  35. package/edit/select/lambo-edit-input-textarea.vue +91 -91
  36. package/edit/select/lambo-edit-input.vue +91 -91
  37. package/edit/select/lambo-edit-multi-select.vue +168 -168
  38. package/edit/select/lambo-edit-search-single-select.vue +186 -186
  39. package/edit/select/lambo-edit-single-select.vue +162 -162
  40. package/edit/select/styles/css/index.css +133 -133
  41. package/flow/approval/flow-approval.vue +552 -552
  42. package/flow/comps/flow-attachment-list.vue +230 -230
  43. package/flow/comps/flow-attachment-modal.vue +194 -194
  44. package/flow/comps/flow-copy-users.vue +358 -358
  45. package/flow/comps/flow-node-card.vue +150 -150
  46. package/flow/comps/flow-node-header.vue +172 -172
  47. package/flow/comps/flow-util.js +156 -156
  48. package/flow/comps/icons/approved.svg +11 -11
  49. package/flow/comps/icons/canceled.svg +11 -11
  50. package/flow/comps/icons/rejected.svg +11 -11
  51. package/flow/comps/icons/underway.svg +11 -11
  52. package/flow/detail/flow-detail.vue +467 -467
  53. package/flow/index.js +51 -51
  54. package/flow/lambo-flow-detail.vue +912 -912
  55. package/flow/lambo-flow-edit.vue +15 -15
  56. package/flow/submit/flow-submit.vue +383 -383
  57. package/icon/lambo-required-red-star.vue +47 -47
  58. package/icon/lambo-vector-icon.vue +71 -71
  59. package/list/lambo-list.vue +412 -413
  60. package/nav/lambo-top-nav.vue +81 -81
  61. package/order/comps/icons/approved.svg +10 -10
  62. package/order/comps/icons/underway.svg +10 -10
  63. package/order/comps/order-attachment-list.vue +228 -228
  64. package/order/comps/order-attachment-modal.vue +194 -194
  65. package/order/comps/order-node-card.vue +126 -126
  66. package/order/comps/order-node-header.vue +133 -133
  67. package/order/comps/order-util.js +132 -132
  68. package/order/detail/order-detail.vue +432 -432
  69. package/order/handle/order-handle.vue +517 -517
  70. package/order/index.js +33 -33
  71. package/package.json +38 -37
  72. package/search/lambo-date-range-page.vue +196 -196
  73. package/search/lambo-date-range.vue +111 -111
  74. package/search/lambo-date.vue +105 -105
  75. package/search/lambo-input.vue +74 -74
  76. package/search/lambo-multi-select.vue +129 -129
  77. package/search/lambo-org-select-page.vue +109 -109
  78. package/search/lambo-search-box.vue +61 -61
  79. package/search/lambo-search-single-select.vue +152 -152
  80. package/search/lambo-single-select.vue +123 -123
  81. package/search/lambo-week-date-select.vue +521 -521
  82. package/search/styles/css/index.css +138 -138
  83. package/styles/base.less +77 -77
  84. package/styles/components/btn.less +7 -7
  85. package/styles/components/search.less +33 -33
  86. package/styles/components/tag.less +181 -181
  87. package/styles/index.less +4 -4
  88. package/table/lambo-ag-table.vue +227 -227
  89. package/tag/lambo-tag.vue +23 -23
  90. package/title/lambo-title1.vue +151 -151
  91. package/title/lambo-title2.vue +37 -37
  92. package/title/lambo-title3.vue +77 -77
  93. package/util/assist.js +43 -43
  94. package/util/axios/cacheconf.js +19 -19
  95. package/util/axios/index.js +11 -11
  96. package/util/axios/interceptors.js +101 -101
  97. package/util/bus.js +4 -4
  98. package/util/jssdk-sczy.js +104 -104
  99. package/util/jssdk.js +608 -565
  100. package/util/math.js +76 -76
  101. package/util/token.js +36 -36
@@ -1,552 +1,552 @@
1
- <template>
2
- <div class="flow-approval-container">
3
- <!-- 流程头部信息 -->
4
- <div class="flow-header" v-if="showHeader">
5
- <div class="flow-header-left">
6
- <div class="flow-title">
7
- <span class="flow-name">{{ flowInfo.flowName || '审批流程' }}</span>
8
- </div>
9
- <div class="flow-meta" v-if="flowInfo.createTime || flowInfo.createUser || (copyUsers && copyUsers.length > 0)">
10
- <div v-if="flowInfo.createUser" class="meta-item">
11
- <span class="meta-label">发起人:</span>
12
- <span class="meta-value">{{ flowInfo.createUser }}</span>
13
- </div>
14
- <div v-if="flowInfo.createTime" class="meta-item">
15
- <span class="meta-label">发起时间:</span>
16
- <span class="meta-value">{{ flowInfo.createTime }}</span>
17
- </div>
18
- <FlowCopyUsers v-if="copyUsers && copyUsers.length > 0" :copy-users="copyUsers" :editable="false" :show-label="true" />
19
- </div>
20
- </div>
21
- <img :src="getFlowStatusImage()" class="flow-status-image" />
22
- </div>
23
-
24
- <!-- 流程节点时间线 -->
25
- <div class="flow-timeline">
26
- <div class="timeline-item" v-for="(item, index) in sortedFlowNodes" :key="index">
27
- <!-- 左侧时间线 -->
28
- <div class="timeline-col">
29
- <div class="timeline-dot" :class="'dot-' + getStatusClass(item.status)">
30
- <van-icon :name="getStatusIcon(item.status)" size="14"></van-icon>
31
- </div>
32
- <div class="timeline-line" v-if="index !== sortedFlowNodes.length - 1"></div>
33
- </div>
34
-
35
- <!-- 右侧内容 -->
36
- <div class="content-col">
37
- <!-- 节点头部信息 -->
38
- <FlowNodeHeader :node-info="item" :node-index="index" />
39
-
40
- <!-- 当前待审批节点:显示审批操作 -->
41
- <div v-if="item.status === 'processing' && isCurrentAuditNode(index)" class="approval-card">
42
- <!-- 申请描述(如果有) -->
43
- <div v-if="item.applyDescription" class="submit-section">
44
- <div class="section-label">申请描述</div>
45
- <div class="section-content">{{ item.applyDescription }}</div>
46
- </div>
47
-
48
- <!-- 附件列表 -->
49
- <FlowAttachmentList
50
- :attachments="currentNodeAttachments"
51
- :show-title="true"
52
- :editable="true"
53
- @click="handleAttachmentClick"
54
- @upload-success="handleUploadSuccess"
55
- @remove="handleRemoveAttachment"
56
- />
57
-
58
- <!-- 审批意见输入 -->
59
- <div class="approval-section">
60
- <div class="section-label">
61
- <span>审批意见</span>
62
- <span v-if="quickFillPhrases && quickFillPhrases.length > 0" class="quick-fill-hint">(点击常用语可快速填充)</span>
63
- </div>
64
- <div v-if="quickFillPhrases && quickFillPhrases.length > 0" class="quick-fill-tags">
65
- <van-tag
66
- v-for="(phrase, idx) in quickFillPhrases"
67
- :key="idx"
68
- type="default"
69
- size="medium"
70
- class="quick-fill-tag"
71
- @click="fillPhrase(phrase)"
72
- >
73
- {{ phrase }}
74
- </van-tag>
75
- </div>
76
- <van-field
77
- v-model="auditComment"
78
- type="textarea"
79
- :rows="3"
80
- maxlength="200"
81
- show-word-limit
82
- placeholder="请输入审批意见..."
83
- />
84
- </div>
85
-
86
- <!-- 审批操作按钮 -->
87
- <div class="approval-actions">
88
- <van-button type="warning" @click="handleReject" icon="close" :loading="rejecting" block>
89
- 不通过
90
- </van-button>
91
- <van-button type="primary" @click="handleApprove" icon="success" :loading="approving" block>
92
- 通过
93
- </van-button>
94
- </div>
95
- </div>
96
-
97
- <!-- 审批详情卡片(已完成/已驳回节点) -->
98
- <FlowNodeCard
99
- v-else-if="item.auditResult || item.auditComment || item.auditTime"
100
- :node-info="item"
101
- :is-apply-node="index === 0"
102
- >
103
- <template slot="attachments">
104
- <FlowAttachmentList
105
- v-if="item.attachments && item.attachments.length > 0"
106
- :attachments="item.attachments"
107
- @click="handleAttachmentClick"
108
- />
109
- </template>
110
- </FlowNodeCard>
111
-
112
- <!-- 待审批提示(后续节点) -->
113
- <div v-else-if="item.status === 'pending'" class="pending-tip">
114
- <van-icon name="clock-o" size="14" color="#ff976a"></van-icon>
115
- <span>等待审批中...</span>
116
- </div>
117
- </div>
118
- </div>
119
-
120
- <!-- 空状态 -->
121
- <div v-if="sortedFlowNodes.length === 0" class="flow-empty">
122
- <van-icon name="info-o" size="48" color="#ccc"></van-icon>
123
- <p>暂无流程节点信息</p>
124
- </div>
125
- </div>
126
-
127
- <!-- 附件预览弹窗 -->
128
- <FlowAttachmentModal
129
- :visible.sync="previewModalVisible"
130
- :file-url="previewFileUrl"
131
- :file-name="previewFileName"
132
- :modal-width="previewModalWidth"
133
- />
134
- </div>
135
- </template>
136
-
137
- <script>
138
- import FlowNodeHeader from '../comps/flow-node-header.vue'
139
- import FlowNodeCard from '../comps/flow-node-card.vue'
140
- import FlowAttachmentList from '../comps/flow-attachment-list.vue'
141
- import FlowAttachmentModal from '../comps/flow-attachment-modal.vue'
142
- import FlowCopyUsers from '../comps/flow-copy-users.vue'
143
- import { fileGetUrl } from '../../api/doc'
144
- import { getStatusIcon, getStatusClass } from '../comps/flow-util.js'
145
-
146
- export default {
147
- name: 'FlowApproval',
148
- components: {
149
- FlowNodeHeader,
150
- FlowNodeCard,
151
- FlowAttachmentList,
152
- FlowAttachmentModal,
153
- FlowCopyUsers
154
- },
155
- props: {
156
- /**
157
- * 流程基本信息
158
- * @property {string} flowName - 流程名称
159
- * @property {string} createUser - 发起人
160
- * @property {string} createTime - 发起时间
161
- */
162
- flowInfo: {
163
- type: Object,
164
- default: () => ({})
165
- },
166
- /**
167
- * 流程节点数组
168
- * @property {number} seq - 节点序号
169
- * @property {string} taskName - 节点任务名称
170
- * @property {string} auditUserName - 审批人姓名
171
- * @property {string} auditUserAvatar - 审批人头像
172
- * @property {string} status - 节点状态
173
- * @property {string} auditResult - 审批结果
174
- * @property {string} auditTime - 审批时间
175
- * @property {string} startTime - 开始时间
176
- * @property {string} endTime - 结束时间
177
- * @property {string} auditComment - 审批意见
178
- * @property {string} applyDescription - 申请描述
179
- * @property {Array} attachments - 附件列表
180
- */
181
- flowNodes: {
182
- type: Array,
183
- default: () => []
184
- },
185
- /**
186
- * 是否显示头部区域
187
- * @default true
188
- */
189
- showHeader: {
190
- type: Boolean,
191
- default: true
192
- },
193
- /**
194
- * 抄送人列表
195
- * @property {string} name - 抄送人姓名
196
- * @property {string} avatar - 抄送人头像地址
197
- */
198
- copyUsers: {
199
- type: Array,
200
- default: () => []
201
- },
202
- /**
203
- * 当前审批节点索引(默认第一个 processing 状态的节点)
204
- */
205
- currentAuditNodeIndex: {
206
- type: Number,
207
- default: -1
208
- },
209
- /**
210
- * 审批常用语快捷填充列表,为空则不显示
211
- */
212
- quickFillPhrases: {
213
- type: Array,
214
- default: () => []
215
- }
216
- },
217
- data() {
218
- return {
219
- auditComment: '',
220
- approving: false,
221
- rejecting: false,
222
- previewModalVisible: false,
223
- previewFileUrl: '',
224
- previewFileName: '',
225
- previewModalWidth: '320px',
226
- currentNodeAttachments: []
227
- }
228
- },
229
- computed: {
230
- sortedFlowNodes() {
231
- return [...this.flowNodes].sort((a, b) => (a.seq || 0) - (b.seq || 0))
232
- },
233
- overallFlowStatus() {
234
- const nodes = this.sortedFlowNodes
235
- if (nodes.length === 0) return 'processing'
236
- if (nodes.some(n => n.status === 'rejected')) return 'rejected'
237
- if (nodes.every(n => n.status === 'completed')) return 'completed'
238
- if (nodes.some(n => n.status === 'processing')) return 'processing'
239
- return 'processing'
240
- },
241
- currentAuditNode() {
242
- if (this.currentAuditNodeIndex >= 0) {
243
- return this.sortedFlowNodes[this.currentAuditNodeIndex]
244
- }
245
- return this.sortedFlowNodes.find(n => n.status === 'processing')
246
- }
247
- },
248
- watch: {
249
- currentAuditNode: {
250
- immediate: true,
251
- handler(node) {
252
- if (node && node.attachments) {
253
- this.currentNodeAttachments = [...node.attachments]
254
- } else {
255
- this.currentNodeAttachments = []
256
- }
257
- }
258
- }
259
- },
260
- methods: {
261
- getStatusIcon,
262
- getStatusClass,
263
- // 获取整体流程状态图片
264
- getFlowStatusImage() {
265
- const statusMap = {
266
- completed: require('../comps/icons/approved.svg'),
267
- processing: require('../comps/icons/underway.svg'),
268
- rejected: require('../comps/icons/rejected.svg'),
269
- withdrawn: require('../comps/icons/canceled.svg')
270
- }
271
- return statusMap[this.overallFlowStatus] || statusMap.processing
272
- },
273
- // 判断是否是当前审批节点
274
- isCurrentAuditNode(index) {
275
- if (this.currentAuditNodeIndex >= 0) {
276
- return index === this.currentAuditNodeIndex
277
- }
278
- return this.sortedFlowNodes[index].status === 'processing'
279
- },
280
- handleAttachmentClick(file) {
281
- if (!file || !file.fileName) return
282
- const previewUrl = file.fileUrl || (file.fileId ? fileGetUrl + file.fileId : '')
283
- if (!previewUrl) return
284
- this.previewFileUrl = previewUrl
285
- this.previewFileName = file.fileName
286
- this.previewModalVisible = true
287
- },
288
- handleUploadSuccess(fileData) {
289
- this.currentNodeAttachments.push(fileData)
290
- },
291
- handleRemoveAttachment(index) {
292
- this.currentNodeAttachments.splice(index, 1)
293
- },
294
- handleApprove() {
295
- this.approving = true
296
- this.$emit('approve', {
297
- auditComment: this.auditComment,
298
- flowInfo: this.flowInfo,
299
- currentNode: this.currentAuditNode,
300
- attachments: this.currentNodeAttachments
301
- })
302
- this.approving = false
303
- },
304
- handleReject() {
305
- this.rejecting = true
306
- this.$emit('reject', {
307
- auditComment: this.auditComment,
308
- flowInfo: this.flowInfo,
309
- currentNode: this.currentAuditNode,
310
- attachments: this.currentNodeAttachments
311
- })
312
- this.rejecting = false
313
- },
314
- fillPhrase(phrase) {
315
- if (this.auditComment && !this.auditComment.endsWith(' ')) {
316
- this.auditComment += ' '
317
- }
318
- this.auditComment += phrase
319
- }
320
- }
321
- }
322
- </script>
323
-
324
- <style scoped>
325
- .flow-approval-container {
326
- border-radius: 4px;
327
- padding: 16px;
328
- background: #fff;
329
- }
330
-
331
- .flow-header {
332
- position: relative;
333
- border-bottom: 1px solid #f0f0f0;
334
- margin-bottom: 16px;
335
- padding-bottom: 12px;
336
- padding-right: 80px;
337
- }
338
-
339
- .flow-header-left {
340
- flex: 1;
341
- }
342
-
343
- .flow-title {
344
- margin-bottom: 8px;
345
- }
346
-
347
- .flow-name {
348
- font-size: 16px;
349
- font-weight: 600;
350
- color: #262626;
351
- }
352
-
353
- .flow-status-image {
354
- position: absolute;
355
- top: 2px;
356
- right: 0;
357
- height: 70px;
358
- width: auto;
359
- z-index: 10;
360
- image-rendering: -webkit-optimize-contrast;
361
- image-rendering: crisp-edges;
362
- transform: translateZ(0);
363
- backface-visibility: hidden;
364
- filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.08));
365
- }
366
-
367
- .flow-meta {
368
- display: flex;
369
- flex-direction: column;
370
- gap: 6px;
371
- font-size: 13px;
372
- }
373
-
374
- .meta-item {
375
- display: flex;
376
- }
377
-
378
- .meta-label {
379
- color: #8c8c8c;
380
- flex-shrink: 0;
381
- }
382
-
383
- .meta-value {
384
- color: #262626;
385
- }
386
-
387
- .flow-timeline {
388
- position: relative;
389
- }
390
-
391
- .timeline-item {
392
- display: flex;
393
- padding-bottom: 16px;
394
- }
395
-
396
- .timeline-item:last-child {
397
- padding-bottom: 0;
398
- }
399
-
400
- .timeline-col {
401
- display: flex;
402
- flex-direction: column;
403
- align-items: center;
404
- margin-right: 12px;
405
- width: 28px;
406
- flex-shrink: 0;
407
- }
408
-
409
- .timeline-dot {
410
- width: 28px;
411
- height: 28px;
412
- border-radius: 50%;
413
- display: flex;
414
- align-items: center;
415
- justify-content: center;
416
- background: #f0f0f0;
417
- color: #999;
418
- border: 2px solid #fff;
419
- box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
420
- z-index: 2;
421
- }
422
-
423
- .timeline-dot.dot-success {
424
- background: #07c160;
425
- color: #fff;
426
- }
427
-
428
- .timeline-dot.dot-process {
429
- background: #1989fa;
430
- color: #fff;
431
- animation: pulse 2s infinite;
432
- }
433
-
434
- .timeline-dot.dot-error {
435
- background: #ee0a24;
436
- color: #fff;
437
- }
438
-
439
- .timeline-dot.dot-warning {
440
- background: #ff976a;
441
- color: #fff;
442
- }
443
-
444
- .timeline-dot.dot-wait {
445
- background: #f0f0f0;
446
- color: #999;
447
- }
448
-
449
- @keyframes pulse {
450
- 0%,
451
- 100% {
452
- box-shadow: 0 0 0 0 rgba(25, 137, 250, 0.4);
453
- }
454
- 50% {
455
- box-shadow: 0 0 0 8px rgba(25, 137, 250, 0);
456
- }
457
- }
458
-
459
- .timeline-line {
460
- width: 2px;
461
- flex: 1;
462
- min-height: 24px;
463
- background: #e8e8e8;
464
- margin-top: 4px;
465
- }
466
-
467
- .content-col {
468
- flex: 1;
469
- min-width: 0;
470
- }
471
-
472
- .approval-card {
473
- border-radius: 4px;
474
- padding: 12px;
475
- border: 1px solid #e8e8e8;
476
- }
477
-
478
- .submit-section {
479
- margin-top: 0;
480
- }
481
-
482
- .approval-section {
483
- margin-top: 12px;
484
- }
485
-
486
- .approval-section:last-child {
487
- margin-bottom: 0;
488
- }
489
-
490
- .section-label {
491
- font-size: 13px;
492
- font-weight: 500;
493
- color: #595959;
494
- margin-bottom: 8px;
495
- }
496
-
497
- .quick-fill-hint {
498
- font-size: 11px;
499
- font-weight: normal;
500
- color: #999;
501
- margin-left: 6px;
502
- }
503
-
504
- .quick-fill-tags {
505
- margin-bottom: 8px;
506
- line-height: 2;
507
- }
508
-
509
- .quick-fill-tag {
510
- margin-right: 8px;
511
- margin-bottom: 8px;
512
- cursor: pointer;
513
- }
514
-
515
- .section-content {
516
- font-size: 13px;
517
- color: #262626;
518
- line-height: 1.5;
519
- }
520
-
521
- .approval-actions {
522
- display: flex;
523
- gap: 12px;
524
- margin-top: 16px;
525
- }
526
-
527
- .pending-tip {
528
- display: flex;
529
- align-items: center;
530
- gap: 6px;
531
- padding: 8px 12px;
532
- background: #fff7e8;
533
- border: 1px solid #ffd9b3;
534
- border-radius: 4px;
535
- font-size: 13px;
536
- color: #ff976a;
537
- }
538
-
539
- .flow-empty {
540
- display: flex;
541
- flex-direction: column;
542
- align-items: center;
543
- justify-content: center;
544
- padding: 60px 20px;
545
- color: #999;
546
- }
547
-
548
- .flow-empty p {
549
- margin: 12px 0 0 0;
550
- font-size: 14px;
551
- }
552
- </style>
1
+ <template>
2
+ <div class="flow-approval-container">
3
+ <!-- 流程头部信息 -->
4
+ <div class="flow-header" v-if="showHeader">
5
+ <div class="flow-header-left">
6
+ <div class="flow-title">
7
+ <span class="flow-name">{{ flowInfo.flowName || '审批流程' }}</span>
8
+ </div>
9
+ <div class="flow-meta" v-if="flowInfo.createTime || flowInfo.createUser || (copyUsers && copyUsers.length > 0)">
10
+ <div v-if="flowInfo.createUser" class="meta-item">
11
+ <span class="meta-label">发起人:</span>
12
+ <span class="meta-value">{{ flowInfo.createUser }}</span>
13
+ </div>
14
+ <div v-if="flowInfo.createTime" class="meta-item">
15
+ <span class="meta-label">发起时间:</span>
16
+ <span class="meta-value">{{ flowInfo.createTime }}</span>
17
+ </div>
18
+ <FlowCopyUsers v-if="copyUsers && copyUsers.length > 0" :copy-users="copyUsers" :editable="false" :show-label="true" />
19
+ </div>
20
+ </div>
21
+ <img :src="getFlowStatusImage()" class="flow-status-image" />
22
+ </div>
23
+
24
+ <!-- 流程节点时间线 -->
25
+ <div class="flow-timeline">
26
+ <div class="timeline-item" v-for="(item, index) in sortedFlowNodes" :key="index">
27
+ <!-- 左侧时间线 -->
28
+ <div class="timeline-col">
29
+ <div class="timeline-dot" :class="'dot-' + getStatusClass(item.status)">
30
+ <van-icon :name="getStatusIcon(item.status)" size="14"></van-icon>
31
+ </div>
32
+ <div class="timeline-line" v-if="index !== sortedFlowNodes.length - 1"></div>
33
+ </div>
34
+
35
+ <!-- 右侧内容 -->
36
+ <div class="content-col">
37
+ <!-- 节点头部信息 -->
38
+ <FlowNodeHeader :node-info="item" :node-index="index" />
39
+
40
+ <!-- 当前待审批节点:显示审批操作 -->
41
+ <div v-if="item.status === 'processing' && isCurrentAuditNode(index)" class="approval-card">
42
+ <!-- 申请描述(如果有) -->
43
+ <div v-if="item.applyDescription" class="submit-section">
44
+ <div class="section-label">申请描述</div>
45
+ <div class="section-content">{{ item.applyDescription }}</div>
46
+ </div>
47
+
48
+ <!-- 附件列表 -->
49
+ <FlowAttachmentList
50
+ :attachments="currentNodeAttachments"
51
+ :show-title="true"
52
+ :editable="true"
53
+ @click="handleAttachmentClick"
54
+ @upload-success="handleUploadSuccess"
55
+ @remove="handleRemoveAttachment"
56
+ />
57
+
58
+ <!-- 审批意见输入 -->
59
+ <div class="approval-section">
60
+ <div class="section-label">
61
+ <span>审批意见</span>
62
+ <span v-if="quickFillPhrases && quickFillPhrases.length > 0" class="quick-fill-hint">(点击常用语可快速填充)</span>
63
+ </div>
64
+ <div v-if="quickFillPhrases && quickFillPhrases.length > 0" class="quick-fill-tags">
65
+ <van-tag
66
+ v-for="(phrase, idx) in quickFillPhrases"
67
+ :key="idx"
68
+ type="default"
69
+ size="medium"
70
+ class="quick-fill-tag"
71
+ @click="fillPhrase(phrase)"
72
+ >
73
+ {{ phrase }}
74
+ </van-tag>
75
+ </div>
76
+ <van-field
77
+ v-model="auditComment"
78
+ type="textarea"
79
+ :rows="3"
80
+ maxlength="200"
81
+ show-word-limit
82
+ placeholder="请输入审批意见..."
83
+ />
84
+ </div>
85
+
86
+ <!-- 审批操作按钮 -->
87
+ <div class="approval-actions">
88
+ <van-button type="warning" @click="handleReject" icon="close" :loading="rejecting" block>
89
+ 不通过
90
+ </van-button>
91
+ <van-button type="primary" @click="handleApprove" icon="success" :loading="approving" block>
92
+ 通过
93
+ </van-button>
94
+ </div>
95
+ </div>
96
+
97
+ <!-- 审批详情卡片(已完成/已驳回节点) -->
98
+ <FlowNodeCard
99
+ v-else-if="item.auditResult || item.auditComment || item.auditTime"
100
+ :node-info="item"
101
+ :is-apply-node="index === 0"
102
+ >
103
+ <template slot="attachments">
104
+ <FlowAttachmentList
105
+ v-if="item.attachments && item.attachments.length > 0"
106
+ :attachments="item.attachments"
107
+ @click="handleAttachmentClick"
108
+ />
109
+ </template>
110
+ </FlowNodeCard>
111
+
112
+ <!-- 待审批提示(后续节点) -->
113
+ <div v-else-if="item.status === 'pending'" class="pending-tip">
114
+ <van-icon name="clock-o" size="14" color="#ff976a"></van-icon>
115
+ <span>等待审批中...</span>
116
+ </div>
117
+ </div>
118
+ </div>
119
+
120
+ <!-- 空状态 -->
121
+ <div v-if="sortedFlowNodes.length === 0" class="flow-empty">
122
+ <van-icon name="info-o" size="48" color="#ccc"></van-icon>
123
+ <p>暂无流程节点信息</p>
124
+ </div>
125
+ </div>
126
+
127
+ <!-- 附件预览弹窗 -->
128
+ <FlowAttachmentModal
129
+ :visible.sync="previewModalVisible"
130
+ :file-url="previewFileUrl"
131
+ :file-name="previewFileName"
132
+ :modal-width="previewModalWidth"
133
+ />
134
+ </div>
135
+ </template>
136
+
137
+ <script>
138
+ import FlowNodeHeader from '../comps/flow-node-header.vue'
139
+ import FlowNodeCard from '../comps/flow-node-card.vue'
140
+ import FlowAttachmentList from '../comps/flow-attachment-list.vue'
141
+ import FlowAttachmentModal from '../comps/flow-attachment-modal.vue'
142
+ import FlowCopyUsers from '../comps/flow-copy-users.vue'
143
+ import { fileGetUrl } from '../../api/doc'
144
+ import { getStatusIcon, getStatusClass } from '../comps/flow-util.js'
145
+
146
+ export default {
147
+ name: 'FlowApproval',
148
+ components: {
149
+ FlowNodeHeader,
150
+ FlowNodeCard,
151
+ FlowAttachmentList,
152
+ FlowAttachmentModal,
153
+ FlowCopyUsers
154
+ },
155
+ props: {
156
+ /**
157
+ * 流程基本信息
158
+ * @property {string} flowName - 流程名称
159
+ * @property {string} createUser - 发起人
160
+ * @property {string} createTime - 发起时间
161
+ */
162
+ flowInfo: {
163
+ type: Object,
164
+ default: () => ({})
165
+ },
166
+ /**
167
+ * 流程节点数组
168
+ * @property {number} seq - 节点序号
169
+ * @property {string} taskName - 节点任务名称
170
+ * @property {string} auditUserName - 审批人姓名
171
+ * @property {string} auditUserAvatar - 审批人头像
172
+ * @property {string} status - 节点状态
173
+ * @property {string} auditResult - 审批结果
174
+ * @property {string} auditTime - 审批时间
175
+ * @property {string} startTime - 开始时间
176
+ * @property {string} endTime - 结束时间
177
+ * @property {string} auditComment - 审批意见
178
+ * @property {string} applyDescription - 申请描述
179
+ * @property {Array} attachments - 附件列表
180
+ */
181
+ flowNodes: {
182
+ type: Array,
183
+ default: () => []
184
+ },
185
+ /**
186
+ * 是否显示头部区域
187
+ * @default true
188
+ */
189
+ showHeader: {
190
+ type: Boolean,
191
+ default: true
192
+ },
193
+ /**
194
+ * 抄送人列表
195
+ * @property {string} name - 抄送人姓名
196
+ * @property {string} avatar - 抄送人头像地址
197
+ */
198
+ copyUsers: {
199
+ type: Array,
200
+ default: () => []
201
+ },
202
+ /**
203
+ * 当前审批节点索引(默认第一个 processing 状态的节点)
204
+ */
205
+ currentAuditNodeIndex: {
206
+ type: Number,
207
+ default: -1
208
+ },
209
+ /**
210
+ * 审批常用语快捷填充列表,为空则不显示
211
+ */
212
+ quickFillPhrases: {
213
+ type: Array,
214
+ default: () => []
215
+ }
216
+ },
217
+ data() {
218
+ return {
219
+ auditComment: '',
220
+ approving: false,
221
+ rejecting: false,
222
+ previewModalVisible: false,
223
+ previewFileUrl: '',
224
+ previewFileName: '',
225
+ previewModalWidth: '320px',
226
+ currentNodeAttachments: []
227
+ }
228
+ },
229
+ computed: {
230
+ sortedFlowNodes() {
231
+ return [...this.flowNodes].sort((a, b) => (a.seq || 0) - (b.seq || 0))
232
+ },
233
+ overallFlowStatus() {
234
+ const nodes = this.sortedFlowNodes
235
+ if (nodes.length === 0) return 'processing'
236
+ if (nodes.some(n => n.status === 'rejected')) return 'rejected'
237
+ if (nodes.every(n => n.status === 'completed')) return 'completed'
238
+ if (nodes.some(n => n.status === 'processing')) return 'processing'
239
+ return 'processing'
240
+ },
241
+ currentAuditNode() {
242
+ if (this.currentAuditNodeIndex >= 0) {
243
+ return this.sortedFlowNodes[this.currentAuditNodeIndex]
244
+ }
245
+ return this.sortedFlowNodes.find(n => n.status === 'processing')
246
+ }
247
+ },
248
+ watch: {
249
+ currentAuditNode: {
250
+ immediate: true,
251
+ handler(node) {
252
+ if (node && node.attachments) {
253
+ this.currentNodeAttachments = [...node.attachments]
254
+ } else {
255
+ this.currentNodeAttachments = []
256
+ }
257
+ }
258
+ }
259
+ },
260
+ methods: {
261
+ getStatusIcon,
262
+ getStatusClass,
263
+ // 获取整体流程状态图片
264
+ getFlowStatusImage() {
265
+ const statusMap = {
266
+ completed: require('../comps/icons/approved.svg'),
267
+ processing: require('../comps/icons/underway.svg'),
268
+ rejected: require('../comps/icons/rejected.svg'),
269
+ withdrawn: require('../comps/icons/canceled.svg')
270
+ }
271
+ return statusMap[this.overallFlowStatus] || statusMap.processing
272
+ },
273
+ // 判断是否是当前审批节点
274
+ isCurrentAuditNode(index) {
275
+ if (this.currentAuditNodeIndex >= 0) {
276
+ return index === this.currentAuditNodeIndex
277
+ }
278
+ return this.sortedFlowNodes[index].status === 'processing'
279
+ },
280
+ handleAttachmentClick(file) {
281
+ if (!file || !file.fileName) return
282
+ const previewUrl = file.fileUrl || (file.fileId ? fileGetUrl + file.fileId : '')
283
+ if (!previewUrl) return
284
+ this.previewFileUrl = previewUrl
285
+ this.previewFileName = file.fileName
286
+ this.previewModalVisible = true
287
+ },
288
+ handleUploadSuccess(fileData) {
289
+ this.currentNodeAttachments.push(fileData)
290
+ },
291
+ handleRemoveAttachment(index) {
292
+ this.currentNodeAttachments.splice(index, 1)
293
+ },
294
+ handleApprove() {
295
+ this.approving = true
296
+ this.$emit('approve', {
297
+ auditComment: this.auditComment,
298
+ flowInfo: this.flowInfo,
299
+ currentNode: this.currentAuditNode,
300
+ attachments: this.currentNodeAttachments
301
+ })
302
+ this.approving = false
303
+ },
304
+ handleReject() {
305
+ this.rejecting = true
306
+ this.$emit('reject', {
307
+ auditComment: this.auditComment,
308
+ flowInfo: this.flowInfo,
309
+ currentNode: this.currentAuditNode,
310
+ attachments: this.currentNodeAttachments
311
+ })
312
+ this.rejecting = false
313
+ },
314
+ fillPhrase(phrase) {
315
+ if (this.auditComment && !this.auditComment.endsWith(' ')) {
316
+ this.auditComment += ' '
317
+ }
318
+ this.auditComment += phrase
319
+ }
320
+ }
321
+ }
322
+ </script>
323
+
324
+ <style scoped>
325
+ .flow-approval-container {
326
+ border-radius: 4px;
327
+ padding: 16px;
328
+ background: #fff;
329
+ }
330
+
331
+ .flow-header {
332
+ position: relative;
333
+ border-bottom: 1px solid #f0f0f0;
334
+ margin-bottom: 16px;
335
+ padding-bottom: 12px;
336
+ padding-right: 80px;
337
+ }
338
+
339
+ .flow-header-left {
340
+ flex: 1;
341
+ }
342
+
343
+ .flow-title {
344
+ margin-bottom: 8px;
345
+ }
346
+
347
+ .flow-name {
348
+ font-size: 16px;
349
+ font-weight: 600;
350
+ color: #262626;
351
+ }
352
+
353
+ .flow-status-image {
354
+ position: absolute;
355
+ top: 2px;
356
+ right: 0;
357
+ height: 70px;
358
+ width: auto;
359
+ z-index: 10;
360
+ image-rendering: -webkit-optimize-contrast;
361
+ image-rendering: crisp-edges;
362
+ transform: translateZ(0);
363
+ backface-visibility: hidden;
364
+ filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.08));
365
+ }
366
+
367
+ .flow-meta {
368
+ display: flex;
369
+ flex-direction: column;
370
+ gap: 6px;
371
+ font-size: 13px;
372
+ }
373
+
374
+ .meta-item {
375
+ display: flex;
376
+ }
377
+
378
+ .meta-label {
379
+ color: #8c8c8c;
380
+ flex-shrink: 0;
381
+ }
382
+
383
+ .meta-value {
384
+ color: #262626;
385
+ }
386
+
387
+ .flow-timeline {
388
+ position: relative;
389
+ }
390
+
391
+ .timeline-item {
392
+ display: flex;
393
+ padding-bottom: 16px;
394
+ }
395
+
396
+ .timeline-item:last-child {
397
+ padding-bottom: 0;
398
+ }
399
+
400
+ .timeline-col {
401
+ display: flex;
402
+ flex-direction: column;
403
+ align-items: center;
404
+ margin-right: 12px;
405
+ width: 28px;
406
+ flex-shrink: 0;
407
+ }
408
+
409
+ .timeline-dot {
410
+ width: 28px;
411
+ height: 28px;
412
+ border-radius: 50%;
413
+ display: flex;
414
+ align-items: center;
415
+ justify-content: center;
416
+ background: #f0f0f0;
417
+ color: #999;
418
+ border: 2px solid #fff;
419
+ box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
420
+ z-index: 2;
421
+ }
422
+
423
+ .timeline-dot.dot-success {
424
+ background: #07c160;
425
+ color: #fff;
426
+ }
427
+
428
+ .timeline-dot.dot-process {
429
+ background: #1989fa;
430
+ color: #fff;
431
+ animation: pulse 2s infinite;
432
+ }
433
+
434
+ .timeline-dot.dot-error {
435
+ background: #ee0a24;
436
+ color: #fff;
437
+ }
438
+
439
+ .timeline-dot.dot-warning {
440
+ background: #ff976a;
441
+ color: #fff;
442
+ }
443
+
444
+ .timeline-dot.dot-wait {
445
+ background: #f0f0f0;
446
+ color: #999;
447
+ }
448
+
449
+ @keyframes pulse {
450
+ 0%,
451
+ 100% {
452
+ box-shadow: 0 0 0 0 rgba(25, 137, 250, 0.4);
453
+ }
454
+ 50% {
455
+ box-shadow: 0 0 0 8px rgba(25, 137, 250, 0);
456
+ }
457
+ }
458
+
459
+ .timeline-line {
460
+ width: 2px;
461
+ flex: 1;
462
+ min-height: 24px;
463
+ background: #e8e8e8;
464
+ margin-top: 4px;
465
+ }
466
+
467
+ .content-col {
468
+ flex: 1;
469
+ min-width: 0;
470
+ }
471
+
472
+ .approval-card {
473
+ border-radius: 4px;
474
+ padding: 12px;
475
+ border: 1px solid #e8e8e8;
476
+ }
477
+
478
+ .submit-section {
479
+ margin-top: 0;
480
+ }
481
+
482
+ .approval-section {
483
+ margin-top: 12px;
484
+ }
485
+
486
+ .approval-section:last-child {
487
+ margin-bottom: 0;
488
+ }
489
+
490
+ .section-label {
491
+ font-size: 13px;
492
+ font-weight: 500;
493
+ color: #595959;
494
+ margin-bottom: 8px;
495
+ }
496
+
497
+ .quick-fill-hint {
498
+ font-size: 11px;
499
+ font-weight: normal;
500
+ color: #999;
501
+ margin-left: 6px;
502
+ }
503
+
504
+ .quick-fill-tags {
505
+ margin-bottom: 8px;
506
+ line-height: 2;
507
+ }
508
+
509
+ .quick-fill-tag {
510
+ margin-right: 8px;
511
+ margin-bottom: 8px;
512
+ cursor: pointer;
513
+ }
514
+
515
+ .section-content {
516
+ font-size: 13px;
517
+ color: #262626;
518
+ line-height: 1.5;
519
+ }
520
+
521
+ .approval-actions {
522
+ display: flex;
523
+ gap: 12px;
524
+ margin-top: 16px;
525
+ }
526
+
527
+ .pending-tip {
528
+ display: flex;
529
+ align-items: center;
530
+ gap: 6px;
531
+ padding: 8px 12px;
532
+ background: #fff7e8;
533
+ border: 1px solid #ffd9b3;
534
+ border-radius: 4px;
535
+ font-size: 13px;
536
+ color: #ff976a;
537
+ }
538
+
539
+ .flow-empty {
540
+ display: flex;
541
+ flex-direction: column;
542
+ align-items: center;
543
+ justify-content: center;
544
+ padding: 60px 20px;
545
+ color: #999;
546
+ }
547
+
548
+ .flow-empty p {
549
+ margin: 12px 0 0 0;
550
+ font-size: 14px;
551
+ }
552
+ </style>