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,227 +1,227 @@
1
- <template>
2
- <el-dialog
3
- :model-value="modelValue"
4
- title="修改并重新提交"
5
- width="820px"
6
- append-to-body
7
- destroy-on-close
8
- class="oa-resubmit-dialog"
9
- @update:model-value="emit('update:modelValue', $event)"
10
- @opened="prefill"
11
- >
12
- <div class="oa-resubmit">
13
- <el-alert
14
- type="warning"
15
- :closable="false"
16
- show-icon
17
- title="流程已退回,请根据退回意见修改后重新提交"
18
- >
19
- <template #default>
20
- <div class="oa-resubmit__tip">
21
- <span>退回节点:{{ task?.nodeName || '发起人' }}</span>
22
- <span v-if="rejectComment">退回意见:{{ rejectComment }}</span>
23
- <span>请重点核对:{{ focusFields }}</span>
24
- </div>
25
- </template>
26
- </el-alert>
27
-
28
- <div class="oa-resubmit__form">
29
- <FormViewer ref="formRef" :form-config="formComponents" :show-actions="false" />
30
- </div>
31
-
32
- <el-form label-position="top" class="oa-resubmit__comment">
33
- <el-form-item label="补充说明(可选)">
34
- <el-input
35
- v-model="comment"
36
- type="textarea"
37
- :rows="2"
38
- maxlength="300"
39
- show-word-limit
40
- placeholder="说明本次修改内容,便于审批人快速核对"
41
- />
42
- </el-form-item>
43
- </el-form>
44
- </div>
45
-
46
- <template #footer>
47
- <div class="oa-resubmit__footer">
48
- <span class="oa-muted">提交后将按最新表单内容重新判断分支</span>
49
- <el-button @click="emit('update:modelValue', false)">取消</el-button>
50
- <el-button type="primary" :loading="submitting" @click="submit">
51
- 重新提交
52
- </el-button>
53
- </div>
54
- </template>
55
- </el-dialog>
56
- </template>
57
-
58
- <script setup>
59
- import { computed, nextTick, ref } from 'vue'
60
- import { ElMessage } from 'element-plus'
61
- import { FormViewer } from 'gbformdesign'
62
- import { buildKeyFacts } from '../model.js'
63
-
64
- defineOptions({ name: 'OaResubmitDialog' })
65
-
66
- const props = defineProps({
67
- modelValue: { type: Boolean, default: false },
68
- instance: { type: Object, default: null },
69
- task: { type: Object, default: null },
70
- submitting: { type: Boolean, default: false }
71
- })
72
-
73
- const emit = defineEmits(['update:modelValue', 'submitted'])
74
-
75
- const formRef = ref(null)
76
- const comment = ref('')
77
-
78
- const formComponents = computed(
79
- () => props.instance?.definition?.form?.components || []
80
- )
81
- const rejectComment = computed(() => {
82
- const records = [...(props.task?.records || [])].reverse()
83
- return records.find((record) => record.action === 'reject')?.comment || ''
84
- })
85
- const focusFields = computed(() => {
86
- const facts = buildKeyFacts(props.instance)
87
- return facts.length
88
- ? facts.map((fact) => fact.label).join('、')
89
- : '申请内容与附件'
90
- })
91
-
92
- function prefill() {
93
- const viewer = formRef.value
94
- if (!viewer?.formData) return
95
- Object.keys(viewer.formData).forEach((key) => delete viewer.formData[key])
96
- Object.assign(viewer.formData, JSON.parse(JSON.stringify(props.instance?.state?.variables || {})))
97
- comment.value = ''
98
- }
99
-
100
- async function submit() {
101
- const viewer = formRef.value
102
- if (!viewer) return
103
- try {
104
- await viewer.formRef?.validate?.()
105
- } catch {
106
- ElMessage.warning('请先完善表单必填项')
107
- return
108
- }
109
- emit('submitted', {
110
- data: JSON.parse(JSON.stringify(viewer.formData)),
111
- comment: comment.value.trim()
112
- })
113
- await nextTick()
114
- emit('update:modelValue', false)
115
- }
116
- </script>
117
-
118
- <style scoped lang="scss">
119
- .oa-resubmit {
120
- display: flex;
121
- flex-direction: column;
122
- gap: 14px;
123
- }
124
-
125
- .oa-resubmit__tip {
126
- display: flex;
127
- flex-direction: column;
128
- gap: 3px;
129
- margin-top: 4px;
130
- font-size: 12px;
131
- line-height: 1.6;
132
- }
133
-
134
- .oa-resubmit__form {
135
- max-height: 52vh;
136
- overflow: auto;
137
- padding: 18px 20px 8px;
138
- border: 1px solid var(--oa-line);
139
- border-radius: 9px;
140
- background: #fcfdff;
141
-
142
- :deep(.form-view-container) {
143
- height: auto;
144
- }
145
-
146
- :deep(.form-view-content) {
147
- overflow: visible;
148
- }
149
-
150
- :deep(.el-form-item__label) {
151
- color: var(--oa-muted);
152
- font-size: 12px;
153
- }
154
- }
155
-
156
- .oa-resubmit__comment {
157
- :deep(.el-form-item__label) {
158
- color: var(--oa-muted);
159
- font-size: 12px;
160
- }
161
- }
162
-
163
- .oa-resubmit__footer {
164
- display: flex;
165
- align-items: center;
166
- justify-content: flex-end;
167
- gap: 8px;
168
-
169
- .oa-muted {
170
- margin-right: auto;
171
- font-size: 11px;
172
- }
173
- }
174
-
175
- @media (max-width: 960px) {
176
- .oa-resubmit__form {
177
- max-height: 46vh;
178
- padding: 12px;
179
- }
180
-
181
- .oa-resubmit__form :deep(.form-wrapper) {
182
- display: block;
183
- }
184
-
185
- .oa-resubmit__form :deep(.form-item-wrapper),
186
- .oa-resubmit__form :deep(.form-item-wrapper.is-row),
187
- .oa-resubmit__form :deep(.form-item-wrapper[style*='--item-width']) {
188
- width: 100% !important;
189
- max-width: 100% !important;
190
- flex: 0 0 100% !important;
191
- }
192
-
193
- .oa-resubmit__form :deep(.el-form-item) {
194
- display: flex;
195
- flex-direction: column;
196
- align-items: stretch;
197
- }
198
-
199
- .oa-resubmit__form :deep(.el-form-item__label) {
200
- width: auto !important;
201
- height: auto;
202
- padding: 0 0 5px;
203
- justify-content: flex-start;
204
- line-height: 1.4;
205
- text-align: left;
206
- }
207
-
208
- .oa-resubmit__form :deep(.el-form-item__content) {
209
- width: 100%;
210
- margin-left: 0 !important;
211
- }
212
-
213
- .oa-resubmit__footer {
214
- flex-wrap: wrap;
215
-
216
- .oa-muted {
217
- flex: 0 0 100%;
218
- margin-bottom: 4px;
219
- }
220
-
221
- .el-button {
222
- min-height: 44px;
223
- flex: 1;
224
- }
225
- }
226
- }
227
- </style>
1
+ <template>
2
+ <el-dialog
3
+ :model-value="modelValue"
4
+ title="修改并重新提交"
5
+ width="820px"
6
+ append-to-body
7
+ destroy-on-close
8
+ class="oa-resubmit-dialog"
9
+ @update:model-value="emit('update:modelValue', $event)"
10
+ @opened="prefill"
11
+ >
12
+ <div class="oa-resubmit">
13
+ <el-alert
14
+ type="warning"
15
+ :closable="false"
16
+ show-icon
17
+ title="流程已退回,请根据退回意见修改后重新提交"
18
+ >
19
+ <template #default>
20
+ <div class="oa-resubmit__tip">
21
+ <span>退回节点:{{ task?.nodeName || '发起人' }}</span>
22
+ <span v-if="rejectComment">退回意见:{{ rejectComment }}</span>
23
+ <span>请重点核对:{{ focusFields }}</span>
24
+ </div>
25
+ </template>
26
+ </el-alert>
27
+
28
+ <div class="oa-resubmit__form">
29
+ <FormViewer ref="formRef" :form-config="formComponents" :show-actions="false" />
30
+ </div>
31
+
32
+ <el-form label-position="top" class="oa-resubmit__comment">
33
+ <el-form-item label="补充说明(可选)">
34
+ <el-input
35
+ v-model="comment"
36
+ type="textarea"
37
+ :rows="2"
38
+ maxlength="300"
39
+ show-word-limit
40
+ placeholder="说明本次修改内容,便于审批人快速核对"
41
+ />
42
+ </el-form-item>
43
+ </el-form>
44
+ </div>
45
+
46
+ <template #footer>
47
+ <div class="oa-resubmit__footer">
48
+ <span class="oa-muted">提交后将按最新表单内容重新判断分支</span>
49
+ <el-button @click="emit('update:modelValue', false)">取消</el-button>
50
+ <el-button type="primary" :loading="submitting" @click="submit">
51
+ 重新提交
52
+ </el-button>
53
+ </div>
54
+ </template>
55
+ </el-dialog>
56
+ </template>
57
+
58
+ <script setup>
59
+ import { computed, nextTick, ref } from 'vue'
60
+ import { ElMessage } from 'element-plus'
61
+ import { FormViewer } from 'gbformdesign'
62
+ import { buildKeyFacts } from '../model.js'
63
+
64
+ defineOptions({ name: 'OaResubmitDialog' })
65
+
66
+ const props = defineProps({
67
+ modelValue: { type: Boolean, default: false },
68
+ instance: { type: Object, default: null },
69
+ task: { type: Object, default: null },
70
+ submitting: { type: Boolean, default: false }
71
+ })
72
+
73
+ const emit = defineEmits(['update:modelValue', 'submitted'])
74
+
75
+ const formRef = ref(null)
76
+ const comment = ref('')
77
+
78
+ const formComponents = computed(
79
+ () => props.instance?.definition?.form?.components || []
80
+ )
81
+ const rejectComment = computed(() => {
82
+ const records = [...(props.task?.records || [])].reverse()
83
+ return records.find((record) => record.action === 'reject')?.comment || ''
84
+ })
85
+ const focusFields = computed(() => {
86
+ const facts = buildKeyFacts(props.instance)
87
+ return facts.length
88
+ ? facts.map((fact) => fact.label).join('、')
89
+ : '申请内容与附件'
90
+ })
91
+
92
+ function prefill() {
93
+ const viewer = formRef.value
94
+ if (!viewer?.formData) return
95
+ Object.keys(viewer.formData).forEach((key) => delete viewer.formData[key])
96
+ Object.assign(viewer.formData, JSON.parse(JSON.stringify(props.instance?.state?.variables || {})))
97
+ comment.value = ''
98
+ }
99
+
100
+ async function submit() {
101
+ const viewer = formRef.value
102
+ if (!viewer) return
103
+ try {
104
+ await viewer.formRef?.validate?.()
105
+ } catch {
106
+ ElMessage.warning('请先完善表单必填项')
107
+ return
108
+ }
109
+ emit('submitted', {
110
+ data: JSON.parse(JSON.stringify(viewer.formData)),
111
+ comment: comment.value.trim()
112
+ })
113
+ await nextTick()
114
+ emit('update:modelValue', false)
115
+ }
116
+ </script>
117
+
118
+ <style scoped lang="scss">
119
+ .oa-resubmit {
120
+ display: flex;
121
+ flex-direction: column;
122
+ gap: 14px;
123
+ }
124
+
125
+ .oa-resubmit__tip {
126
+ display: flex;
127
+ flex-direction: column;
128
+ gap: 3px;
129
+ margin-top: 4px;
130
+ font-size: 12px;
131
+ line-height: 1.6;
132
+ }
133
+
134
+ .oa-resubmit__form {
135
+ max-height: 52vh;
136
+ overflow: auto;
137
+ padding: 18px 20px 8px;
138
+ border: 1px solid var(--oa-line);
139
+ border-radius: 9px;
140
+ background: #fcfdff;
141
+
142
+ :deep(.form-view-container) {
143
+ height: auto;
144
+ }
145
+
146
+ :deep(.form-view-content) {
147
+ overflow: visible;
148
+ }
149
+
150
+ :deep(.el-form-item__label) {
151
+ color: var(--oa-muted);
152
+ font-size: 12px;
153
+ }
154
+ }
155
+
156
+ .oa-resubmit__comment {
157
+ :deep(.el-form-item__label) {
158
+ color: var(--oa-muted);
159
+ font-size: 12px;
160
+ }
161
+ }
162
+
163
+ .oa-resubmit__footer {
164
+ display: flex;
165
+ align-items: center;
166
+ justify-content: flex-end;
167
+ gap: 8px;
168
+
169
+ .oa-muted {
170
+ margin-right: auto;
171
+ font-size: 11px;
172
+ }
173
+ }
174
+
175
+ @media (max-width: 960px) {
176
+ .oa-resubmit__form {
177
+ max-height: 46vh;
178
+ padding: 12px;
179
+ }
180
+
181
+ .oa-resubmit__form :deep(.form-wrapper) {
182
+ display: block;
183
+ }
184
+
185
+ .oa-resubmit__form :deep(.form-item-wrapper),
186
+ .oa-resubmit__form :deep(.form-item-wrapper.is-row),
187
+ .oa-resubmit__form :deep(.form-item-wrapper[style*='--item-width']) {
188
+ width: 100% !important;
189
+ max-width: 100% !important;
190
+ flex: 0 0 100% !important;
191
+ }
192
+
193
+ .oa-resubmit__form :deep(.el-form-item) {
194
+ display: flex;
195
+ flex-direction: column;
196
+ align-items: stretch;
197
+ }
198
+
199
+ .oa-resubmit__form :deep(.el-form-item__label) {
200
+ width: auto !important;
201
+ height: auto;
202
+ padding: 0 0 5px;
203
+ justify-content: flex-start;
204
+ line-height: 1.4;
205
+ text-align: left;
206
+ }
207
+
208
+ .oa-resubmit__form :deep(.el-form-item__content) {
209
+ width: 100%;
210
+ margin-left: 0 !important;
211
+ }
212
+
213
+ .oa-resubmit__footer {
214
+ flex-wrap: wrap;
215
+
216
+ .oa-muted {
217
+ flex: 0 0 100%;
218
+ margin-bottom: 4px;
219
+ }
220
+
221
+ .el-button {
222
+ min-height: 44px;
223
+ flex: 1;
224
+ }
225
+ }
226
+ }
227
+ </style>