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