import createAxios from '@/utils/request'

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

const MAPPING_PATH = BPM_BOOT + '/bpm/form'

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

/**
 * 查询所有流程表单
 */
export const getFormSimpleList = () => {
    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 addForm = (data: any) => {
    return createAxios({
        url: MAPPING_PATH + '/add',
        method: 'POST',
        data: data
    })
}


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


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