流程问题优化

zzq
刘妍 2024-06-06 16:44:41 +08:00
parent 8acacd4a99
commit 189843c8e9
3 changed files with 21 additions and 5 deletions

View File

@ -228,7 +228,7 @@
await process.bpmnModeler.saveXML({ format: true }).then(({ xml }) => {
const json = JSON.parse(convert.xml2json(xml, { spaces: 2 }));
const flowElements = json.elements[0].elements[0].elements;
console.log(flowElements)
console.log(flowElements);
for (var j = 0; j < flowElements.length; j++) {
if (flowElements[j].attributes.name) {
flowWfDataStore.setWfDataName(
@ -236,6 +236,21 @@
flowElements[j].attributes.name,
);
}
if (flowElements[j].name == 'bpmn2:sequenceFlow') {
const currentNode = flowWfDataStore.getWfDataNode(flowElements[j].attributes.id);
if (currentNode) {
flowWfDataStore.updataWfDataNode(
flowElements[j].attributes.id,
'from',
flowElements[j].attributes.sourceRef,
);
flowWfDataStore.updataWfDataNode(
flowElements[j].attributes.id,
'to',
flowElements[j].attributes.targetRef,
);
}
}
}
});
// try {

View File

@ -52,10 +52,11 @@
() => props.element,
(newVal) => {
if (newVal.type == 'bpmn:SequenceFlow') {
console.log(newVal);
const currentNode = flowWfDataStore.getWfDataNode(newVal.id);
if (currentNode) {
node.value = currentNode;
node.value.from = newVal.from;
node.value.to = newVal.to;
} else {
node.value = newVal;
}

View File

@ -35,7 +35,9 @@
import { postAdd, update } from '@/api/sys/WFSchemeInfo';
import { useMessage } from '@/hooks/web/useMessage';
const { createMessage } = useMessage();
import { flowStore } from '@/store/modules/flow';
const flowWfDataStore = flowStore();
const props = defineProps({
code: String,
});
@ -81,9 +83,7 @@
// tabStore.closeTabByKey('/dashboard/scheme_preview/add?code=' + schemeCode, router);
// }
}
function onSaveDesigner(){
}
function onSaveDesigner() {}
</script>
<style scoped>
.preview-box {