Browse Source

fix: 冲突

master
wangxiang 2 years ago
parent
commit
3a24962891
No known key found for this signature in database
GPG Key ID: 1BA7946AB6B232E4
  1. 63
      src/views/workflow/model/helper/WorkflowModelDesign.vue

63
src/views/workflow/model/helper/WorkflowModelDesign.vue

@ -40,37 +40,40 @@ @@ -40,37 +40,40 @@
const microAppStore = useMicroAppStore();
const [registerModal, { setModalProps, closeModal, changeLoading }] = useModalInner(async (data: BoxPayload = { _tag: '' }) => {
changeLoading();
state.workflowDesignApp = loadMicroApp(Object.assign({} , apps.find(item => item.name == 'workflow-design'), {
container: '#workflowDesign',
props: {
...getSubDefineProps(),
[GlStateEnum.WORKFLOW_DESIGN_APP_PROPS_KEY]: workflowDesignProps
}
}), { sandbox: { experimentalStyleIsolation: true }});
state.workflowDesignApp.mountPromise.then(async () => {
//
state.tag = data._tag;
const id = data.record?.id;
const workflowDesignApp: Recordable = microAppStore.getWorkflowDesignApp(WORKFLOW_DESIGN_APP_COMPONENTS.DESIGN),
// fix: 100ms bpmn.jsmodel,
setTimeout(function () {
state.workflowDesignApp = loadMicroApp(Object.assign({} , apps.find(item => item.name == 'workflow-design'), {
container: '#workflowDesign',
props: {
...getSubDefineProps(),
[GlStateEnum.WORKFLOW_DESIGN_APP_PROPS_KEY]: workflowDesignProps
}
}), { sandbox: { experimentalStyleIsolation: true }});
state.workflowDesignApp.mountPromise.then(async () => {
//
state.tag = data._tag;
const id = data.record?.id;
const workflowDesignApp: Recordable = microAppStore.getWorkflowDesignApp(WORKFLOW_DESIGN_APP_COMPONENTS.DESIGN),
workflowRef: Recordable = workflowDesignApp.getRef().$refs['workflow-design'];
workflowRef.setBpmnXml('');
workflowRef.reset();
//
const props: Partial<ModalProps> = { loading: false };
switch (state.tag) {
case 'add':
props.title = '新增流程模型';
break;
case 'edit':
props.title = '编辑流程模型';
const modelRepresentation = await getModel(id);
workflowRef.setModelData(modelRepresentation);
const bpmnXml = await getModelXml(id);
workflowRef.setBpmnXml(bpmnXml);
break;
}
setModalProps(props);
});
workflowRef.setBpmnXml('');
workflowRef.reset();
//
const props: Partial<ModalProps> = { loading: false };
switch (state.tag) {
case 'add':
props.title = '新增流程模型';
break;
case 'edit':
props.title = '编辑流程模型';
const modelRepresentation = await getModel(id);
workflowRef.setModelData(modelRepresentation);
const bpmnXml = await getModelXml(id);
workflowRef.setBpmnXml(bpmnXml);
break;
}
setModalProps(props);
});
}, 100);
});
function handleVisibleChange(visible: boolean) {
!visible && state.workflowDesignApp.unmount();

Loading…
Cancel
Save