workFlowService.ts 1.87 KB
import request from "@/utils/request";
import useUserStore from "@/store/modules/user";
const userStore = useUserStore()
const userData = JSON.parse(userStore.userData)

// 获取流程详情。
export const getProcessFlowDetail = (params) => request({
    url: `${import.meta.env.VITE_APP_WORK_FLOW_URL}/work-flow/detail/?approvalGuid=${params}`,
    method: 'post',
  })
// 审批通过
export const passFlowData = (params) => request({
  url: `${import.meta.env.VITE_APP_WORK_FLOW_URL}/work-flow/data/allow-flow`,
  method: 'post',
  data: params
})
// 审批驳回
export const rejectFlowData = (params) => request({
  url: `${import.meta.env.VITE_APP_WORK_FLOW_URL}/work-flow/data/backup-flow`,
  method: 'post',
  data: params
})
// 审批撤销
export const revokeFlowData = (params) => request({
  url: `${import.meta.env.VITE_APP_WORK_FLOW_URL}/work-flow/data/canal-flow`,
  method: 'post',
  data: params
})
// 删除流程
export const deleteFlowData = (params) => request({
  url: `${import.meta.env.VITE_APP_WORK_FLOW_URL}/work-flow/data/del`,
  method: 'post',
  params
})

export const getFlowData = (params) => request({
  url: `${import.meta.env.VITE_APP_WORK_FLOW_URL}/work-flow/data/page-list`,
  method: 'post',
  data: params
})
export const getCamundaDeploymentId = (flowType) => request({
  url: `${import.meta.env.VITE_APP_WORK_FLOW_URL}/work-flow/data/get-camunda-deployment-id`,
  method: 'post',
  data: {
    tenantGuid: userData.tenantGuid,
    flowType:flowType,
    staffGuid: userData.staffGuid,
  }
})

export const getDetailDataPromise = (deploymentId)=> request({
  url: `${import.meta.env.VITE_APP_CAMUNDA_URL}/process-definition/get-detail?deploymentId=${deploymentId}`,
  method: 'get',
})

export const getProcessNodesPromise = (params)=>request({
  url: `${import.meta.env.VITE_APP_CAMUNDA_URL}/process-definition/get-process-nodes`,
  method: 'post',
  data: params
})