import request from '@/utils/request'

// 查询部门下拉树结构
export function deptTreeSelect(removeId) {
  return request({
    url: '/system/dept/deptTree',
    method: 'get',
    params:removeId
  })
}

export function handsheDeptTreeSelect() {
  return request({
    url: '/system/dept/deptTree/hangshe',
    method: 'get'
  })
}


export function businessTreeSelect(para) {
  // return request({
  //   url: '/system/dept/deptTree/business',
  //   method: 'get'
  // })
  if(!para)
  {
    para={
      excludeOrgCode:"900000000",
      excludeOrgName:"各部门"
    }
  }
  return request({
    url: '/system/dept/deptTree/business',
    method: 'post',
    data: para,
  })
}


export function wholeTreeSelect(para) {
  if(!para) {
    para={
      orgId:"",
      includeSub:true,
      excludeOrgName:"各部门"
    }
  }
  return request({
    url: '/system/dept/deptTree/whole',
    method: 'post',
    data: para,
  })
}



// 查询文件
export function getFile(code) {
  return request({
    url: '/file/file/getFile/' + code,
    method: 'get'
  })
}

// 查询机构下拉树结构
export function deptTreeList() {
  return request({
    url: '/system/dept/sysDeptTree',
    method: 'get'
  })
}


export function upload(data,type) {
  return request({
    url: '/file/file/upload',
    method: 'post',
    headers: {
      'Content-Type': 'multipart/form-data',
    },
    data: data,
    params:{
      busType: type
    }
  })
}

// 获取当前系统角色信息
export function getRoles() {
  return request({
    url: '/system/role/getRoles',
    method: 'get'
  })
}
