workflow-bpmn-modeler-andtv-vue3 10.0.6 → 10.0.7
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/workflow-bpmn-modeler-andtv-vue3.common.js +2 -185
- package/dist/workflow-bpmn-modeler-andtv-vue3.umd.js +2 -185
- package/dist/workflow-bpmn-modeler-andtv-vue3.umd.min.js +2 -185
- package/package/bpmn-styles.css +40 -0
- package/package/index.vue +67 -23
- package/package.json +1 -1
- 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 +0 -224
@@ -0,0 +1,40 @@
|
|
1
|
+
/* BPMN.js 核心样式 */
|
2
|
+
@import url('https://cdn.jsdelivr.net/npm/bpmn-js@8.10.0/dist/assets/diagram-js.css');
|
3
|
+
@import url('https://cdn.jsdelivr.net/npm/bpmn-js@8.10.0/dist/assets/bpmn-font/css/bpmn.css');
|
4
|
+
@import url('https://cdn.jsdelivr.net/npm/bpmn-js@8.10.0/dist/assets/bpmn-font/css/bpmn-codes.css');
|
5
|
+
@import url('https://cdn.jsdelivr.net/npm/bpmn-js@8.10.0/dist/assets/bpmn-font/css/bpmn-embedded.css');
|
6
|
+
|
7
|
+
/* 确保BPMN容器有正确的高度 */
|
8
|
+
.bpmn-container {
|
9
|
+
width: 100%;
|
10
|
+
height: 100%;
|
11
|
+
min-height: 400px;
|
12
|
+
}
|
13
|
+
|
14
|
+
.bpmn-container .djs-container {
|
15
|
+
width: 100%;
|
16
|
+
height: 100%;
|
17
|
+
}
|
18
|
+
|
19
|
+
.bpmn-container .djs-container svg {
|
20
|
+
width: 100%;
|
21
|
+
height: 100%;
|
22
|
+
}
|
23
|
+
|
24
|
+
/* 确保工具栏正确显示 */
|
25
|
+
.djs-palette {
|
26
|
+
position: absolute !important;
|
27
|
+
left: 20px !important;
|
28
|
+
top: 20px !important;
|
29
|
+
z-index: 10 !important;
|
30
|
+
}
|
31
|
+
|
32
|
+
/* 确保画布区域可见 */
|
33
|
+
.djs-canvas {
|
34
|
+
background: white !important;
|
35
|
+
}
|
36
|
+
|
37
|
+
/* 修复可能的显示问题 */
|
38
|
+
.djs-element {
|
39
|
+
pointer-events: auto !important;
|
40
|
+
}
|
package/package/index.vue
CHANGED
@@ -168,24 +168,38 @@ watch(() => props.xml, (val: string) => {
|
|
168
168
|
}
|
169
169
|
})
|
170
170
|
|
171
|
-
onMounted(() => {
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
171
|
+
onMounted(async () => {
|
172
|
+
try {
|
173
|
+
// 确保容器存在
|
174
|
+
if (!canvas.value) {
|
175
|
+
console.error('Canvas container not found')
|
176
|
+
return
|
177
|
+
}
|
178
|
+
|
179
|
+
// 生成实例
|
180
|
+
modeler.value = new Modeler({
|
181
|
+
container: canvas.value,
|
182
|
+
additionalModules: [
|
183
|
+
{
|
184
|
+
translate: ['value', customTranslate]
|
185
|
+
}
|
186
|
+
],
|
187
|
+
moddleExtensions: {
|
188
|
+
flowable: flowableModdle
|
178
189
|
}
|
179
|
-
|
180
|
-
|
181
|
-
|
190
|
+
})
|
191
|
+
|
192
|
+
// 等待下一个tick确保DOM更新
|
193
|
+
await nextTick()
|
194
|
+
|
195
|
+
// 新增流程定义
|
196
|
+
if (!props.xml) {
|
197
|
+
newDiagram()
|
198
|
+
} else {
|
199
|
+
createNewDiagram(props.xml)
|
182
200
|
}
|
183
|
-
})
|
184
|
-
|
185
|
-
if (!props.xml) {
|
186
|
-
newDiagram()
|
187
|
-
} else {
|
188
|
-
createNewDiagram(props.xml)
|
201
|
+
} catch (error) {
|
202
|
+
console.error('BPMN Modeler initialization failed:', error)
|
189
203
|
}
|
190
204
|
})
|
191
205
|
|
@@ -229,13 +243,25 @@ const createNewDiagram = async (data: string): Promise<void> => {
|
|
229
243
|
return str.replace(/</g, '<')
|
230
244
|
})
|
231
245
|
try {
|
232
|
-
if (!modeler.value)
|
246
|
+
if (!modeler.value) {
|
247
|
+
console.error('Modeler not initialized')
|
248
|
+
return
|
249
|
+
}
|
250
|
+
|
251
|
+
console.log('Importing XML data...', data.substring(0, 200) + '...')
|
233
252
|
await modeler.value.importXML(data)
|
253
|
+
console.log('XML imported successfully')
|
254
|
+
|
255
|
+
// 等待DOM更新
|
256
|
+
await nextTick()
|
257
|
+
|
234
258
|
adjustPalette()
|
235
259
|
fitViewport()
|
260
|
+
|
261
|
+
console.log('Diagram created successfully')
|
236
262
|
// fillColor()
|
237
263
|
} catch (err: any) {
|
238
|
-
console.error(err.message, err.warnings)
|
264
|
+
console.error('Failed to create diagram:', err.message, err.warnings)
|
239
265
|
}
|
240
266
|
}
|
241
267
|
|
@@ -423,11 +449,11 @@ const downloadFile = (filename: string, data: string, type: string): void => {
|
|
423
449
|
</script>
|
424
450
|
|
425
451
|
<style lang="scss">
|
426
|
-
/* BPMN.js 样式导入 */
|
427
|
-
@import
|
428
|
-
@import
|
429
|
-
@import
|
430
|
-
@import
|
452
|
+
/* BPMN.js 样式导入 - 使用CDN确保样式正确加载 */
|
453
|
+
@import url('https://cdn.jsdelivr.net/npm/bpmn-js@8.10.0/dist/assets/diagram-js.css');
|
454
|
+
@import url('https://cdn.jsdelivr.net/npm/bpmn-js@8.10.0/dist/assets/bpmn-font/css/bpmn.css');
|
455
|
+
@import url('https://cdn.jsdelivr.net/npm/bpmn-js@8.10.0/dist/assets/bpmn-font/css/bpmn-codes.css');
|
456
|
+
@import url('https://cdn.jsdelivr.net/npm/bpmn-js@8.10.0/dist/assets/bpmn-font/css/bpmn-embedded.css');
|
431
457
|
|
432
458
|
/* 视图模式样式 */
|
433
459
|
.view-mode {
|
@@ -607,6 +633,24 @@ const downloadFile = (filename: string, data: string, type: string): void => {
|
|
607
633
|
height: 100%;
|
608
634
|
position: relative;
|
609
635
|
z-index: 1;
|
636
|
+
min-height: 400px;
|
637
|
+
|
638
|
+
/* 确保BPMN容器正确显示 */
|
639
|
+
:deep(.djs-container) {
|
640
|
+
width: 100% !important;
|
641
|
+
height: 100% !important;
|
642
|
+
min-height: 400px !important;
|
643
|
+
}
|
644
|
+
|
645
|
+
:deep(.djs-container svg) {
|
646
|
+
width: 100% !important;
|
647
|
+
height: 100% !important;
|
648
|
+
background: white !important;
|
649
|
+
}
|
650
|
+
|
651
|
+
:deep(.djs-canvas) {
|
652
|
+
background: white !important;
|
653
|
+
}
|
610
654
|
}
|
611
655
|
|
612
656
|
/* 属性面板 */
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "workflow-bpmn-modeler-andtv-vue3",
|
3
|
-
"version": "10.0.
|
3
|
+
"version": "10.0.7",
|
4
4
|
"description": "基于 `Vue3` + `TypeScript` + `Ant Design Vue` 和 `bpmn.io@8.10` ,实现 flowable 的 modeler 模型设计器",
|
5
5
|
"main": "dist/workflow-bpmn-modeler-andtv-vue3.common.js",
|
6
6
|
"module": "dist/workflow-bpmn-modeler-andtv-vue3.common.js",
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|