gbflowengine 0.1.0 → 0.1.1

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 (79) hide show
  1. package/README.md +271 -271
  2. package/dist/gbflowengine.css +1 -1
  3. package/dist/gbflowengine.js +8232 -6913
  4. package/dist/gbflowengine.js.map +1 -1
  5. package/dist/gbflowengine.umd.cjs +2 -2
  6. package/dist/gbflowengine.umd.cjs.map +1 -1
  7. package/package.json +85 -84
  8. package/src/center/DefinitionInspect.vue +291 -291
  9. package/src/center/FlowCenter.vue +33 -33
  10. package/src/center/index.js +29 -29
  11. package/src/center/storage.js +748 -748
  12. package/src/core/flow/condition.js +160 -160
  13. package/src/core/flow/customNode.js +385 -385
  14. package/src/core/flow/defaults.js +124 -124
  15. package/src/core/flow/flowConstant.js +265 -265
  16. package/src/core/flow/flowNodeUtils.js +29 -29
  17. package/src/core/flow/index.js +47 -47
  18. package/src/core/flow/node.js +44 -44
  19. package/src/core/flow/nodeFactory.js +58 -58
  20. package/src/core/flow/prediction.js +325 -325
  21. package/src/core/flow/schema.js +864 -864
  22. package/src/definition/FlowDefinitionDesigner.vue +338 -338
  23. package/src/definition/index.js +9 -9
  24. package/src/index.js +39 -39
  25. package/src/storage.js +200 -200
  26. package/src/testing/FlowTestPanel.vue +2502 -2502
  27. package/src/testing/UserConfigDrawer.vue +376 -376
  28. package/src/testing/diagram/FlowProgressDiagram.vue +318 -318
  29. package/src/testing/diagramModel.js +517 -517
  30. package/src/testing/index.js +23 -23
  31. package/src/testing/mock.js +246 -246
  32. package/src/testing/oaExecutors.js +51 -51
  33. package/src/testing/oaSeed.js +467 -467
  34. package/src/testing/sample.js +412 -412
  35. package/src/testing/seed.js +122 -122
  36. package/src/utils/format.js +27 -27
  37. package/src/visual/FlowCanvas.vue +440 -440
  38. package/src/visual/NodeProgressDetail.vue +43 -43
  39. package/src/visual/NodeStatusBadge.vue +17 -17
  40. package/src/visual/NodeWrap.vue +46 -46
  41. package/src/visual/ScWorkflow.vue +49 -49
  42. package/src/visual/SelectDialog.vue +459 -459
  43. package/src/visual/conditionHelpers.js +116 -116
  44. package/src/visual/index.js +6 -6
  45. package/src/visual/nodes/AddNode.vue +222 -222
  46. package/src/visual/nodes/ApproverNode.vue +347 -347
  47. package/src/visual/nodes/BranchNode.vue +441 -441
  48. package/src/visual/nodes/CustomNode.vue +339 -339
  49. package/src/visual/nodes/EndNode.vue +21 -21
  50. package/src/visual/nodes/PassNode.vue +100 -100
  51. package/src/visual/nodes/PromoterNode.vue +134 -134
  52. package/src/visual/nodes/RejectNode.vue +100 -100
  53. package/src/visual/nodes/SendNode.vue +151 -151
  54. package/src/visual/styles.scss +879 -879
  55. package/src/visual/useScNodeStatus.js +18 -18
  56. package/src/workbench/OaWorkbench.vue +1341 -1341
  57. package/src/workbench/components/ApprovalWorkspace.vue +2090 -2090
  58. package/src/workbench/components/CategoryIcon.vue +74 -74
  59. package/src/workbench/components/NotificationIcon.vue +73 -73
  60. package/src/workbench/components/ProcessSteps.vue +557 -557
  61. package/src/workbench/components/ResubmitDialog.vue +227 -227
  62. package/src/workbench/components/SidebarNav.vue +138 -138
  63. package/src/workbench/components/StartFlowDialog.vue +1058 -1058
  64. package/src/workbench/components/UserAvatar.vue +68 -68
  65. package/src/workbench/model.js +1080 -1080
  66. package/src/workbench/pages/DesignPage.vue +798 -798
  67. package/src/workbench/pages/HomePage.vue +1050 -1050
  68. package/src/workbench/pages/MonitorPage.vue +1029 -1029
  69. package/src/workbench/pages/NotificationsPage.vue +554 -554
  70. package/src/workbench/pages/RequestsPage.vue +644 -644
  71. package/src/workbench/pages/TaskCenterPage.vue +1155 -1155
  72. package/src/workbench/pages/TemplatesPage.vue +680 -680
  73. package/src/workbench/styles.scss +555 -555
  74. package/types/center.d.ts +5 -5
  75. package/types/core.d.ts +479 -479
  76. package/types/definition.d.ts +4 -4
  77. package/types/index.d.ts +34 -34
  78. package/types/testing.d.ts +20 -20
  79. package/types/visual.d.ts +20 -20
@@ -1,1155 +1,1155 @@
1
- <template>
2
- <div
3
- class="oa-taskcenter"
4
- :class="{ 'is-mobile-detail': isMobile && activeItem }"
5
- >
6
- <header class="oa-taskcenter__head">
7
- <div>
8
- <p class="oa-eyebrow">审批协同</p>
9
- <h1 class="oa-title">待办中心</h1>
10
- <p class="oa-subtitle">
11
- 按超时与优先级处理任务;审批动作只对当前任务责任人开放。
12
- </p>
13
- </div>
14
- <div class="oa-taskcenter__head-right">
15
- <label class="oa-switch">
16
- <el-switch v-model="continuous" size="small" />
17
- <span>连续办理</span>
18
- </label>
19
- <el-button plain :icon="Refresh" @click="refresh">刷新</el-button>
20
- </div>
21
- </header>
22
-
23
- <div class="oa-taskcenter__body">
24
- <aside class="oa-task-list-panel oa-card">
25
- <div class="oa-task-list-panel__head">
26
- <div class="oa-segment oa-segment--lg">
27
- <button
28
- type="button"
29
- :class="{ 'is-active': oa.taskTab.value === 'approve' }"
30
- @click="switchTab('approve')"
31
- >
32
- 待我审批
33
- <em>{{ oa.approveItems.value.length }}</em>
34
- </button>
35
- <button
36
- type="button"
37
- :class="{ 'is-active': oa.taskTab.value === 'submit' }"
38
- @click="switchTab('submit')"
39
- >
40
- 待我提交
41
- <em>{{ oa.submitItems.value.length }}</em>
42
- </button>
43
- </div>
44
-
45
- <el-input
46
- v-model="keyword"
47
- :prefix-icon="Search"
48
- placeholder="搜索标题、单号、发起人"
49
- clearable
50
- size="small"
51
- />
52
- </div>
53
-
54
- <div class="oa-task-list-panel__filters">
55
- <button
56
- v-for="option in quickFilters"
57
- :key="option.value"
58
- type="button"
59
- class="oa-filter-pill"
60
- :class="{ 'is-active': quick === option.value }"
61
- @click="quick = option.value"
62
- >
63
- {{ option.label }}
64
- <span v-if="option.count !== undefined">{{ option.count }}</span>
65
- </button>
66
- <el-select
67
- v-model="processFilter"
68
- size="small"
69
- class="oa-task-list-panel__process"
70
- placeholder="全部流程"
71
- clearable
72
- >
73
- <el-option
74
- v-for="option in processOptions"
75
- :key="option.value"
76
- :label="option.label"
77
- :value="option.value"
78
- />
79
- </el-select>
80
- <el-select v-model="sortMode" size="small" class="oa-task-list-panel__sort">
81
- <el-option label="超时优先" value="priority" />
82
- <el-option label="最新到达" value="latest" />
83
- <el-option label="金额降序" value="amount" />
84
- </el-select>
85
- <el-button
86
- link
87
- type="primary"
88
- class="oa-task-list-panel__save"
89
- :icon="CollectionTag"
90
- :disabled="!hasActiveFilter"
91
- @click="saveCurrentView"
92
- >
93
- 保存视图
94
- </el-button>
95
- </div>
96
-
97
- <div v-if="savedViews.length" class="oa-task-list-panel__views">
98
- <span class="oa-task-list-panel__views-label">常用视图</span>
99
- <button
100
- v-for="view in savedViews"
101
- :key="view.id"
102
- type="button"
103
- class="oa-saved-view"
104
- @click="applySavedView(view)"
105
- >
106
- {{ view.name }}
107
- <i role="button" aria-label="删除视图" @click.stop="oa.removeView(view.id)">
108
- <el-icon><Close /></el-icon>
109
- </i>
110
- </button>
111
- </div>
112
-
113
- <div class="oa-task-list-panel__list">
114
- <template v-if="filteredItems.length">
115
- <article
116
- v-for="item in filteredItems"
117
- :key="item.id"
118
- class="oa-task-item"
119
- :class="{
120
- 'is-active': activeItem?.id === item.id,
121
- 'is-overdue': item.overdue,
122
- 'is-selected': selectedIds.includes(item.id)
123
- }"
124
- >
125
- <el-checkbox
126
- v-if="oa.taskTab.value === 'approve' && batchMode"
127
- :model-value="selectedIds.includes(item.id)"
128
- class="oa-task-item__check"
129
- @click.stop
130
- @change="toggleSelected(item, $event)"
131
- />
132
- <div
133
- class="oa-task-item__main"
134
- role="button"
135
- tabindex="0"
136
- @click="select(item)"
137
- @keydown.enter="select(item)"
138
- @keydown.space.prevent="select(item)"
139
- >
140
- <div class="oa-task-item__top">
141
- <span class="oa-task-item__priority" :class="`is-${item.priorityMeta.tone}`">
142
- {{ item.priorityMeta.label }}
143
- </span>
144
- <strong>{{ item.title }}</strong>
145
- <span v-if="item.overdue" class="oa-chip oa-chip--danger">已超时</span>
146
- <span v-else-if="item.dueSoon" class="oa-chip oa-chip--warning">即将超时</span>
147
- </div>
148
- <div class="oa-task-item__meta">
149
- {{ item.initiatorName }} · {{ item.initiatorDept }}
150
- <i></i>
151
- {{ item.code }}
152
- </div>
153
- <div class="oa-task-item__node">
154
- <span>{{ item.kind === 'submit' ? '退回待提交' : item.nodeName }}</span>
155
- <em v-if="item.signModeLabel">{{ item.signModeLabel }}</em>
156
- <em v-if="item.progress.total > 1">{{ item.progress.approved }}/{{ item.progress.total }}</em>
157
- </div>
158
- <div class="oa-task-item__bottom">
159
- <span class="oa-num">{{ item.amount ? formatMoney(item.amount) : '—' }}</span>
160
- <span :class="{ 'is-danger': item.overdue }">
161
- {{ formatElapsed(item.arrivedAt, oa.now.value) }}
162
- </span>
163
- </div>
164
- </div>
165
- </article>
166
- </template>
167
- <div v-else class="oa-empty">
168
- <span class="oa-empty__icon">
169
- <el-icon><CircleCheck /></el-icon>
170
- </span>
171
- <strong>{{ emptyTitle }}</strong>
172
- <p>{{ emptyDescription }}</p>
173
- </div>
174
- </div>
175
-
176
- <div class="oa-task-list-panel__foot">
177
- <template v-if="oa.taskTab.value === 'approve'">
178
- <button
179
- type="button"
180
- class="oa-batch-toggle"
181
- :class="{ 'is-active': batchMode }"
182
- @click="toggleBatchMode"
183
- >
184
- {{ batchMode ? '退出批量' : '批量审批' }}
185
- </button>
186
- <template v-if="batchMode">
187
- <button type="button" class="oa-link" @click="toggleSelectAll">
188
- {{ allSelected ? '取消全选' : '全选' }}
189
- </button>
190
- <span class="oa-muted">已选 {{ selectedIds.length }} 项</span>
191
- <el-button
192
- size="small"
193
- type="primary"
194
- :disabled="!selectedIds.length"
195
- :loading="batchBusy"
196
- @click="batchApprove"
197
- >
198
- 批量同意
199
- </el-button>
200
- </template>
201
- <span v-else class="oa-muted">{{ filteredItems.length }} 项待办</span>
202
- </template>
203
- <span v-else class="oa-muted">
204
- 审核人退回后,你需要在“待我提交”中修改并重新提交
205
- </span>
206
- </div>
207
- </aside>
208
-
209
- <main class="oa-task-detail">
210
- <ApprovalWorkspace
211
- v-if="detailInstance"
212
- :instance="detailInstance"
213
- :task="detailTask"
214
- :dismissible="isMobile"
215
- @close="closeDetail"
216
- @handled="handleHandled"
217
- />
218
- <div v-else class="oa-card oa-task-empty">
219
- <div class="oa-empty">
220
- <span class="oa-empty__icon"><el-icon><Tickets /></el-icon></span>
221
- <strong>选择一项待办开始处理</strong>
222
- <p>左侧列表按超时和优先级排序,选择后可在此查看申请正文与流程轨迹。</p>
223
- </div>
224
- <div class="oa-task-empty__tips">
225
- <div>
226
- <span>01</span>
227
- <p><strong>先看摘要</strong>金额、等级、归属与当前节点一目了然</p>
228
- </div>
229
- <div>
230
- <span>02</span>
231
- <p><strong>再核轨迹</strong>查看前序意见、责任人与命中分支</p>
232
- </div>
233
- <div>
234
- <span>03</span>
235
- <p><strong>最后决策</strong>同意、退回、转办与加签均有明确结果</p>
236
- </div>
237
- </div>
238
- </div>
239
- </main>
240
- </div>
241
- </div>
242
- </template>
243
-
244
- <script setup>
245
- import { computed, inject, onBeforeUnmount, onMounted, ref, watch } from 'vue'
246
- import { ElMessage, ElMessageBox } from 'element-plus'
247
- import {
248
- CircleCheck,
249
- Close,
250
- CollectionTag,
251
- Refresh,
252
- Search,
253
- Tickets
254
- } from '@element-plus/icons-vue'
255
- import ApprovalWorkspace from '../components/ApprovalWorkspace.vue'
256
- import {
257
- formatElapsed,
258
- formatMoney,
259
- instanceCode,
260
- sameId
261
- } from '../model.js'
262
-
263
- defineOptions({ name: 'OaTaskCenterPage' })
264
-
265
- const oa = inject('oaStore')
266
-
267
- const keyword = ref('')
268
- const quick = ref('all')
269
- const processFilter = ref('')
270
- const sortMode = ref('priority')
271
- const batchMode = ref(false)
272
- const selectedIds = ref([])
273
- const batchBusy = ref(false)
274
- const continuous = ref(true)
275
- const isMobile = ref(false)
276
-
277
- const quickFilters = computed(() => {
278
- const items = currentItems.value
279
- return [
280
- { value: 'all', label: '全部' },
281
- {
282
- value: 'overdue',
283
- label: '已超时',
284
- count: items.filter((item) => item.overdue).length
285
- },
286
- {
287
- value: 'urgent',
288
- label: '加急',
289
- count: items.filter((item) => item.priority === 'urgent').length
290
- },
291
- {
292
- value: 'high',
293
- label: '优先',
294
- count: items.filter((item) => item.priority === 'high').length
295
- }
296
- ]
297
- })
298
-
299
- const currentItems = computed(() =>
300
- oa.taskTab.value === 'approve' ? oa.approveItems.value : oa.submitItems.value
301
- )
302
-
303
- const processOptions = computed(() => {
304
- const map = new Map()
305
- currentItems.value.forEach((item) => {
306
- const name = item.instance.definition?.meta?.name || '未命名流程'
307
- map.set(name, (map.get(name) || 0) + 1)
308
- })
309
- return [...map.entries()].map(([label, count]) => ({
310
- value: label,
311
- label: `${label}(${count})`
312
- }))
313
- })
314
-
315
- const filteredItems = computed(() => {
316
- const text = keyword.value.trim().toLowerCase()
317
- const items = currentItems.value.filter((item) => {
318
- if (quick.value === 'overdue' && !item.overdue) return false
319
- if (quick.value === 'urgent' && item.priority !== 'urgent') return false
320
- if (quick.value === 'high' && item.priority !== 'high') return false
321
- if (
322
- processFilter.value &&
323
- item.instance.definition?.meta?.name !== processFilter.value
324
- ) {
325
- return false
326
- }
327
- if (!text) return true
328
- return [item.title, item.code, item.initiatorName, item.nodeName, instanceCode(item.instance)]
329
- .filter(Boolean)
330
- .some((field) => String(field).toLowerCase().includes(text))
331
- })
332
- return items.sort((left, right) => {
333
- if (sortMode.value === 'latest') {
334
- return String(right.arrivedAt).localeCompare(String(left.arrivedAt))
335
- }
336
- if (sortMode.value === 'amount') {
337
- return (right.amount || 0) - (left.amount || 0)
338
- }
339
- if (left.overdue !== right.overdue) return left.overdue ? -1 : 1
340
- if (left.priority !== right.priority) {
341
- const ranks = { urgent: 0, high: 1, normal: 2 }
342
- return ranks[left.priority] - ranks[right.priority]
343
- }
344
- return String(left.arrivedAt).localeCompare(String(right.arrivedAt))
345
- })
346
- })
347
-
348
- const activeItem = computed(() =>
349
- currentItems.value.find(
350
- (item) =>
351
- sameId(item.instance.id, oa.activeInstanceId.value) &&
352
- sameId(item.task.id, oa.activeTaskId.value)
353
- )
354
- )
355
-
356
- const detailInstance = computed(() => {
357
- if (oa.activeInstance.value) return oa.activeInstance.value
358
- return filteredItems.value[0]?.instance || null
359
- })
360
-
361
- const detailTask = computed(() => {
362
- if (oa.activeInstance.value) return oa.activeTask.value
363
- return filteredItems.value[0]?.task || null
364
- })
365
-
366
- const savedViews = computed(() =>
367
- oa.savedViews.value.filter(
368
- (view) =>
369
- view.scope === 'tasks' &&
370
- (view.userId === undefined || String(view.userId) === String(oa.currentUserId.value))
371
- )
372
- )
373
-
374
- const hasActiveFilter = computed(
375
- () => Boolean(keyword.value.trim() || quick.value !== 'all' || processFilter.value)
376
- )
377
-
378
- const allSelected = computed(
379
- () =>
380
- filteredItems.value.length > 0 &&
381
- filteredItems.value.every((item) => selectedIds.value.includes(item.id))
382
- )
383
-
384
- const emptyTitle = computed(() =>
385
- oa.taskTab.value === 'approve' ? '没有匹配的待办' : '没有待提交的申请'
386
- )
387
- const emptyDescription = computed(() =>
388
- oa.taskTab.value === 'approve'
389
- ? '新的审批任务到达后会实时出现在这里。也可以调整筛选条件查看其他任务。'
390
- : '被审批人退回的申请会出现在这里,修改表单后可重新提交。'
391
- )
392
-
393
- const mobileMedia = () => {
394
- if (typeof window === 'undefined' || !window.matchMedia) return null
395
- return window.matchMedia('(max-width: 960px)')
396
- }
397
- let mediaQuery = null
398
-
399
- function handleMediaChange(event) {
400
- isMobile.value = event.matches
401
- }
402
-
403
- onMounted(() => {
404
- mediaQuery = mobileMedia()
405
- if (mediaQuery) {
406
- isMobile.value = mediaQuery.matches
407
- mediaQuery.addEventListener?.('change', handleMediaChange)
408
- }
409
- if (!isMobile.value && !activeItem.value && filteredItems.value.length) {
410
- select(filteredItems.value[0])
411
- }
412
- })
413
-
414
- onBeforeUnmount(() => {
415
- mediaQuery?.removeEventListener?.('change', handleMediaChange)
416
- })
417
-
418
- watch(
419
- () => oa.currentUserId.value,
420
- () => {
421
- selectedIds.value = []
422
- batchMode.value = false
423
- if (isMobile.value) closeDetail()
424
- else if (filteredItems.value.length) select(filteredItems.value[0])
425
- else oa.selectTask(null, null)
426
- }
427
- )
428
-
429
- watch(
430
- () => oa.taskTab.value,
431
- () => {
432
- selectedIds.value = []
433
- batchMode.value = false
434
- if (filteredItems.value.length && !isMobile.value) select(filteredItems.value[0])
435
- else oa.selectTask(null, null)
436
- }
437
- )
438
-
439
- watch([quick, keyword, processFilter], () => {
440
- selectedIds.value = []
441
- batchMode.value = false
442
- })
443
-
444
- function select(item) {
445
- oa.selectTask(item.instance.id, item.task.id)
446
- }
447
-
448
- function switchTab(tab) {
449
- oa.taskTab.value = tab
450
- }
451
-
452
- function refresh() {
453
- oa.tickAllInstances()
454
- oa.now.value = Date.now()
455
- ElMessage.success('待办已刷新')
456
- }
457
-
458
- function closeDetail() {
459
- oa.selectTask(null, null)
460
- }
461
-
462
- function toggleSelected(item, checked) {
463
- if (checked) {
464
- if (!selectedIds.value.includes(item.id)) {
465
- selectedIds.value = [...selectedIds.value, item.id]
466
- }
467
- } else {
468
- selectedIds.value = selectedIds.value.filter((id) => id !== item.id)
469
- }
470
- }
471
-
472
- function toggleBatchMode() {
473
- batchMode.value = !batchMode.value
474
- if (!batchMode.value) selectedIds.value = []
475
- }
476
-
477
- function toggleSelectAll() {
478
- selectedIds.value = allSelected.value
479
- ? []
480
- : filteredItems.value.map((item) => item.id)
481
- }
482
-
483
- async function batchApprove() {
484
- const chosen = filteredItems.value.filter((item) => selectedIds.value.includes(item.id))
485
- if (!chosen.length) return
486
- try {
487
- await ElMessageBox.confirm(
488
- `将同意 ${chosen.length} 项审批任务。批量操作仅执行“同意”,需要退回或转办的任务请逐件处理。`,
489
- '批量同意',
490
- {
491
- type: 'warning',
492
- confirmButtonText: '确认同意',
493
- cancelButtonText: '取消'
494
- }
495
- )
496
- } catch {
497
- return
498
- }
499
- batchBusy.value = true
500
- let success = 0
501
- const failures = []
502
- chosen.forEach((item) => {
503
- try {
504
- oa.actOnTask(item.instance.id, item.task.id, 'approve', {
505
- comment: '批量审批通过'
506
- })
507
- success += 1
508
- } catch (error) {
509
- failures.push(`${item.title}:${error.message}`)
510
- }
511
- })
512
- batchBusy.value = false
513
- selectedIds.value = []
514
- batchMode.value = false
515
- if (success) {
516
- ElMessage.success(`已同意 ${success} 项审批任务`)
517
- }
518
- if (failures.length) {
519
- ElMessage.warning(`${failures.length} 项处理失败,可能已被其他审批人处理`)
520
- }
521
- setTimeout(() => {
522
- if (filteredItems.value.length) select(filteredItems.value[0])
523
- else oa.selectTask(null, null)
524
- }, 0)
525
- }
526
-
527
- async function saveCurrentView() {
528
- try {
529
- const { value } = await ElMessageBox.prompt('为当前筛选条件命名', '保存常用视图', {
530
- confirmButtonText: '保存',
531
- cancelButtonText: '取消',
532
- inputPlaceholder: '例如:我的超时采购',
533
- inputValidator: (text) => Boolean(String(text || '').trim()) || '请输入视图名称'
534
- })
535
- oa.saveView({
536
- name: String(value).trim(),
537
- scope: 'tasks',
538
- filter: {
539
- keyword: keyword.value,
540
- quick: quick.value,
541
- processFilter: processFilter.value,
542
- sortMode: sortMode.value
543
- }
544
- })
545
- ElMessage.success('视图已保存')
546
- } catch {
547
- // 用户取消
548
- }
549
- }
550
-
551
- function applySavedView(view) {
552
- const filter = view.filter || {}
553
- keyword.value = filter.keyword || ''
554
- quick.value = filter.quick || 'all'
555
- processFilter.value = filter.processFilter || ''
556
- sortMode.value = filter.sortMode || 'priority'
557
- }
558
-
559
- function handleHandled(payload) {
560
- const handledId = `${oa.activeInstanceId.value}:${oa.activeTaskId.value}`
561
- setTimeout(() => {
562
- if (payload?.type === 'addSign') {
563
- return
564
- }
565
- if (continuous.value) {
566
- const next = filteredItems.value.find((item) => item.id !== handledId)
567
- if (next) {
568
- select(next)
569
- return
570
- }
571
- }
572
- oa.activeTaskId.value = null
573
- if (isMobile.value) closeDetail()
574
- }, 0)
575
- }
576
- </script>
577
-
578
- <style scoped lang="scss">
579
- .oa-taskcenter {
580
- display: flex;
581
- flex-direction: column;
582
- height: 100%;
583
- min-height: 0;
584
- padding: 18px 20px 20px;
585
- }
586
-
587
- .oa-taskcenter__head {
588
- flex-shrink: 0;
589
- display: flex;
590
- align-items: flex-start;
591
- justify-content: space-between;
592
- gap: 16px;
593
- padding-bottom: 9px;
594
- }
595
-
596
- .oa-taskcenter__head .oa-subtitle {
597
- margin-top: 3px;
598
- }
599
-
600
- .oa-taskcenter__head-right {
601
- display: flex;
602
- align-items: center;
603
- gap: 12px;
604
- padding-top: 16px;
605
-
606
- .el-button {
607
- min-height: 32px;
608
- }
609
- }
610
-
611
- .oa-switch {
612
- display: inline-flex;
613
- align-items: center;
614
- gap: 6px;
615
- color: var(--oa-muted);
616
- font-size: 11.5px;
617
- cursor: pointer;
618
- }
619
-
620
- .oa-taskcenter__body {
621
- flex: 1;
622
- min-height: 0;
623
- display: grid;
624
- grid-template-columns: 376px minmax(0, 1fr);
625
- gap: 14px;
626
- }
627
-
628
- .oa-task-list-panel {
629
- display: flex;
630
- flex-direction: column;
631
- min-height: 0;
632
- overflow: hidden;
633
- }
634
-
635
- .oa-task-list-panel__head {
636
- flex-shrink: 0;
637
- display: flex;
638
- flex-direction: column;
639
- gap: 9px;
640
- padding: 12px 13px 9px;
641
- border-bottom: 1px solid var(--oa-line);
642
- }
643
-
644
- .oa-segment {
645
- display: inline-flex;
646
- gap: 2px;
647
- padding: 2px;
648
- border-radius: 7px;
649
- background: #f1f4f9;
650
-
651
- button {
652
- display: inline-flex;
653
- align-items: center;
654
- justify-content: center;
655
- gap: 5px;
656
- flex: 1;
657
- padding: 4px 9px;
658
- border: none;
659
- border-radius: 5px;
660
- background: transparent;
661
- color: var(--oa-muted);
662
- font-size: 11.5px;
663
- cursor: pointer;
664
-
665
- em {
666
- display: inline-grid;
667
- place-items: center;
668
- min-width: 16px;
669
- height: 16px;
670
- padding: 0 4px;
671
- border-radius: 8px;
672
- background: #e3e8f0;
673
- color: #67758a;
674
- font-size: 9px;
675
- font-style: normal;
676
- font-weight: 600;
677
- }
678
-
679
- &.is-active {
680
- background: #fff;
681
- color: var(--oa-ink);
682
- font-weight: 600;
683
- box-shadow: 0 1px 3px rgba(15, 31, 55, 0.08);
684
-
685
- em {
686
- background: var(--oa-primary-soft);
687
- color: var(--oa-primary);
688
- }
689
- }
690
- }
691
- }
692
-
693
- .oa-segment--lg button {
694
- padding: 6px 10px;
695
- font-size: 12px;
696
- }
697
-
698
- .oa-task-list-panel__filters {
699
- display: flex;
700
- align-items: center;
701
- flex-wrap: wrap;
702
- gap: 5px;
703
- padding: 9px 13px 8px;
704
- border-bottom: 1px solid #f0f3f8;
705
- }
706
-
707
- .oa-filter-pill {
708
- display: inline-flex;
709
- align-items: center;
710
- gap: 4px;
711
- padding: 3px 8px;
712
- border: 1px solid transparent;
713
- border-radius: 4px;
714
- background: #f3f6fa;
715
- color: var(--oa-muted);
716
- font-size: 10.5px;
717
- cursor: pointer;
718
-
719
- span {
720
- color: var(--oa-faint);
721
- font-size: 9.5px;
722
- }
723
-
724
- &:hover {
725
- color: var(--oa-primary);
726
- }
727
-
728
- &.is-active {
729
- border-color: #cbd9f5;
730
- background: var(--oa-primary-soft);
731
- color: var(--oa-primary);
732
- font-weight: 600;
733
-
734
- span {
735
- color: var(--oa-primary);
736
- }
737
- }
738
- }
739
-
740
- .oa-task-list-panel__process,
741
- .oa-task-list-panel__sort {
742
- width: 108px;
743
- margin-left: 1px;
744
-
745
- :deep(.el-select__wrapper) {
746
- min-height: 25px;
747
- padding: 2px 8px;
748
- box-shadow: none;
749
- background: #f3f6fa;
750
- font-size: 10.5px;
751
- }
752
- }
753
-
754
- .oa-task-list-panel__sort {
755
- width: 92px;
756
- }
757
-
758
- .oa-task-list-panel__save {
759
- margin-left: auto;
760
- font-size: 10.5px;
761
- }
762
-
763
- .oa-task-list-panel__views {
764
- flex-shrink: 0;
765
- display: flex;
766
- align-items: center;
767
- flex-wrap: wrap;
768
- gap: 5px;
769
- padding: 7px 13px;
770
- border-bottom: 1px solid #f0f3f8;
771
- }
772
-
773
- .oa-task-list-panel__views-label {
774
- color: var(--oa-faint);
775
- font-size: 10px;
776
- }
777
-
778
- .oa-saved-view {
779
- display: inline-flex;
780
- align-items: center;
781
- gap: 4px;
782
- padding: 2px 6px;
783
- border: 1px solid var(--oa-line);
784
- border-radius: 4px;
785
- background: #fff;
786
- color: var(--oa-muted);
787
- font-size: 10px;
788
- cursor: pointer;
789
-
790
- &:hover {
791
- border-color: #c9d7f4;
792
- color: var(--oa-primary);
793
- }
794
-
795
- i {
796
- display: inline-flex;
797
- color: #aeb8c7;
798
- font-size: 9px;
799
- }
800
- }
801
-
802
- .oa-task-list-panel__list {
803
- flex: 1;
804
- min-height: 0;
805
- overflow: auto;
806
- padding: 6px;
807
- }
808
-
809
- .oa-task-item {
810
- display: flex;
811
- align-items: stretch;
812
- gap: 7px;
813
- padding: 10px 10px 10px 8px;
814
- border: 1px solid transparent;
815
- border-radius: 8px;
816
- cursor: pointer;
817
- transition: background 0.15s ease, border-color 0.15s ease;
818
-
819
- + .oa-task-item {
820
- margin-top: 2px;
821
- }
822
-
823
- &:hover {
824
- background: #f8faff;
825
- }
826
-
827
- &.is-active {
828
- border-color: #cbdcff;
829
- background: #f5f8ff;
830
- box-shadow: inset 2px 0 0 var(--oa-primary);
831
- }
832
-
833
- &.is-selected {
834
- background: #f7f9ff;
835
- }
836
- }
837
-
838
- .oa-task-item__check {
839
- align-self: flex-start;
840
- margin-top: 2px;
841
- }
842
-
843
- .oa-task-item__main {
844
- flex: 1;
845
- min-width: 0;
846
- padding: 0;
847
- border: none;
848
- background: transparent;
849
- color: inherit;
850
- font: inherit;
851
- text-align: left;
852
- cursor: pointer;
853
- }
854
-
855
- .oa-task-item__top {
856
- display: flex;
857
- align-items: center;
858
- gap: 5px;
859
- min-width: 0;
860
-
861
- strong {
862
- flex: 1;
863
- overflow: hidden;
864
- color: var(--oa-ink);
865
- font-size: 12.5px;
866
- font-weight: 600;
867
- text-overflow: ellipsis;
868
- white-space: nowrap;
869
- }
870
- }
871
-
872
- .oa-task-item__priority {
873
- flex-shrink: 0;
874
- padding: 0 4px;
875
- border-radius: 3px;
876
- background: #f0f3f8;
877
- color: #6e7c90;
878
- font-size: 9px;
879
- font-weight: 600;
880
- line-height: 16px;
881
-
882
- &.is-danger {
883
- background: var(--oa-danger-soft);
884
- color: var(--oa-danger);
885
- }
886
-
887
- &.is-warning {
888
- background: var(--oa-warning-soft);
889
- color: var(--oa-warning);
890
- }
891
- }
892
-
893
- .oa-task-item__meta {
894
- display: flex;
895
- align-items: center;
896
- gap: 5px;
897
- margin-top: 4px;
898
- color: var(--oa-faint);
899
- font-size: 10.5px;
900
- overflow: hidden;
901
- white-space: nowrap;
902
-
903
- i {
904
- width: 2px;
905
- height: 2px;
906
- border-radius: 50%;
907
- background: #c5cedd;
908
- }
909
- }
910
-
911
- .oa-task-item__node {
912
- display: flex;
913
- align-items: center;
914
- gap: 5px;
915
- margin-top: 6px;
916
- color: var(--oa-muted);
917
- font-size: 10.5px;
918
-
919
- span {
920
- padding: 1px 5px;
921
- border-radius: 3px;
922
- background: #f1f4f9;
923
- }
924
-
925
- em {
926
- color: var(--oa-faint);
927
- font-size: 9.5px;
928
- font-style: normal;
929
- }
930
- }
931
-
932
- .oa-task-item__bottom {
933
- display: flex;
934
- align-items: center;
935
- justify-content: space-between;
936
- gap: 8px;
937
- margin-top: 5px;
938
- color: var(--oa-faint);
939
- font-size: 10px;
940
-
941
- span:first-child {
942
- color: var(--oa-ink);
943
- font-size: 11px;
944
- font-weight: 600;
945
- }
946
-
947
- .is-danger {
948
- color: var(--oa-danger);
949
- font-weight: 600;
950
- }
951
- }
952
-
953
- .oa-task-list-panel__foot {
954
- flex-shrink: 0;
955
- display: flex;
956
- align-items: center;
957
- gap: 8px;
958
- min-height: 42px;
959
- padding: 7px 13px;
960
- border-top: 1px solid var(--oa-line);
961
- background: #fcfdff;
962
- color: var(--oa-faint);
963
- font-size: 10.5px;
964
-
965
- .oa-muted:first-of-type {
966
- margin-right: auto;
967
- }
968
-
969
- .el-button {
970
- margin-left: auto;
971
- }
972
- }
973
-
974
- .oa-batch-toggle {
975
- padding: 3px 8px;
976
- border: 1px solid var(--oa-line);
977
- border-radius: 4px;
978
- background: #fff;
979
- color: var(--oa-muted);
980
- font-size: 10.5px;
981
- cursor: pointer;
982
-
983
- &.is-active {
984
- border-color: #cbdcff;
985
- background: var(--oa-primary-soft);
986
- color: var(--oa-primary);
987
- }
988
- }
989
-
990
- .oa-task-detail {
991
- min-width: 0;
992
- min-height: 0;
993
- overflow: hidden;
994
- border: 1px solid var(--oa-line);
995
- border-radius: var(--oa-radius);
996
- background: #fff;
997
- box-shadow: var(--oa-shadow);
998
- }
999
-
1000
- .oa-task-empty {
1001
- display: flex;
1002
- flex-direction: column;
1003
- justify-content: center;
1004
- height: 100%;
1005
- background:
1006
- radial-gradient(circle at 50% 30%, rgba(36, 86, 214, 0.045), transparent 46%),
1007
- #fff;
1008
- }
1009
-
1010
- .oa-task-empty__tips {
1011
- display: flex;
1012
- justify-content: center;
1013
- flex-wrap: wrap;
1014
- gap: 12px;
1015
- padding: 0 40px 60px;
1016
-
1017
- div {
1018
- display: flex;
1019
- align-items: flex-start;
1020
- gap: 8px;
1021
- width: 210px;
1022
- padding: 12px;
1023
- border: 1px solid var(--oa-line);
1024
- border-radius: 8px;
1025
- background: rgba(255, 255, 255, 0.7);
1026
-
1027
- > span {
1028
- color: #b6c3d8;
1029
- font-size: 12px;
1030
- font-weight: 700;
1031
- font-variant-numeric: tabular-nums;
1032
- }
1033
-
1034
- p {
1035
- margin: 0;
1036
- color: var(--oa-faint);
1037
- font-size: 10.5px;
1038
- line-height: 1.65;
1039
-
1040
- strong {
1041
- display: block;
1042
- margin-bottom: 2px;
1043
- color: var(--oa-muted);
1044
- font-size: 11px;
1045
- }
1046
- }
1047
- }
1048
- }
1049
-
1050
- @media (max-width: 1300px) {
1051
- .oa-taskcenter__body {
1052
- grid-template-columns: 350px minmax(0, 1fr);
1053
- }
1054
- }
1055
-
1056
- @media (max-width: 960px) {
1057
- .oa-taskcenter {
1058
- height: calc(100% - 1px);
1059
- padding: 12px 10px 70px;
1060
- }
1061
-
1062
- .oa-taskcenter__head {
1063
- padding-bottom: 10px;
1064
- }
1065
-
1066
- .oa-taskcenter__head-right {
1067
- display: none;
1068
- }
1069
-
1070
- .oa-taskcenter__body {
1071
- display: block;
1072
- min-height: 0;
1073
- }
1074
-
1075
- .oa-task-list-panel {
1076
- height: 100%;
1077
- border: none;
1078
- box-shadow: none;
1079
- background: transparent;
1080
- }
1081
-
1082
- .oa-task-list-panel__head,
1083
- .oa-task-list-panel__filters,
1084
- .oa-task-list-panel__views {
1085
- background: #fff;
1086
- border: 1px solid var(--oa-line);
1087
- border-bottom: none;
1088
- }
1089
-
1090
- .oa-task-list-panel__head {
1091
- border-radius: var(--oa-radius) var(--oa-radius) 0 0;
1092
- }
1093
-
1094
- .oa-task-list-panel__list {
1095
- background: #fff;
1096
- border-right: 1px solid var(--oa-line);
1097
- border-left: 1px solid var(--oa-line);
1098
- padding: 6px 8px;
1099
- }
1100
-
1101
- .oa-task-list-panel__foot {
1102
- border: 1px solid var(--oa-line);
1103
- border-radius: 0 0 var(--oa-radius) var(--oa-radius);
1104
- }
1105
-
1106
- .oa-task-detail {
1107
- display: none;
1108
- height: 100%;
1109
- border: none;
1110
- box-shadow: none;
1111
- }
1112
-
1113
- .oa-taskcenter.is-mobile-detail {
1114
- padding: 0;
1115
- padding-bottom: 0;
1116
- }
1117
-
1118
- .oa-taskcenter.is-mobile-detail .oa-taskcenter__head,
1119
- .oa-taskcenter.is-mobile-detail .oa-task-list-panel {
1120
- display: none;
1121
- }
1122
-
1123
- .oa-taskcenter.is-mobile-detail .oa-task-detail {
1124
- display: block;
1125
- border-radius: 0;
1126
- }
1127
-
1128
- .oa-task-list-panel__process,
1129
- .oa-task-list-panel__sort {
1130
- width: calc(50% - 4px);
1131
- }
1132
-
1133
- .oa-task-list-panel__save {
1134
- margin-left: 0;
1135
- }
1136
- }
1137
-
1138
- @media (max-width: 560px) {
1139
- .oa-taskcenter {
1140
- padding-bottom: 60px;
1141
- }
1142
-
1143
- .oa-taskcenter__head .oa-subtitle {
1144
- display: none;
1145
- }
1146
-
1147
- .oa-task-list-panel__head {
1148
- gap: 7px;
1149
- }
1150
-
1151
- .oa-task-item {
1152
- padding: 10px 8px;
1153
- }
1154
- }
1155
- </style>
1
+ <template>
2
+ <div
3
+ class="oa-taskcenter"
4
+ :class="{ 'is-mobile-detail': isMobile && activeItem }"
5
+ >
6
+ <header class="oa-taskcenter__head">
7
+ <div>
8
+ <p class="oa-eyebrow">审批协同</p>
9
+ <h1 class="oa-title">待办中心</h1>
10
+ <p class="oa-subtitle">
11
+ 按超时与优先级处理任务;审批动作只对当前任务责任人开放。
12
+ </p>
13
+ </div>
14
+ <div class="oa-taskcenter__head-right">
15
+ <label class="oa-switch">
16
+ <el-switch v-model="continuous" size="small" />
17
+ <span>连续办理</span>
18
+ </label>
19
+ <el-button plain :icon="Refresh" @click="refresh">刷新</el-button>
20
+ </div>
21
+ </header>
22
+
23
+ <div class="oa-taskcenter__body">
24
+ <aside class="oa-task-list-panel oa-card">
25
+ <div class="oa-task-list-panel__head">
26
+ <div class="oa-segment oa-segment--lg">
27
+ <button
28
+ type="button"
29
+ :class="{ 'is-active': oa.taskTab.value === 'approve' }"
30
+ @click="switchTab('approve')"
31
+ >
32
+ 待我审批
33
+ <em>{{ oa.approveItems.value.length }}</em>
34
+ </button>
35
+ <button
36
+ type="button"
37
+ :class="{ 'is-active': oa.taskTab.value === 'submit' }"
38
+ @click="switchTab('submit')"
39
+ >
40
+ 待我提交
41
+ <em>{{ oa.submitItems.value.length }}</em>
42
+ </button>
43
+ </div>
44
+
45
+ <el-input
46
+ v-model="keyword"
47
+ :prefix-icon="Search"
48
+ placeholder="搜索标题、单号、发起人"
49
+ clearable
50
+ size="small"
51
+ />
52
+ </div>
53
+
54
+ <div class="oa-task-list-panel__filters">
55
+ <button
56
+ v-for="option in quickFilters"
57
+ :key="option.value"
58
+ type="button"
59
+ class="oa-filter-pill"
60
+ :class="{ 'is-active': quick === option.value }"
61
+ @click="quick = option.value"
62
+ >
63
+ {{ option.label }}
64
+ <span v-if="option.count !== undefined">{{ option.count }}</span>
65
+ </button>
66
+ <el-select
67
+ v-model="processFilter"
68
+ size="small"
69
+ class="oa-task-list-panel__process"
70
+ placeholder="全部流程"
71
+ clearable
72
+ >
73
+ <el-option
74
+ v-for="option in processOptions"
75
+ :key="option.value"
76
+ :label="option.label"
77
+ :value="option.value"
78
+ />
79
+ </el-select>
80
+ <el-select v-model="sortMode" size="small" class="oa-task-list-panel__sort">
81
+ <el-option label="超时优先" value="priority" />
82
+ <el-option label="最新到达" value="latest" />
83
+ <el-option label="金额降序" value="amount" />
84
+ </el-select>
85
+ <el-button
86
+ link
87
+ type="primary"
88
+ class="oa-task-list-panel__save"
89
+ :icon="CollectionTag"
90
+ :disabled="!hasActiveFilter"
91
+ @click="saveCurrentView"
92
+ >
93
+ 保存视图
94
+ </el-button>
95
+ </div>
96
+
97
+ <div v-if="savedViews.length" class="oa-task-list-panel__views">
98
+ <span class="oa-task-list-panel__views-label">常用视图</span>
99
+ <button
100
+ v-for="view in savedViews"
101
+ :key="view.id"
102
+ type="button"
103
+ class="oa-saved-view"
104
+ @click="applySavedView(view)"
105
+ >
106
+ {{ view.name }}
107
+ <i role="button" aria-label="删除视图" @click.stop="oa.removeView(view.id)">
108
+ <el-icon><Close /></el-icon>
109
+ </i>
110
+ </button>
111
+ </div>
112
+
113
+ <div class="oa-task-list-panel__list">
114
+ <template v-if="filteredItems.length">
115
+ <article
116
+ v-for="item in filteredItems"
117
+ :key="item.id"
118
+ class="oa-task-item"
119
+ :class="{
120
+ 'is-active': activeItem?.id === item.id,
121
+ 'is-overdue': item.overdue,
122
+ 'is-selected': selectedIds.includes(item.id)
123
+ }"
124
+ >
125
+ <el-checkbox
126
+ v-if="oa.taskTab.value === 'approve' && batchMode"
127
+ :model-value="selectedIds.includes(item.id)"
128
+ class="oa-task-item__check"
129
+ @click.stop
130
+ @change="toggleSelected(item, $event)"
131
+ />
132
+ <div
133
+ class="oa-task-item__main"
134
+ role="button"
135
+ tabindex="0"
136
+ @click="select(item)"
137
+ @keydown.enter="select(item)"
138
+ @keydown.space.prevent="select(item)"
139
+ >
140
+ <div class="oa-task-item__top">
141
+ <span class="oa-task-item__priority" :class="`is-${item.priorityMeta.tone}`">
142
+ {{ item.priorityMeta.label }}
143
+ </span>
144
+ <strong>{{ item.title }}</strong>
145
+ <span v-if="item.overdue" class="oa-chip oa-chip--danger">已超时</span>
146
+ <span v-else-if="item.dueSoon" class="oa-chip oa-chip--warning">即将超时</span>
147
+ </div>
148
+ <div class="oa-task-item__meta">
149
+ {{ item.initiatorName }} · {{ item.initiatorDept }}
150
+ <i></i>
151
+ {{ item.code }}
152
+ </div>
153
+ <div class="oa-task-item__node">
154
+ <span>{{ item.kind === 'submit' ? '退回待提交' : item.nodeName }}</span>
155
+ <em v-if="item.signModeLabel">{{ item.signModeLabel }}</em>
156
+ <em v-if="item.progress.total > 1">{{ item.progress.approved }}/{{ item.progress.total }}</em>
157
+ </div>
158
+ <div class="oa-task-item__bottom">
159
+ <span class="oa-num">{{ item.amount ? formatMoney(item.amount) : '—' }}</span>
160
+ <span :class="{ 'is-danger': item.overdue }">
161
+ {{ formatElapsed(item.arrivedAt, oa.now.value) }}
162
+ </span>
163
+ </div>
164
+ </div>
165
+ </article>
166
+ </template>
167
+ <div v-else class="oa-empty">
168
+ <span class="oa-empty__icon">
169
+ <el-icon><CircleCheck /></el-icon>
170
+ </span>
171
+ <strong>{{ emptyTitle }}</strong>
172
+ <p>{{ emptyDescription }}</p>
173
+ </div>
174
+ </div>
175
+
176
+ <div class="oa-task-list-panel__foot">
177
+ <template v-if="oa.taskTab.value === 'approve'">
178
+ <button
179
+ type="button"
180
+ class="oa-batch-toggle"
181
+ :class="{ 'is-active': batchMode }"
182
+ @click="toggleBatchMode"
183
+ >
184
+ {{ batchMode ? '退出批量' : '批量审批' }}
185
+ </button>
186
+ <template v-if="batchMode">
187
+ <button type="button" class="oa-link" @click="toggleSelectAll">
188
+ {{ allSelected ? '取消全选' : '全选' }}
189
+ </button>
190
+ <span class="oa-muted">已选 {{ selectedIds.length }} 项</span>
191
+ <el-button
192
+ size="small"
193
+ type="primary"
194
+ :disabled="!selectedIds.length"
195
+ :loading="batchBusy"
196
+ @click="batchApprove"
197
+ >
198
+ 批量同意
199
+ </el-button>
200
+ </template>
201
+ <span v-else class="oa-muted">{{ filteredItems.length }} 项待办</span>
202
+ </template>
203
+ <span v-else class="oa-muted">
204
+ 审核人退回后,你需要在“待我提交”中修改并重新提交
205
+ </span>
206
+ </div>
207
+ </aside>
208
+
209
+ <main class="oa-task-detail">
210
+ <ApprovalWorkspace
211
+ v-if="detailInstance"
212
+ :instance="detailInstance"
213
+ :task="detailTask"
214
+ :dismissible="isMobile"
215
+ @close="closeDetail"
216
+ @handled="handleHandled"
217
+ />
218
+ <div v-else class="oa-card oa-task-empty">
219
+ <div class="oa-empty">
220
+ <span class="oa-empty__icon"><el-icon><Tickets /></el-icon></span>
221
+ <strong>选择一项待办开始处理</strong>
222
+ <p>左侧列表按超时和优先级排序,选择后可在此查看申请正文与流程轨迹。</p>
223
+ </div>
224
+ <div class="oa-task-empty__tips">
225
+ <div>
226
+ <span>01</span>
227
+ <p><strong>先看摘要</strong>金额、等级、归属与当前节点一目了然</p>
228
+ </div>
229
+ <div>
230
+ <span>02</span>
231
+ <p><strong>再核轨迹</strong>查看前序意见、责任人与命中分支</p>
232
+ </div>
233
+ <div>
234
+ <span>03</span>
235
+ <p><strong>最后决策</strong>同意、退回、转办与加签均有明确结果</p>
236
+ </div>
237
+ </div>
238
+ </div>
239
+ </main>
240
+ </div>
241
+ </div>
242
+ </template>
243
+
244
+ <script setup>
245
+ import { computed, inject, onBeforeUnmount, onMounted, ref, watch } from 'vue'
246
+ import { ElMessage, ElMessageBox } from 'element-plus'
247
+ import {
248
+ CircleCheck,
249
+ Close,
250
+ CollectionTag,
251
+ Refresh,
252
+ Search,
253
+ Tickets
254
+ } from 'gbicons'
255
+ import ApprovalWorkspace from '../components/ApprovalWorkspace.vue'
256
+ import {
257
+ formatElapsed,
258
+ formatMoney,
259
+ instanceCode,
260
+ sameId
261
+ } from '../model.js'
262
+
263
+ defineOptions({ name: 'OaTaskCenterPage' })
264
+
265
+ const oa = inject('oaStore')
266
+
267
+ const keyword = ref('')
268
+ const quick = ref('all')
269
+ const processFilter = ref('')
270
+ const sortMode = ref('priority')
271
+ const batchMode = ref(false)
272
+ const selectedIds = ref([])
273
+ const batchBusy = ref(false)
274
+ const continuous = ref(true)
275
+ const isMobile = ref(false)
276
+
277
+ const quickFilters = computed(() => {
278
+ const items = currentItems.value
279
+ return [
280
+ { value: 'all', label: '全部' },
281
+ {
282
+ value: 'overdue',
283
+ label: '已超时',
284
+ count: items.filter((item) => item.overdue).length
285
+ },
286
+ {
287
+ value: 'urgent',
288
+ label: '加急',
289
+ count: items.filter((item) => item.priority === 'urgent').length
290
+ },
291
+ {
292
+ value: 'high',
293
+ label: '优先',
294
+ count: items.filter((item) => item.priority === 'high').length
295
+ }
296
+ ]
297
+ })
298
+
299
+ const currentItems = computed(() =>
300
+ oa.taskTab.value === 'approve' ? oa.approveItems.value : oa.submitItems.value
301
+ )
302
+
303
+ const processOptions = computed(() => {
304
+ const map = new Map()
305
+ currentItems.value.forEach((item) => {
306
+ const name = item.instance.definition?.meta?.name || '未命名流程'
307
+ map.set(name, (map.get(name) || 0) + 1)
308
+ })
309
+ return [...map.entries()].map(([label, count]) => ({
310
+ value: label,
311
+ label: `${label}(${count})`
312
+ }))
313
+ })
314
+
315
+ const filteredItems = computed(() => {
316
+ const text = keyword.value.trim().toLowerCase()
317
+ const items = currentItems.value.filter((item) => {
318
+ if (quick.value === 'overdue' && !item.overdue) return false
319
+ if (quick.value === 'urgent' && item.priority !== 'urgent') return false
320
+ if (quick.value === 'high' && item.priority !== 'high') return false
321
+ if (
322
+ processFilter.value &&
323
+ item.instance.definition?.meta?.name !== processFilter.value
324
+ ) {
325
+ return false
326
+ }
327
+ if (!text) return true
328
+ return [item.title, item.code, item.initiatorName, item.nodeName, instanceCode(item.instance)]
329
+ .filter(Boolean)
330
+ .some((field) => String(field).toLowerCase().includes(text))
331
+ })
332
+ return items.sort((left, right) => {
333
+ if (sortMode.value === 'latest') {
334
+ return String(right.arrivedAt).localeCompare(String(left.arrivedAt))
335
+ }
336
+ if (sortMode.value === 'amount') {
337
+ return (right.amount || 0) - (left.amount || 0)
338
+ }
339
+ if (left.overdue !== right.overdue) return left.overdue ? -1 : 1
340
+ if (left.priority !== right.priority) {
341
+ const ranks = { urgent: 0, high: 1, normal: 2 }
342
+ return ranks[left.priority] - ranks[right.priority]
343
+ }
344
+ return String(left.arrivedAt).localeCompare(String(right.arrivedAt))
345
+ })
346
+ })
347
+
348
+ const activeItem = computed(() =>
349
+ currentItems.value.find(
350
+ (item) =>
351
+ sameId(item.instance.id, oa.activeInstanceId.value) &&
352
+ sameId(item.task.id, oa.activeTaskId.value)
353
+ )
354
+ )
355
+
356
+ const detailInstance = computed(() => {
357
+ if (oa.activeInstance.value) return oa.activeInstance.value
358
+ return filteredItems.value[0]?.instance || null
359
+ })
360
+
361
+ const detailTask = computed(() => {
362
+ if (oa.activeInstance.value) return oa.activeTask.value
363
+ return filteredItems.value[0]?.task || null
364
+ })
365
+
366
+ const savedViews = computed(() =>
367
+ oa.savedViews.value.filter(
368
+ (view) =>
369
+ view.scope === 'tasks' &&
370
+ (view.userId === undefined || String(view.userId) === String(oa.currentUserId.value))
371
+ )
372
+ )
373
+
374
+ const hasActiveFilter = computed(
375
+ () => Boolean(keyword.value.trim() || quick.value !== 'all' || processFilter.value)
376
+ )
377
+
378
+ const allSelected = computed(
379
+ () =>
380
+ filteredItems.value.length > 0 &&
381
+ filteredItems.value.every((item) => selectedIds.value.includes(item.id))
382
+ )
383
+
384
+ const emptyTitle = computed(() =>
385
+ oa.taskTab.value === 'approve' ? '没有匹配的待办' : '没有待提交的申请'
386
+ )
387
+ const emptyDescription = computed(() =>
388
+ oa.taskTab.value === 'approve'
389
+ ? '新的审批任务到达后会实时出现在这里。也可以调整筛选条件查看其他任务。'
390
+ : '被审批人退回的申请会出现在这里,修改表单后可重新提交。'
391
+ )
392
+
393
+ const mobileMedia = () => {
394
+ if (typeof window === 'undefined' || !window.matchMedia) return null
395
+ return window.matchMedia('(max-width: 960px)')
396
+ }
397
+ let mediaQuery = null
398
+
399
+ function handleMediaChange(event) {
400
+ isMobile.value = event.matches
401
+ }
402
+
403
+ onMounted(() => {
404
+ mediaQuery = mobileMedia()
405
+ if (mediaQuery) {
406
+ isMobile.value = mediaQuery.matches
407
+ mediaQuery.addEventListener?.('change', handleMediaChange)
408
+ }
409
+ if (!isMobile.value && !activeItem.value && filteredItems.value.length) {
410
+ select(filteredItems.value[0])
411
+ }
412
+ })
413
+
414
+ onBeforeUnmount(() => {
415
+ mediaQuery?.removeEventListener?.('change', handleMediaChange)
416
+ })
417
+
418
+ watch(
419
+ () => oa.currentUserId.value,
420
+ () => {
421
+ selectedIds.value = []
422
+ batchMode.value = false
423
+ if (isMobile.value) closeDetail()
424
+ else if (filteredItems.value.length) select(filteredItems.value[0])
425
+ else oa.selectTask(null, null)
426
+ }
427
+ )
428
+
429
+ watch(
430
+ () => oa.taskTab.value,
431
+ () => {
432
+ selectedIds.value = []
433
+ batchMode.value = false
434
+ if (filteredItems.value.length && !isMobile.value) select(filteredItems.value[0])
435
+ else oa.selectTask(null, null)
436
+ }
437
+ )
438
+
439
+ watch([quick, keyword, processFilter], () => {
440
+ selectedIds.value = []
441
+ batchMode.value = false
442
+ })
443
+
444
+ function select(item) {
445
+ oa.selectTask(item.instance.id, item.task.id)
446
+ }
447
+
448
+ function switchTab(tab) {
449
+ oa.taskTab.value = tab
450
+ }
451
+
452
+ function refresh() {
453
+ oa.tickAllInstances()
454
+ oa.now.value = Date.now()
455
+ ElMessage.success('待办已刷新')
456
+ }
457
+
458
+ function closeDetail() {
459
+ oa.selectTask(null, null)
460
+ }
461
+
462
+ function toggleSelected(item, checked) {
463
+ if (checked) {
464
+ if (!selectedIds.value.includes(item.id)) {
465
+ selectedIds.value = [...selectedIds.value, item.id]
466
+ }
467
+ } else {
468
+ selectedIds.value = selectedIds.value.filter((id) => id !== item.id)
469
+ }
470
+ }
471
+
472
+ function toggleBatchMode() {
473
+ batchMode.value = !batchMode.value
474
+ if (!batchMode.value) selectedIds.value = []
475
+ }
476
+
477
+ function toggleSelectAll() {
478
+ selectedIds.value = allSelected.value
479
+ ? []
480
+ : filteredItems.value.map((item) => item.id)
481
+ }
482
+
483
+ async function batchApprove() {
484
+ const chosen = filteredItems.value.filter((item) => selectedIds.value.includes(item.id))
485
+ if (!chosen.length) return
486
+ try {
487
+ await ElMessageBox.confirm(
488
+ `将同意 ${chosen.length} 项审批任务。批量操作仅执行“同意”,需要退回或转办的任务请逐件处理。`,
489
+ '批量同意',
490
+ {
491
+ type: 'warning',
492
+ confirmButtonText: '确认同意',
493
+ cancelButtonText: '取消'
494
+ }
495
+ )
496
+ } catch {
497
+ return
498
+ }
499
+ batchBusy.value = true
500
+ let success = 0
501
+ const failures = []
502
+ chosen.forEach((item) => {
503
+ try {
504
+ oa.actOnTask(item.instance.id, item.task.id, 'approve', {
505
+ comment: '批量审批通过'
506
+ })
507
+ success += 1
508
+ } catch (error) {
509
+ failures.push(`${item.title}:${error.message}`)
510
+ }
511
+ })
512
+ batchBusy.value = false
513
+ selectedIds.value = []
514
+ batchMode.value = false
515
+ if (success) {
516
+ ElMessage.success(`已同意 ${success} 项审批任务`)
517
+ }
518
+ if (failures.length) {
519
+ ElMessage.warning(`${failures.length} 项处理失败,可能已被其他审批人处理`)
520
+ }
521
+ setTimeout(() => {
522
+ if (filteredItems.value.length) select(filteredItems.value[0])
523
+ else oa.selectTask(null, null)
524
+ }, 0)
525
+ }
526
+
527
+ async function saveCurrentView() {
528
+ try {
529
+ const { value } = await ElMessageBox.prompt('为当前筛选条件命名', '保存常用视图', {
530
+ confirmButtonText: '保存',
531
+ cancelButtonText: '取消',
532
+ inputPlaceholder: '例如:我的超时采购',
533
+ inputValidator: (text) => Boolean(String(text || '').trim()) || '请输入视图名称'
534
+ })
535
+ oa.saveView({
536
+ name: String(value).trim(),
537
+ scope: 'tasks',
538
+ filter: {
539
+ keyword: keyword.value,
540
+ quick: quick.value,
541
+ processFilter: processFilter.value,
542
+ sortMode: sortMode.value
543
+ }
544
+ })
545
+ ElMessage.success('视图已保存')
546
+ } catch {
547
+ // 用户取消
548
+ }
549
+ }
550
+
551
+ function applySavedView(view) {
552
+ const filter = view.filter || {}
553
+ keyword.value = filter.keyword || ''
554
+ quick.value = filter.quick || 'all'
555
+ processFilter.value = filter.processFilter || ''
556
+ sortMode.value = filter.sortMode || 'priority'
557
+ }
558
+
559
+ function handleHandled(payload) {
560
+ const handledId = `${oa.activeInstanceId.value}:${oa.activeTaskId.value}`
561
+ setTimeout(() => {
562
+ if (payload?.type === 'addSign') {
563
+ return
564
+ }
565
+ if (continuous.value) {
566
+ const next = filteredItems.value.find((item) => item.id !== handledId)
567
+ if (next) {
568
+ select(next)
569
+ return
570
+ }
571
+ }
572
+ oa.activeTaskId.value = null
573
+ if (isMobile.value) closeDetail()
574
+ }, 0)
575
+ }
576
+ </script>
577
+
578
+ <style scoped lang="scss">
579
+ .oa-taskcenter {
580
+ display: flex;
581
+ flex-direction: column;
582
+ height: 100%;
583
+ min-height: 0;
584
+ padding: 18px 20px 20px;
585
+ }
586
+
587
+ .oa-taskcenter__head {
588
+ flex-shrink: 0;
589
+ display: flex;
590
+ align-items: flex-start;
591
+ justify-content: space-between;
592
+ gap: 16px;
593
+ padding-bottom: 9px;
594
+ }
595
+
596
+ .oa-taskcenter__head .oa-subtitle {
597
+ margin-top: 3px;
598
+ }
599
+
600
+ .oa-taskcenter__head-right {
601
+ display: flex;
602
+ align-items: center;
603
+ gap: 12px;
604
+ padding-top: 16px;
605
+
606
+ .el-button {
607
+ min-height: 32px;
608
+ }
609
+ }
610
+
611
+ .oa-switch {
612
+ display: inline-flex;
613
+ align-items: center;
614
+ gap: 6px;
615
+ color: var(--oa-muted);
616
+ font-size: 11.5px;
617
+ cursor: pointer;
618
+ }
619
+
620
+ .oa-taskcenter__body {
621
+ flex: 1;
622
+ min-height: 0;
623
+ display: grid;
624
+ grid-template-columns: 376px minmax(0, 1fr);
625
+ gap: 14px;
626
+ }
627
+
628
+ .oa-task-list-panel {
629
+ display: flex;
630
+ flex-direction: column;
631
+ min-height: 0;
632
+ overflow: hidden;
633
+ }
634
+
635
+ .oa-task-list-panel__head {
636
+ flex-shrink: 0;
637
+ display: flex;
638
+ flex-direction: column;
639
+ gap: 9px;
640
+ padding: 12px 13px 9px;
641
+ border-bottom: 1px solid var(--oa-line);
642
+ }
643
+
644
+ .oa-segment {
645
+ display: inline-flex;
646
+ gap: 2px;
647
+ padding: 2px;
648
+ border-radius: 7px;
649
+ background: #f1f4f9;
650
+
651
+ button {
652
+ display: inline-flex;
653
+ align-items: center;
654
+ justify-content: center;
655
+ gap: 5px;
656
+ flex: 1;
657
+ padding: 4px 9px;
658
+ border: none;
659
+ border-radius: 5px;
660
+ background: transparent;
661
+ color: var(--oa-muted);
662
+ font-size: 11.5px;
663
+ cursor: pointer;
664
+
665
+ em {
666
+ display: inline-grid;
667
+ place-items: center;
668
+ min-width: 16px;
669
+ height: 16px;
670
+ padding: 0 4px;
671
+ border-radius: 8px;
672
+ background: #e3e8f0;
673
+ color: #67758a;
674
+ font-size: 9px;
675
+ font-style: normal;
676
+ font-weight: 600;
677
+ }
678
+
679
+ &.is-active {
680
+ background: #fff;
681
+ color: var(--oa-ink);
682
+ font-weight: 600;
683
+ box-shadow: 0 1px 3px rgba(15, 31, 55, 0.08);
684
+
685
+ em {
686
+ background: var(--oa-primary-soft);
687
+ color: var(--oa-primary);
688
+ }
689
+ }
690
+ }
691
+ }
692
+
693
+ .oa-segment--lg button {
694
+ padding: 6px 10px;
695
+ font-size: 12px;
696
+ }
697
+
698
+ .oa-task-list-panel__filters {
699
+ display: flex;
700
+ align-items: center;
701
+ flex-wrap: wrap;
702
+ gap: 5px;
703
+ padding: 9px 13px 8px;
704
+ border-bottom: 1px solid #f0f3f8;
705
+ }
706
+
707
+ .oa-filter-pill {
708
+ display: inline-flex;
709
+ align-items: center;
710
+ gap: 4px;
711
+ padding: 3px 8px;
712
+ border: 1px solid transparent;
713
+ border-radius: 4px;
714
+ background: #f3f6fa;
715
+ color: var(--oa-muted);
716
+ font-size: 10.5px;
717
+ cursor: pointer;
718
+
719
+ span {
720
+ color: var(--oa-faint);
721
+ font-size: 9.5px;
722
+ }
723
+
724
+ &:hover {
725
+ color: var(--oa-primary);
726
+ }
727
+
728
+ &.is-active {
729
+ border-color: #cbd9f5;
730
+ background: var(--oa-primary-soft);
731
+ color: var(--oa-primary);
732
+ font-weight: 600;
733
+
734
+ span {
735
+ color: var(--oa-primary);
736
+ }
737
+ }
738
+ }
739
+
740
+ .oa-task-list-panel__process,
741
+ .oa-task-list-panel__sort {
742
+ width: 108px;
743
+ margin-left: 1px;
744
+
745
+ :deep(.el-select__wrapper) {
746
+ min-height: 25px;
747
+ padding: 2px 8px;
748
+ box-shadow: none;
749
+ background: #f3f6fa;
750
+ font-size: 10.5px;
751
+ }
752
+ }
753
+
754
+ .oa-task-list-panel__sort {
755
+ width: 92px;
756
+ }
757
+
758
+ .oa-task-list-panel__save {
759
+ margin-left: auto;
760
+ font-size: 10.5px;
761
+ }
762
+
763
+ .oa-task-list-panel__views {
764
+ flex-shrink: 0;
765
+ display: flex;
766
+ align-items: center;
767
+ flex-wrap: wrap;
768
+ gap: 5px;
769
+ padding: 7px 13px;
770
+ border-bottom: 1px solid #f0f3f8;
771
+ }
772
+
773
+ .oa-task-list-panel__views-label {
774
+ color: var(--oa-faint);
775
+ font-size: 10px;
776
+ }
777
+
778
+ .oa-saved-view {
779
+ display: inline-flex;
780
+ align-items: center;
781
+ gap: 4px;
782
+ padding: 2px 6px;
783
+ border: 1px solid var(--oa-line);
784
+ border-radius: 4px;
785
+ background: #fff;
786
+ color: var(--oa-muted);
787
+ font-size: 10px;
788
+ cursor: pointer;
789
+
790
+ &:hover {
791
+ border-color: #c9d7f4;
792
+ color: var(--oa-primary);
793
+ }
794
+
795
+ i {
796
+ display: inline-flex;
797
+ color: #aeb8c7;
798
+ font-size: 9px;
799
+ }
800
+ }
801
+
802
+ .oa-task-list-panel__list {
803
+ flex: 1;
804
+ min-height: 0;
805
+ overflow: auto;
806
+ padding: 6px;
807
+ }
808
+
809
+ .oa-task-item {
810
+ display: flex;
811
+ align-items: stretch;
812
+ gap: 7px;
813
+ padding: 10px 10px 10px 8px;
814
+ border: 1px solid transparent;
815
+ border-radius: 8px;
816
+ cursor: pointer;
817
+ transition: background 0.15s ease, border-color 0.15s ease;
818
+
819
+ + .oa-task-item {
820
+ margin-top: 2px;
821
+ }
822
+
823
+ &:hover {
824
+ background: #f8faff;
825
+ }
826
+
827
+ &.is-active {
828
+ border-color: #cbdcff;
829
+ background: #f5f8ff;
830
+ box-shadow: inset 2px 0 0 var(--oa-primary);
831
+ }
832
+
833
+ &.is-selected {
834
+ background: #f7f9ff;
835
+ }
836
+ }
837
+
838
+ .oa-task-item__check {
839
+ align-self: flex-start;
840
+ margin-top: 2px;
841
+ }
842
+
843
+ .oa-task-item__main {
844
+ flex: 1;
845
+ min-width: 0;
846
+ padding: 0;
847
+ border: none;
848
+ background: transparent;
849
+ color: inherit;
850
+ font: inherit;
851
+ text-align: left;
852
+ cursor: pointer;
853
+ }
854
+
855
+ .oa-task-item__top {
856
+ display: flex;
857
+ align-items: center;
858
+ gap: 5px;
859
+ min-width: 0;
860
+
861
+ strong {
862
+ flex: 1;
863
+ overflow: hidden;
864
+ color: var(--oa-ink);
865
+ font-size: 12.5px;
866
+ font-weight: 600;
867
+ text-overflow: ellipsis;
868
+ white-space: nowrap;
869
+ }
870
+ }
871
+
872
+ .oa-task-item__priority {
873
+ flex-shrink: 0;
874
+ padding: 0 4px;
875
+ border-radius: 3px;
876
+ background: #f0f3f8;
877
+ color: #6e7c90;
878
+ font-size: 9px;
879
+ font-weight: 600;
880
+ line-height: 16px;
881
+
882
+ &.is-danger {
883
+ background: var(--oa-danger-soft);
884
+ color: var(--oa-danger);
885
+ }
886
+
887
+ &.is-warning {
888
+ background: var(--oa-warning-soft);
889
+ color: var(--oa-warning);
890
+ }
891
+ }
892
+
893
+ .oa-task-item__meta {
894
+ display: flex;
895
+ align-items: center;
896
+ gap: 5px;
897
+ margin-top: 4px;
898
+ color: var(--oa-faint);
899
+ font-size: 10.5px;
900
+ overflow: hidden;
901
+ white-space: nowrap;
902
+
903
+ i {
904
+ width: 2px;
905
+ height: 2px;
906
+ border-radius: 50%;
907
+ background: #c5cedd;
908
+ }
909
+ }
910
+
911
+ .oa-task-item__node {
912
+ display: flex;
913
+ align-items: center;
914
+ gap: 5px;
915
+ margin-top: 6px;
916
+ color: var(--oa-muted);
917
+ font-size: 10.5px;
918
+
919
+ span {
920
+ padding: 1px 5px;
921
+ border-radius: 3px;
922
+ background: #f1f4f9;
923
+ }
924
+
925
+ em {
926
+ color: var(--oa-faint);
927
+ font-size: 9.5px;
928
+ font-style: normal;
929
+ }
930
+ }
931
+
932
+ .oa-task-item__bottom {
933
+ display: flex;
934
+ align-items: center;
935
+ justify-content: space-between;
936
+ gap: 8px;
937
+ margin-top: 5px;
938
+ color: var(--oa-faint);
939
+ font-size: 10px;
940
+
941
+ span:first-child {
942
+ color: var(--oa-ink);
943
+ font-size: 11px;
944
+ font-weight: 600;
945
+ }
946
+
947
+ .is-danger {
948
+ color: var(--oa-danger);
949
+ font-weight: 600;
950
+ }
951
+ }
952
+
953
+ .oa-task-list-panel__foot {
954
+ flex-shrink: 0;
955
+ display: flex;
956
+ align-items: center;
957
+ gap: 8px;
958
+ min-height: 42px;
959
+ padding: 7px 13px;
960
+ border-top: 1px solid var(--oa-line);
961
+ background: #fcfdff;
962
+ color: var(--oa-faint);
963
+ font-size: 10.5px;
964
+
965
+ .oa-muted:first-of-type {
966
+ margin-right: auto;
967
+ }
968
+
969
+ .el-button {
970
+ margin-left: auto;
971
+ }
972
+ }
973
+
974
+ .oa-batch-toggle {
975
+ padding: 3px 8px;
976
+ border: 1px solid var(--oa-line);
977
+ border-radius: 4px;
978
+ background: #fff;
979
+ color: var(--oa-muted);
980
+ font-size: 10.5px;
981
+ cursor: pointer;
982
+
983
+ &.is-active {
984
+ border-color: #cbdcff;
985
+ background: var(--oa-primary-soft);
986
+ color: var(--oa-primary);
987
+ }
988
+ }
989
+
990
+ .oa-task-detail {
991
+ min-width: 0;
992
+ min-height: 0;
993
+ overflow: hidden;
994
+ border: 1px solid var(--oa-line);
995
+ border-radius: var(--oa-radius);
996
+ background: #fff;
997
+ box-shadow: var(--oa-shadow);
998
+ }
999
+
1000
+ .oa-task-empty {
1001
+ display: flex;
1002
+ flex-direction: column;
1003
+ justify-content: center;
1004
+ height: 100%;
1005
+ background:
1006
+ radial-gradient(circle at 50% 30%, rgba(36, 86, 214, 0.045), transparent 46%),
1007
+ #fff;
1008
+ }
1009
+
1010
+ .oa-task-empty__tips {
1011
+ display: flex;
1012
+ justify-content: center;
1013
+ flex-wrap: wrap;
1014
+ gap: 12px;
1015
+ padding: 0 40px 60px;
1016
+
1017
+ div {
1018
+ display: flex;
1019
+ align-items: flex-start;
1020
+ gap: 8px;
1021
+ width: 210px;
1022
+ padding: 12px;
1023
+ border: 1px solid var(--oa-line);
1024
+ border-radius: 8px;
1025
+ background: rgba(255, 255, 255, 0.7);
1026
+
1027
+ > span {
1028
+ color: #b6c3d8;
1029
+ font-size: 12px;
1030
+ font-weight: 700;
1031
+ font-variant-numeric: tabular-nums;
1032
+ }
1033
+
1034
+ p {
1035
+ margin: 0;
1036
+ color: var(--oa-faint);
1037
+ font-size: 10.5px;
1038
+ line-height: 1.65;
1039
+
1040
+ strong {
1041
+ display: block;
1042
+ margin-bottom: 2px;
1043
+ color: var(--oa-muted);
1044
+ font-size: 11px;
1045
+ }
1046
+ }
1047
+ }
1048
+ }
1049
+
1050
+ @media (max-width: 1300px) {
1051
+ .oa-taskcenter__body {
1052
+ grid-template-columns: 350px minmax(0, 1fr);
1053
+ }
1054
+ }
1055
+
1056
+ @media (max-width: 960px) {
1057
+ .oa-taskcenter {
1058
+ height: calc(100% - 1px);
1059
+ padding: 12px 10px 70px;
1060
+ }
1061
+
1062
+ .oa-taskcenter__head {
1063
+ padding-bottom: 10px;
1064
+ }
1065
+
1066
+ .oa-taskcenter__head-right {
1067
+ display: none;
1068
+ }
1069
+
1070
+ .oa-taskcenter__body {
1071
+ display: block;
1072
+ min-height: 0;
1073
+ }
1074
+
1075
+ .oa-task-list-panel {
1076
+ height: 100%;
1077
+ border: none;
1078
+ box-shadow: none;
1079
+ background: transparent;
1080
+ }
1081
+
1082
+ .oa-task-list-panel__head,
1083
+ .oa-task-list-panel__filters,
1084
+ .oa-task-list-panel__views {
1085
+ background: #fff;
1086
+ border: 1px solid var(--oa-line);
1087
+ border-bottom: none;
1088
+ }
1089
+
1090
+ .oa-task-list-panel__head {
1091
+ border-radius: var(--oa-radius) var(--oa-radius) 0 0;
1092
+ }
1093
+
1094
+ .oa-task-list-panel__list {
1095
+ background: #fff;
1096
+ border-right: 1px solid var(--oa-line);
1097
+ border-left: 1px solid var(--oa-line);
1098
+ padding: 6px 8px;
1099
+ }
1100
+
1101
+ .oa-task-list-panel__foot {
1102
+ border: 1px solid var(--oa-line);
1103
+ border-radius: 0 0 var(--oa-radius) var(--oa-radius);
1104
+ }
1105
+
1106
+ .oa-task-detail {
1107
+ display: none;
1108
+ height: 100%;
1109
+ border: none;
1110
+ box-shadow: none;
1111
+ }
1112
+
1113
+ .oa-taskcenter.is-mobile-detail {
1114
+ padding: 0;
1115
+ padding-bottom: 0;
1116
+ }
1117
+
1118
+ .oa-taskcenter.is-mobile-detail .oa-taskcenter__head,
1119
+ .oa-taskcenter.is-mobile-detail .oa-task-list-panel {
1120
+ display: none;
1121
+ }
1122
+
1123
+ .oa-taskcenter.is-mobile-detail .oa-task-detail {
1124
+ display: block;
1125
+ border-radius: 0;
1126
+ }
1127
+
1128
+ .oa-task-list-panel__process,
1129
+ .oa-task-list-panel__sort {
1130
+ width: calc(50% - 4px);
1131
+ }
1132
+
1133
+ .oa-task-list-panel__save {
1134
+ margin-left: 0;
1135
+ }
1136
+ }
1137
+
1138
+ @media (max-width: 560px) {
1139
+ .oa-taskcenter {
1140
+ padding-bottom: 60px;
1141
+ }
1142
+
1143
+ .oa-taskcenter__head .oa-subtitle {
1144
+ display: none;
1145
+ }
1146
+
1147
+ .oa-task-list-panel__head {
1148
+ gap: 7px;
1149
+ }
1150
+
1151
+ .oa-task-item {
1152
+ padding: 10px 8px;
1153
+ }
1154
+ }
1155
+ </style>