123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- import request from '@/config/axios'
- import { ProcessDefinitionVO } from '@/api/bpm/model'
- import { NodeType, CandidateStrategy } from '@/components/SimpleProcessDesignerV2/src/consts'
- export type Task = {
- id: string
- name: string
- }
- export type ProcessInstanceVO = {
- id: number
- name: string
- processDefinitionId: string
- category: string
- result: number
- tasks: Task[]
- fields: string[]
- status: number
- remark: string
- businessKey: string
- createTime: string
- endTime: string
- processDefinition?: ProcessDefinitionVO
- }
- // 用户信息
- export type User = {
- id: number
- nickname: string
- avatar: string
- }
- // 审批任务信息
- export type ApprovalTaskInfo = {
- id: number
- ownerUser: User
- assigneeUser: User
- status: number
- reason: string
- signPicUrl: string
- }
- // 审批节点信息
- export type ApprovalNodeInfo = {
- id: number
- name: string
- nodeType: NodeType
- candidateStrategy?: CandidateStrategy
- status: number
- startTime?: Date
- endTime?: Date
- candidateUsers?: User[]
- tasks: ApprovalTaskInfo[]
- }
- export const getProcessInstanceMyPage = async (params: any) => {
- return await request.get({ url: '/bpm/process-instance/my-page', params })
- }
- export const getProcessInstanceManagerPage = async (params: any) => {
- return await request.get({ url: '/bpm/process-instance/manager-page', params })
- }
- export const createProcessInstance = async (data) => {
- return await request.post({ url: '/bpm/process-instance/create', data: data })
- }
- export const cancelProcessInstanceByStartUser = async (id: number, reason: string) => {
- const data = {
- id: id,
- reason: reason
- }
- return await request.delete({ url: '/bpm/process-instance/cancel-by-start-user', data: data })
- }
- export const cancelProcessInstanceByAdmin = async (id: number, reason: string) => {
- const data = {
- id: id,
- reason: reason
- }
- return await request.delete({ url: '/bpm/process-instance/cancel-by-admin', data: data })
- }
- export const getProcessInstance = async (id: string) => {
- return await request.get({ url: '/bpm/process-instance/get?id=' + id })
- }
- export const getProcessInstanceCopyPage = async (params: any) => {
- return await request.get({ url: '/bpm/process-instance/copy/page', params })
- }
- // 获取审批详情
- export const getApprovalDetail = async (params: any) => {
- return await request.get({ url: 'bpm/process-instance/get-approval-detail', params })
- }
- // 获取表单字段权限
- export const getFormFieldsPermission = async (params: any) => {
- return await request.get({ url: '/bpm/process-instance/get-form-fields-permission', params })
- }
- // 获取流程实例的 BPMN 模型视图
- export const getProcessInstanceBpmnModelView = async (id: string) => {
- return await request.get({ url: '/bpm/process-instance/get-bpmn-model-view?id=' + id })
- }
|