工作流的编辑无法撤回、crtl 选中的问题

This commit is contained in:
YunaiV 2022-05-28 23:23:13 +08:00
parent da4f300824
commit 325a8d0a6e
2 changed files with 4 additions and 23 deletions

View File

@ -118,6 +118,7 @@ export default {
componentName: "MyProcessDesigner",
props: {
value: String, // xml
valueWatch: true, // xml watch
processId: String, // key
processName: String, // name
formId: Number, // form
@ -252,11 +253,6 @@ export default {
this.bpmnModeler = null;
});
},
watch: {
value: function (newValue) { // xmlString
this.createNewDiagram(newValue);
}
},
methods: {
initBpmnModeler() {
if (this.bpmnModeler) return;
@ -307,7 +303,7 @@ export default {
let newName = this.processName || `业务流程_${new Date().getTime()}`;
let xmlString = xml || DefaultEmptyXML(newId, newName, this.prefix);
try {
console.log(this.bpmnModeler.importXML);
// console.log(this.bpmnModeler.importXML);
let { warnings } = await this.bpmnModeler.importXML(xmlString);
if (warnings && warnings.length) {
warnings.forEach(warn => console.warn(warn));

View File

@ -2,7 +2,7 @@
<div class="app-container">
<!-- 流程设计器负责绘制流程等 -->
<my-process-designer :key="`designer-${reloadIndex}`" v-model="xmlString" v-bind="controlForm"
<my-process-designer v-if="xmlString !== undefined" :key="`designer-${reloadIndex}`" v-model="xmlString" v-bind="controlForm"
keyboard ref="processDesigner" @init-finished="initModeler"
@save="save"/>
@ -30,7 +30,7 @@ export default {
components: { MyProcessPalette },
data() {
return {
xmlString: "", // BPMN XML
xmlString: undefined, // BPMN XML
modeler: null,
reloadIndex: 0,
controlDrawerVisible: false,
@ -72,21 +72,6 @@ export default {
console.log(modeler);
}, 10);
},
reloadProcessDesigner(deep) {
this.controlForm.additionalModel = [];
for (let key in this.addis) {
if (this.addis[key]) {
this.controlForm.additionalModel.push(this.addis[key]);
}
}
deep && (this.xmlString = undefined);
this.reloadIndex += 1;
this.modeler = null; // panel
// if (deep) {
// this.xmlString = undefined;
// this.$refs.processDesigner.processRestart();
// }
},
save(bpmnXml) {
const data = {
...this.model,