File tree Expand file tree Collapse file tree 2 files changed +4
-23
lines changed
components/bpmnProcessDesigner/package/designer Expand file tree Collapse file tree 2 files changed +4
-23
lines changed Original file line number Diff line number Diff line change @@ -118,6 +118,7 @@ export default {
118
118
componentName: " MyProcessDesigner" ,
119
119
props: {
120
120
value: String , // xml 字符串
121
+ valueWatch: true , // xml 字符串的 watch 状态
121
122
processId: String , // 流程 key 标识
122
123
processName: String , // 流程 name 名字
123
124
formId: Number , // 流程 form 表单编号
@@ -252,11 +253,6 @@ export default {
252
253
this .bpmnModeler = null ;
253
254
});
254
255
},
255
- watch: {
256
- value : function (newValue ) { // 在 xmlString 发生变化时,重新创建,从而绘制流程图
257
- this .createNewDiagram (newValue);
258
- }
259
- },
260
256
methods: {
261
257
initBpmnModeler () {
262
258
if (this .bpmnModeler ) return ;
@@ -307,7 +303,7 @@ export default {
307
303
let newName = this .processName || ` 业务流程_${ new Date ().getTime ()} ` ;
308
304
let xmlString = xml || DefaultEmptyXML (newId, newName, this .prefix );
309
305
try {
310
- console .log (this .bpmnModeler .importXML );
306
+ // console.log(this.bpmnModeler.importXML);
311
307
let { warnings } = await this .bpmnModeler .importXML (xmlString);
312
308
if (warnings && warnings .length ) {
313
309
warnings .forEach (warn => console .warn (warn));
Original file line number Diff line number Diff line change 2
2
<div class =" app-container" >
3
3
4
4
<!-- 流程设计器,负责绘制流程等 -->
5
- <my-process-designer :key =" `designer-${reloadIndex}`" v-model =" xmlString" v-bind =" controlForm"
5
+ <my-process-designer v-if = " xmlString !== undefined " :key =" `designer-${reloadIndex}`" v-model =" xmlString" v-bind =" controlForm"
6
6
keyboard ref =" processDesigner" @init-finished =" initModeler"
7
7
@save =" save" />
8
8
@@ -30,7 +30,7 @@ export default {
30
30
components: { MyProcessPalette },
31
31
data () {
32
32
return {
33
- xmlString: " " , // BPMN XML
33
+ xmlString: undefined , // BPMN XML
34
34
modeler: null ,
35
35
reloadIndex: 0 ,
36
36
controlDrawerVisible: false ,
@@ -72,21 +72,6 @@ export default {
72
72
console .log (modeler);
73
73
}, 10 );
74
74
},
75
- reloadProcessDesigner (deep ) {
76
- this .controlForm .additionalModel = [];
77
- for (let key in this .addis ) {
78
- if (this .addis [key]) {
79
- this .controlForm .additionalModel .push (this .addis [key]);
80
- }
81
- }
82
- deep && (this .xmlString = undefined );
83
- this .reloadIndex += 1 ;
84
- this .modeler = null ; // 避免 panel 异常
85
- // if (deep) {
86
- // this.xmlString = undefined;
87
- // this.$refs.processDesigner.processRestart();
88
- // }
89
- },
90
75
save (bpmnXml ) {
91
76
const data = {
92
77
... this .model ,
You can’t perform that action at this time.
0 commit comments