import request from '@/utils/request'
import {download} from '@/utils/request'

// 查询流程列表
export function listWfProcess(query) {
    return request({
        url: '/tongzhou/wfProcess/wfProcess/list',
        method: 'get',
        params: query
    })
}

// 查询流程详细
export function getWfProcess(processId) {
    return request({
        url: '/tongzhou/wfProcess/wfProcess/' + processId,
        method: 'get'
    })
}

// 新增流程
export function addWfProcess(data) {
    return request({
        url: '/tongzhou/wfProcess/wfProcess',
        method: 'post',
        data: data
    })
}

// 修改流程
export function updateWfProcess(data) {
    return request({
        url: '/tongzhou/wfProcess/wfProcess',
        method: 'put',
        data: data
    })
}

// 删除流程
export function delWfProcess(processId) {
    return request({
        url: '/tongzhou/wfProcess/wfProcess/' + processId,
        method: 'delete'
    })
}

// 导出流程
export function downloadWfProcess(data) {
    download(
        '/tongzhou/wfProcess/wfProcess/export',
        data,
        `wfProcess_${new Date().getTime()}.xlsx`)
}
