import { request } from '@umijs/max';


export default {
    //创建分组
    Add(parms: WorkInfoTypes.WorkInfoAddInput) {
        return request('/api/workinfo/add', {
            method: 'POST',
            data: {
                ...parms,
            },
        });
    },
    AddBatch(parms:any){
        return request('/api/workbatch/add', {
            method: 'POST',
            data: {
                ...parms,
            },
        });
    },
    UpdateBatch(parms:any){
        return request('/api/workbatch/update', {
            method: 'POST',
            data: {
                ...parms,
            },
        });
    },
    DelBatch(parms:any){
        return request(`/api/workbatch/del`, {
            method: 'POST',
            data: {
                ...parms,
            },
        }); 
    },
    //删除
    Del(parms: WorkInfoTypes.WorkInfoDelInput) {
        return request(`/api/workinfo/del`, {
            method: 'POST',
            data: {
                ...parms,
            },
        });
    },
    //修改
    Update(parms: WorkInfoTypes.WorkInfoUpdateInput) {
        return request('/api/workinfo/update', {
            method: 'POST',
            data: {
                ...parms,
            },
        });
    },
    //列表
    List(parms: WorkInfoTypes.Query) {
        return request('/api/workinfo/list', {
            method: 'POST',
            data: {
                ...parms,
            }
        });
    },
    /**
     * 分页查询
     * @param parms 
     * @returns 
     */
    PagedList(parms: WorkInfoTypes.Page) {
        return request('/api/workinfo/pagedlist', {
            method: 'POST',
            data: {
                ...parms,
            },
        });
    },
    WorkBatchPagedList(parms: WorkInfoTypes.Page) {
        return request('/api/workbatch/pagedlist', {
            method: 'POST',
            data: {
                ...parms,
            },
        });
    },
    Publish(parms: any) {
        return request(`/api/workinfo/publish`, {
            method: 'POST',
            data: {
                ...parms,
            },
        });
    },
    publishs(parms:any){
        return request(`/api/workinfo/publishs`, {
            method: 'POST',
            data: {
                ...parms,
            },
        });
    },
    UpdateStatus(parms: WorkInfoTypes.WorkInfoStatusUpdateInput) {
        return request('/api/workinfo/ForcedEnd', {
            method: 'POST',
            data: {
                ...parms,
            },
        });
    },
    ForcedEnd(workId: string) {
        return request(`/api/workinfo/forcedend/${workId}`, {
            method: 'POST'
        });
    },
    UpdateStatusList(workId: string) {
        return request(`/api/workinfo/statuslist/${workId}`, {
            method: 'GET'
        });
    },
    EditDetail(id:string){
        return request(`/api/workinfo/editdetail/${id}`, {
            method: 'GET'
        });
    }
}

