import { HcApi } from '../../request/index'

export default {
       //分页
    async page(form) {
        return HcApi({
            url: '/api//blade-attach/project/page',
            method: 'post',
            data: form,
        }, false)
    },

    //新增
    async add(form) {
        return HcApi({
            url: '/api/blade-attach/project/add',
            method: 'post',
            data: form,
        }, false)
    },
        //修改
     async update(form) {
        return HcApi({
            url: '/api/blade-attach/project/update',
            method: 'post',
            data: form,
        }, false)
    },
    //项目与计划详情
    async detailMore(id) {
        return HcApi({
            url: '/api/blade-attach/project/project-and-plan-detail',
            method: 'get',
            params: { id },
        }, false)
    },
    //项目详情
    async detail(id) {
        return HcApi({
            url: '/api/blade-attach/project/detail',
            method: 'get',
            params: { id },
        }, false)
    },
    //修改项目完成情况
    async updateProFin(form) {
        return HcApi({
            url: '/api/blade-attach/project/update-project-finished',
            method: 'post',
            data: form,
        }, false)
    },
    //删除
    async del(ids) {
        return HcApi({
            url: '/api/blade-attach/project/delete',
            method: 'post',
            data: { ids },
        }, false)
    },
    //下载模板
    async exportTemplate() {
        return HcApi({
            url: '/api/blade-attach/project/import-temp',
            method: 'post',
            params: {},
        }, false)
    },
    //导出
    async exportWorkfocus(ids) {
        return HcApi({
            url: '/api/blade-attach/project/export-workfocus',
            method: 'get',
            params: { id_equal: ids },
            responseType: 'blob',
        }, false)
    },
    //获取年份
    async getProjectYear() {
        return HcApi({
            url: '/api/blade-attach/project/get-project-year',
            method: 'get',
            params: {},
        }, false)
    },
    //项目生成报告
    async buildReport(form) {
        return HcApi({
            url: '/api/blade-attach/project/build-report',
            method: 'get',
            params: form,
            responseType: 'blob',
        }, false)
    },
    //获取年份
    async getAllYear() {
        return HcApi({
            url: '/api/blade-attach/project/allYear',
            method: 'get',
            params: {},
        }, false)
    },
}
