import request from '@/utils/request'

// 查询角色列表
export function listRoles(data) {
  return request({
    url: '/boman-web-core/p/cs/one/map',
    method: 'POST',
    data
  })
}

// 未读接口
export function weiduhegw(data) {
  return request({
    url: '/boman-web-core/p/cs/queryList',
    method: 'POST',
    data
  })
}
// 历史字号
export function listIndex(data) {
   return request({
     url: '/boman-web-core/p/cs/queryList',
     method: 'post',
     data: data
   })
 }
 // 根据人员查询角色,部门
 export function buent(data) {
    return request({
      url: '/system/user/getDeptNameAndRoleName',
      method: 'post',
      data: data
    })
  }

 // 保存
 export function addbjectSave(data) {
   return request({
     url: '/boman-web-core/p/cs/complex/save',
     method: 'POST',
     data
   })
 }

 // 保存
 export function addbjectSavety(data) {
   return request({
     url: '/boman-web-core/p/cs/objectSave',
     method: 'POST',
     data
   })
 }
 
 // 催收文
 export function addbjectSawen(data) {
   return request({
     url: '/boman-web-core/p/cs/insertList',
     method: 'POST',
     data
   })
 }




// 查询分发单位  名称
export function issdanelist(id) {
  return request({
    url: '/boman-web-core/messageReceive/' + id,
    method: 'get'
  })
}

// 查询表单id
export function issdaneid(id) {
  return request({
    url: '/boman-web-core/p/cs/table/getByTableName/' + id,
    method: 'get'
  })
}

// 查询角色详细
export function getRole(id) {
  return request({
    url: '/system/role/' + id,
    method: 'get'
  })
}

// 保存
export function setMenu(data) {
  return request({
    url: '/boman-system/role/menu',
    method: 'post',
    data: data
  })
}

// 新增角色
export function addRole(data) {
  return request({
    url: '/system/role',
    method: 'post',
    data: data
  })
}

// 下载
export function pdfDwon(data) {
  return request({
    url: '/boman-file/previewAndDownload',
    method: 'post',
    data: data
  })
}

// 修改角色
export function updateRole(data) {
  return request({
    url: '/system/role',
    method: 'put',
    data: data
  })
}

// 角色数据权限
export function dataScope(data) {
  return request({
    url: '/system/role/dataScope',
    method: 'put',
    data: data
  })
}

// 角色状态修改
export function changeRoleStatus(id, status) {
  const data = {
    id,
    status
  }
  return request({
    url: '/system/role/changeStatus',
    method: 'put',
    data: data
  })
}

// 查询部门下拉树结构
export function treeselectid() {
  return request({
    url: '/boman-system/user/listUserTree',
    method: 'get'
  })
}

// 查询时间是否超过30分钟
export function timeu(id) {
  return request({
    url: '/boman-web-core/message/canDownload/' + id,
    method: 'get'
  })
}

// 未读变已读
export function weit(data) {
  return request({
    url: '/boman-web-core/message/receiveMessage',
    method: 'post',
    data: data
  })
}

// 删除角色
export function delRole(id) {
  return request({
    url: '/system/role/' + id,
    method: 'delete'
  })
}
