import request from "@/utils/request";

// 科研机构列表
export function researchList(params) {
    return request({
        url: "/business/casResearch/list",
        method: "GET",
        params,
    });
}

// 科研机构获取账号
export function getAccount(id) {
    return request({
        url: `/business/casResearch/getAccount/${id}`,
        method: "get",
    });
}

// 科研机构筛选信息
export function researchSelect(data) {
    return request({
        url: "/admin/v1/manage/research/select",
        method: "post",
        data,
    });
}

// 科研机构信息添加
export function researchAdd(data) {
    return request({
        url: "/business/casResearch",
        method: "post",
        data,
    });
}

// 科研机构信息修改
export function researchEdit(data) {
    return request({
        url: "/business/casResearch",
        method: "PUT",
        data,
    });
}

// 机构重置密码
export function resetPassword(id, password) {
    return request({
        url: `/business/casResearch/restPassword/${id}/${password}`,
        method: "put",
    });
}

// 科研机构详细信息
export function researchDetail(id) {
    return request({
        url: `/business/casResearch/${id}`,
        method: "GET",
    });
}

// 科研机构详细信息
export function researchDelete(ids) {
    return request({
        url: `/business/casResearch/${ids}`,
        method: "DELETE",
    });
}

// 分配账号
export function allocateAccount(data) {
    return request({
        url: "/business/casResearch/allocateAccount",
        method: "post",
        data,
    });
}

export function casResearchDelete(ids) {
    return request({
        url: `/business/casResearch/${ids}`,
        method: "DELETE",
    });
}

export const casResearchImportData = () => {
    return request({
        url: `/business/casResearch/importTemplate`,
        method: "GET",
        responseType: 'blob'
    })
}