import requestOld from "@/utils/requestOld"

// 获取日常巡检表列表
export async function handleGetPATROLList(params: any) {
    const data = await requestOld(`/Examine/GetPATROLList`, {
        method: 'POST',
        data: params
    })

    if (data.Result_Code !== 100) {
        return data
    }

    return data.Result_Data.List
}


// 获得区域列表
export async function handleGetSERVERPARTTYPEList(params: any) {
    const data = await requestOld(`/BasicConfig/GetSERVERPARTTYPEList`, {
        method: 'POST',
        data: params
    })

    if (data.Result_Code !== 100) {
        return data
    }

    return data.Result_Data.List
}

// 同步日常巡检
export async function handleSynchroPATROL(params: any) {
    const data = await requestOld(`/Examine/SynchroPATROL`, {
        method: 'POST',
        data: params
    })

    if (data.Result_Code !== 100) {
        return data
    }

    return data
}

// 获取服务区信息
export async function handleGetServerpartTree(params: any) {
    const data = await requestOld(`/BaseInfo/GetServerpartTree`, {
        method: 'GET',
        params
    })

    if (data.Result_Code !== 100) {
        return data
    }

    return data.Result_Data.List
}

// 同步巡检整改通知表
export async function handleSynchroRECTIFICATION(params: any) {
    const data = await requestOld(`/Examine/SynchroRECTIFICATION`, {
        method: 'POST',
        data: params
    })

    if (data.Result_Code !== 100) {
        return data
    }

    return data
}

// 获取巡检整改通知表列表
export async function handleGetRECTIFICATIONList(params: any) {
    const data = await requestOld(`/Examine/GetRECTIFICATIONList`, {
        method: 'POST',
        data: params
    })

    if (data.Result_Code !== 100) {
        return data
    }

    return data.Result_Data.List
}

// 获取服务区方位的方法
export async function handleGetSERVERPARTDetail(params: any) {
    const data = await requestOld(`/BaseInfo/GetSERVERPARTDetail`, {
        method: 'GET',
        params
    })

    if (data.Result_Code !== 100) {
        return data
    }

    return data.Result_Data
}

//  获取巡查安全问题列表
export async function handlGetPatrolSecurityList(params: any) {
    const data = await requestOld(`/Examine/GetPatrolSecurityList`, {
        method: 'POST',
        data: params
    })

    if (data.Result_Code !== 100) {
        return data
    }

    return data.Result_Data.List
}


// 拿到当前服务区的 分类定级
export async function handlGetSPCONTRIBUTIONList(params: any) {
    const data = await requestOld(`/Analysis/GetSPCONTRIBUTIONList`, {
        method: 'POST',
        data: params
    })

    if (data.Result_Code !== 100) {
        return data
    }

    return data.Result_Data.List
}