import request from '@/helpers/request'
const axios = require('@/common/axios').default
// 上传图片或文件
// export function uploadFile(data) {
//     return request({
//         url: '/api-web/uploadFile',
//         method: 'post',
//         noClean: true,
//         data
//     })
// }


// 上传文件
export const uploadFile = (data) => {
    return axios({
        url: '/api-web/uploadFile',
        method: 'post',
        data: data
    })
}


// 上传文件
export const oaUploadFile = (data) => {
    return axios({
        url: '/api-web/import/oaUploadFile',
        method: 'post',
        data: data
    })
}

// 获取流程列表
export function classify(data) {
    return request({
        baseURL: "/api-oa",
        url: '/api/v1/process/classify',
        method: 'get',
        params: data
    })
}

// 获取我得待审批列表
export function getWorkOrderList(data) {
    return request({
        baseURL: "/api-oa",
        url: '/api/v1/work-order/list',
        method: 'get',
        hideLoading: true,
        params: data
    })
}

export function processStructure(data) {
    return request({
        baseURL: "/api-oa",
        url: '/api/v1/work-order/process-structure',
        method: 'get',
        params: data
    })
}

// 新建工单
export function createWorkOrder(data) {
    return request({
        baseURL: "/api-oa",
        noClean: true,
        url: '/api/v1/work-order/create',
        method: 'post',
        data
    })
}

// 处理工单
export function handleWorkOrder(data) {
    return request({
        baseURL: "/api-oa",
        noClean: true,
        url: '/api/v1/work-order/handle',
        method: 'post',
        data
    })
}

// 获取学校
export function getOrganCooperation(data) {
    return request({
        url: '/eduOrganization/getOrganCooperation',
        method: 'get',
        params: data
    })
}

export function sysUserList(data) {
    return request({
        baseURL: "/api-oa",
        noClean: true,
        url: '/api/v1/sysUserList',
        method: 'get',
        params: data
    })
}

// 转交工单
export function inversionWorkOrder(data) {
    return request({
        baseURL: "/api-oa",
        url: '/api/v1/work-order/inversion',
        method: 'post',
        data
    })
}

// 催办工单
export function urgeWorkOrder(params) {
    return request({
        baseURL: '/api-oa',
        url: '/api/v1/work-order/urge',
        method: 'get',
        params
    })
}

export function getInfo() {
    return request({
        baseURL: '/api-oa',
        url: '/api/v1/getinfo',
        method: 'get'
    })
}

export function dashboard() {
    return request({
        baseURL: '/api-oa',
        url: '/api/v1/dashboard',
        method: 'get'
    })
}

export function todoCount() {
    return request({
        baseURL: '/api-oa',
        url: '/api/v1/dashboard/todoCount',
        method: 'get'
    })
}



// 结束工单
export function unityWorkOrder(params) {
    return request({
        baseURL: '/api-oa',
        url: '/api/v1/work-order/unity',
        method: 'get',
        params
    })
}


// 全部分部
export function queryAllOrgan(params) {
    return request({
        url: '/eduOrganization/queryAllOrgan',
        method: 'get',
        params
    })
}

//
export function asyncPlayLog(data) {
    return request({
        url: '/oa/syncPayLog',
        method: 'post',
        requestType: 'form',
        data
    })
}

export function checkCourseReturnFee(data) {
    return request({
        url: '/oa/checkCourseReturnFee',
        method: 'post',
        data
    })
}

// /sysMessage/queryCountOfUnread
export function queryCountOfUnread() {
    return request({
        url: '/sysEduMessage/queryCountOfUnread',
        method: 'get'
    })
}
