gbflowengine 0.0.0-stage → 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 (93) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +270 -2
  3. package/dist/gbflowengine.css +1 -0
  4. package/dist/gbflowengine.js +19682 -0
  5. package/dist/gbflowengine.js.map +1 -0
  6. package/dist/gbflowengine.umd.cjs +5 -0
  7. package/dist/gbflowengine.umd.cjs.map +1 -0
  8. package/package.json +83 -4
  9. package/src/center/DefinitionInspect.vue +291 -0
  10. package/src/center/FlowCenter.vue +33 -0
  11. package/src/center/index.js +29 -0
  12. package/src/center/storage.js +748 -0
  13. package/src/core/flow/condition.js +160 -0
  14. package/src/core/flow/customNode.js +385 -0
  15. package/src/core/flow/defaults.js +124 -0
  16. package/src/core/flow/flowConstant.js +265 -0
  17. package/src/core/flow/flowNodeUtils.js +30 -0
  18. package/src/core/flow/index.js +47 -0
  19. package/src/core/flow/node.js +44 -0
  20. package/src/core/flow/nodeFactory.js +58 -0
  21. package/src/core/flow/prediction.js +325 -0
  22. package/src/core/flow/runtime/auto.js +83 -0
  23. package/src/core/flow/runtime/decide.js +329 -0
  24. package/src/core/flow/runtime/event.js +28 -0
  25. package/src/core/flow/runtime/execute.js +357 -0
  26. package/src/core/flow/runtime/helpers.js +52 -0
  27. package/src/core/flow/runtime/query.js +146 -0
  28. package/src/core/flow/runtime/reject.js +137 -0
  29. package/src/core/flow/runtime/token.js +269 -0
  30. package/src/core/flow/runtime.js +129 -0
  31. package/src/core/flow/schema.js +864 -0
  32. package/src/definition/FlowDefinitionDesigner.vue +338 -0
  33. package/src/definition/index.js +9 -0
  34. package/src/index.js +39 -0
  35. package/src/storage.js +200 -0
  36. package/src/testing/FlowTestPanel.vue +2502 -0
  37. package/src/testing/UserConfigDrawer.vue +376 -0
  38. package/src/testing/diagram/FlowProgressDiagram.vue +318 -0
  39. package/src/testing/diagramModel.js +517 -0
  40. package/src/testing/index.js +23 -0
  41. package/src/testing/mock.js +246 -0
  42. package/src/testing/oaExecutors.js +51 -0
  43. package/src/testing/oaSeed.js +467 -0
  44. package/src/testing/sample.js +412 -0
  45. package/src/testing/seed.js +122 -0
  46. package/src/utils/format.js +27 -0
  47. package/src/visual/FlowCanvas.vue +441 -0
  48. package/src/visual/NodeProgressDetail.vue +43 -0
  49. package/src/visual/NodeStatusBadge.vue +17 -0
  50. package/src/visual/NodeWrap.vue +47 -0
  51. package/src/visual/ScWorkflow.vue +50 -0
  52. package/src/visual/SelectDialog.vue +460 -0
  53. package/src/visual/conditionHelpers.js +117 -0
  54. package/src/visual/index.js +6 -0
  55. package/src/visual/nodes/AddNode.vue +223 -0
  56. package/src/visual/nodes/ApproverNode.vue +348 -0
  57. package/src/visual/nodes/BranchNode.vue +442 -0
  58. package/src/visual/nodes/CustomNode.vue +339 -0
  59. package/src/visual/nodes/EndNode.vue +22 -0
  60. package/src/visual/nodes/PassNode.vue +101 -0
  61. package/src/visual/nodes/PromoterNode.vue +135 -0
  62. package/src/visual/nodes/RejectNode.vue +101 -0
  63. package/src/visual/nodes/SendNode.vue +152 -0
  64. package/src/visual/styles.scss +879 -0
  65. package/src/visual/useScNodeStatus.js +18 -0
  66. package/src/workbench/OaWorkbench.vue +1341 -0
  67. package/src/workbench/components/ApprovalWorkspace.vue +2090 -0
  68. package/src/workbench/components/CategoryIcon.vue +74 -0
  69. package/src/workbench/components/NotificationIcon.vue +73 -0
  70. package/src/workbench/components/ProcessSteps.vue +557 -0
  71. package/src/workbench/components/ResubmitDialog.vue +227 -0
  72. package/src/workbench/components/SidebarNav.vue +138 -0
  73. package/src/workbench/components/StartFlowDialog.vue +1058 -0
  74. package/src/workbench/components/UserAvatar.vue +68 -0
  75. package/src/workbench/custom-tasks.js +130 -0
  76. package/src/workbench/model.js +1080 -0
  77. package/src/workbench/pages/DesignPage.vue +798 -0
  78. package/src/workbench/pages/HomePage.vue +1050 -0
  79. package/src/workbench/pages/MonitorPage.vue +1029 -0
  80. package/src/workbench/pages/NotificationsPage.vue +554 -0
  81. package/src/workbench/pages/RequestsPage.vue +644 -0
  82. package/src/workbench/pages/TaskCenterPage.vue +1155 -0
  83. package/src/workbench/pages/TemplatesPage.vue +680 -0
  84. package/src/workbench/persistence.js +89 -0
  85. package/src/workbench/shared.js +18 -0
  86. package/src/workbench/styles.scss +555 -0
  87. package/src/workbench/useWorkbench.js +955 -0
  88. package/types/center.d.ts +5 -0
  89. package/types/core.d.ts +479 -0
  90. package/types/definition.d.ts +4 -0
  91. package/types/index.d.ts +34 -0
  92. package/types/testing.d.ts +20 -0
  93. package/types/visual.d.ts +20 -0
@@ -0,0 +1,2090 @@
1
+ <template>
2
+ <div class="oa-approval">
3
+ <header class="oa-approval__head">
4
+ <div class="oa-approval__topline">
5
+ <button
6
+ v-if="dismissible"
7
+ type="button"
8
+ class="oa-approval__back"
9
+ aria-label="返回列表"
10
+ @click="emit('close')"
11
+ >
12
+ <el-icon><Back /></el-icon>
13
+ </button>
14
+ <span class="oa-approval__code">{{ instance.code || instanceCode(instance) }}</span>
15
+ <span class="oa-approval__template">{{ instance.definition?.meta?.name }}</span>
16
+ <span class="oa-approval__version">v{{ instance.definitionVersion || 1 }}</span>
17
+ <span class="oa-status" :class="`oa-status--${overallStatus.tone}`">{{ overallStatus.label }}</span>
18
+ <span v-if="hasOverdue" class="oa-chip oa-chip--danger">已超时</span>
19
+ <span v-else-if="instance.priority === 'urgent'" class="oa-chip oa-chip--danger">加急</span>
20
+ <span v-else-if="instance.priority === 'high'" class="oa-chip oa-chip--warning">优先</span>
21
+ </div>
22
+
23
+ <div class="oa-approval__title-row">
24
+ <h2>{{ instance.name }}</h2>
25
+ <div class="oa-approval__head-actions">
26
+ <el-button v-if="canRevoke" plain @click="handleRevoke">撤回申请</el-button>
27
+ <el-button v-if="canUrge" plain :icon="Bell" @click="handleUrge">催办</el-button>
28
+ <el-button v-if="canTerminate" type="danger" plain @click="handleTerminate">终止</el-button>
29
+ <el-button
30
+ v-if="dismissible"
31
+ class="oa-approval__close"
32
+ :icon="Close"
33
+ circle
34
+ aria-label="关闭"
35
+ @click="emit('close')"
36
+ />
37
+ </div>
38
+ </div>
39
+
40
+ <div class="oa-approval__meta">
41
+ <UserAvatar :name="initiatorName" :size="22" />
42
+ <span>{{ initiatorName }}</span>
43
+ <span class="oa-approval__meta-dept">{{ initiatorDept }}</span>
44
+ <i></i>
45
+ <span>提交于 {{ formatDateTime(instance.state?.startedAt || instance.createdAt) }}</span>
46
+ <i></i>
47
+ <span>已流转 {{ formatElapsed(instance.state?.startedAt || instance.createdAt, oa.now.value) }}</span>
48
+ <template v-if="runtimeNote">
49
+ <i></i>
50
+ <span>{{ runtimeNote }}</span>
51
+ </template>
52
+ </div>
53
+ </header>
54
+
55
+ <div class="oa-approval__scroll">
56
+ <section class="oa-approval__summary">
57
+ <template v-if="canViewSensitive">
58
+ <div v-if="amountFact" class="oa-summary-amount">
59
+ <small>{{ amountFact.label }}</small>
60
+ <strong class="oa-num">{{ amountFact.value }}</strong>
61
+ <span v-if="instance.priority !== 'normal'" class="oa-summary-amount__flag">
62
+ {{ instance.priority === 'urgent' ? '高金额 · 需重点审核' : '关注金额' }}
63
+ </span>
64
+ </div>
65
+ <div class="oa-summary-facts">
66
+ <div
67
+ v-for="fact in otherFacts"
68
+ :key="fact.key"
69
+ class="oa-summary-fact"
70
+ >
71
+ <small>{{ fact.label }}</small>
72
+ <span :title="String(fact.value)">{{ fact.value }}</span>
73
+ </div>
74
+ <div v-if="!otherFacts.length && !amountFact" class="oa-summary-fact oa-summary-fact--wide">
75
+ <small>申请事项</small>
76
+ <span>{{ instance.definition?.meta?.description || '按表单内容执行审批' }}</span>
77
+ </div>
78
+ </div>
79
+ </template>
80
+ <div v-else class="oa-summary-restricted">
81
+ <el-icon><Lock /></el-icon>
82
+ 当前身份仅可查看流程状态,敏感申请信息已隐藏
83
+ </div>
84
+ <div class="oa-summary-side">
85
+ <span class="oa-summary-side__label">当前进度</span>
86
+ <strong>{{ progressLabel }}</strong>
87
+ <div class="oa-progress">
88
+ <span :style="{ width: `${progressPercent}%` }"></span>
89
+ </div>
90
+ </div>
91
+ </section>
92
+
93
+ <div class="oa-approval__columns">
94
+ <div class="oa-approval__left">
95
+ <template v-if="canViewSensitive">
96
+ <section class="oa-card oa-form-card">
97
+ <div class="oa-section-head">
98
+ <h3 class="oa-section-head__title">
99
+ 申请信息
100
+ <small>{{ formEntries.length }} 个字段</small>
101
+ </h3>
102
+ <button type="button" class="oa-link" @click="formExpanded = !formExpanded">
103
+ {{ formExpanded ? '收起完整表单' : '展开完整表单' }}
104
+ </button>
105
+ </div>
106
+ <div v-if="formExpanded" class="oa-form-grid">
107
+ <div
108
+ v-for="entry in formEntries"
109
+ :key="entry.variableName"
110
+ class="oa-form-field"
111
+ :class="{ 'is-wide': entry.wide }"
112
+ >
113
+ <label>
114
+ {{ entry.label }}
115
+ <span v-if="entry.route" class="oa-form-field__route">影响路径</span>
116
+ </label>
117
+ <div v-if="entry.type === 'checkbox-group' && entry.rawValue?.length" class="oa-form-field__chips">
118
+ <span v-for="item in chipsOf(entry)" :key="item" class="oa-chip">{{ item }}</span>
119
+ </div>
120
+ <p v-else :class="{ 'is-empty': entry.value === '—' }">{{ entry.value }}</p>
121
+ </div>
122
+ </div>
123
+ <p v-else class="oa-form-card__collapsed">
124
+ 完整表单已收起,上方摘要保留了决策所需的关键字段。
125
+ </p>
126
+ </section>
127
+
128
+ <section class="oa-card oa-material-card">
129
+ <div class="oa-section-head">
130
+ <h3 class="oa-section-head__title">
131
+ 材料与凭据
132
+ <small>{{ attachmentCount ? `已附 ${attachmentCount} 项` : '未上传附件' }}</small>
133
+ </h3>
134
+ </div>
135
+ <div class="oa-material">
136
+ <div class="oa-material__group">
137
+ <span class="oa-material__label">材料清单</span>
138
+ <div class="oa-material__chips">
139
+ <span
140
+ v-for="material in business.materials"
141
+ :key="material"
142
+ class="oa-chip"
143
+ >
144
+ <el-icon><Document /></el-icon>{{ material }}
145
+ </span>
146
+ <span v-if="!business.materials.length" class="oa-faint">该流程未配置强制材料</span>
147
+ </div>
148
+ </div>
149
+ <div v-if="attachmentLabels.length" class="oa-material__group">
150
+ <span class="oa-material__label">表单附件</span>
151
+ <div class="oa-material__chips">
152
+ <span v-for="label in attachmentLabels" :key="label" class="oa-chip oa-chip--success">
153
+ <el-icon><CircleCheck /></el-icon>{{ label }}
154
+ </span>
155
+ </div>
156
+ </div>
157
+ <div v-if="uploadedFiles.length" class="oa-material__group">
158
+ <span class="oa-material__label">上传附件</span>
159
+ <div class="oa-material__chips">
160
+ <span
161
+ v-for="file in uploadedFiles"
162
+ :key="`${file.name}_${file.size}`"
163
+ class="oa-chip"
164
+ >
165
+ <el-icon><Document /></el-icon>{{ file.name }}
166
+ <em class="oa-material__size">{{ formatFileSize(file.size) }}</em>
167
+ </span>
168
+ </div>
169
+ </div>
170
+ <p class="oa-material__note">
171
+ <el-icon><Lock /></el-icon>
172
+ 附件仅对流程参与人、抄送人与流程管理员可见,敏感操作会写入审计日志。
173
+ </p>
174
+ </div>
175
+ </section>
176
+ </template>
177
+
178
+ <section v-else class="oa-card oa-permission">
179
+ <span class="oa-empty__icon"><el-icon><Lock /></el-icon></span>
180
+ <strong>当前身份无权查看申请详情</strong>
181
+ <p>仅流程参与人、抄送人与流程管理员可查看表单、附件与审批意见。你仍可查看流程名称与当前状态。</p>
182
+ </section>
183
+
184
+ <section class="oa-card oa-instance-info">
185
+ <div class="oa-section-head">
186
+ <h3 class="oa-section-head__title">单据信息</h3>
187
+ </div>
188
+ <dl>
189
+ <div><dt>流程类型</dt><dd>{{ instance.definition?.meta?.name }}</dd></div>
190
+ <div><dt>所属分类</dt><dd>{{ business.category }}</dd></div>
191
+ <div><dt>流程版本</dt><dd>v{{ instance.definitionVersion || 1 }}</dd></div>
192
+ <div><dt>发起部门</dt><dd>{{ initiatorDept }}</dd></div>
193
+ <div><dt>提交时间</dt><dd class="oa-num">{{ formatDateTime(instance.state?.startedAt || instance.createdAt) }}</dd></div>
194
+ <div><dt>流程周期</dt><dd>{{ formatSla(business.slaHours) }}</dd></div>
195
+ <div><dt>数据来源</dt><dd><span class="oa-sync-dot"></span>本地 OA 测试环境 · 已同步</dd></div>
196
+ <div><dt>流程编号</dt><dd class="oa-num">{{ instance.code || instanceCode(instance) }}</dd></div>
197
+ </dl>
198
+ </section>
199
+ </div>
200
+
201
+ <aside class="oa-approval__right">
202
+ <section v-if="instance.state?.status === 'running'" class="oa-card oa-node-card">
203
+ <div class="oa-node-card__head">
204
+ <span class="oa-node-card__eyebrow">当前节点</span>
205
+ <span v-if="actionTask" class="oa-chip oa-chip--primary">你的任务</span>
206
+ <span v-else-if="hasCustomPending" class="oa-chip oa-chip--primary">自定义节点</span>
207
+ <span v-else class="oa-chip">只读查看</span>
208
+ </div>
209
+ <template v-if="pendingTasks.length">
210
+ <article
211
+ v-for="pending in pendingTasks.slice(0, 2)"
212
+ :key="pending.id"
213
+ class="oa-node-task"
214
+ :class="{ 'is-mine': isTaskMine(pending), 'is-custom': pending.kind === 'custom' }"
215
+ >
216
+ <div class="oa-node-task__title">
217
+ <h4>{{ pending.nodeName }}</h4>
218
+ <span v-if="pending.kind === 'custom'" class="oa-node-task__sign">
219
+ 自定义节点
220
+ <em v-if="pending.cycle > 1">第 {{ pending.cycle }} 轮</em>
221
+ </span>
222
+ <span v-else class="oa-node-task__sign">
223
+ {{ signLabel(pending) }}
224
+ <em v-if="pending.cycle > 1">第 {{ pending.cycle }} 轮</em>
225
+ </span>
226
+ </div>
227
+ <div v-if="pending.kind === 'custom'" class="oa-node-task__system">
228
+ <el-icon><SetUp /></el-icon>
229
+ <span>{{ canViewSensitive ? customNodeSummary(pending.custom) : '自定义节点' }}</span>
230
+ <em>{{ customRunningText(pending) }}</em>
231
+ </div>
232
+ <div v-else class="oa-node-task__approvers">
233
+ <span
234
+ v-for="approver in pending.approvers"
235
+ :key="approver.id"
236
+ class="oa-node-task__approver"
237
+ :class="{
238
+ 'is-done': hasApproved(pending, approver),
239
+ 'is-me': isMe(approver)
240
+ }"
241
+ >
242
+ <i></i>{{ approver.name }}
243
+ <em v-if="isMe(approver)">我</em>
244
+ <em v-if="approver.addedBy">加签</em>
245
+ </span>
246
+ </div>
247
+ <div class="oa-node-task__foot">
248
+ <span v-if="pending.kind === 'custom'">由系统执行器自动处理</span>
249
+ <span v-else>{{ signProgressText(pending) }}</span>
250
+ <span v-if="waitingText(pending)" :class="{ 'is-danger': taskOverdue(pending) }">
251
+ {{ waitingText(pending) }}
252
+ </span>
253
+ </div>
254
+ </article>
255
+ <p v-if="pendingTasks.length > 2" class="oa-node-card__more">
256
+ 另有 {{ pendingTasks.length - 2 }} 个并行节点处理中
257
+ </p>
258
+ </template>
259
+ <div v-else class="oa-node-card__empty">
260
+ <el-icon><Loading /></el-icon>
261
+ 流程正在自动流转,请稍候刷新
262
+ </div>
263
+ </section>
264
+
265
+ <section v-else class="oa-card oa-result-card" :class="`is-${overallStatus.tone}`">
266
+ <span class="oa-result-card__icon">
267
+ <el-icon>
268
+ <component :is="instance.state?.status === 'completed' ? CircleCheckFilled : CircleCloseFilled" />
269
+ </el-icon>
270
+ </span>
271
+ <div>
272
+ <strong>{{ overallStatus.label }}</strong>
273
+ <p>{{ resultDescription }}</p>
274
+ <small class="oa-num">{{ formatDateTime(instance.state?.endedAt) }}</small>
275
+ </div>
276
+ </section>
277
+
278
+ <section class="oa-card oa-track-card">
279
+ <div class="oa-section-head">
280
+ <h3 class="oa-section-head__title">
281
+ 流程轨迹
282
+ <small v-if="instance.state?.cycle > 1">第 {{ instance.state.cycle }} 轮</small>
283
+ </h3>
284
+ <div class="oa-track-card__legend oa-desktop-only">
285
+ <span><i class="is-done"></i>已完成</span>
286
+ <span><i class="is-current"></i>当前</span>
287
+ <span><i class="is-upcoming"></i>待执行</span>
288
+ </div>
289
+ </div>
290
+ <div v-if="decisions.length" class="oa-track-card__decisions">
291
+ <span v-for="decision in decisions" :key="decision.id" class="oa-chip oa-chip--primary">
292
+ {{ decision.text }}
293
+ </span>
294
+ </div>
295
+ <div class="oa-track-card__body">
296
+ <ProcessSteps :steps="displaySteps" :now="oa.now.value" />
297
+ </div>
298
+ </section>
299
+
300
+ <section v-if="canAct && actionTask" class="oa-card oa-action-card">
301
+ <div class="oa-section-head">
302
+ <h3 class="oa-section-head__title">
303
+ 审批操作
304
+ <small>{{ oa.currentUserName.value }} · {{ oa.currentUserRoleNames.value.join(' / ') || '审批人' }}</small>
305
+ </h3>
306
+ </div>
307
+ <template v-if="actionTask.kind === 'submit'">
308
+ <div class="oa-action-card__resubmit">
309
+ <el-alert
310
+ type="warning"
311
+ :closable="false"
312
+ show-icon
313
+ title="该申请已被退回,请修改后重新提交"
314
+ :description="resubmitHint"
315
+ />
316
+ <el-button type="primary" :icon="EditPen" @click="resubmitVisible = true">
317
+ 修改并重新提交
318
+ </el-button>
319
+ </div>
320
+ </template>
321
+ <template v-else>
322
+ <div class="oa-action-card__policy" :class="{ 'is-danger': rejectPolicy.terminate }">
323
+ <el-icon><InfoFilled /></el-icon>
324
+ <span>{{ rejectPolicy.hint }}</span>
325
+ </div>
326
+ <div class="oa-quick-phrases">
327
+ <button
328
+ v-for="phrase in quickPhrases"
329
+ :key="phrase"
330
+ type="button"
331
+ class="oa-quick-phrases__item"
332
+ @click="appendPhrase(phrase)"
333
+ >
334
+ {{ phrase }}
335
+ </button>
336
+ </div>
337
+ <el-input
338
+ v-model="comment"
339
+ type="textarea"
340
+ :rows="2"
341
+ maxlength="400"
342
+ show-word-limit
343
+ placeholder="填写审批意见(退回时必须说明原因)"
344
+ />
345
+ <div class="oa-action-card__buttons">
346
+ <el-button
347
+ type="success"
348
+ :loading="submitting === 'approve'"
349
+ @click="executeAction('approve')"
350
+ >
351
+ 同意
352
+ </el-button>
353
+ <el-button
354
+ :type="rejectPolicy.terminate ? 'danger' : 'default'"
355
+ :plain="!rejectPolicy.terminate"
356
+ :loading="submitting === 'reject'"
357
+ @click="executeAction('reject')"
358
+ >
359
+ {{ rejectPolicy.label }}
360
+ </el-button>
361
+ <el-dropdown trigger="click" @command="openActionDialog">
362
+ <el-button :icon="MoreFilled" plain>更多</el-button>
363
+ <template #dropdown>
364
+ <el-dropdown-menu>
365
+ <el-dropdown-item
366
+ v-if="canTransfer"
367
+ command="transfer"
368
+ :icon="Switch"
369
+ >
370
+ 转办
371
+ </el-dropdown-item>
372
+ <el-dropdown-item command="addSign" :icon="Plus">加签</el-dropdown-item>
373
+ </el-dropdown-menu>
374
+ </template>
375
+ </el-dropdown>
376
+ </div>
377
+ </template>
378
+ </section>
379
+
380
+ <section v-else-if="instance.state?.status === 'running'" class="oa-card oa-readonly">
381
+ <el-icon><InfoFilled /></el-icon>
382
+ <div>
383
+ <strong>当前节点由 {{ currentApproverNames }} 处理</strong>
384
+ <p>你以只读身份查看流程。无权执行的操作不会出现在界面上,所有节点均有权限校验。</p>
385
+ </div>
386
+ </section>
387
+
388
+ <section v-if="isAdmin && instance.state?.status === 'running'" class="oa-admin-note">
389
+ <el-icon><Lock /></el-icon>
390
+ 管理员干预(催办 / 终止)会写入审计日志,可在流程监控中检索。
391
+ </section>
392
+ </aside>
393
+ </div>
394
+ </div>
395
+
396
+ <div v-if="canAct && actionTask" class="oa-mobile-bar">
397
+ <template v-if="actionTask.kind === 'submit'">
398
+ <el-button type="primary" @click="resubmitVisible = true">修改并重新提交</el-button>
399
+ </template>
400
+ <template v-else>
401
+ <button type="button" class="oa-mobile-bar__ghost" @click="openActionDialog('reject')">
402
+ {{ rejectPolicy.label }}
403
+ </button>
404
+ <button type="button" class="oa-mobile-bar__primary" @click="openActionDialog('approve')">
405
+ 同意
406
+ </button>
407
+ <el-dropdown trigger="click" @command="openActionDialog" popper-class="oa-mobile-more">
408
+ <button type="button" class="oa-mobile-bar__more" aria-label="更多操作">
409
+ <el-icon><MoreFilled /></el-icon>
410
+ </button>
411
+ <template #dropdown>
412
+ <el-dropdown-menu>
413
+ <el-dropdown-item v-if="canTransfer" command="transfer">转办</el-dropdown-item>
414
+ <el-dropdown-item command="addSign">加签</el-dropdown-item>
415
+ </el-dropdown-menu>
416
+ </template>
417
+ </el-dropdown>
418
+ </template>
419
+ </div>
420
+
421
+ <el-dialog
422
+ v-model="actionDialog.visible"
423
+ :title="actionDialogTitle"
424
+ width="min(520px, 94vw)"
425
+ append-to-body
426
+ class="oa-action-dialog"
427
+ destroy-on-close
428
+ >
429
+ <div class="oa-action-dialog__task">
430
+ <span>节点</span>
431
+ <strong>{{ actionTask?.nodeName }}</strong>
432
+ <span>{{ instance.code || instanceCode(instance) }}</span>
433
+ </div>
434
+ <el-form label-position="top">
435
+ <el-form-item v-if="actionDialog.type === 'transfer'" label="转办给">
436
+ <el-select v-model="actionDialog.targetUserId" filterable placeholder="选择接收人" style="width: 100%">
437
+ <el-option
438
+ v-for="user in targetUsers"
439
+ :key="user.id"
440
+ :label="`${user.realName} · ${user.deptLabel}`"
441
+ :value="user.id"
442
+ />
443
+ </el-select>
444
+ <p class="oa-action-dialog__tip">转办后由接收人继续处理本节点,原审批人不再收到该任务。</p>
445
+ </el-form-item>
446
+ <el-form-item v-if="actionDialog.type === 'addSign'" label="加签给">
447
+ <el-select v-model="actionDialog.targetUserId" filterable placeholder="选择加签人" style="width: 100%">
448
+ <el-option
449
+ v-for="user in targetUsers"
450
+ :key="user.id"
451
+ :label="`${user.realName} · ${user.deptLabel}`"
452
+ :value="user.id"
453
+ />
454
+ </el-select>
455
+ <p class="oa-action-dialog__tip">加签人将与本节点审批人共同完成审批,并留下独立意见。</p>
456
+ </el-form-item>
457
+ <el-form-item :label="actionDialog.type === 'reject' ? '退回原因(必填)' : '审批意见'">
458
+ <el-input
459
+ v-model="actionDialog.comment"
460
+ type="textarea"
461
+ :rows="4"
462
+ maxlength="400"
463
+ show-word-limit
464
+ placeholder="请填写处理意见"
465
+ />
466
+ </el-form-item>
467
+ </el-form>
468
+ <div v-if="actionDialog.type === 'reject'" class="oa-action-dialog__policy">
469
+ {{ rejectPolicy.hint }}
470
+ </div>
471
+ <template #footer>
472
+ <el-button @click="actionDialog.visible = false">取消</el-button>
473
+ <el-button
474
+ :type="actionDialog.type === 'approve' ? 'success' : actionDialog.type === 'reject' ? 'danger' : 'primary'"
475
+ :loading="Boolean(submitting)"
476
+ :disabled="actionDialog.type !== 'approve' && actionDialog.type !== 'reject' && !actionDialog.targetUserId"
477
+ @click="confirmDialog"
478
+ >
479
+ {{ actionDialogConfirmText }}
480
+ </el-button>
481
+ </template>
482
+ </el-dialog>
483
+
484
+ <ResubmitDialog
485
+ v-model="resubmitVisible"
486
+ :instance="instance"
487
+ :task="actionTask"
488
+ :submitting="submitting === 'resubmit'"
489
+ @submitted="handleResubmit"
490
+ />
491
+ </div>
492
+ </template>
493
+
494
+ <script setup>
495
+ import { computed, inject, reactive, ref, watch } from 'vue'
496
+ import { ElMessage, ElMessageBox } from 'element-plus'
497
+ import {
498
+ Back,
499
+ Bell,
500
+ CircleCheck,
501
+ CircleCheckFilled,
502
+ CircleCloseFilled,
503
+ Close,
504
+ Document,
505
+ EditPen,
506
+ InfoFilled,
507
+ Loading,
508
+ Lock,
509
+ SetUp,
510
+ MoreFilled,
511
+ Plus,
512
+ Switch
513
+ } from 'gbicons'
514
+ import { SignModeLabel } from '../../core/flow/flowConstant.js'
515
+ import { customNodeSummary } from '../../core/flow/customNode.js'
516
+ import { formatDateTime } from '../../utils/format.js'
517
+ import {
518
+ buildFormEntries,
519
+ buildKeyFacts,
520
+ buildProcessSteps,
521
+ buildRouteDecisions,
522
+ formatElapsed,
523
+ formatSla,
524
+ instanceCode,
525
+ isTaskOverdue,
526
+ resolveBusiness,
527
+ sameId,
528
+ statusMeta
529
+ } from '../model.js'
530
+ import ProcessSteps from './ProcessSteps.vue'
531
+ import ResubmitDialog from './ResubmitDialog.vue'
532
+ import UserAvatar from './UserAvatar.vue'
533
+
534
+ defineOptions({ name: 'OaApprovalWorkspace' })
535
+
536
+ const props = defineProps({
537
+ instance: { type: Object, required: true },
538
+ task: { type: Object, default: null },
539
+ dismissible: { type: Boolean, default: false }
540
+ })
541
+
542
+ const emit = defineEmits(['close', 'handled'])
543
+ const oa = inject('oaStore')
544
+
545
+ const comment = ref('')
546
+ const submitting = ref('')
547
+ const formExpanded = ref(true)
548
+ const resubmitVisible = ref(false)
549
+ const actionDialog = reactive({
550
+ visible: false,
551
+ type: 'approve',
552
+ comment: '',
553
+ targetUserId: null
554
+ })
555
+
556
+ const quickPhrases = [
557
+ '同意,按申请执行',
558
+ '材料齐全,同意',
559
+ '请补充说明后重新提交'
560
+ ]
561
+
562
+ const business = computed(() => resolveBusiness(props.instance?.definition))
563
+ const initiatorName = computed(
564
+ () => props.instance?.state?.initiator?.name || props.instance?.initiator?.name || '未知发起人'
565
+ )
566
+ const initiatorDept = computed(
567
+ () =>
568
+ props.instance?.state?.initiator?.deptName ||
569
+ props.instance?.initiator?.deptName ||
570
+ '未分配部门'
571
+ )
572
+ const pendingTasks = computed(() =>
573
+ (props.instance?.state?.tasks || []).filter((task) => task.status === 'pending')
574
+ )
575
+ const hasCustomPending = computed(() =>
576
+ pendingTasks.value.some((task) => task.kind === 'custom')
577
+ )
578
+ const actionTask = computed(() => {
579
+ const direct = props.task
580
+ if (direct && oa.canActOnTask(props.instance, direct)) return direct
581
+ return (
582
+ pendingTasks.value.find((task) => oa.canActOnTask(props.instance, task)) || null
583
+ )
584
+ })
585
+ const canAct = computed(() => Boolean(actionTask.value))
586
+ const isAdmin = computed(() => oa.isAdmin.value)
587
+ const canRevoke = computed(() => oa.canRevoke(props.instance))
588
+ const canUrge = computed(
589
+ () =>
590
+ isAdmin.value &&
591
+ props.instance?.state?.status === 'running' &&
592
+ pendingTasks.value.some((task) => task.kind !== 'custom')
593
+ )
594
+ const canTerminate = computed(
595
+ () => isAdmin.value && props.instance?.state?.status === 'running'
596
+ )
597
+ const canTransfer = computed(
598
+ () => actionTask.value && oa.canTransfer(props.instance, actionTask.value)
599
+ )
600
+ const isOwner = computed(
601
+ () => sameId(props.instance?.state?.initiator?.id, oa.currentUserId.value)
602
+ )
603
+ const canViewSensitive = computed(() => {
604
+ if (isAdmin.value || isOwner.value) return true
605
+ const userId = oa.currentUserId.value
606
+ const state = props.instance?.state
607
+ const isApprover = (state?.tasks || []).some(
608
+ (task) =>
609
+ (task.approvers || []).some((approver) => sameId(approver.id, userId)) ||
610
+ (task.approvedBy || []).some((approver) => sameId(approver.id, userId)) ||
611
+ (task.records || []).some((record) => sameId(record.approver?.id, userId))
612
+ )
613
+ const isCc = (state?.ccRecords || []).some((record) =>
614
+ (record.users || []).some((user) => sameId(user.id, userId))
615
+ )
616
+ return isApprover || isCc
617
+ })
618
+
619
+ const hasCustomFailure = computed(() =>
620
+ (props.instance?.state?.history || []).some((event) => event.event === 'customFailed')
621
+ )
622
+ const overallStatus = computed(() => {
623
+ const status = props.instance?.state?.status
624
+ if (status === 'cancelled' && hasCustomFailure.value) {
625
+ return { label: '执行异常', tone: 'danger' }
626
+ }
627
+ if (status === 'running' && actionTask.value) return { label: '待我处理', tone: 'warning' }
628
+ return statusMeta(status)
629
+ })
630
+ const hasOverdue = computed(() =>
631
+ pendingTasks.value.some((task) => isTaskOverdue(props.instance, task, oa.now.value))
632
+ )
633
+ const facts = computed(() => buildKeyFacts(props.instance))
634
+ const amountFact = computed(() => facts.value.find((fact) => fact.emphasis) || null)
635
+ const otherFacts = computed(() =>
636
+ facts.value.filter((fact) => fact !== amountFact.value).slice(0, 4)
637
+ )
638
+ const formEntries = computed(() => {
639
+ const routeVariables = collectRouteVariables(props.instance?.definition?.workflow)
640
+ return buildFormEntries(props.instance).map((entry) => ({
641
+ ...entry,
642
+ route: routeVariables.has(entry.variableName)
643
+ }))
644
+ })
645
+ const attachmentFields = computed(() =>
646
+ formEntries.value.filter(
647
+ (entry) => entry.type === 'checkbox-group' || /attach|file/i.test(entry.variableName)
648
+ )
649
+ )
650
+ const attachmentLabels = computed(() => {
651
+ const labels = []
652
+ attachmentFields.value.forEach((field) => {
653
+ if (field.value && field.value !== '—') labels.push(...field.value.split('、'))
654
+ })
655
+ return [...new Set(labels)]
656
+ })
657
+ const uploadedFiles = computed(() => props.instance?.attachments || [])
658
+ const attachmentCount = computed(
659
+ () => attachmentLabels.value.length + uploadedFiles.value.length
660
+ )
661
+ function chipsOf(entry) {
662
+ return entry.value && entry.value !== '—' ? entry.value.split('、') : []
663
+ }
664
+
665
+ function formatFileSize(size) {
666
+ const value = Number(size) || 0
667
+ if (value < 1024) return `${value} B`
668
+ if (value < 1024 * 1024) return `${Math.round(value / 1024)} KB`
669
+ return `${(value / (1024 * 1024)).toFixed(1)} MB`
670
+ }
671
+
672
+ const progressPercent = computed(() => {
673
+ const tasks = props.instance?.state?.tasks || []
674
+ if (!tasks.length) return 0
675
+ if (['completed', 'rejected', 'revoked', 'cancelled'].includes(props.instance?.state?.status)) {
676
+ return 100
677
+ }
678
+ const done = tasks.filter((task) =>
679
+ ['approved', 'completed', 'rejected', 'failed'].includes(task.status)
680
+ ).length
681
+ return Math.round((done / tasks.length) * 100)
682
+ })
683
+ const progressLabel = computed(() => {
684
+ const tasks = props.instance?.state?.tasks || []
685
+ if (!tasks.length) return '尚未开始'
686
+ const done = tasks.filter((task) => ['approved', 'completed'].includes(task.status)).length
687
+ return `${done}/${tasks.length} 个节点已完成`
688
+ })
689
+ const runtimeNote = computed(() => {
690
+ if (props.instance?.state?.status !== 'running') return ''
691
+ const pending = pendingTasks.value[0]
692
+ return pending ? `当前停留 ${formatElapsed(pending.createdAt, oa.now.value)}` : ''
693
+ })
694
+ const rejectPolicy = computed(() => {
695
+ const node = findNode(props.instance?.definition?.workflow, actionTask.value?.nodeId)
696
+ const strategy = node?.rejectStrategy || 'terminate'
697
+ const label =
698
+ strategy === 'terminate'
699
+ ? '驳回'
700
+ : strategy === 'to_previous'
701
+ ? '退回上一节点'
702
+ : strategy === 'to_specified'
703
+ ? '退回指定节点'
704
+ : '退回修改'
705
+ const terminate = strategy === 'terminate'
706
+ const retryLimit = Math.max(0, Number(node?.rejectRetryLimit) || 0)
707
+ const retriesUsed = (props.instance?.state?.history || []).filter(
708
+ (event) => event.event === 'return' && sameId(event.nodeId, node?.nodeId)
709
+ ).length
710
+ let hint = terminate
711
+ ? '驳回后本次流程结束,判定为不通过。'
712
+ : strategy === 'to_previous'
713
+ ? '退回上一节点重新处理,处理完成后继续流转。'
714
+ : strategy === 'to_specified'
715
+ ? '退回指定节点重新处理,处理完成后继续流转。'
716
+ : '退回后由发起人修改并重新提交,流程继续流转。'
717
+ if (!terminate && retryLimit) {
718
+ hint += ` 已退回 ${retriesUsed}/${retryLimit} 次,超出上限将直接不通过。`
719
+ }
720
+ return { label, hint, terminate }
721
+ })
722
+ const currentApproverNames = computed(() => {
723
+ const names = pendingTasks.value.flatMap((task) =>
724
+ (task.approvers || [])
725
+ .filter((approver) => !(task.approvedBy || []).some((item) => sameId(item.id, approver.id)))
726
+ .map((approver) => approver.name)
727
+ )
728
+ if (!names.length && pendingTasks.value.some((task) => task.kind === 'custom')) {
729
+ return '系统执行器'
730
+ }
731
+ return [...new Set(names)].join('、') || '其他审批人'
732
+ })
733
+ const resultDescription = computed(() => {
734
+ const status = props.instance?.state?.status
735
+ if (status === 'completed' && hasCustomFailure.value) {
736
+ return '流程已完成,但自定义节点曾执行失败,已按「继续」策略流转;请查看流程轨迹。'
737
+ }
738
+ if (status === 'completed') return '所有审批节点已完成,流程正常结束。'
739
+ if (status === 'rejected') return '流程被审批人驳回,本次申请未通过。'
740
+ if (status === 'revoked') return '发起人主动撤回了本次申请。'
741
+ if (status === 'cancelled' && hasCustomFailure.value) {
742
+ return '自定义节点执行失败,流程已终止;失败原因已记录在流程轨迹中。'
743
+ }
744
+ if (status === 'cancelled') return '流程管理员终止了本次流程,操作已留痕。'
745
+ return ''
746
+ })
747
+ const prediction = computed(() => oa.predictInstance(props.instance))
748
+ const steps = computed(() =>
749
+ buildProcessSteps(props.instance, prediction.value, oa.now.value)
750
+ )
751
+ const displaySteps = computed(() => {
752
+ if (canViewSensitive.value) return steps.value
753
+ return steps.value.map((step) => ({
754
+ ...step,
755
+ records: [],
756
+ actors: [],
757
+ subtitle: step.kind === 'custom' ? '自定义节点' : step.subtitle,
758
+ task:
759
+ step.kind === 'custom'
760
+ ? { ...step.task, result: undefined, lastError: undefined }
761
+ : step.task
762
+ }))
763
+ })
764
+ const decisions = computed(() => (canViewSensitive.value ? buildRouteDecisions(props.instance) : []))
765
+ const resubmitHint = computed(() => {
766
+ const records = [...(actionTask.value?.records || [])].reverse()
767
+ return records.find((record) => record.action === 'reject')?.comment || '请根据退回意见修改申请内容。'
768
+ })
769
+ const targetUsers = computed(() => {
770
+ const excluded = new Set(
771
+ (actionTask.value?.approvers || []).map((approver) => String(approver.id))
772
+ )
773
+ return oa.usersWithStats.value.filter((user) => !excluded.has(String(user.id)))
774
+ })
775
+ const actionDialogTitle = computed(
776
+ () =>
777
+ ({
778
+ approve: '同意审批',
779
+ reject: rejectPolicy.value.label,
780
+ transfer: '转办任务',
781
+ addSign: '加签'
782
+ })[actionDialog.type] || '审批操作'
783
+ )
784
+ const actionDialogConfirmText = computed(
785
+ () =>
786
+ ({
787
+ approve: '确认同意',
788
+ reject: `确认${rejectPolicy.value.label}`,
789
+ transfer: '确认转办',
790
+ addSign: '确认加签'
791
+ })[actionDialog.type] || '确认'
792
+ )
793
+
794
+ watch(
795
+ () => [props.instance?.id, props.task?.id],
796
+ () => {
797
+ comment.value = ''
798
+ actionDialog.visible = false
799
+ }
800
+ )
801
+
802
+ function isMe(approver) {
803
+ return sameId(approver.id, oa.currentUserId.value)
804
+ }
805
+
806
+ function hasApproved(task, approver) {
807
+ return (task.approvedBy || []).some((item) => sameId(item.id, approver.id))
808
+ }
809
+
810
+ function isTaskMine(task) {
811
+ return oa.canActOnTask(props.instance, task)
812
+ }
813
+
814
+ function signLabel(task) {
815
+ return SignModeLabel[task.signMode] || '并签'
816
+ }
817
+
818
+ function customRunningText(task) {
819
+ const key = `${props.instance?.id}:${task.id}`
820
+ return oa.customExecutingTaskIds.value.includes(key) ? '执行中' : '等待执行'
821
+ }
822
+
823
+ function signProgressText(task) {
824
+ const approved = (task.approvedBy || []).length
825
+ if (task.signMode === 'or') {
826
+ return approved ? `已同意 ${approved}/${task.approvers.length}` : '或签 · 任意一人同意即可'
827
+ }
828
+ return `已同意 ${approved}/${task.approvers.length}`
829
+ }
830
+
831
+ function waitingText(task) {
832
+ const overdue = isTaskOverdue(props.instance, task, oa.now.value)
833
+ const wait = formatElapsed(task.createdAt, oa.now.value)
834
+ if (overdue) return `已等待 ${wait} · 超时`
835
+ return `到达 ${formatDateTime(task.createdAt, { short: true })}`
836
+ }
837
+
838
+ function taskOverdue(task) {
839
+ return isTaskOverdue(props.instance, task, oa.now.value)
840
+ }
841
+
842
+ function appendPhrase(phrase) {
843
+ comment.value = comment.value ? `${comment.value};${phrase}` : phrase
844
+ }
845
+
846
+ function findNode(node, nodeId) {
847
+ if (!node) return null
848
+ if (sameId(node.nodeId, nodeId)) return node
849
+ for (const branch of node.branchList || []) {
850
+ const found = findNode(branch, nodeId)
851
+ if (found) return found
852
+ }
853
+ return findNode(node.childNode, nodeId)
854
+ }
855
+
856
+ function collectRouteVariables(workflow) {
857
+ const result = new Set()
858
+ const visit = (node) => {
859
+ if (!node) return
860
+ ;(node.conditions || []).forEach((condition) => {
861
+ const variable = condition.variable ?? condition.variableName
862
+ if (variable) result.add(variable)
863
+ })
864
+ ;(node.branchList || []).forEach(visit)
865
+ visit(node.childNode)
866
+ }
867
+ visit(workflow)
868
+ return result
869
+ }
870
+
871
+ async function executeAction(type) {
872
+ if (!actionTask.value) return
873
+ if (submitting.value) return
874
+ const finalComment = comment.value.trim()
875
+ if (type === 'reject' && !finalComment) {
876
+ ElMessage.warning(`请填写${rejectPolicy.value.label}原因`)
877
+ return
878
+ }
879
+ submitting.value = type
880
+ try {
881
+ const state = oa.actOnTask(props.instance.id, actionTask.value.id, type, {
882
+ comment: finalComment
883
+ })
884
+ comment.value = ''
885
+ if (type === 'approve') {
886
+ ElMessage.success(state.status === 'completed' ? '已同意,流程已完成' : '已同意,流转至下一节点')
887
+ } else if (type === 'reject') {
888
+ ElMessage.success(
889
+ state.status === 'rejected' ? '已驳回,流程已结束' : '已退回,等待发起人修改'
890
+ )
891
+ }
892
+ emit('handled', { type, state })
893
+ } catch (error) {
894
+ ElMessage.error(error.message || '操作失败')
895
+ } finally {
896
+ submitting.value = ''
897
+ }
898
+ }
899
+
900
+ function openActionDialog(type) {
901
+ if (!actionTask.value) return
902
+ actionDialog.type = type
903
+ actionDialog.comment = comment.value
904
+ actionDialog.targetUserId = null
905
+ actionDialog.visible = true
906
+ }
907
+
908
+ async function confirmDialog() {
909
+ const type = actionDialog.type
910
+ if (type === 'reject' && !actionDialog.comment.trim()) {
911
+ ElMessage.warning(`请填写${rejectPolicy.value.label}原因`)
912
+ return
913
+ }
914
+ if (type === 'transfer' || type === 'addSign') {
915
+ if (!actionDialog.targetUserId) {
916
+ ElMessage.warning(type === 'transfer' ? '请选择转办对象' : '请选择加签人')
917
+ return
918
+ }
919
+ submitting.value = type
920
+ try {
921
+ oa.actOnTask(props.instance.id, actionTask.value.id, type, {
922
+ comment: actionDialog.comment.trim(),
923
+ targetUserId: actionDialog.targetUserId
924
+ })
925
+ const target = oa.usersWithStats.value.find(
926
+ (user) => sameId(user.id, actionDialog.targetUserId)
927
+ )
928
+ ElMessage.success(
929
+ type === 'transfer'
930
+ ? `已转办给 ${target?.realName || '目标用户'}`
931
+ : `已加签 ${target?.realName || '目标用户'}`
932
+ )
933
+ actionDialog.visible = false
934
+ emit('handled', { type })
935
+ } catch (error) {
936
+ ElMessage.error(error.message || '操作失败')
937
+ } finally {
938
+ submitting.value = ''
939
+ }
940
+ return
941
+ }
942
+ comment.value = actionDialog.comment
943
+ actionDialog.visible = false
944
+ await executeAction(type)
945
+ }
946
+
947
+ async function handleResubmit(payload) {
948
+ if (!actionTask.value) return
949
+ submitting.value = 'resubmit'
950
+ try {
951
+ const state = oa.actOnTask(props.instance.id, actionTask.value.id, 'resubmit', payload)
952
+ ElMessage.success('已重新提交,流程继续流转')
953
+ resubmitVisible.value = false
954
+ emit('handled', { type: 'resubmit', state })
955
+ } catch (error) {
956
+ ElMessage.error(error.message || '提交失败')
957
+ } finally {
958
+ submitting.value = ''
959
+ }
960
+ }
961
+
962
+ async function handleRevoke() {
963
+ try {
964
+ await ElMessageBox.confirm('撤回后本次流程将终止,已提交的内容会保留在轨迹中。', '撤回申请', {
965
+ type: 'warning',
966
+ confirmButtonText: '确认撤回',
967
+ cancelButtonText: '取消'
968
+ })
969
+ } catch {
970
+ return
971
+ }
972
+ try {
973
+ oa.revokeInstance(props.instance.id, '发起人主动撤回')
974
+ ElMessage.success('申请已撤回')
975
+ } catch (error) {
976
+ ElMessage.error(error.message || '撤回失败')
977
+ }
978
+ }
979
+
980
+ async function handleUrge() {
981
+ const pending = pendingTasks.value.find((task) => task.kind !== 'custom')
982
+ if (!pending) return
983
+ try {
984
+ const { value } = await ElMessageBox.prompt('催办信息会发送给当前节点审批人,并写入审计日志。', '催办', {
985
+ confirmButtonText: '发送催办',
986
+ cancelButtonText: '取消',
987
+ inputValue: '请尽快处理该审批节点',
988
+ inputValidator: (text) => Boolean(String(text || '').trim()) || '请填写催办说明'
989
+ })
990
+ oa.urgeTask(props.instance.id, pending.id, value)
991
+ ElMessage.success('催办已发送')
992
+ } catch {
993
+ // 用户取消
994
+ }
995
+ }
996
+
997
+ async function handleTerminate() {
998
+ try {
999
+ const { value } = await ElMessageBox.prompt(
1000
+ '终止后流程立即结束,操作会写入审计日志。请填写终止原因。',
1001
+ '终止流程',
1002
+ {
1003
+ type: 'warning',
1004
+ confirmButtonText: '终止流程',
1005
+ cancelButtonText: '取消',
1006
+ inputPlaceholder: '请输入终止原因',
1007
+ inputValidator: (text) => Boolean(String(text || '').trim()) || '终止原因不能为空'
1008
+ }
1009
+ )
1010
+ oa.terminateInstance(props.instance.id, value)
1011
+ ElMessage.info('流程已终止,操作已留痕')
1012
+ } catch {
1013
+ // 用户取消
1014
+ }
1015
+ }
1016
+ </script>
1017
+
1018
+ <style scoped lang="scss">
1019
+ .oa-approval {
1020
+ display: flex;
1021
+ flex-direction: column;
1022
+ height: 100%;
1023
+ min-height: 0;
1024
+ background: #f5f7fb;
1025
+ }
1026
+
1027
+ .oa-approval__head {
1028
+ flex-shrink: 0;
1029
+ padding: 14px 22px 11px;
1030
+ background: #fff;
1031
+ border-bottom: 1px solid var(--oa-line);
1032
+ }
1033
+
1034
+ .oa-approval__topline {
1035
+ display: flex;
1036
+ align-items: center;
1037
+ flex-wrap: wrap;
1038
+ gap: 7px;
1039
+ min-height: 22px;
1040
+ }
1041
+
1042
+ .oa-approval__back {
1043
+ display: none;
1044
+ align-items: center;
1045
+ justify-content: center;
1046
+ width: 30px;
1047
+ height: 30px;
1048
+ margin-right: 2px;
1049
+ border: 1px solid var(--oa-line);
1050
+ border-radius: 7px;
1051
+ background: #fff;
1052
+ color: var(--oa-muted);
1053
+ cursor: pointer;
1054
+ }
1055
+
1056
+ .oa-approval__code {
1057
+ color: var(--oa-faint);
1058
+ font-size: 11px;
1059
+ font-variant-numeric: tabular-nums;
1060
+ }
1061
+
1062
+ .oa-approval__template {
1063
+ color: var(--oa-muted);
1064
+ font-size: 11px;
1065
+ }
1066
+
1067
+ .oa-approval__version {
1068
+ padding: 0 5px;
1069
+ border-radius: 3px;
1070
+ background: #f1f4f9;
1071
+ color: var(--oa-faint);
1072
+ font-size: 9.5px;
1073
+ }
1074
+
1075
+ .oa-approval__title-row {
1076
+ display: flex;
1077
+ align-items: flex-start;
1078
+ justify-content: space-between;
1079
+ gap: 16px;
1080
+ margin-top: 6px;
1081
+
1082
+ h2 {
1083
+ margin: 0;
1084
+ color: var(--oa-ink-strong);
1085
+ font-size: 20px;
1086
+ font-weight: 650;
1087
+ letter-spacing: -0.02em;
1088
+ line-height: 1.35;
1089
+ }
1090
+ }
1091
+
1092
+ .oa-approval__head-actions {
1093
+ display: flex;
1094
+ align-items: center;
1095
+ gap: 6px;
1096
+ flex-shrink: 0;
1097
+ padding-top: 2px;
1098
+ }
1099
+
1100
+ .oa-approval__meta {
1101
+ display: flex;
1102
+ align-items: center;
1103
+ flex-wrap: wrap;
1104
+ gap: 7px;
1105
+ margin-top: 8px;
1106
+ color: var(--oa-muted);
1107
+ font-size: 11.5px;
1108
+
1109
+ i {
1110
+ width: 2px;
1111
+ height: 2px;
1112
+ border-radius: 50%;
1113
+ background: #c3ccda;
1114
+ }
1115
+ }
1116
+
1117
+ .oa-approval__meta-dept {
1118
+ color: var(--oa-faint);
1119
+ }
1120
+
1121
+ .oa-approval__scroll {
1122
+ flex: 1;
1123
+ min-height: 0;
1124
+ display: flex;
1125
+ flex-direction: column;
1126
+ overflow: hidden;
1127
+ padding: 12px 22px 18px;
1128
+ }
1129
+
1130
+ .oa-approval__summary {
1131
+ flex-shrink: 0;
1132
+ display: flex;
1133
+ align-items: stretch;
1134
+ gap: 14px;
1135
+ padding: 12px 16px;
1136
+ border: 1px solid var(--oa-line);
1137
+ border-radius: var(--oa-radius);
1138
+ background: #fff;
1139
+ box-shadow: var(--oa-shadow);
1140
+ }
1141
+
1142
+ .oa-summary-amount {
1143
+ display: flex;
1144
+ flex-direction: column;
1145
+ justify-content: center;
1146
+ min-width: 168px;
1147
+ padding-right: 14px;
1148
+ border-right: 1px solid var(--oa-line);
1149
+
1150
+ small {
1151
+ color: var(--oa-faint);
1152
+ font-size: 11px;
1153
+ }
1154
+
1155
+ strong {
1156
+ margin-top: 2px;
1157
+ color: var(--oa-ink-strong);
1158
+ font-size: 24px;
1159
+ font-weight: 700;
1160
+ letter-spacing: -0.02em;
1161
+ line-height: 1.25;
1162
+ }
1163
+ }
1164
+
1165
+ .oa-summary-amount__flag {
1166
+ margin-top: 3px;
1167
+ color: var(--oa-danger);
1168
+ font-size: 10px;
1169
+ font-weight: 500;
1170
+ }
1171
+
1172
+ .oa-summary-facts {
1173
+ display: grid;
1174
+ grid-template-columns: repeat(2, minmax(0, 1fr));
1175
+ gap: 10px 28px;
1176
+ flex: 1;
1177
+ align-content: center;
1178
+ min-width: 0;
1179
+ }
1180
+
1181
+ .oa-summary-fact {
1182
+ display: flex;
1183
+ flex-direction: column;
1184
+ gap: 2px;
1185
+ min-width: 0;
1186
+
1187
+ small {
1188
+ color: var(--oa-faint);
1189
+ font-size: 10.5px;
1190
+ }
1191
+
1192
+ span {
1193
+ overflow: hidden;
1194
+ color: var(--oa-ink);
1195
+ font-size: 12px;
1196
+ font-weight: 550;
1197
+ text-overflow: ellipsis;
1198
+ white-space: nowrap;
1199
+ }
1200
+
1201
+ &--wide {
1202
+ grid-column: span 2;
1203
+ }
1204
+ }
1205
+
1206
+ .oa-summary-restricted {
1207
+ display: flex;
1208
+ align-items: center;
1209
+ gap: 6px;
1210
+ flex: 1;
1211
+ color: var(--oa-faint);
1212
+ font-size: 11.5px;
1213
+ }
1214
+
1215
+ .oa-summary-side {
1216
+ display: flex;
1217
+ flex-direction: column;
1218
+ justify-content: center;
1219
+ width: 150px;
1220
+ flex-shrink: 0;
1221
+ padding-left: 18px;
1222
+ border-left: 1px solid var(--oa-line);
1223
+
1224
+ strong {
1225
+ margin-top: 2px;
1226
+ color: var(--oa-ink);
1227
+ font-size: 12px;
1228
+ font-weight: 600;
1229
+ }
1230
+
1231
+ .oa-progress {
1232
+ margin-top: 7px;
1233
+ }
1234
+ }
1235
+
1236
+ .oa-summary-side__label {
1237
+ color: var(--oa-faint);
1238
+ font-size: 10.5px;
1239
+ }
1240
+
1241
+ .oa-approval__columns {
1242
+ flex: 1;
1243
+ min-height: 0;
1244
+ display: grid;
1245
+ grid-template-columns: minmax(0, 1fr) 370px;
1246
+ gap: 16px;
1247
+ align-items: stretch;
1248
+ margin-top: 16px;
1249
+ }
1250
+
1251
+ .oa-approval__left,
1252
+ .oa-approval__right {
1253
+ display: flex;
1254
+ flex-direction: column;
1255
+ gap: 14px;
1256
+ min-width: 0;
1257
+ min-height: 0;
1258
+ }
1259
+
1260
+ .oa-approval__left {
1261
+ overflow-y: auto;
1262
+ padding-right: 5px;
1263
+ }
1264
+
1265
+ .oa-approval__right {
1266
+ overflow: hidden;
1267
+ }
1268
+
1269
+
1270
+ .oa-form-grid {
1271
+ display: grid;
1272
+ grid-template-columns: repeat(2, minmax(0, 1fr));
1273
+ gap: 0 26px;
1274
+ padding: 2px 20px 16px;
1275
+
1276
+ .oa-form-field {
1277
+ min-width: 0;
1278
+ padding: 11px 0;
1279
+ border-bottom: 1px dashed #eef1f6;
1280
+
1281
+ &.is-wide {
1282
+ grid-column: span 2;
1283
+ }
1284
+
1285
+ label {
1286
+ display: flex;
1287
+ align-items: center;
1288
+ gap: 6px;
1289
+ color: var(--oa-faint);
1290
+ font-size: 11px;
1291
+ }
1292
+
1293
+ p {
1294
+ margin: 4px 0 0;
1295
+ color: var(--oa-ink);
1296
+ font-size: 12.5px;
1297
+ font-weight: 500;
1298
+ line-height: 1.65;
1299
+ white-space: pre-wrap;
1300
+ word-break: break-word;
1301
+
1302
+ &.is-empty {
1303
+ color: #b0bac8;
1304
+ }
1305
+ }
1306
+ }
1307
+ }
1308
+
1309
+ .oa-form-field__route {
1310
+ padding: 0 4px;
1311
+ border-radius: 3px;
1312
+ background: #eef2ff;
1313
+ color: var(--oa-primary);
1314
+ font-size: 9px;
1315
+ font-weight: 500;
1316
+ line-height: 15px;
1317
+ }
1318
+
1319
+ .oa-form-field__chips {
1320
+ display: flex;
1321
+ flex-wrap: wrap;
1322
+ gap: 5px;
1323
+ margin-top: 5px;
1324
+ }
1325
+
1326
+ .oa-form-card__collapsed {
1327
+ margin: 0;
1328
+ padding: 0 20px 20px;
1329
+ color: var(--oa-faint);
1330
+ font-size: 12px;
1331
+ }
1332
+
1333
+ .oa-material {
1334
+ display: flex;
1335
+ flex-direction: column;
1336
+ gap: 11px;
1337
+ padding: 0 20px 18px;
1338
+ }
1339
+
1340
+ .oa-material__group {
1341
+ display: flex;
1342
+ gap: 10px;
1343
+ align-items: flex-start;
1344
+ }
1345
+
1346
+ .oa-material__label {
1347
+ flex-shrink: 0;
1348
+ width: 58px;
1349
+ padding-top: 3px;
1350
+ color: var(--oa-faint);
1351
+ font-size: 11px;
1352
+ }
1353
+
1354
+ .oa-material__chips {
1355
+ display: flex;
1356
+ flex-wrap: wrap;
1357
+ gap: 5px;
1358
+ min-height: 22px;
1359
+ font-size: 11.5px;
1360
+ }
1361
+
1362
+ .oa-material__size {
1363
+ color: var(--oa-faint);
1364
+ font-size: 9px;
1365
+ font-style: normal;
1366
+ }
1367
+
1368
+ .oa-material__note {
1369
+ display: flex;
1370
+ align-items: flex-start;
1371
+ gap: 5px;
1372
+ margin: 2px 0 0;
1373
+ padding-top: 10px;
1374
+ border-top: 1px dashed var(--oa-line);
1375
+ color: var(--oa-faint);
1376
+ font-size: 10.5px;
1377
+ line-height: 1.65;
1378
+
1379
+ .el-icon {
1380
+ margin-top: 2px;
1381
+ }
1382
+ }
1383
+
1384
+ .oa-instance-info {
1385
+ padding-bottom: 6px;
1386
+
1387
+ dl {
1388
+ display: grid;
1389
+ grid-template-columns: repeat(2, minmax(0, 1fr));
1390
+ gap: 0 24px;
1391
+ margin: 0;
1392
+ padding: 0 20px 12px;
1393
+
1394
+ div {
1395
+ display: flex;
1396
+ align-items: baseline;
1397
+ gap: 10px;
1398
+ padding: 8px 0;
1399
+ border-bottom: 1px dashed #eef1f6;
1400
+ font-size: 11.5px;
1401
+ }
1402
+
1403
+ dt {
1404
+ flex-shrink: 0;
1405
+ width: 62px;
1406
+ color: var(--oa-faint);
1407
+ }
1408
+
1409
+ dd {
1410
+ margin: 0;
1411
+ color: var(--oa-ink);
1412
+ font-weight: 500;
1413
+ }
1414
+ }
1415
+ }
1416
+
1417
+ .oa-sync-dot {
1418
+ display: inline-block;
1419
+ width: 5px;
1420
+ height: 5px;
1421
+ margin-right: 4px;
1422
+ border-radius: 50%;
1423
+ background: var(--oa-success);
1424
+ vertical-align: 1px;
1425
+ }
1426
+
1427
+ .oa-permission {
1428
+ display: flex;
1429
+ flex-direction: column;
1430
+ align-items: center;
1431
+ gap: 8px;
1432
+ padding: 44px 30px;
1433
+ text-align: center;
1434
+
1435
+ strong {
1436
+ color: var(--oa-ink);
1437
+ font-size: 14px;
1438
+ }
1439
+
1440
+ p {
1441
+ max-width: 380px;
1442
+ margin: 0;
1443
+ color: var(--oa-faint);
1444
+ font-size: 12px;
1445
+ line-height: 1.7;
1446
+ }
1447
+ }
1448
+
1449
+ .oa-node-card {
1450
+ flex-shrink: 0;
1451
+ padding-bottom: 4px;
1452
+ }
1453
+
1454
+ .oa-node-card__head {
1455
+ display: flex;
1456
+ align-items: center;
1457
+ gap: 8px;
1458
+ padding: 10px 16px 4px;
1459
+ }
1460
+
1461
+ .oa-node-card__eyebrow {
1462
+ color: var(--oa-ink);
1463
+ font-size: 13px;
1464
+ font-weight: 650;
1465
+ }
1466
+
1467
+ .oa-node-task {
1468
+ margin: 2px 10px 8px;
1469
+ padding: 8px 10px;
1470
+ border: 1px solid var(--oa-line);
1471
+ border-radius: 8px;
1472
+ background: #fcfdff;
1473
+
1474
+ &.is-mine {
1475
+ border-color: #cddbfb;
1476
+ background: linear-gradient(180deg, #f7f9ff, #fff);
1477
+ }
1478
+ }
1479
+
1480
+ .oa-node-task__title {
1481
+ display: flex;
1482
+ align-items: center;
1483
+ justify-content: space-between;
1484
+ gap: 8px;
1485
+
1486
+ h4 {
1487
+ margin: 0;
1488
+ color: var(--oa-ink);
1489
+ font-size: 12.5px;
1490
+ font-weight: 650;
1491
+ }
1492
+ }
1493
+
1494
+ .oa-node-task__sign {
1495
+ display: inline-flex;
1496
+ align-items: center;
1497
+ gap: 5px;
1498
+ color: var(--oa-faint);
1499
+ font-size: 10px;
1500
+
1501
+ em {
1502
+ padding: 0 4px;
1503
+ border-radius: 3px;
1504
+ background: var(--oa-warning-soft);
1505
+ color: var(--oa-warning);
1506
+ font-style: normal;
1507
+ }
1508
+ }
1509
+
1510
+ .oa-node-task__system {
1511
+ display: flex;
1512
+ align-items: center;
1513
+ flex-wrap: wrap;
1514
+ gap: 6px;
1515
+ margin-top: 7px;
1516
+ color: var(--oa-muted);
1517
+ font-size: 10.5px;
1518
+
1519
+ > .el-icon {
1520
+ color: #6f5cf1;
1521
+ }
1522
+
1523
+ em {
1524
+ margin-left: auto;
1525
+ padding: 0 5px;
1526
+ border-radius: 3px;
1527
+ background: #f4f1ff;
1528
+ color: #6f5cf1;
1529
+ font-size: 9px;
1530
+ font-style: normal;
1531
+ }
1532
+ }
1533
+
1534
+ .oa-node-task__approvers {
1535
+ display: flex;
1536
+ flex-wrap: wrap;
1537
+ gap: 5px;
1538
+ margin-top: 5px;
1539
+ }
1540
+
1541
+ .oa-node-task__approver {
1542
+ display: inline-flex;
1543
+ align-items: center;
1544
+ gap: 4px;
1545
+ padding: 2px 6px;
1546
+ border-radius: 4px;
1547
+ background: #f1f4f9;
1548
+ color: var(--oa-muted);
1549
+ font-size: 10.5px;
1550
+
1551
+ i {
1552
+ width: 5px;
1553
+ height: 5px;
1554
+ border-radius: 50%;
1555
+ background: #b3bdcc;
1556
+ }
1557
+
1558
+ em {
1559
+ color: var(--oa-primary);
1560
+ font-size: 9px;
1561
+ font-style: normal;
1562
+ }
1563
+
1564
+ &.is-done {
1565
+ background: var(--oa-success-soft);
1566
+ color: var(--oa-success);
1567
+
1568
+ i {
1569
+ background: var(--oa-success);
1570
+ }
1571
+ }
1572
+
1573
+ &.is-me {
1574
+ box-shadow: inset 0 0 0 1px #c9d7f4;
1575
+ }
1576
+ }
1577
+
1578
+ .oa-node-task__foot {
1579
+ display: flex;
1580
+ align-items: center;
1581
+ justify-content: space-between;
1582
+ gap: 10px;
1583
+ margin-top: 6px;
1584
+ padding-top: 6px;
1585
+ border-top: 1px dashed var(--oa-line);
1586
+ color: var(--oa-faint);
1587
+ font-size: 10px;
1588
+
1589
+ .is-danger {
1590
+ color: var(--oa-danger);
1591
+ font-weight: 600;
1592
+ }
1593
+ }
1594
+
1595
+ .oa-node-card__more {
1596
+ margin: 0 18px 12px;
1597
+ color: var(--oa-faint);
1598
+ font-size: 10.5px;
1599
+ }
1600
+
1601
+ .oa-node-card__empty {
1602
+ display: flex;
1603
+ align-items: center;
1604
+ gap: 6px;
1605
+ padding: 4px 18px 16px;
1606
+ color: var(--oa-muted);
1607
+ font-size: 12px;
1608
+ }
1609
+
1610
+ .oa-result-card {
1611
+ flex-shrink: 0;
1612
+ display: flex;
1613
+ align-items: flex-start;
1614
+ gap: 12px;
1615
+ padding: 16px 18px;
1616
+
1617
+ &.is-success .oa-result-card__icon {
1618
+ background: var(--oa-success-soft);
1619
+ color: var(--oa-success);
1620
+ }
1621
+
1622
+ &.is-danger .oa-result-card__icon {
1623
+ background: var(--oa-danger-soft);
1624
+ color: var(--oa-danger);
1625
+ }
1626
+
1627
+ &.is-neutral .oa-result-card__icon {
1628
+ background: #f1f4f9;
1629
+ color: var(--oa-muted);
1630
+ }
1631
+
1632
+ strong {
1633
+ color: var(--oa-ink);
1634
+ font-size: 14px;
1635
+ }
1636
+
1637
+ p {
1638
+ margin: 2px 0 4px;
1639
+ color: var(--oa-muted);
1640
+ font-size: 11.5px;
1641
+ line-height: 1.6;
1642
+ }
1643
+
1644
+ small {
1645
+ color: var(--oa-faint);
1646
+ font-size: 10.5px;
1647
+ }
1648
+ }
1649
+
1650
+ .oa-result-card__icon {
1651
+ display: grid;
1652
+ place-items: center;
1653
+ width: 34px;
1654
+ height: 34px;
1655
+ flex-shrink: 0;
1656
+ border-radius: 50%;
1657
+ font-size: 17px;
1658
+ }
1659
+
1660
+ .oa-track-card {
1661
+ flex: 1;
1662
+ min-height: 0;
1663
+ display: flex;
1664
+ flex-direction: column;
1665
+ overflow: hidden;
1666
+ padding-bottom: 12px;
1667
+ }
1668
+
1669
+ .oa-track-card .oa-section-head,
1670
+ .oa-track-card__decisions {
1671
+ flex-shrink: 0;
1672
+ }
1673
+
1674
+ .oa-track-card__legend {
1675
+ display: flex;
1676
+ align-items: center;
1677
+ gap: 9px;
1678
+ color: var(--oa-faint);
1679
+ font-size: 9.5px;
1680
+
1681
+ span {
1682
+ display: inline-flex;
1683
+ align-items: center;
1684
+ gap: 3px;
1685
+ }
1686
+
1687
+ i {
1688
+ width: 5px;
1689
+ height: 5px;
1690
+ border-radius: 50%;
1691
+
1692
+ &.is-done {
1693
+ background: var(--oa-success);
1694
+ }
1695
+
1696
+ &.is-current {
1697
+ background: var(--oa-primary);
1698
+ }
1699
+
1700
+ &.is-upcoming {
1701
+ background: #b7c1d0;
1702
+ }
1703
+ }
1704
+ }
1705
+
1706
+ .oa-track-card__decisions {
1707
+ display: flex;
1708
+ flex-wrap: wrap;
1709
+ gap: 5px;
1710
+ padding: 0 18px 10px;
1711
+ }
1712
+
1713
+ .oa-track-card__body {
1714
+ flex: 1;
1715
+ min-height: 0;
1716
+ overflow: auto;
1717
+ padding: 2px 18px 8px;
1718
+ }
1719
+
1720
+ .oa-action-card {
1721
+ flex-shrink: 0;
1722
+ padding-bottom: 12px;
1723
+ box-shadow: 0 -6px 22px rgba(15, 31, 55, 0.05), var(--oa-shadow);
1724
+ }
1725
+
1726
+ .oa-action-card .oa-section-head {
1727
+ padding: 9px 16px 6px;
1728
+ }
1729
+
1730
+ .oa-action-card__policy {
1731
+ display: flex;
1732
+ align-items: flex-start;
1733
+ gap: 6px;
1734
+ margin: 0 16px 7px;
1735
+ padding: 6px 8px;
1736
+ border-radius: 6px;
1737
+ background: var(--oa-warning-soft);
1738
+ color: #8d5d17;
1739
+ font-size: 10.5px;
1740
+ line-height: 1.6;
1741
+
1742
+ .el-icon {
1743
+ margin-top: 2px;
1744
+ flex-shrink: 0;
1745
+ }
1746
+
1747
+ &.is-danger {
1748
+ background: var(--oa-danger-soft);
1749
+ color: #9c342c;
1750
+ }
1751
+ }
1752
+
1753
+ .oa-quick-phrases {
1754
+ display: flex;
1755
+ flex-wrap: wrap;
1756
+ gap: 5px;
1757
+ padding: 0 16px 7px;
1758
+ }
1759
+
1760
+ .oa-quick-phrases__item {
1761
+ padding: 3px 7px;
1762
+ border: 1px solid var(--oa-line);
1763
+ border-radius: 4px;
1764
+ background: #fff;
1765
+ color: var(--oa-muted);
1766
+ font-size: 10px;
1767
+ cursor: pointer;
1768
+ transition: border-color 0.15s ease, color 0.15s ease;
1769
+
1770
+ &:hover {
1771
+ border-color: #c7d5f1;
1772
+ color: var(--oa-primary);
1773
+ }
1774
+ }
1775
+
1776
+ .oa-action-card {
1777
+ :deep(.el-textarea) {
1778
+ padding: 0 16px;
1779
+ }
1780
+
1781
+ :deep(.el-textarea__inner) {
1782
+ font-size: 12px;
1783
+ line-height: 1.6;
1784
+ }
1785
+ }
1786
+
1787
+ .oa-action-card__buttons {
1788
+ display: flex;
1789
+ align-items: center;
1790
+ gap: 7px;
1791
+ padding: 8px 16px 0;
1792
+
1793
+ .el-button {
1794
+ flex: 1;
1795
+ min-height: 34px;
1796
+ }
1797
+
1798
+ .el-dropdown {
1799
+ flex: 0 0 auto;
1800
+ }
1801
+ }
1802
+
1803
+ .oa-action-card__resubmit {
1804
+ display: flex;
1805
+ flex-direction: column;
1806
+ gap: 12px;
1807
+ padding: 0 16px 4px;
1808
+
1809
+ .el-button {
1810
+ align-self: flex-start;
1811
+ min-height: 34px;
1812
+ }
1813
+ }
1814
+
1815
+ .oa-readonly {
1816
+ display: flex;
1817
+ align-items: flex-start;
1818
+ gap: 9px;
1819
+ padding: 14px 16px;
1820
+ color: var(--oa-muted);
1821
+
1822
+ > .el-icon {
1823
+ flex-shrink: 0;
1824
+ margin-top: 2px;
1825
+ color: var(--oa-faint);
1826
+ }
1827
+
1828
+ strong {
1829
+ color: var(--oa-ink);
1830
+ font-size: 12px;
1831
+ }
1832
+
1833
+ p {
1834
+ margin: 3px 0 0;
1835
+ color: var(--oa-faint);
1836
+ font-size: 10.5px;
1837
+ line-height: 1.65;
1838
+ }
1839
+ }
1840
+
1841
+ .oa-admin-note {
1842
+ display: flex;
1843
+ align-items: center;
1844
+ gap: 5px;
1845
+ padding: 0 4px;
1846
+ color: var(--oa-faint);
1847
+ font-size: 9.5px;
1848
+ }
1849
+
1850
+ .oa-mobile-bar {
1851
+ display: none;
1852
+ }
1853
+
1854
+ .oa-action-dialog__task {
1855
+ display: flex;
1856
+ align-items: center;
1857
+ gap: 8px;
1858
+ margin-bottom: 14px;
1859
+ padding: 8px 11px;
1860
+ border-radius: 7px;
1861
+ background: var(--oa-surface-soft);
1862
+ color: var(--oa-faint);
1863
+ font-size: 11px;
1864
+
1865
+ strong {
1866
+ color: var(--oa-ink);
1867
+ font-size: 12px;
1868
+ }
1869
+
1870
+ span:last-child {
1871
+ margin-left: auto;
1872
+ font-variant-numeric: tabular-nums;
1873
+ }
1874
+ }
1875
+
1876
+ .oa-action-dialog__tip {
1877
+ margin: 5px 0 0;
1878
+ color: var(--oa-faint);
1879
+ font-size: 10.5px;
1880
+ line-height: 1.6;
1881
+ }
1882
+
1883
+ .oa-action-dialog__policy {
1884
+ margin-top: 2px;
1885
+ padding: 8px 10px;
1886
+ border-radius: 6px;
1887
+ background: var(--oa-warning-soft);
1888
+ color: #8d5d17;
1889
+ font-size: 11px;
1890
+ line-height: 1.6;
1891
+ }
1892
+
1893
+ @media (max-width: 1250px) {
1894
+ .oa-approval__columns {
1895
+ grid-template-columns: minmax(0, 1fr) 340px;
1896
+ }
1897
+
1898
+ .oa-approval__scroll {
1899
+ padding: 14px 18px 22px;
1900
+ }
1901
+
1902
+ .oa-approval__head {
1903
+ padding: 15px 18px 12px;
1904
+ }
1905
+ }
1906
+
1907
+ @media (max-width: 960px) {
1908
+ .oa-approval {
1909
+ height: 100%;
1910
+ }
1911
+
1912
+ .oa-approval__head {
1913
+ padding: 12px 14px 10px;
1914
+ }
1915
+
1916
+ .oa-approval__back {
1917
+ display: inline-flex;
1918
+ }
1919
+
1920
+ .oa-approval__title-row {
1921
+ h2 {
1922
+ font-size: 17px;
1923
+ }
1924
+ }
1925
+
1926
+ .oa-approval__head-actions {
1927
+ flex-wrap: wrap;
1928
+ justify-content: flex-end;
1929
+
1930
+ .oa-approval__close {
1931
+ display: none;
1932
+ }
1933
+
1934
+ .el-button {
1935
+ min-height: 44px;
1936
+ }
1937
+ }
1938
+
1939
+ .oa-approval__scroll {
1940
+ display: block;
1941
+ overflow: auto;
1942
+ padding: 10px 12px 84px;
1943
+ }
1944
+
1945
+ .oa-approval__columns {
1946
+ display: block;
1947
+ flex: none;
1948
+ }
1949
+
1950
+ .oa-approval__left,
1951
+ .oa-approval__right {
1952
+ overflow: visible;
1953
+ }
1954
+
1955
+ .oa-track-card {
1956
+ display: block;
1957
+ overflow: visible;
1958
+ }
1959
+
1960
+ .oa-track-card__body {
1961
+ max-height: none;
1962
+ overflow: visible;
1963
+ }
1964
+
1965
+ .oa-approval__summary {
1966
+ flex-wrap: wrap;
1967
+ gap: 12px;
1968
+ padding: 12px 14px;
1969
+ }
1970
+
1971
+ .oa-summary-amount {
1972
+ min-width: 140px;
1973
+ padding-right: 0;
1974
+ border-right: none;
1975
+
1976
+ strong {
1977
+ font-size: 22px;
1978
+ }
1979
+ }
1980
+
1981
+ .oa-summary-facts {
1982
+ flex: 1 1 55%;
1983
+ grid-template-columns: repeat(2, minmax(0, 1fr));
1984
+ gap: 7px 16px;
1985
+ }
1986
+
1987
+ .oa-summary-restricted {
1988
+ display: flex;
1989
+ align-items: center;
1990
+ gap: 6px;
1991
+ flex: 1;
1992
+ color: var(--oa-faint);
1993
+ font-size: 11.5px;
1994
+ }
1995
+
1996
+ .oa-summary-side {
1997
+ width: 100%;
1998
+ padding: 9px 0 0;
1999
+ border-top: 1px solid var(--oa-line);
2000
+ border-left: none;
2001
+ }
2002
+
2003
+ .oa-approval__columns {
2004
+ grid-template-columns: minmax(0, 1fr);
2005
+ gap: 12px;
2006
+ }
2007
+
2008
+ .oa-approval__right {
2009
+ position: static;
2010
+ }
2011
+
2012
+ .oa-form-grid {
2013
+ grid-template-columns: minmax(0, 1fr);
2014
+ padding: 0 14px 12px;
2015
+
2016
+ .oa-form-field.is-wide {
2017
+ grid-column: auto;
2018
+ }
2019
+ }
2020
+
2021
+ .oa-instance-info dl {
2022
+ grid-template-columns: minmax(0, 1fr);
2023
+ padding: 0 14px 10px;
2024
+ }
2025
+
2026
+ .oa-material {
2027
+ padding: 0 14px 14px;
2028
+ }
2029
+
2030
+ .oa-action-card {
2031
+ display: none;
2032
+ }
2033
+
2034
+ .oa-mobile-bar {
2035
+ position: fixed;
2036
+ right: 0;
2037
+ bottom: 0;
2038
+ left: 0;
2039
+ z-index: 20;
2040
+ display: flex;
2041
+ gap: 8px;
2042
+ padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
2043
+ background: rgba(255, 255, 255, 0.96);
2044
+ border-top: 1px solid var(--oa-line);
2045
+ backdrop-filter: blur(10px);
2046
+
2047
+ button {
2048
+ min-height: 44px;
2049
+ border-radius: 7px;
2050
+ font-size: 13px;
2051
+ font-weight: 600;
2052
+ cursor: pointer;
2053
+ }
2054
+
2055
+ .el-button {
2056
+ width: 100%;
2057
+ min-height: 44px;
2058
+ }
2059
+ }
2060
+
2061
+ .oa-mobile-bar__ghost {
2062
+ flex: 1;
2063
+ border: 1px solid var(--oa-line-strong);
2064
+ background: #fff;
2065
+ color: var(--oa-ink);
2066
+ }
2067
+
2068
+ .oa-mobile-bar__primary {
2069
+ flex: 1.3;
2070
+ border: 1px solid var(--oa-primary);
2071
+ background: var(--oa-primary);
2072
+ color: #fff;
2073
+ }
2074
+
2075
+ .oa-mobile-bar__more {
2076
+ display: grid;
2077
+ place-items: center;
2078
+ width: 46px;
2079
+ flex: 0 0 46px;
2080
+ border: 1px solid var(--oa-line-strong);
2081
+ background: #fff;
2082
+ color: var(--oa-muted);
2083
+ }
2084
+
2085
+ .oa-approval :deep(.el-dialog) {
2086
+ width: calc(100vw - 20px) !important;
2087
+ margin-top: 8vh !important;
2088
+ }
2089
+ }
2090
+ </style>