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

Loading…
Cancel
Save