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.
- package/README.md +271 -271
- package/dist/gbflowengine.css +1 -1
- package/dist/gbflowengine.js +8232 -6913
- package/dist/gbflowengine.js.map +1 -1
- package/dist/gbflowengine.umd.cjs +2 -2
- package/dist/gbflowengine.umd.cjs.map +1 -1
- package/package.json +85 -84
- package/src/center/DefinitionInspect.vue +291 -291
- package/src/center/FlowCenter.vue +33 -33
- package/src/center/index.js +29 -29
- package/src/center/storage.js +748 -748
- package/src/core/flow/condition.js +160 -160
- package/src/core/flow/customNode.js +385 -385
- package/src/core/flow/defaults.js +124 -124
- package/src/core/flow/flowConstant.js +265 -265
- package/src/core/flow/flowNodeUtils.js +29 -29
- package/src/core/flow/index.js +47 -47
- package/src/core/flow/node.js +44 -44
- package/src/core/flow/nodeFactory.js +58 -58
- package/src/core/flow/prediction.js +325 -325
- package/src/core/flow/schema.js +864 -864
- package/src/definition/FlowDefinitionDesigner.vue +338 -338
- package/src/definition/index.js +9 -9
- package/src/index.js +39 -39
- package/src/storage.js +200 -200
- package/src/testing/FlowTestPanel.vue +2502 -2502
- package/src/testing/UserConfigDrawer.vue +376 -376
- package/src/testing/diagram/FlowProgressDiagram.vue +318 -318
- package/src/testing/diagramModel.js +517 -517
- package/src/testing/index.js +23 -23
- package/src/testing/mock.js +246 -246
- package/src/testing/oaExecutors.js +51 -51
- package/src/testing/oaSeed.js +467 -467
- package/src/testing/sample.js +412 -412
- package/src/testing/seed.js +122 -122
- package/src/utils/format.js +27 -27
- package/src/visual/FlowCanvas.vue +440 -440
- package/src/visual/NodeProgressDetail.vue +43 -43
- package/src/visual/NodeStatusBadge.vue +17 -17
- package/src/visual/NodeWrap.vue +46 -46
- package/src/visual/ScWorkflow.vue +49 -49
- package/src/visual/SelectDialog.vue +459 -459
- package/src/visual/conditionHelpers.js +116 -116
- package/src/visual/index.js +6 -6
- package/src/visual/nodes/AddNode.vue +222 -222
- package/src/visual/nodes/ApproverNode.vue +347 -347
- package/src/visual/nodes/BranchNode.vue +441 -441
- package/src/visual/nodes/CustomNode.vue +339 -339
- package/src/visual/nodes/EndNode.vue +21 -21
- package/src/visual/nodes/PassNode.vue +100 -100
- package/src/visual/nodes/PromoterNode.vue +134 -134
- package/src/visual/nodes/RejectNode.vue +100 -100
- package/src/visual/nodes/SendNode.vue +151 -151
- package/src/visual/styles.scss +879 -879
- package/src/visual/useScNodeStatus.js +18 -18
- package/src/workbench/OaWorkbench.vue +1341 -1341
- package/src/workbench/components/ApprovalWorkspace.vue +2090 -2090
- package/src/workbench/components/CategoryIcon.vue +74 -74
- package/src/workbench/components/NotificationIcon.vue +73 -73
- package/src/workbench/components/ProcessSteps.vue +557 -557
- package/src/workbench/components/ResubmitDialog.vue +227 -227
- package/src/workbench/components/SidebarNav.vue +138 -138
- package/src/workbench/components/StartFlowDialog.vue +1058 -1058
- package/src/workbench/components/UserAvatar.vue +68 -68
- package/src/workbench/model.js +1080 -1080
- package/src/workbench/pages/DesignPage.vue +798 -798
- package/src/workbench/pages/HomePage.vue +1050 -1050
- package/src/workbench/pages/MonitorPage.vue +1029 -1029
- package/src/workbench/pages/NotificationsPage.vue +554 -554
- package/src/workbench/pages/RequestsPage.vue +644 -644
- package/src/workbench/pages/TaskCenterPage.vue +1155 -1155
- package/src/workbench/pages/TemplatesPage.vue +680 -680
- package/src/workbench/styles.scss +555 -555
- package/types/center.d.ts +5 -5
- package/types/core.d.ts +479 -479
- package/types/definition.d.ts +4 -4
- package/types/index.d.ts +34 -34
- package/types/testing.d.ts +20 -20
- package/types/visual.d.ts +20 -20
|
@@ -1,291 +1,291 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="flow-inspect">
|
|
3
|
-
<section class="flow-inspect__head" :class="valid ? 'is-ok' : 'is-bad'">
|
|
4
|
-
<el-icon class="flow-inspect__icon">
|
|
5
|
-
<CircleCheckFilled v-if="valid" />
|
|
6
|
-
<WarningFilled v-else />
|
|
7
|
-
</el-icon>
|
|
8
|
-
<div class="flow-inspect__summary">
|
|
9
|
-
<h2>{{ valid ? '流程检测通过' : `发现 ${errors.length} 个问题` }}</h2>
|
|
10
|
-
<p>
|
|
11
|
-
{{ definition?.meta?.name || '未命名流程' }} · 共 {{ totalNodes }} 个节点 · {{ formFields }} 个表单字段
|
|
12
|
-
<template v-if="warnings.length"> · {{ warnings.length }} 条提示</template>
|
|
13
|
-
</p>
|
|
14
|
-
</div>
|
|
15
|
-
<div class="flow-inspect__actions">
|
|
16
|
-
<el-button :icon="Refresh" @click="runInspect">重新检测</el-button>
|
|
17
|
-
<el-button type="primary" :icon="Promotion" :disabled="!valid" @click="emit('start-flow')">
|
|
18
|
-
去发起流程
|
|
19
|
-
</el-button>
|
|
20
|
-
</div>
|
|
21
|
-
</section>
|
|
22
|
-
|
|
23
|
-
<el-tabs v-model="tab" class="flow-inspect__tabs">
|
|
24
|
-
<el-tab-pane :label="`问题清单 ${errors.length + warnings.length}`" name="issues">
|
|
25
|
-
<el-empty v-if="!errors.length && !warnings.length" description="没有发现问题,流程可以发布" />
|
|
26
|
-
<ul v-else class="issue-list">
|
|
27
|
-
<li v-for="(item, index) in errors" :key="`e${index}`" class="issue issue--error">
|
|
28
|
-
<span class="issue__tag">错误</span>
|
|
29
|
-
<span class="issue__text">{{ item.message }}</span>
|
|
30
|
-
<span v-if="nodeNameOf(item)" class="issue__node">{{ nodeNameOf(item) }}</span>
|
|
31
|
-
</li>
|
|
32
|
-
<li v-for="(item, index) in warnings" :key="`w${index}`" class="issue issue--warn">
|
|
33
|
-
<span class="issue__tag">提示</span>
|
|
34
|
-
<span class="issue__text">{{ item.message }}</span>
|
|
35
|
-
<span v-if="nodeNameOf(item)" class="issue__node">{{ nodeNameOf(item) }}</span>
|
|
36
|
-
</li>
|
|
37
|
-
</ul>
|
|
38
|
-
</el-tab-pane>
|
|
39
|
-
|
|
40
|
-
<el-tab-pane label="节点统计" name="stats">
|
|
41
|
-
<div class="stat-grid">
|
|
42
|
-
<div v-for="item in nodeStats" :key="item.type" class="stat-card">
|
|
43
|
-
<span class="stat-card__value">{{ item.count }}</span>
|
|
44
|
-
<span class="stat-card__label">{{ item.label }}</span>
|
|
45
|
-
</div>
|
|
46
|
-
<div v-if="!nodeStats.length" class="stat-empty">流程里还没有节点</div>
|
|
47
|
-
</div>
|
|
48
|
-
</el-tab-pane>
|
|
49
|
-
|
|
50
|
-
<el-tab-pane :label="`表单变量 ${formVariables.length}`" name="vars">
|
|
51
|
-
<el-empty v-if="!formVariables.length" description="这个流程还没有设计表单字段" />
|
|
52
|
-
<el-table v-else :data="formVariables" size="small" border>
|
|
53
|
-
<el-table-column prop="variable" label="变量" min-width="140" />
|
|
54
|
-
<el-table-column prop="label" label="名称" min-width="140" />
|
|
55
|
-
<el-table-column prop="dataType" label="类型" width="120" />
|
|
56
|
-
</el-table>
|
|
57
|
-
</el-tab-pane>
|
|
58
|
-
</el-tabs>
|
|
59
|
-
</div>
|
|
60
|
-
</template>
|
|
61
|
-
|
|
62
|
-
<script setup>
|
|
63
|
-
import { computed, ref, watch } from 'vue'
|
|
64
|
-
import { CircleCheckFilled, Promotion, Refresh, WarningFilled } from '
|
|
65
|
-
import {
|
|
66
|
-
enrichFormVariables,
|
|
67
|
-
getAllNodes,
|
|
68
|
-
getNodeStatistics,
|
|
69
|
-
NodeTypeLabel,
|
|
70
|
-
validateDefinition
|
|
71
|
-
} from '../core/flow/index.js'
|
|
72
|
-
|
|
73
|
-
const props = defineProps({
|
|
74
|
-
definition: { type: Object, default: null }
|
|
75
|
-
})
|
|
76
|
-
|
|
77
|
-
const emit = defineEmits(['start-flow'])
|
|
78
|
-
|
|
79
|
-
const tab = ref('issues')
|
|
80
|
-
const report = ref({ valid: true, errors: [], warnings: [] })
|
|
81
|
-
|
|
82
|
-
function runInspect() {
|
|
83
|
-
if (!props.definition) {
|
|
84
|
-
report.value = { valid: false, errors: [{ message: '没有可检测的流程定义' }], warnings: [] }
|
|
85
|
-
return
|
|
86
|
-
}
|
|
87
|
-
try {
|
|
88
|
-
report.value = validateDefinition(props.definition)
|
|
89
|
-
} catch (error) {
|
|
90
|
-
report.value = { valid: false, errors: [{ message: error.message || String(error) }], warnings: [] }
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
watch(() => props.definition, runInspect, { immediate: true, deep: true })
|
|
95
|
-
|
|
96
|
-
const valid = computed(() => report.value.valid && !report.value.errors.length)
|
|
97
|
-
const errors = computed(() => report.value.errors || [])
|
|
98
|
-
const warnings = computed(() => report.value.warnings || [])
|
|
99
|
-
|
|
100
|
-
const nodes = computed(() => (props.definition?.workflow ? getAllNodes(props.definition.workflow) : []))
|
|
101
|
-
const totalNodes = computed(() => nodes.value.length)
|
|
102
|
-
|
|
103
|
-
const nodeStats = computed(() => {
|
|
104
|
-
if (!props.definition?.workflow) return []
|
|
105
|
-
const stats = getNodeStatistics(props.definition.workflow)
|
|
106
|
-
return Object.entries(stats).map(([type, count]) => ({
|
|
107
|
-
type,
|
|
108
|
-
count,
|
|
109
|
-
label: NodeTypeLabel[type] || type
|
|
110
|
-
}))
|
|
111
|
-
})
|
|
112
|
-
|
|
113
|
-
const formFields = computed(() => props.definition?.form?.components?.length || 0)
|
|
114
|
-
const formVariables = computed(() =>
|
|
115
|
-
props.definition?.form?.components?.length ? enrichFormVariables(props.definition.form.components) : []
|
|
116
|
-
)
|
|
117
|
-
|
|
118
|
-
function nodeNameOf(issue) {
|
|
119
|
-
const nodeId = issue?.nodeId ?? issue?.node?.nodeId
|
|
120
|
-
if (nodeId === undefined || nodeId === null) return ''
|
|
121
|
-
const found = nodes.value.find((node) => String(node.nodeId) === String(nodeId))
|
|
122
|
-
return found ? `节点:${found.nodeName}` : `节点 ${nodeId}`
|
|
123
|
-
}
|
|
124
|
-
</script>
|
|
125
|
-
|
|
126
|
-
<style lang="scss">
|
|
127
|
-
.flow-inspect {
|
|
128
|
-
display: flex;
|
|
129
|
-
flex-direction: column;
|
|
130
|
-
height: 100%;
|
|
131
|
-
min-height: 0;
|
|
132
|
-
padding: 16px;
|
|
133
|
-
box-sizing: border-box;
|
|
134
|
-
background: #f5f7fb;
|
|
135
|
-
overflow: hidden;
|
|
136
|
-
|
|
137
|
-
&__head {
|
|
138
|
-
flex-shrink: 0;
|
|
139
|
-
display: flex;
|
|
140
|
-
align-items: center;
|
|
141
|
-
gap: 14px;
|
|
142
|
-
padding: 16px 18px;
|
|
143
|
-
background: #fff;
|
|
144
|
-
border-radius: 12px;
|
|
145
|
-
border: 1px solid #e6eaf2;
|
|
146
|
-
|
|
147
|
-
&.is-ok {
|
|
148
|
-
border-color: #c9ecd4;
|
|
149
|
-
background: linear-gradient(180deg, #f5fdf7, #fff);
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
&.is-bad {
|
|
153
|
-
border-color: #f6d5d5;
|
|
154
|
-
background: linear-gradient(180deg, #fff7f7, #fff);
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
&__icon {
|
|
159
|
-
font-size: 30px;
|
|
160
|
-
color: #22a06b;
|
|
161
|
-
|
|
162
|
-
.is-bad & {
|
|
163
|
-
color: #e5484d;
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
&__summary {
|
|
168
|
-
flex: 1;
|
|
169
|
-
min-width: 0;
|
|
170
|
-
|
|
171
|
-
h2 {
|
|
172
|
-
margin: 0;
|
|
173
|
-
font-size: 16px;
|
|
174
|
-
font-weight: 600;
|
|
175
|
-
color: #1f2937;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
p {
|
|
179
|
-
margin: 4px 0 0;
|
|
180
|
-
font-size: 12px;
|
|
181
|
-
color: #7b8794;
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
&__actions {
|
|
186
|
-
display: flex;
|
|
187
|
-
gap: 8px;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
&__tabs {
|
|
191
|
-
flex: 1;
|
|
192
|
-
min-height: 0;
|
|
193
|
-
margin-top: 12px;
|
|
194
|
-
display: flex;
|
|
195
|
-
flex-direction: column;
|
|
196
|
-
|
|
197
|
-
> .el-tabs__header {
|
|
198
|
-
margin: 0 0 10px;
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
> .el-tabs__content {
|
|
202
|
-
flex: 1;
|
|
203
|
-
min-height: 0;
|
|
204
|
-
overflow: auto;
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
.issue-list {
|
|
210
|
-
margin: 0;
|
|
211
|
-
padding: 0;
|
|
212
|
-
list-style: none;
|
|
213
|
-
display: flex;
|
|
214
|
-
flex-direction: column;
|
|
215
|
-
gap: 8px;
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
.issue {
|
|
219
|
-
display: flex;
|
|
220
|
-
align-items: center;
|
|
221
|
-
gap: 10px;
|
|
222
|
-
padding: 10px 14px;
|
|
223
|
-
background: #fff;
|
|
224
|
-
border-radius: 10px;
|
|
225
|
-
border: 1px solid #e6eaf2;
|
|
226
|
-
font-size: 13px;
|
|
227
|
-
|
|
228
|
-
&__tag {
|
|
229
|
-
flex-shrink: 0;
|
|
230
|
-
padding: 1px 8px;
|
|
231
|
-
border-radius: 999px;
|
|
232
|
-
font-size: 11px;
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
&__text {
|
|
236
|
-
flex: 1;
|
|
237
|
-
min-width: 0;
|
|
238
|
-
color: #334155;
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
&__node {
|
|
242
|
-
flex-shrink: 0;
|
|
243
|
-
font-size: 12px;
|
|
244
|
-
color: #8a94a6;
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
&--error .issue__tag {
|
|
248
|
-
background: #fdecec;
|
|
249
|
-
color: #d93a3f;
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
&--warn .issue__tag {
|
|
253
|
-
background: #fff5e6;
|
|
254
|
-
color: #b7791f;
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
.stat-grid {
|
|
259
|
-
display: grid;
|
|
260
|
-
grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
|
|
261
|
-
gap: 10px;
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
.stat-card {
|
|
265
|
-
display: flex;
|
|
266
|
-
flex-direction: column;
|
|
267
|
-
gap: 4px;
|
|
268
|
-
padding: 14px 16px;
|
|
269
|
-
background: #fff;
|
|
270
|
-
border: 1px solid #e6eaf2;
|
|
271
|
-
border-radius: 10px;
|
|
272
|
-
|
|
273
|
-
&__value {
|
|
274
|
-
font-size: 22px;
|
|
275
|
-
font-weight: 600;
|
|
276
|
-
color: #1f2937;
|
|
277
|
-
line-height: 1.1;
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
&__label {
|
|
281
|
-
font-size: 12px;
|
|
282
|
-
color: #7b8794;
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
.stat-empty {
|
|
287
|
-
padding: 24px;
|
|
288
|
-
color: #8a94a6;
|
|
289
|
-
font-size: 13px;
|
|
290
|
-
}
|
|
291
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div class="flow-inspect">
|
|
3
|
+
<section class="flow-inspect__head" :class="valid ? 'is-ok' : 'is-bad'">
|
|
4
|
+
<el-icon class="flow-inspect__icon">
|
|
5
|
+
<CircleCheckFilled v-if="valid" />
|
|
6
|
+
<WarningFilled v-else />
|
|
7
|
+
</el-icon>
|
|
8
|
+
<div class="flow-inspect__summary">
|
|
9
|
+
<h2>{{ valid ? '流程检测通过' : `发现 ${errors.length} 个问题` }}</h2>
|
|
10
|
+
<p>
|
|
11
|
+
{{ definition?.meta?.name || '未命名流程' }} · 共 {{ totalNodes }} 个节点 · {{ formFields }} 个表单字段
|
|
12
|
+
<template v-if="warnings.length"> · {{ warnings.length }} 条提示</template>
|
|
13
|
+
</p>
|
|
14
|
+
</div>
|
|
15
|
+
<div class="flow-inspect__actions">
|
|
16
|
+
<el-button :icon="Refresh" @click="runInspect">重新检测</el-button>
|
|
17
|
+
<el-button type="primary" :icon="Promotion" :disabled="!valid" @click="emit('start-flow')">
|
|
18
|
+
去发起流程
|
|
19
|
+
</el-button>
|
|
20
|
+
</div>
|
|
21
|
+
</section>
|
|
22
|
+
|
|
23
|
+
<el-tabs v-model="tab" class="flow-inspect__tabs">
|
|
24
|
+
<el-tab-pane :label="`问题清单 ${errors.length + warnings.length}`" name="issues">
|
|
25
|
+
<el-empty v-if="!errors.length && !warnings.length" description="没有发现问题,流程可以发布" />
|
|
26
|
+
<ul v-else class="issue-list">
|
|
27
|
+
<li v-for="(item, index) in errors" :key="`e${index}`" class="issue issue--error">
|
|
28
|
+
<span class="issue__tag">错误</span>
|
|
29
|
+
<span class="issue__text">{{ item.message }}</span>
|
|
30
|
+
<span v-if="nodeNameOf(item)" class="issue__node">{{ nodeNameOf(item) }}</span>
|
|
31
|
+
</li>
|
|
32
|
+
<li v-for="(item, index) in warnings" :key="`w${index}`" class="issue issue--warn">
|
|
33
|
+
<span class="issue__tag">提示</span>
|
|
34
|
+
<span class="issue__text">{{ item.message }}</span>
|
|
35
|
+
<span v-if="nodeNameOf(item)" class="issue__node">{{ nodeNameOf(item) }}</span>
|
|
36
|
+
</li>
|
|
37
|
+
</ul>
|
|
38
|
+
</el-tab-pane>
|
|
39
|
+
|
|
40
|
+
<el-tab-pane label="节点统计" name="stats">
|
|
41
|
+
<div class="stat-grid">
|
|
42
|
+
<div v-for="item in nodeStats" :key="item.type" class="stat-card">
|
|
43
|
+
<span class="stat-card__value">{{ item.count }}</span>
|
|
44
|
+
<span class="stat-card__label">{{ item.label }}</span>
|
|
45
|
+
</div>
|
|
46
|
+
<div v-if="!nodeStats.length" class="stat-empty">流程里还没有节点</div>
|
|
47
|
+
</div>
|
|
48
|
+
</el-tab-pane>
|
|
49
|
+
|
|
50
|
+
<el-tab-pane :label="`表单变量 ${formVariables.length}`" name="vars">
|
|
51
|
+
<el-empty v-if="!formVariables.length" description="这个流程还没有设计表单字段" />
|
|
52
|
+
<el-table v-else :data="formVariables" size="small" border>
|
|
53
|
+
<el-table-column prop="variable" label="变量" min-width="140" />
|
|
54
|
+
<el-table-column prop="label" label="名称" min-width="140" />
|
|
55
|
+
<el-table-column prop="dataType" label="类型" width="120" />
|
|
56
|
+
</el-table>
|
|
57
|
+
</el-tab-pane>
|
|
58
|
+
</el-tabs>
|
|
59
|
+
</div>
|
|
60
|
+
</template>
|
|
61
|
+
|
|
62
|
+
<script setup>
|
|
63
|
+
import { computed, ref, watch } from 'vue'
|
|
64
|
+
import { CircleCheckFilled, Promotion, Refresh, WarningFilled } from 'gbicons'
|
|
65
|
+
import {
|
|
66
|
+
enrichFormVariables,
|
|
67
|
+
getAllNodes,
|
|
68
|
+
getNodeStatistics,
|
|
69
|
+
NodeTypeLabel,
|
|
70
|
+
validateDefinition
|
|
71
|
+
} from '../core/flow/index.js'
|
|
72
|
+
|
|
73
|
+
const props = defineProps({
|
|
74
|
+
definition: { type: Object, default: null }
|
|
75
|
+
})
|
|
76
|
+
|
|
77
|
+
const emit = defineEmits(['start-flow'])
|
|
78
|
+
|
|
79
|
+
const tab = ref('issues')
|
|
80
|
+
const report = ref({ valid: true, errors: [], warnings: [] })
|
|
81
|
+
|
|
82
|
+
function runInspect() {
|
|
83
|
+
if (!props.definition) {
|
|
84
|
+
report.value = { valid: false, errors: [{ message: '没有可检测的流程定义' }], warnings: [] }
|
|
85
|
+
return
|
|
86
|
+
}
|
|
87
|
+
try {
|
|
88
|
+
report.value = validateDefinition(props.definition)
|
|
89
|
+
} catch (error) {
|
|
90
|
+
report.value = { valid: false, errors: [{ message: error.message || String(error) }], warnings: [] }
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
watch(() => props.definition, runInspect, { immediate: true, deep: true })
|
|
95
|
+
|
|
96
|
+
const valid = computed(() => report.value.valid && !report.value.errors.length)
|
|
97
|
+
const errors = computed(() => report.value.errors || [])
|
|
98
|
+
const warnings = computed(() => report.value.warnings || [])
|
|
99
|
+
|
|
100
|
+
const nodes = computed(() => (props.definition?.workflow ? getAllNodes(props.definition.workflow) : []))
|
|
101
|
+
const totalNodes = computed(() => nodes.value.length)
|
|
102
|
+
|
|
103
|
+
const nodeStats = computed(() => {
|
|
104
|
+
if (!props.definition?.workflow) return []
|
|
105
|
+
const stats = getNodeStatistics(props.definition.workflow)
|
|
106
|
+
return Object.entries(stats).map(([type, count]) => ({
|
|
107
|
+
type,
|
|
108
|
+
count,
|
|
109
|
+
label: NodeTypeLabel[type] || type
|
|
110
|
+
}))
|
|
111
|
+
})
|
|
112
|
+
|
|
113
|
+
const formFields = computed(() => props.definition?.form?.components?.length || 0)
|
|
114
|
+
const formVariables = computed(() =>
|
|
115
|
+
props.definition?.form?.components?.length ? enrichFormVariables(props.definition.form.components) : []
|
|
116
|
+
)
|
|
117
|
+
|
|
118
|
+
function nodeNameOf(issue) {
|
|
119
|
+
const nodeId = issue?.nodeId ?? issue?.node?.nodeId
|
|
120
|
+
if (nodeId === undefined || nodeId === null) return ''
|
|
121
|
+
const found = nodes.value.find((node) => String(node.nodeId) === String(nodeId))
|
|
122
|
+
return found ? `节点:${found.nodeName}` : `节点 ${nodeId}`
|
|
123
|
+
}
|
|
124
|
+
</script>
|
|
125
|
+
|
|
126
|
+
<style lang="scss">
|
|
127
|
+
.flow-inspect {
|
|
128
|
+
display: flex;
|
|
129
|
+
flex-direction: column;
|
|
130
|
+
height: 100%;
|
|
131
|
+
min-height: 0;
|
|
132
|
+
padding: 16px;
|
|
133
|
+
box-sizing: border-box;
|
|
134
|
+
background: #f5f7fb;
|
|
135
|
+
overflow: hidden;
|
|
136
|
+
|
|
137
|
+
&__head {
|
|
138
|
+
flex-shrink: 0;
|
|
139
|
+
display: flex;
|
|
140
|
+
align-items: center;
|
|
141
|
+
gap: 14px;
|
|
142
|
+
padding: 16px 18px;
|
|
143
|
+
background: #fff;
|
|
144
|
+
border-radius: 12px;
|
|
145
|
+
border: 1px solid #e6eaf2;
|
|
146
|
+
|
|
147
|
+
&.is-ok {
|
|
148
|
+
border-color: #c9ecd4;
|
|
149
|
+
background: linear-gradient(180deg, #f5fdf7, #fff);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
&.is-bad {
|
|
153
|
+
border-color: #f6d5d5;
|
|
154
|
+
background: linear-gradient(180deg, #fff7f7, #fff);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
&__icon {
|
|
159
|
+
font-size: 30px;
|
|
160
|
+
color: #22a06b;
|
|
161
|
+
|
|
162
|
+
.is-bad & {
|
|
163
|
+
color: #e5484d;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
&__summary {
|
|
168
|
+
flex: 1;
|
|
169
|
+
min-width: 0;
|
|
170
|
+
|
|
171
|
+
h2 {
|
|
172
|
+
margin: 0;
|
|
173
|
+
font-size: 16px;
|
|
174
|
+
font-weight: 600;
|
|
175
|
+
color: #1f2937;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
p {
|
|
179
|
+
margin: 4px 0 0;
|
|
180
|
+
font-size: 12px;
|
|
181
|
+
color: #7b8794;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
&__actions {
|
|
186
|
+
display: flex;
|
|
187
|
+
gap: 8px;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
&__tabs {
|
|
191
|
+
flex: 1;
|
|
192
|
+
min-height: 0;
|
|
193
|
+
margin-top: 12px;
|
|
194
|
+
display: flex;
|
|
195
|
+
flex-direction: column;
|
|
196
|
+
|
|
197
|
+
> .el-tabs__header {
|
|
198
|
+
margin: 0 0 10px;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
> .el-tabs__content {
|
|
202
|
+
flex: 1;
|
|
203
|
+
min-height: 0;
|
|
204
|
+
overflow: auto;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
.issue-list {
|
|
210
|
+
margin: 0;
|
|
211
|
+
padding: 0;
|
|
212
|
+
list-style: none;
|
|
213
|
+
display: flex;
|
|
214
|
+
flex-direction: column;
|
|
215
|
+
gap: 8px;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.issue {
|
|
219
|
+
display: flex;
|
|
220
|
+
align-items: center;
|
|
221
|
+
gap: 10px;
|
|
222
|
+
padding: 10px 14px;
|
|
223
|
+
background: #fff;
|
|
224
|
+
border-radius: 10px;
|
|
225
|
+
border: 1px solid #e6eaf2;
|
|
226
|
+
font-size: 13px;
|
|
227
|
+
|
|
228
|
+
&__tag {
|
|
229
|
+
flex-shrink: 0;
|
|
230
|
+
padding: 1px 8px;
|
|
231
|
+
border-radius: 999px;
|
|
232
|
+
font-size: 11px;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
&__text {
|
|
236
|
+
flex: 1;
|
|
237
|
+
min-width: 0;
|
|
238
|
+
color: #334155;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
&__node {
|
|
242
|
+
flex-shrink: 0;
|
|
243
|
+
font-size: 12px;
|
|
244
|
+
color: #8a94a6;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
&--error .issue__tag {
|
|
248
|
+
background: #fdecec;
|
|
249
|
+
color: #d93a3f;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
&--warn .issue__tag {
|
|
253
|
+
background: #fff5e6;
|
|
254
|
+
color: #b7791f;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
.stat-grid {
|
|
259
|
+
display: grid;
|
|
260
|
+
grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
|
|
261
|
+
gap: 10px;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
.stat-card {
|
|
265
|
+
display: flex;
|
|
266
|
+
flex-direction: column;
|
|
267
|
+
gap: 4px;
|
|
268
|
+
padding: 14px 16px;
|
|
269
|
+
background: #fff;
|
|
270
|
+
border: 1px solid #e6eaf2;
|
|
271
|
+
border-radius: 10px;
|
|
272
|
+
|
|
273
|
+
&__value {
|
|
274
|
+
font-size: 22px;
|
|
275
|
+
font-weight: 600;
|
|
276
|
+
color: #1f2937;
|
|
277
|
+
line-height: 1.1;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
&__label {
|
|
281
|
+
font-size: 12px;
|
|
282
|
+
color: #7b8794;
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
.stat-empty {
|
|
287
|
+
padding: 24px;
|
|
288
|
+
color: #8a94a6;
|
|
289
|
+
font-size: 13px;
|
|
290
|
+
}
|
|
291
|
+
</style>
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<OaWorkbench
|
|
3
|
-
:title="title"
|
|
4
|
-
:subtitle="subtitle"
|
|
5
|
-
:seed-instances="seedInstances"
|
|
6
|
-
:users="users"
|
|
7
|
-
:departments="departments"
|
|
8
|
-
:roles="roles"
|
|
9
|
-
:initiator-id="initiatorId"
|
|
10
|
-
:custom-executors="customExecutors"
|
|
11
|
-
:custom-fetch="customFetch"
|
|
12
|
-
:demo="demo"
|
|
13
|
-
/>
|
|
14
|
-
</template>
|
|
15
|
-
|
|
16
|
-
<script setup>
|
|
17
|
-
import OaWorkbench from '../workbench/OaWorkbench.vue'
|
|
18
|
-
|
|
19
|
-
defineOptions({ name: 'GbFlowCenter' })
|
|
20
|
-
|
|
21
|
-
defineProps({
|
|
22
|
-
title: { type: String, default: '流程中台' },
|
|
23
|
-
subtitle: { type: String, default: '企业流程 · 审批协同' },
|
|
24
|
-
seedInstances: { type: Array, default: () => [] },
|
|
25
|
-
users: { type: Array, default: () => [] },
|
|
26
|
-
departments: { type: Array, default: () => [] },
|
|
27
|
-
roles: { type: Array, default: () => [] },
|
|
28
|
-
initiatorId: { type: [String, Number], default: null },
|
|
29
|
-
customExecutors: { type: Object, default: () => ({}) },
|
|
30
|
-
customFetch: { type: Function, default: null },
|
|
31
|
-
demo: { type: Boolean, default: false }
|
|
32
|
-
})
|
|
33
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<OaWorkbench
|
|
3
|
+
:title="title"
|
|
4
|
+
:subtitle="subtitle"
|
|
5
|
+
:seed-instances="seedInstances"
|
|
6
|
+
:users="users"
|
|
7
|
+
:departments="departments"
|
|
8
|
+
:roles="roles"
|
|
9
|
+
:initiator-id="initiatorId"
|
|
10
|
+
:custom-executors="customExecutors"
|
|
11
|
+
:custom-fetch="customFetch"
|
|
12
|
+
:demo="demo"
|
|
13
|
+
/>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<script setup>
|
|
17
|
+
import OaWorkbench from '../workbench/OaWorkbench.vue'
|
|
18
|
+
|
|
19
|
+
defineOptions({ name: 'GbFlowCenter' })
|
|
20
|
+
|
|
21
|
+
defineProps({
|
|
22
|
+
title: { type: String, default: '流程中台' },
|
|
23
|
+
subtitle: { type: String, default: '企业流程 · 审批协同' },
|
|
24
|
+
seedInstances: { type: Array, default: () => [] },
|
|
25
|
+
users: { type: Array, default: () => [] },
|
|
26
|
+
departments: { type: Array, default: () => [] },
|
|
27
|
+
roles: { type: Array, default: () => [] },
|
|
28
|
+
initiatorId: { type: [String, Number], default: null },
|
|
29
|
+
customExecutors: { type: Object, default: () => ({}) },
|
|
30
|
+
customFetch: { type: Function, default: null },
|
|
31
|
+
demo: { type: Boolean, default: false }
|
|
32
|
+
})
|
|
33
|
+
</script>
|