workflow-bpmn-modeler-andtv-vue3 10.1.1 → 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.
- package/dist/fonts/bpmn.5d33bee4.eot +0 -0
- package/dist/fonts/bpmn.67058807.woff2 +0 -0
- package/dist/fonts/bpmn.b5c9250d.ttf +0 -0
- package/dist/fonts/bpmn.e9e7d076.woff +0 -0
- package/dist/img/bpmn.74eea12b.svg +224 -0
- package/dist/workflow-bpmn-modeler-andtv-vue3.common.js +199 -5
- package/dist/workflow-bpmn-modeler-andtv-vue3.umd.js +199 -5
- package/dist/workflow-bpmn-modeler-andtv-vue3.umd.min.js +199 -5
- package/package/CHANGELOG.md +6 -0
- package/package/LICENSE +21 -0
- package/package/README.md +208 -0
- package/package/components/nodePanel/process.vue +9 -2
- package/package/components/nodePanel/startEnd.vue +6 -2
- package/package/dist/demo.html +9 -0
- package/package/dist/fonts/bpmn.5d33bee4.eot +0 -0
- package/package/dist/fonts/bpmn.67058807.woff2 +0 -0
- package/package/dist/fonts/bpmn.b5c9250d.ttf +0 -0
- package/package/dist/fonts/bpmn.e9e7d076.woff +0 -0
- package/package/dist/img/bpmn.74eea12b.svg +224 -0
- package/package/dist/workflow-bpmn-modeler-andtv-vue3.common.js +5617 -0
- package/package/dist/workflow-bpmn-modeler-andtv-vue3.umd.js +5617 -0
- package/package/dist/workflow-bpmn-modeler-andtv-vue3.umd.min.js +5617 -0
- package/package/index.vue +91 -427
- package/package/package/BpmData.js +68 -0
- package/package/package/PropertyPanel.vue +342 -0
- package/package/package/common/customTranslate.js +20 -0
- package/package/package/common/mixinExecutionListener.js +24 -0
- package/package/package/common/mixinPanel.js +70 -0
- package/package/package/common/mixinXcrud.js +22 -0
- package/package/package/common/parseElement.js +53 -0
- package/package/package/components/custom/customContextPad.vue +24 -0
- package/package/package/components/nodePanel/gateway.vue +165 -0
- package/package/package/components/nodePanel/process.vue +201 -0
- package/package/package/components/nodePanel/property/executionListener.vue +240 -0
- package/package/package/components/nodePanel/property/listenerParam.vue +137 -0
- package/package/package/components/nodePanel/property/multiInstance.vue +177 -0
- package/package/package/components/nodePanel/property/signal.vue +178 -0
- package/package/package/components/nodePanel/property/taskListener.vue +242 -0
- package/package/package/components/nodePanel/sequenceFlow.vue +180 -0
- package/package/package/components/nodePanel/startEnd.vue +174 -0
- package/package/package/components/nodePanel/task.vue +452 -0
- package/package/package/flowable/flowable.json +1218 -0
- package/package/package/flowable/init.js +24 -0
- package/package/package/flowable/showConfig.js +51 -0
- package/package/package/index.js +9 -0
- package/package/package/index.ts +10 -0
- package/package/package/index.vue +730 -0
- package/package/package/lang/zh.js +227 -0
- package/package/package/types/components.d.ts +35 -0
- package/package/package.json +89 -0
- package/package.json +12 -13
- package/package/bpmn-styles.css +0 -40
package/package/index.vue
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
<template>
|
2
|
-
<
|
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"
|
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(
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
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
|
-
|
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
|
-
|
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 =
|
406
|
-
|
194
|
+
const newDiagram = (): void => {
|
195
|
+
createNewDiagram(getInitStr())
|
407
196
|
}
|
408
197
|
|
409
198
|
// 让图能自适应屏幕
|
410
199
|
const fitViewport = (): void => {
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
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, '<')
|
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
|
-
|
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(
|
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
|
-
//
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
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
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
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
|
-
}
|
292
|
+
}
|
554
293
|
} catch (e) {
|
555
|
-
console.
|
294
|
+
console.log(e)
|
556
295
|
}
|
557
296
|
}
|
558
297
|
const fillColor = (): void => {
|
@@ -686,57 +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
|
-
@import
|
691
|
-
@import
|
692
|
-
@import
|
693
|
-
@import
|
694
|
-
|
695
|
-
/* 强制BPMN样式 */
|
696
|
-
.djs-container {
|
697
|
-
width: 100% !important;
|
698
|
-
height: 100% !important;
|
699
|
-
position: relative !important;
|
700
|
-
}
|
701
|
-
|
702
|
-
.djs-canvas {
|
703
|
-
width: 100% !important;
|
704
|
-
height: 100% !important;
|
705
|
-
background: white !important;
|
706
|
-
}
|
707
|
-
|
708
|
-
.djs-palette {
|
709
|
-
position: absolute !important;
|
710
|
-
left: 20px !important;
|
711
|
-
top: 20px !important;
|
712
|
-
z-index: 10 !important;
|
713
|
-
background: white !important;
|
714
|
-
border: 1px solid #ccc !important;
|
715
|
-
border-radius: 4px !important;
|
716
|
-
box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
|
717
|
-
}
|
718
|
-
|
719
|
-
.djs-palette-entries {
|
720
|
-
padding: 8px !important;
|
721
|
-
}
|
722
|
-
|
723
|
-
.djs-palette-entry {
|
724
|
-
margin: 4px 0 !important;
|
725
|
-
padding: 8px !important;
|
726
|
-
border-radius: 4px !important;
|
727
|
-
cursor: pointer !important;
|
728
|
-
transition: background-color 0.2s !important;
|
729
|
-
}
|
730
|
-
|
731
|
-
.djs-palette-entry:hover {
|
732
|
-
background-color: #f0f0f0 !important;
|
733
|
-
}
|
734
|
-
|
735
|
-
/* 确保viewport正确显示 */
|
736
|
-
.viewport {
|
737
|
-
width: 100% !important;
|
738
|
-
height: 100% !important;
|
739
|
-
}
|
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";
|
740
433
|
|
741
434
|
/* 视图模式样式 */
|
742
435
|
.view-mode {
|
@@ -916,35 +609,6 @@ const downloadFile = (filename: string, data: string, type: string): void => {
|
|
916
609
|
height: 100%;
|
917
610
|
position: relative;
|
918
611
|
z-index: 1;
|
919
|
-
min-height: 400px;
|
920
|
-
display: block;
|
921
|
-
|
922
|
-
/* 确保BPMN容器正确显示 */
|
923
|
-
:deep(.djs-container) {
|
924
|
-
width: 100% !important;
|
925
|
-
height: 100% !important;
|
926
|
-
min-height: 400px !important;
|
927
|
-
display: block !important;
|
928
|
-
}
|
929
|
-
|
930
|
-
:deep(.djs-container svg) {
|
931
|
-
width: 100% !important;
|
932
|
-
height: 100% !important;
|
933
|
-
background: white !important;
|
934
|
-
display: block !important;
|
935
|
-
}
|
936
|
-
|
937
|
-
:deep(.djs-canvas) {
|
938
|
-
background: white !important;
|
939
|
-
width: 100% !important;
|
940
|
-
height: 100% !important;
|
941
|
-
}
|
942
|
-
|
943
|
-
/* 确保在jeecgboot环境中正确显示 */
|
944
|
-
:deep(.viewport) {
|
945
|
-
width: 100% !important;
|
946
|
-
height: 100% !important;
|
947
|
-
}
|
948
612
|
}
|
949
613
|
|
950
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
|
+
}
|