import {baseServer} from '@/api/index'
import fetch from '@/utils/require'

//分页列表
export function getList(pageNum, pageSize, params) {
    return fetch({
        url: `${baseServer}/qyxypj/queryPageList?pageNum=${pageNum}&pageSize=${pageSize}`,
        method: 'post',
        data: params
    })
}

// 单条编辑
export function editById(params) {
    return fetch({
        url: `${baseServer}/qyxypj/update`,
        method: 'post',
        data: params
    })
}

// 批量编辑
export function updateBatch(ids, param) {
    return fetch({
        url: `${baseServer}/qyxypj/updateBatch?ids=${ids}`,
        method: 'post',
        data: param
    })
}

// 批量提交
export function updateBatchTj(ids) {
    return fetch({
        url: `${baseServer}/qyxypj/updateBatchTj?ids=${ids}`,
        method: 'post'
    })
}

// 删除
export function delectById(id) {
    return fetch({
        url: `${baseServer}/qyxypj/delete?id=${id}`,
        method: 'post'
    })
}

// 导出
export function exportByObject(params) {
    return fetch({
        url: `${baseServer}/qyxypj/exportQyxypj`,
        method: 'post',
        responseType: 'blob', // 申明为文件流
        data: params
    })
}