mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2024-11-23 07:41:53 +08:00
工作流的编辑无法撤回、crtl 选中的问题
This commit is contained in:
parent
da4f300824
commit
325a8d0a6e
@ -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));
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user