2024-03-20 22:25:24 +08:00
|
|
|
<template>
|
2024-04-27 00:35:18 +08:00
|
|
|
<SimpleProcessDesigner :model-id="modelId"/>
|
2024-03-20 22:25:24 +08:00
|
|
|
</template>
|
2024-04-27 00:35:18 +08:00
|
|
|
<script setup lang='ts'>
|
|
|
|
|
import { SimpleProcessDesigner } from '@/components/SimpleProcessDesignerV2/src/';
|
2024-04-14 10:26:42 +08:00
|
|
|
import { getModel } from '@/api/bpm/model'
|
|
|
|
|
import { getForm, FormVO } from '@/api/bpm/form'
|
2024-04-27 00:35:18 +08:00
|
|
|
defineOptions({
|
|
|
|
|
name: 'SimpleWorkflowDesignEditor'
|
2024-04-14 10:26:42 +08:00
|
|
|
})
|
2024-04-27 00:35:18 +08:00
|
|
|
const { query } = useRoute() // 路由的查询
|
|
|
|
|
const modelId : string | undefined = query.modelId as string;
|
|
|
|
|
const formFields = ref<string[]>([])
|
|
|
|
|
const formType = ref(20);
|
|
|
|
|
provide('formFields', formFields)
|
2024-04-18 15:56:49 +08:00
|
|
|
provide('formType', formType)
|
2024-04-27 00:35:18 +08:00
|
|
|
onMounted( async () => {
|
|
|
|
|
const bpmnModel = await getModel(modelId);
|
2024-04-14 10:26:42 +08:00
|
|
|
if (bpmnModel) {
|
2024-04-18 15:56:49 +08:00
|
|
|
formType.value = bpmnModel.formType
|
|
|
|
|
if (formType.value === 10) {
|
2024-04-14 10:26:42 +08:00
|
|
|
const bpmnForm = await getForm(bpmnModel.formId) as unknown as FormVO
|
2024-04-27 00:35:18 +08:00
|
|
|
formFields.value = bpmnForm?.fields
|
2024-04-14 10:26:42 +08:00
|
|
|
}
|
|
|
|
|
}
|
2024-03-29 19:56:45 +08:00
|
|
|
})
|
2024-03-20 22:25:24 +08:00
|
|
|
</script>
|
2024-04-27 00:35:18 +08:00
|
|
|
<style lang='scss' scoped>
|
2024-04-02 20:56:51 +08:00
|
|
|
|
2024-03-29 19:56:45 +08:00
|
|
|
</style>
|