workflow-bpmn-modeler-andtv-vue3 10.1.2 → 10.2.0

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 (52) hide show
  1. package/dist/fonts/bpmn.5d33bee4.eot +0 -0
  2. package/dist/fonts/bpmn.67058807.woff2 +0 -0
  3. package/dist/fonts/bpmn.b5c9250d.ttf +0 -0
  4. package/dist/fonts/bpmn.e9e7d076.woff +0 -0
  5. package/dist/img/bpmn.74eea12b.svg +224 -0
  6. package/dist/workflow-bpmn-modeler-andtv-vue3.common.js +199 -5
  7. package/dist/workflow-bpmn-modeler-andtv-vue3.umd.js +199 -5
  8. package/dist/workflow-bpmn-modeler-andtv-vue3.umd.min.js +199 -5
  9. package/package/CHANGELOG.md +6 -0
  10. package/package/LICENSE +21 -0
  11. package/package/README.md +208 -0
  12. package/package/components/nodePanel/process.vue +9 -2
  13. package/package/components/nodePanel/startEnd.vue +6 -2
  14. package/package/dist/demo.html +9 -0
  15. package/package/dist/fonts/bpmn.5d33bee4.eot +0 -0
  16. package/package/dist/fonts/bpmn.67058807.woff2 +0 -0
  17. package/package/dist/fonts/bpmn.b5c9250d.ttf +0 -0
  18. package/package/dist/fonts/bpmn.e9e7d076.woff +0 -0
  19. package/package/dist/img/bpmn.74eea12b.svg +224 -0
  20. package/package/dist/workflow-bpmn-modeler-andtv-vue3.common.js +5617 -0
  21. package/package/dist/workflow-bpmn-modeler-andtv-vue3.umd.js +5617 -0
  22. package/package/dist/workflow-bpmn-modeler-andtv-vue3.umd.min.js +5617 -0
  23. package/package/index.vue +91 -471
  24. package/package/package/BpmData.js +68 -0
  25. package/package/package/PropertyPanel.vue +342 -0
  26. package/package/package/common/customTranslate.js +20 -0
  27. package/package/package/common/mixinExecutionListener.js +24 -0
  28. package/package/package/common/mixinPanel.js +70 -0
  29. package/package/package/common/mixinXcrud.js +22 -0
  30. package/package/package/common/parseElement.js +53 -0
  31. package/package/package/components/custom/customContextPad.vue +24 -0
  32. package/package/package/components/nodePanel/gateway.vue +165 -0
  33. package/package/package/components/nodePanel/process.vue +201 -0
  34. package/package/package/components/nodePanel/property/executionListener.vue +240 -0
  35. package/package/package/components/nodePanel/property/listenerParam.vue +137 -0
  36. package/package/package/components/nodePanel/property/multiInstance.vue +177 -0
  37. package/package/package/components/nodePanel/property/signal.vue +178 -0
  38. package/package/package/components/nodePanel/property/taskListener.vue +242 -0
  39. package/package/package/components/nodePanel/sequenceFlow.vue +180 -0
  40. package/package/package/components/nodePanel/startEnd.vue +174 -0
  41. package/package/package/components/nodePanel/task.vue +452 -0
  42. package/package/package/flowable/flowable.json +1218 -0
  43. package/package/package/flowable/init.js +24 -0
  44. package/package/package/flowable/showConfig.js +51 -0
  45. package/package/package/index.js +9 -0
  46. package/package/package/index.ts +10 -0
  47. package/package/package/index.vue +730 -0
  48. package/package/package/lang/zh.js +227 -0
  49. package/package/package/types/components.d.ts +35 -0
  50. package/package/package.json +89 -0
  51. package/package.json +12 -13
  52. package/package/bpmn-styles.css +0 -40
package/package/index.vue CHANGED
@@ -1,5 +1,6 @@
1
1
  <template>
2
- <div v-loading="isView" class="flow-containers" :class="{ 'view-mode': isView }">
2
+ <a-spin :spinning="isView">
3
+ <div class="flow-containers" :class="{ 'view-mode': isView }">
3
4
  <a-layout class="main-layout">
4
5
  <!-- 顶部工具栏 -->
5
6
  <a-layout-header class="toolbar-header">
@@ -80,7 +81,7 @@
80
81
  <!-- 主内容区域 -->
81
82
  <a-layout class="content-layout">
82
83
  <a-layout-content class="canvas-container">
83
- <div ref="canvas" class="canvas" :id="canvasId" />
84
+ <div ref="canvas" class="canvas" />
84
85
  </a-layout-content>
85
86
  <a-layout-sider class="property-panel">
86
87
  <PropertyPanel v-if="modeler" :modeler="modeler" :users="users" :groups="groups" :categorys="categorys" />
@@ -88,6 +89,7 @@
88
89
  </a-layout>
89
90
  </a-layout>
90
91
  </div>
92
+ </a-spin>
91
93
  </template>
92
94
 
93
95
  <script setup lang="ts">
@@ -157,141 +159,10 @@ const props = withDefaults(defineProps<Props>(), {
157
159
  const emit = defineEmits<{
158
160
  save: [data: SaveData]
159
161
  }>()
160
-
161
- // 暴露手动初始化方法
162
- const manualInit = () => {
163
- if (!modeler.value && canvas.value) {
164
- console.log('Manual initialization triggered')
165
- onMounted()
166
- }
167
- }
168
-
169
- // 简化的初始化方法,专门用于XML加载失败的情况
170
- const simpleInit = async () => {
171
- try {
172
- if (!canvas.value) {
173
- console.error('Canvas container not found for simple init')
174
- return false
175
- }
176
-
177
- console.log('Starting simple initialization...')
178
-
179
- // 强制设置容器样式
180
- canvas.value.style.width = '100%'
181
- canvas.value.style.height = '100%'
182
- canvas.value.style.minHeight = '400px'
183
- canvas.value.style.display = 'block'
184
-
185
- // 等待DOM更新
186
- await nextTick()
187
- await new Promise(resolve => setTimeout(resolve, 50))
188
-
189
- // 创建简单的BPMN模型器实例
190
- modeler.value = new Modeler({
191
- container: canvas.value,
192
- additionalModules: [
193
- {
194
- translate: ['value', customTranslate]
195
- }
196
- ],
197
- moddleExtensions: {
198
- flowable: flowableModdle
199
- }
200
- })
201
-
202
- // 等待下一个tick
203
- await nextTick()
204
-
205
- // 创建基本流程图
206
- await modeler.value.importXML(getInitStr())
207
-
208
- isInitialized.value = true
209
- console.log('Simple initialization completed successfully')
210
- return true
211
- } catch (error) {
212
- console.error('Simple initialization failed:', error)
213
- return false
214
- }
215
- }
216
-
217
- // 强制重新初始化方法
218
- const forceReinit = async () => {
219
- try {
220
- console.log('Force reinitializing BPMN Modeler...')
221
-
222
- // 清理现有实例
223
- if (modeler.value) {
224
- modeler.value.destroy()
225
- modeler.value = null
226
- }
227
-
228
- isInitialized.value = false
229
-
230
- // 等待一段时间
231
- await new Promise(resolve => setTimeout(resolve, 100))
232
-
233
- // 重新初始化
234
- const success = await simpleInit()
235
-
236
- if (success) {
237
- console.log('Force reinitialization successful')
238
- } else {
239
- console.error('Force reinitialization failed')
240
- }
241
-
242
- return success
243
- } catch (error) {
244
- console.error('Force reinitialization error:', error)
245
- return false
246
- }
247
- }
248
-
249
- // 强制刷新BPMN显示
250
- const forceRefresh = async () => {
251
- try {
252
- if (!modeler.value) {
253
- console.error('Modeler not available for refresh')
254
- return false
255
- }
256
-
257
- console.log('Force refreshing BPMN display...')
258
-
259
- // 强制重新渲染
260
- modeler.value.get('canvas').zoom('fit-viewport')
261
-
262
- // 等待一段时间后调整palette
263
- setTimeout(() => {
264
- adjustPalette()
265
- }, 100)
266
-
267
- console.log('BPMN display refreshed')
268
- return true
269
- } catch (error) {
270
- console.error('Failed to refresh BPMN display:', error)
271
- return false
272
- }
273
- }
274
-
275
- // 暴露给父组件
276
- defineExpose({
277
- manualInit,
278
- simpleInit,
279
- forceReinit,
280
- forceRefresh,
281
- isInitialized,
282
- getProcess,
283
- saveXML,
284
- saveImg,
285
- save
286
- })
287
- // 生成唯一的canvas ID
288
- const canvasId = `bpmn-canvas-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`
289
-
290
162
  const canvas = ref<HTMLElement | null>(null)
291
163
  const modeler = ref<Modeler | null>(null)
292
164
  const taskList = ref<any[]>([])
293
165
  const zoom = ref<number>(1)
294
- const isInitialized = ref<boolean>(false)
295
166
 
296
167
  watch(() => props.xml, (val: string) => {
297
168
  if (val) {
@@ -299,149 +170,50 @@ watch(() => props.xml, (val: string) => {
299
170
  }
300
171
  })
301
172
 
302
- onMounted(async () => {
303
- console.log('Component mounted, starting initialization...')
304
-
305
- // 等待DOM完全渲染
306
- await nextTick()
307
-
308
- // 强制等待一段时间确保容器就绪
309
- await new Promise(resolve => setTimeout(resolve, 100))
310
-
311
- const initializeModeler = async () => {
312
- try {
313
- // 确保canvas容器存在
314
- if (!canvas.value) {
315
- console.error('Canvas ref not found')
316
- return false
173
+ onMounted(() => {
174
+ // 生成实例
175
+ modeler.value = new Modeler({
176
+ container: canvas.value,
177
+ additionalModules: [
178
+ {
179
+ translate: ['value', customTranslate]
317
180
  }
318
-
319
- // 强制设置容器尺寸
320
- canvas.value.style.width = '100%'
321
- canvas.value.style.height = '100%'
322
- canvas.value.style.minHeight = '400px'
323
- canvas.value.style.display = 'block'
324
-
325
- console.log('Canvas container prepared, initializing modeler...')
326
-
327
- // 生成实例
328
- modeler.value = new Modeler({
329
- container: canvas.value,
330
- additionalModules: [
331
- {
332
- translate: ['value', customTranslate]
333
- }
334
- ],
335
- moddleExtensions: {
336
- flowable: flowableModdle
337
- },
338
- // 确保画布正确初始化
339
- canvas: {
340
- deferUpdate: false
341
- }
342
- })
343
-
344
- // 等待下一个tick确保DOM更新
345
- await nextTick()
346
-
347
- // 强制触发BPMN渲染
348
- setTimeout(async () => {
349
- try {
350
- // 标记为已初始化
351
- isInitialized.value = true
352
-
353
- // 新增流程定义
354
- if (!props.xml) {
355
- await newDiagram()
356
- } else {
357
- await createNewDiagram(props.xml)
358
- }
359
-
360
- // 强制刷新画布
361
- if (modeler.value) {
362
- modeler.value.get('canvas').zoom('fit-viewport')
363
- }
364
-
365
- console.log('BPMN Modeler initialized successfully')
366
- } catch (error) {
367
- console.error('Error in post-initialization:', error)
368
- }
369
- }, 200)
370
-
371
- return true
372
- } catch (error) {
373
- console.error('BPMN Modeler initialization failed:', error)
374
- return false
181
+ ],
182
+ moddleExtensions: {
183
+ flowable: flowableModdle
375
184
  }
376
- }
377
-
378
- // 尝试初始化
379
- let initialized = await initializeModeler()
380
-
381
- // 如果失败,使用更激进的重试策略
382
- if (!initialized) {
383
- console.log('Initial initialization failed, trying alternative approach...')
384
-
385
- // 使用requestAnimationFrame确保在下一帧尝试
386
- const tryWithRAF = () => {
387
- requestAnimationFrame(async () => {
388
- initialized = await initializeModeler()
389
- if (!initialized) {
390
- // 如果还是失败,再等一帧
391
- requestAnimationFrame(async () => {
392
- initialized = await initializeModeler()
393
- if (!initialized) {
394
- console.error('All initialization attempts failed')
395
- }
396
- })
397
- }
398
- })
399
- }
400
-
401
- tryWithRAF()
185
+ })
186
+ // 新增流程定义
187
+ if (!props.xml) {
188
+ newDiagram()
189
+ } else {
190
+ createNewDiagram(props.xml)
402
191
  }
403
192
  })
404
193
 
405
- const newDiagram = async (): Promise<void> => {
406
- await createNewDiagram(getInitStr())
194
+ const newDiagram = (): void => {
195
+ createNewDiagram(getInitStr())
407
196
  }
408
197
 
409
198
  // 让图能自适应屏幕
410
199
  const fitViewport = (): void => {
411
- try {
412
- if (!modeler.value) {
413
- console.warn('Modeler not available for viewport fitting')
414
- return
415
- }
416
-
417
- zoom.value = modeler.value.get('canvas').zoom('fit-viewport')
418
- const viewport = document.querySelector('.flow-containers .viewport') as SVGSVGElement
419
- if (!viewport) {
420
- console.warn('Viewport element not found')
421
- return
422
- }
423
-
424
- const bbox = viewport.getBBox()
425
- if (!bbox) {
426
- console.warn('Viewport bbox not available')
427
- return
428
- }
429
-
430
- const currentViewbox = modeler.value.get('canvas').viewbox()
431
- const elementMid = {
432
- x: bbox.x + bbox.width / 2 - 65,
433
- y: bbox.y + bbox.height / 2
434
- }
435
- modeler.value.get('canvas').viewbox({
436
- x: elementMid.x - currentViewbox.width / 2,
437
- y: elementMid.y - currentViewbox.height / 2,
438
- width: currentViewbox.width,
439
- height: currentViewbox.height
440
- })
441
- zoom.value = bbox.width / currentViewbox.width * 1.8
442
- } catch (e) {
443
- console.warn('Failed to fit viewport:', e)
200
+ if (!modeler.value) return
201
+ zoom.value = modeler.value.get('canvas').zoom('fit-viewport')
202
+ const viewport = document.querySelector('.flow-containers .viewport') as SVGSVGElement
203
+ const bbox = viewport?.getBBox()
204
+ if (!bbox) return
205
+ const currentViewbox = modeler.value.get('canvas').viewbox()
206
+ const elementMid = {
207
+ x: bbox.x + bbox.width / 2 - 65,
208
+ y: bbox.y + bbox.height / 2
444
209
  }
210
+ modeler.value.get('canvas').viewbox({
211
+ x: elementMid.x - currentViewbox.width / 2,
212
+ y: elementMid.y - currentViewbox.height / 2,
213
+ width: currentViewbox.width,
214
+ height: currentViewbox.height
215
+ })
216
+ zoom.value = bbox.width / currentViewbox.width * 1.8
445
217
  }
446
218
 
447
219
  // 放大缩小
@@ -459,100 +231,67 @@ const createNewDiagram = async (data: string): Promise<void> => {
459
231
  return str.replace(/</g, '&lt;')
460
232
  })
461
233
  try {
462
- if (!modeler.value) {
463
- console.error('Modeler not initialized')
464
- return
465
- }
466
-
467
- console.log('Importing XML data...', data.substring(0, 200) + '...')
234
+ if (!modeler.value) return
468
235
  await modeler.value.importXML(data)
469
- console.log('XML imported successfully')
470
-
471
- // 等待DOM更新
472
- await nextTick()
473
-
474
- // 延迟执行调整方法,确保DOM完全渲染
475
- setTimeout(() => {
476
- try {
477
- adjustPalette()
478
- fitViewport()
479
- console.log('Diagram created successfully')
480
- } catch (adjustError) {
481
- console.warn('Failed to adjust palette or viewport:', adjustError)
482
- // 即使调整失败,也不影响基本功能
483
- }
484
- }, 100)
485
-
236
+ adjustPalette()
237
+ fitViewport()
486
238
  // fillColor()
487
239
  } catch (err: any) {
488
- console.error('Failed to create diagram:', err.message, err.warnings)
489
- throw err // 重新抛出错误,让调用者知道失败
240
+ console.error(err.message, err.warnings)
490
241
  }
491
242
  }
492
243
 
493
244
  // 调整左侧工具栏排版
494
245
  const adjustPalette = (): void => {
495
246
  try {
496
- // 等待DOM完全渲染
497
- setTimeout(() => {
498
- try {
499
- // 获取 bpmn 设计器实例
500
- const canvasElement = canvas.value
501
- if (!canvasElement) {
502
- console.warn('Canvas element not found for palette adjustment')
503
- return
247
+ // 获取 bpmn 设计器实例
248
+ const canvasElement = canvas.value
249
+ if (!canvasElement) return
250
+ const djsPalette = canvasElement.children[0].children[1].children[4] as HTMLElement
251
+ const djsPalStyle: Record<string, string> = {
252
+ width: '130px',
253
+ padding: '5px',
254
+ background: 'white',
255
+ left: '20px',
256
+ borderRadius: '0'
257
+ }
258
+ for (const key in djsPalStyle) {
259
+ (djsPalette.style as any)[key] = djsPalStyle[key]
260
+ }
261
+ const palette = djsPalette.children[0] as HTMLElement
262
+ const allGroups = palette.children
263
+ ;(allGroups[0] as HTMLElement).style.display = 'none'
264
+ // 修改控件样式
265
+ for (let gKey = 0; gKey < allGroups.length; gKey++) {
266
+ const group = allGroups[gKey] as HTMLElement
267
+ for (let cKey = 0; cKey < group.children.length; cKey++) {
268
+ const control = group.children[cKey] as HTMLElement
269
+ const controlStyle: Record<string, string> = {
270
+ display: 'flex',
271
+ justifyContent: 'flex-start',
272
+ alignItems: 'center',
273
+ width: '100%',
274
+ padding: '5px'
504
275
  }
505
-
506
- // 查找BPMN palette元素
507
- const djsPalette = document.querySelector('.djs-palette') as HTMLElement
508
- if (!djsPalette) {
509
- console.warn('BPMN palette element not found')
510
- return
511
- }
512
-
513
- console.log('Found palette element, adjusting styles...')
514
-
515
- // 设置palette样式
516
- djsPalette.style.width = '160px'
517
- djsPalette.style.padding = '8px'
518
- djsPalette.style.background = 'white'
519
- djsPalette.style.left = '20px'
520
- djsPalette.style.top = '20px'
521
- djsPalette.style.borderRadius = '8px'
522
- djsPalette.style.boxShadow = '0 2px 8px rgba(0,0,0,0.1)'
523
- djsPalette.style.zIndex = '1000'
524
-
525
- // 查找palette entries
526
- const paletteEntries = djsPalette.querySelector('.djs-palette-entries') as HTMLElement
527
- if (paletteEntries) {
528
- paletteEntries.style.padding = '8px'
529
-
530
- // 调整每个entry的样式
531
- const entries = paletteEntries.querySelectorAll('.djs-palette-entry')
532
- entries.forEach((entry: HTMLElement) => {
533
- entry.style.margin = '4px 0'
534
- entry.style.padding = '8px'
535
- entry.style.borderRadius = '4px'
536
- entry.style.cursor = 'pointer'
537
- entry.style.transition = 'background-color 0.2s'
538
-
539
- // 添加hover效果
540
- entry.addEventListener('mouseenter', () => {
541
- entry.style.backgroundColor = '#f0f0f0'
542
- })
543
- entry.addEventListener('mouseleave', () => {
544
- entry.style.backgroundColor = 'transparent'
545
- })
546
- })
276
+ if (
277
+ control.className &&
278
+ control.dataset &&
279
+ control.className.indexOf('entry') !== -1
280
+ ) {
281
+ const controlProps = new BpmData().getControl(
282
+ control.dataset.action
283
+ )
284
+ control.innerHTML = `<div style='font-size: 14px;font-weight:500;margin-left:15px;'>${
285
+ controlProps['title']
286
+ }</div>`
287
+ for (const csKey in controlStyle) {
288
+ (control.style as any)[csKey] = controlStyle[csKey]
289
+ }
547
290
  }
548
-
549
- console.log('Palette adjustment completed')
550
- } catch (e) {
551
- console.warn('Failed to adjust palette:', e)
552
291
  }
553
- }, 300)
292
+ }
554
293
  } catch (e) {
555
- console.warn('Failed to adjust palette:', e)
294
+ console.log(e)
556
295
  }
557
296
  }
558
297
  const fillColor = (): void => {
@@ -686,101 +425,11 @@ const downloadFile = (filename: string, data: string, type: string): void => {
686
425
  </script>
687
426
 
688
427
  <style lang="scss">
689
- /* BPMN.js 核心样式 - 完全内联版本 */
690
-
691
- /* 强制BPMN样式 */
692
- .djs-container {
693
- width: 100% !important;
694
- height: 100% !important;
695
- position: relative !important;
696
- background: white !important;
697
- }
698
-
699
- .djs-canvas {
700
- width: 100% !important;
701
- height: 100% !important;
702
- background: white !important;
703
- position: relative !important;
704
- }
705
-
706
- .djs-palette {
707
- position: absolute !important;
708
- left: 20px !important;
709
- top: 20px !important;
710
- z-index: 10 !important;
711
- background: white !important;
712
- border: 1px solid #ccc !important;
713
- border-radius: 4px !important;
714
- box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
715
- }
716
-
717
- .djs-palette-entries {
718
- padding: 8px !important;
719
- }
720
-
721
- .djs-palette-entry {
722
- margin: 4px 0 !important;
723
- padding: 8px !important;
724
- border-radius: 4px !important;
725
- cursor: pointer !important;
726
- transition: background-color 0.2s !important;
727
- }
728
-
729
- .djs-palette-entry:hover {
730
- background-color: #f0f0f0 !important;
731
- }
732
-
733
- /* 确保viewport正确显示 */
734
- .viewport {
735
- width: 100% !important;
736
- height: 100% !important;
737
- }
738
-
739
- /* 强制BPMN样式 */
740
- .djs-container {
741
- width: 100% !important;
742
- height: 100% !important;
743
- position: relative !important;
744
- }
745
-
746
- .djs-canvas {
747
- width: 100% !important;
748
- height: 100% !important;
749
- background: white !important;
750
- }
751
-
752
- .djs-palette {
753
- position: absolute !important;
754
- left: 20px !important;
755
- top: 20px !important;
756
- z-index: 10 !important;
757
- background: white !important;
758
- border: 1px solid #ccc !important;
759
- border-radius: 4px !important;
760
- box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
761
- }
762
-
763
- .djs-palette-entries {
764
- padding: 8px !important;
765
- }
766
-
767
- .djs-palette-entry {
768
- margin: 4px 0 !important;
769
- padding: 8px !important;
770
- border-radius: 4px !important;
771
- cursor: pointer !important;
772
- transition: background-color 0.2s !important;
773
- }
774
-
775
- .djs-palette-entry:hover {
776
- background-color: #f0f0f0 !important;
777
- }
778
-
779
- /* 确保viewport正确显示 */
780
- .viewport {
781
- width: 100% !important;
782
- height: 100% !important;
783
- }
428
+ /* BPMN.js 样式导入 */
429
+ @import "bpmn-js/dist/assets/diagram-js.css";
430
+ @import "bpmn-js/dist/assets/bpmn-font/css/bpmn.css";
431
+ @import "bpmn-js/dist/assets/bpmn-font/css/bpmn-codes.css";
432
+ @import "bpmn-js/dist/assets/bpmn-font/css/bpmn-embedded.css";
784
433
 
785
434
  /* 视图模式样式 */
786
435
  .view-mode {
@@ -960,35 +609,6 @@ const downloadFile = (filename: string, data: string, type: string): void => {
960
609
  height: 100%;
961
610
  position: relative;
962
611
  z-index: 1;
963
- min-height: 400px;
964
- display: block;
965
-
966
- /* 确保BPMN容器正确显示 */
967
- :deep(.djs-container) {
968
- width: 100% !important;
969
- height: 100% !important;
970
- min-height: 400px !important;
971
- display: block !important;
972
- }
973
-
974
- :deep(.djs-container svg) {
975
- width: 100% !important;
976
- height: 100% !important;
977
- background: white !important;
978
- display: block !important;
979
- }
980
-
981
- :deep(.djs-canvas) {
982
- background: white !important;
983
- width: 100% !important;
984
- height: 100% !important;
985
- }
986
-
987
- /* 确保在jeecgboot环境中正确显示 */
988
- :deep(.viewport) {
989
- width: 100% !important;
990
- height: 100% !important;
991
- }
992
612
  }
993
613
 
994
614
  /* 属性面板 */
@@ -0,0 +1,68 @@
1
+ /**
2
+ * 存储流程设计相关参数
3
+ */
4
+ export default class BpmData {
5
+ constructor() {
6
+ this.controls = [] // 设计器控件
7
+ this.init()
8
+ }
9
+
10
+ init() {
11
+ this.controls = [
12
+ {
13
+ action: 'create.start-event',
14
+ title: '开始'
15
+ },
16
+ {
17
+ action: 'create.intermediate-event',
18
+ title: '中间'
19
+ },
20
+ {
21
+ action: 'create.end-event',
22
+ title: '结束'
23
+ },
24
+ {
25
+ action: 'create.exclusive-gateway',
26
+ title: '网关'
27
+ },
28
+ {
29
+ action: 'create.task',
30
+ title: '任务'
31
+ },
32
+ {
33
+ action: 'create.user-task',
34
+ title: '用户任务'
35
+ },
36
+ {
37
+ action: 'create.user-sign-task',
38
+ title: '会签任务'
39
+ },
40
+ {
41
+ action: 'create.subprocess-expanded',
42
+ title: '子流程'
43
+ },
44
+ {
45
+ action: 'create.data-object',
46
+ title: '数据对象'
47
+ },
48
+ {
49
+ action: 'create.data-store',
50
+ title: '数据存储'
51
+ },
52
+ {
53
+ action: 'create.participant-expanded',
54
+ title: '扩展流程'
55
+ },
56
+ {
57
+ action: 'create.group',
58
+ title: '分组'
59
+ }
60
+ ]
61
+ }
62
+
63
+ // 获取控件配置信息
64
+ getControl(action) {
65
+ const result = this.controls.filter(item => item.action === action)
66
+ return result[0] || {}
67
+ }
68
+ }