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

View File

@ -2,7 +2,7 @@
<div class="app-container"> <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" keyboard ref="processDesigner" @init-finished="initModeler"
@save="save"/> @save="save"/>
@ -30,7 +30,7 @@ export default {
components: { MyProcessPalette }, components: { MyProcessPalette },
data() { data() {
return { return {
xmlString: "", // BPMN XML xmlString: undefined, // BPMN XML
modeler: null, modeler: null,
reloadIndex: 0, reloadIndex: 0,
controlDrawerVisible: false, controlDrawerVisible: false,
@ -72,21 +72,6 @@ export default {
console.log(modeler); console.log(modeler);
}, 10); }, 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) { save(bpmnXml) {
const data = { const data = {
...this.model, ...this.model,