import createAxios from '@/utils/request'

import { BPM_BOOT } from '@/utils/constantRequest'

const MAPPING_PATH = BPM_BOOT + '/bpm/category'

/**
 * 查询流程分类数据
 */
export const listCategory = (data: any) => {
    return createAxios({
        url: MAPPING_PATH + '/list',
        method: 'POST',
        data: data
    })
}

/**
 * 查询所有流程分类
 */
export const getCategorySimpleList = () => {
    return createAxios({
        url: MAPPING_PATH + '/simpleList',
        method: 'GET'
    })
}

/**
 * 根据id查询分类详细信息
 */
export const getById = (id: string) => {
    return createAxios({
        url: MAPPING_PATH + '/getById?id=' + id,
        method: 'GET'
    })
}


/**
 * 新增流程分类
 */
export const addCategory = (data: any) => {
    return createAxios({
        url: MAPPING_PATH + '/add',
        method: 'POST',
        data: data
    })
}


/**
 * 更新流程分类
 */
export const updateCategory = (data: any) => {
    return createAxios({
        url: MAPPING_PATH + '/update',
        method: 'POST',
        data: data
    })
}


/**
 * 删除流程分类
 */
export const deleteCategory = (data: any) => {
    let ids = [data]
    return createAxios({
        url: MAPPING_PATH + '/delete',
        method: 'POST',
        data: ids
    })
}
