import {
    service
} from '../utils/request';
//任务中心 统计数量
export function getRwCount(params) {
    return service({
        url: '/mosty-rwzx/tbRwTask/inner/getDataStatistics',
        method: 'get',
        params
    });
};

//任务中心类型统计数量
export function getRwTypeCount(params) {
    return service({
        url: '/mosty-rwzx/tbRwTask/inner/getRWLXDataStatistics',
        method: 'get',
        params
    });
};

//获取个人排行榜数据
export function getGrphbData(params) {
    return service({
        url: '/mosty-rwzx/tbRwTask/inner/getTaskRanking',
        method: 'get',
        params
    });
};

//获取我的任务列表
export function getMyTaskList(params = {}) {
    return service({
        url: '/mosty-rwzx/tbRwTask/inner/selectMyPage',
        method: 'get',
        params
    });
};

//获取任务统计数量
export function getMyTaskTotal(params = {}) {
    return service({
        url: '/mosty-rwzx/tbRwTask/inner/myRwCount',
        method: 'get',
        params
    });
};
//获取任务详情
export function getMyTaskDetail(id) {
    return service({
        url: `/mosty-rwzx/tbRwTask/inner/getTaskInfo/${id}`,
        method: 'get',
    });
}
//获取部门排名
export function getBmpm() {
    return service({
        url: `/mosty-rwzx/tbRwTask/inner/getTaskByDept`,
        method: 'get',
    });
}

//任务详情获取附件详情
export function getFjInfo(id) {
    return service({
        url: `/mosty-base/minio/file/download/${id}`,
        method: 'get',
    });
}

//APP统计任务列表数量
export function getTjRw(params) {
    return service({
        url: '/mosty-rwzx/tbRwTask/inner/rwCountByState',
        method: 'GET',
        params
    })
}

//查询任务列表
export function getRwList(params){
    return service({
        url:'/mosty-rwzx/tbRwTask/inner/selectPage',
        method:"GET",
        params
    })
}

//修改个人状态
export function upGrzt(data){
    return service({
        url:"/mosty-rwzx/tbRwTask/inner/changeGrrwState",
        method:"POST",
        data
    })
}


//查询是否是登录人的任务
export function isMyTask(id){
    return service({
        url:`/mosty-rwzx/tbRwTask/inner/checkMyTask/${id}`,
        method:"GET",
    })
}

// 	根据业务ID和业务类型修改任务状态 
export function editRwzt(data){
    return service({
        url:"/mosty-rwzx/tbRwTask/inner/changeStateByYwid",
        method:"post",
        data
    })
}