import { stringify } from 'qs';
import { request } from '@umijs/max';
import webpath from '@/utils/webPath';


export async function deleteByPrimaryKeyForProWkresAuth(params = {}) {
    return request(`/${webpath.portalwebpath}/web/api/service/prowkresauth/delete?${stringify(params)}`);
}


export async function selectByPrimaryKeyForProWkresAuth(params = {}) {
    return request(`/${webpath.portalwebpath}/web/api/service/prowkresauth/get?${stringify(params)}`);
}


export async function insertForProWkresAuth(params = {}) {
    return request(`/${webpath.portalwebpath}/web/api/service/prowkresauth/insert`, {
        method: 'POST',
        data: {
            ...params,
            method: 'insert',
        },
    });
}


export async function updateForProWkresAuth(params = {}) {
    return request(`/${webpath.portalwebpath}/web/api/service/prowkresauth/update`, {
        method: 'POST',
        data: {
            ...params,
            method: 'update',
        },
    });
}


export async function deleteByMapForProWkresAuth(params = {}) {
    return request(`/${webpath.portalwebpath}/web/api/service/prowkresauth/deleteByMap`, {
        method: 'POST',
        data: {
            ...params,
            method: 'delete',
        },
    });
}


export async function updateByMapForProWkresAuth(params = {}) {
    return request(`/${webpath.portalwebpath}/web/api/service/prowkresauth/updateByMap`, {
        method: 'POST',
        data: {
            ...params,
            method: 'update',
        },
    });
}


export async function getOneForProWkresAuth(params = {}) {
    return request(`/${webpath.portalwebpath}/web/api/service/prowkresauth/getOne`, {
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}



export async function getAllForProWkresAuth(params = {}) {
    return request(`/${webpath.portalwebpath}/web/api/service/prowkresauth/getAll`, {
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}


export async function queryPageForProWkresAuth(params = {}) {
    return request(`/${webpath.portalwebpath}/web/api/service/prowkresauth/queryPage`, {
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}


export async function countForProWkresAuth(params = {}) {
    return request(`/${webpath.portalwebpath}/web/api/service/prowkresauth/count`, {
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}




export async function deleteBatchForProWkresAuth(params = {}) {
    return request(`/${webpath.portalwebpath}/web/api/service/prowkresauth/deleteBatch`, {
        method: 'POST',
        data: {
            ...params,
            method: 'delete',
        },
    });
}


export async function updateBatchForProWkresAuth(params = {}) {
    return request(`/${webpath.portalwebpath}/web/api/service/prowkresauth/updateBatch`, {
        method: 'POST',
        data: {
            ...params,
            method: 'update',
        },
    });
}

export async function getProResourceWorkflowTreeByLevelCode(params = {}) {
    return request(`/${webpath.portalwebpath}/web/api/service/actresource/getProResourceWorkflowTreeByLevelCode`, {
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}

export async function getAllProResourceWorkflowTreeByAuthID(params = {}) {
    return request(`/${webpath.portalwebpath}/web/api/service/actresource/getAllProResourceWorkflowTreeByAuthID`, {
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}

export async function insertBatchForProWkresAuth(params = {}) {
    return request(`/${webpath.portalwebpath}/web/api/service/actresource/updateBatch`, {
        method: 'POST',
        data: {
            ...params,
            method: 'insert',
        },
    });
}

export async function getPageAuthByProResourceWorkflowTreeId(params = {}) {
    return request(`/${webpath.portalwebpath}/web/api/service/prowkresauth/getPageAuthByProResourceWorkflowTreeId`, {
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}

export async function queryPageForProAuthority(params = {}) {
    return request(`/${webpath.portalwebpath}/web/api/service/actroles/queryPage`, {
        method: 'POST',
        data: {
            ...params,
            method: 'fetch',
        },
    });
}

export async function insertForProWkRes(params = {}) {
    return request(`/${webpath.portalwebpath}/web/api/service/proresourceworkflow/insert`, {
        method: 'POST',
        data: {
            ...params,
            method: 'insert',
        },
    });
}

export async function updateForProWkRes(params = {}) {
    return request(`/${webpath.portalwebpath}/web/api/service/proresourceworkflow/update`, {
        method: 'POST',
        data: {
            ...params,
            method: 'update',
        },
    });
}

export async function deleteByPrimaryKeyForProWkRes(params = {}) {
    return request(`/${webpath.portalwebpath}/web/api/service/proresourceworkflow/delete?${stringify(params)}`);
}


export async function updateChangeTargetNodeWithSourceNodeForProResourceWorkflow(params = {}) {
    return request(`/${webpath.portalwebpath}/web/api/service/prowkresauth/updateChangeTargetNodeWithSourceNodeForProResourceWorkflow`, {
        method: 'POST',
        data: {
            ...params,
            method: 'update',
        },
    });
}

