Skip to content

Commit 66d23c6

Browse files
committed
工作流的编辑无法撤回、crtl 选中的问题
1 parent 438ead7 commit 66d23c6

File tree

2 files changed

+4
-23
lines changed

2 files changed

+4
-23
lines changed

src/components/bpmnProcessDesigner/package/designer/ProcessDesigner.vue

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ export default {
118118
componentName: "MyProcessDesigner",
119119
props: {
120120
value: String, // xml 字符串
121+
valueWatch: true, // xml 字符串的 watch 状态
121122
processId: String, // 流程 key 标识
122123
processName: String, // 流程 name 名字
123124
formId: Number, // 流程 form 表单编号
@@ -252,11 +253,6 @@ export default {
252253
this.bpmnModeler = null;
253254
});
254255
},
255-
watch: {
256-
value: function (newValue) { // 在 xmlString 发生变化时,重新创建,从而绘制流程图
257-
this.createNewDiagram(newValue);
258-
}
259-
},
260256
methods: {
261257
initBpmnModeler() {
262258
if (this.bpmnModeler) return;
@@ -307,7 +303,7 @@ export default {
307303
let newName = this.processName || `业务流程_${new Date().getTime()}`;
308304
let xmlString = xml || DefaultEmptyXML(newId, newName, this.prefix);
309305
try {
310-
console.log(this.bpmnModeler.importXML);
306+
// console.log(this.bpmnModeler.importXML);
311307
let { warnings } = await this.bpmnModeler.importXML(xmlString);
312308
if (warnings && warnings.length) {
313309
warnings.forEach(warn => console.warn(warn));

src/views/bpm/model/modelEditor.vue

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div class="app-container">
33

44
<!-- 流程设计器,负责绘制流程等 -->
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"
66
keyboard ref="processDesigner" @init-finished="initModeler"
77
@save="save"/>
88

@@ -30,7 +30,7 @@ export default {
3030
components: { MyProcessPalette },
3131
data() {
3232
return {
33-
xmlString: "", // BPMN XML
33+
xmlString: undefined, // BPMN XML
3434
modeler: null,
3535
reloadIndex: 0,
3636
controlDrawerVisible: false,
@@ -72,21 +72,6 @@ export default {
7272
console.log(modeler);
7373
}, 10);
7474
},
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-
},
9075
save(bpmnXml) {
9176
const data = {
9277
...this.model,

0 commit comments

Comments
 (0)