import createAxios from '@/utils/request'

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

const MAPPING_PATH = SUPERVISION_BOOT + '/workflow/wfForm'

/**
 * 提交表单数据
 */
export const submitFormData = (data: any) => {
    return createAxios({
        url: '/supervision-boot/userReport/add',
        method: 'POST',
        data: data
    })
}
/**
 * 提交表单数据
 */
export const addEditor = (data: any) => {
    return createAxios({
        url: '/supervision-boot/userReportRenewal/addEditor',
        method: 'POST',
        data: data
    })
}

/**
 * 重新发起表单数据(编辑)
 */
export const updateFormData = (data: any) => {
    return createAxios({
        url: '/supervision-boot/userReport/update',
        method: 'POST',
        data: data
    })
}
/**
 * 重新发起表单数据(编辑)
 */
export const resend = (data: any) => {
    return createAxios({
        url: '/supervision-boot/userReportRenewal/resend',
        method: 'POST',
        data: data
    })
}

//取消干扰源审批
export const cancelFormData = (data: any) => {
    return createAxios({
        url: '/supervision-boot/userReport/cancel',
        method: 'POST',
        data
    })
}

export const submitGoNet = (data: any) => {
    return createAxios({
        url: '/supervision-boot/userReportNormal/addUserReportNormal',
        method: 'POST',
        data: data
    })
}

export const userReportGoNetById = (data: any) => {
    return createAxios({
        url: '/supervision-boot/userReportNormal/userReportGoNetById',
        method: 'get',
        params: data
    })
}
// 根据id获取用户档案录入的详细数据
export const getUserReportById = (id: any) => {
    return createAxios({
        url: '/supervision-boot/userReport/getUserReportById?id='+id,
        method: 'get'
    })
}

// 根据方案id获取用户档案录入的详细数据
export const getUserReportByFangAnId = (id: any) => {
    return createAxios({
        url: '/supervision-boot/userReport/getUserReportByFangAnId?id='+id,
        method: 'get'
    })
}

// 根据id获取用户档案录入的详细数据
export const getById = (data: any) => {
    return createAxios({
        url: '/supervision-boot/userReport/getById',
        method: 'get',
        params: data
    })
}

// 根据id获取用户档案录入的详细数据
export const cancel = (data: any) => {
    return createAxios({
        url: '/supervision-boot/userReportNormal/cancel',
        method: 'post',
        data
    })
}
// 根据id获取用户档案录入的详细数据
export const getByDeptDevLine = (params: any) => {
    return createAxios({
        url: '/device-boot/line/getByDeptDevLine',
        method: 'get',
        params
    })
}
// 批量添加和修改文件信息
export const addOrUpdateFile = (data: any) => {
    return createAxios({
        url: '/supervision-boot/fileUrl/addOrUpdateFile',
        method: 'POST',
        data
    })
}
// 根据id查询文件信息集合
export const getFileById = (params: any) => {
    return createAxios({
        url: '/supervision-boot/fileUrl/getFileById',
        method: 'get',
        params
    })
}
