2023-06-03 21:57:59 +08:00
|
|
|
<template>
|
2024-02-03 14:09:45 +08:00
|
|
|
<el-dialog v-if="dialog.visible" v-model="dialog.visible" :title="dialog.title" width="90%" height="100%">
|
2023-06-03 21:57:59 +08:00
|
|
|
<div class="modeler">
|
2024-02-03 14:09:45 +08:00
|
|
|
<bpmn-design ref="bpmnDesign"></bpmn-design>
|
2023-06-03 21:57:59 +08:00
|
|
|
</div>
|
|
|
|
</el-dialog>
|
|
|
|
</template>
|
2023-06-06 12:24:43 +08:00
|
|
|
|
2024-02-03 14:09:45 +08:00
|
|
|
<script lang="ts" setup name="Design">
|
|
|
|
import { getInfo } from '@/api/workflow/model';
|
|
|
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
|
|
import { ModelForm } from '@/api/workflow/model/types';
|
|
|
|
import BpmnDesign from '@/components/BpmnDesign';
|
|
|
|
const bpmnDesign = ref<InstanceType<typeof BpmnDesign>>();
|
|
|
|
const dialog = reactive<DialogOption>({
|
|
|
|
visible: false,
|
|
|
|
title: 'Flowable工作流在线流程设计器'
|
|
|
|
});
|
|
|
|
const modelForm = ref<ModelForm>();
|
|
|
|
const openDialog = (id) => {
|
|
|
|
dialog.visible = true
|
|
|
|
getInfo(id).then(res=>{
|
|
|
|
if (bpmnDesign.value) {
|
|
|
|
Object.assign(modelForm.value, res.data);
|
|
|
|
bpmnDesign.value.initDiagram(modelForm.value.xml);
|
|
|
|
}
|
|
|
|
});
|
2023-06-03 21:57:59 +08:00
|
|
|
};
|
2024-02-03 14:09:45 +08:00
|
|
|
/**
|
|
|
|
* 对外暴露子组件方法
|
|
|
|
*/
|
|
|
|
defineExpose({
|
|
|
|
openDialog
|
|
|
|
});
|
2023-06-03 21:57:59 +08:00
|
|
|
</script>
|