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

export default {
    //获取数据
    async getList(pid) {
        return HcApi({
            url: '/api/blade-manager/contractInfo/get-contractInfo',
            method: 'get',
            params: { pid },
        }, false)
    },
    //详情
    async detail(id) {
        return HcApi({
            url: '/api/blade-manager/contractInfo/detail',
            method: 'get',
            params: { id },
        }, false)
    },
    //详情
    async detail2(form) {
        return HcApi({
            url: '/api/blade-manager/contractInfo/detail2',
            method: 'get',
            params: form,
        }, false)
    },
    //新增和编辑
    async submit(form) {
        return HcApi({
            url: '/api/blade-manager/contractInfo/submit',
            method: 'post',
            data: form,
        }, false)
    },
    //删除
    async del(ids) {
        return HcApi({
            url: '/api/blade-manager/contractInfo/remove',
            method: 'post',
            params: { ids },
        }, false)
    },
    async delFileFromUrl(url) {
        return HcApi({
            url: '/api/blade-manager/contractInfo/delete-file',
            method: 'get',
            params: { url },
        }, false)
    },
    async saveUserInfoByProject(form) {
        return HcApi({
            url: '/api/blade-manager/contractInfo/save-userInfo-by-project',
            method: 'post',
            data: form,
        }, false)
    },
    async findUserByCondition(form) {
        return HcApi({
            url: '/api/blade-manager/contractInfo/get-all-user-by-condition',
            method: 'get',
            params: form,
        }, false)
    },
    async findUserList() {
        return HcApi({
            url: '/api/blade-manager/contractInfo/get-user-list',
            method: 'get',
            params: {},
        }, false)
    },
    async removeUsersByIds(ids) {
        return HcApi({
            url: '/api/blade-manager/contractInfo/remove-users-by-ids',
            method: 'post',
            params: { ids },
        }, false)
    },
    async findJobByRoleId(id) {
        return HcApi({
            url: '/api/blade-manager/contractInfo/get-jobs',
            method: 'get',
            params: { id },
        }, false)
    },
    async resetPasswordByUserId(userId) {
        return HcApi({
            url: '/api/blade-manager/contractInfo/reset-password-by-userId',
            method: 'post',
            params: { userId },
        }, false)
    },
    async submitWbsTreeInContract(form) {
        return HcApi({
            url: '/api/blade-manager/contractInfo/submit-wbsTree-contract',
            method: 'post',
            data: form,
        }, false)
    },
    async getContractInfoTree(form) {
        return HcApi({
            url: '/api/blade-manager/contractInfo/tree',
            method: 'get',
            data: form,
        }, false)
    },
    async findPostByType(category) {
        return HcApi({
            url: '/api/blade-system/post/findPostByType',
            method: 'get',
            params: { category },
        }, false)
    },
    async saveUserInfoByProjectTow(form) {
        return HcApi({
            url: '/api/blade-manager/contractInfo/save-userInfo-by-project-tow',
            method: 'post',
            data: form,
        }, false)
    },
    async searchRole(form) {
        return HcApi({
            url: '/api/blade-system/search/role',
            method: 'get',
            data: form,
        }, false)
    },
}
