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-28 21:53:34 +08:00
|
|
|
import { handleTree } from '@/utils/tree'
|
2024-04-27 22:17:04 +08:00
|
|
|
import * as RoleApi from '@/api/system/role'
|
|
|
|
import * as DeptApi from '@/api/system/dept'
|
|
|
|
import * as PostApi from '@/api/system/post'
|
|
|
|
import * as UserApi from '@/api/system/user'
|
|
|
|
import * as UserGroupApi from '@/api/bpm/userGroup'
|
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);
|
2024-04-27 22:17:04 +08:00
|
|
|
const roleOptions = ref<RoleApi.RoleVO[]>([]) // 角色列表
|
|
|
|
const postOptions = ref<PostApi.PostVO[]>([]) // 岗位列表
|
|
|
|
const userOptions = ref<UserApi.UserVO[]>([]) // 用户列表
|
|
|
|
const deptOptions = ref<DeptApi.DeptVO[]>([]) // 部门列表
|
2024-04-28 21:53:34 +08:00
|
|
|
const deptTreeOptions = ref()
|
2024-04-27 22:17:04 +08:00
|
|
|
const userGroupOptions = ref<UserGroupApi.UserGroupVO[]>([]) // 用户组列表
|
2024-04-27 00:35:18 +08:00
|
|
|
provide('formFields', formFields)
|
2024-04-18 15:56:49 +08:00
|
|
|
provide('formType', formType)
|
2024-04-27 22:17:04 +08:00
|
|
|
provide('roleList', roleOptions)
|
|
|
|
provide('postList', postOptions)
|
|
|
|
provide('userList', userOptions)
|
|
|
|
provide('deptList', deptOptions)
|
|
|
|
provide('userGroupList', userGroupOptions)
|
2024-04-28 21:53:34 +08:00
|
|
|
provide('deptTree', deptTreeOptions)
|
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-04-27 22:17:04 +08:00
|
|
|
// 获得角色列表
|
|
|
|
roleOptions.value = await RoleApi.getSimpleRoleList()
|
|
|
|
postOptions.value = await PostApi.getSimplePostList()
|
|
|
|
// 获得用户列表
|
|
|
|
userOptions.value = await UserApi.getSimpleUserList()
|
|
|
|
// 获得部门列表
|
|
|
|
deptOptions.value = await DeptApi.getSimpleDeptList()
|
2024-04-28 21:53:34 +08:00
|
|
|
|
|
|
|
deptTreeOptions.value = handleTree(deptOptions.value as DeptApi.DeptVO[], 'id');
|
|
|
|
|
2024-04-27 22:17:04 +08:00
|
|
|
// 用户组列表
|
|
|
|
userGroupOptions.value = await UserGroupApi.getUserGroupSimpleList()
|
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-03-29 19:56:45 +08:00
|
|
|
</style>
|