import { request } from "@/utils/request";

/**
 * 项目管理接口集合
 * @method ReportRecord 报告记录列表
 * @method ReportRecordDetails 报告记录详情
 * @method ReportRecordReadFlag 报告记录已读
 * @method ReportInsert 报告提交
 * @method ProjectsSelect 项目下拉
 * @method ProjectsWeekList 导入上一篇
 * @method ProjectsList 项目列表
 * @method ProjectsInsertUpdate 项目新增
 * @method ProjectsDelete 项目删除
 * @method ProjectsExit 项目退出
 * @method ProjectsJoin 项目加入
 */
export function projectApi() {
    return {
        ReportRecord(data) {
            return request({
                url: "/service-iot/pmWorkContent/page",
                method: "GET",
                data: data,
            });
        },
        ReportRecordDetails(data) {
            return request({
                url: "/service-iot/pmWorkContent/reportRecord",
                method: "GET",
                data: data,
            });
        },
        ReportRecordReadFlag(data) {
            return request({
                url: "/service-iot/pmReceive/updateReadFlag",
                method: "GET",
                data: data,
            });
        },
        ReportInsert(data) {
            return request({
                url: '/service-iot/pmWorkReport/add',
                method: 'POST',
                data: data
            })
        },
        ReportDelete(params) {
            return request({
                url: '/service-iot/pmWorkReport/del/' + params,
                method: 'delete',
            })
        },
        ProjectsSelect(data) {
            return request({
                url: '/service-iot/pmProject/projects',
                method: 'GET',
                data: data
            })
        },
        ProjectsWeekList(data) {
            return request({
                url: '/service-iot/pmWorkReport/week',
                method: 'GET',
                data: data
            })
        },
        ProjectsList(data) {
            return request({
                url: '/service-iot/pmProject/page',
                method: 'GET',
                data: data
            })
        },
        ProjectsInsertUpdate(data) {
            return request({
                url: '/service-iot/pmProject/add',
                method: 'POST',
                data: data
            })
        },
        ProjectsDelete(param) {
            return request({
                url: '/service-iot/pmProject/del?projectId=' + param,
                method: 'GET',
            })
        },
        ProjectsExit(param) {
            return request({
                url: '/service-iot/pmProject/exitProject?projectId=' + param,
                method: 'GET',
            })
        },
        ProjectsJoin(param) {
            return request({
                url: '/service-iot/pmProject/joinProject?projectId=' + param,
                method: 'GET',
            })
        },
        TimedReports() {
            return request({
                url: '/service-iot/pmWorkReport/timedReports',
                method: 'GET',
            })
        },
        usersProjectWorkTime(params) {
            return request({
                url: '/service-iot/pmProject/usersProjectWorkTime',
                method: 'GET',
                params
            })
        },
        // 树结构查询部门--用户列表
        deptUserTreeSelect(query) {
            return request({
                url: '/system/dept/deptUserTreeSelect',
                method: 'get',
                params: query
            })
        }
        
    }
}