import request from '@/utils/require'

import { business, flowable, publics, todoApi,cblApiclient } from '@/api/index'

// //new 待办 获得列表页
// export function getDaiBanPagesNew(data, limit) {
//   return request({
//     url: `${business}/home/findWaitItemForGrain/${limit.page}/${limit.size}`,
//     method: 'post',
//     data: data
//   })
// }
//
// //new 待办 获得列表页
// export function findNoticeList(limit) {
//   return request({
//     url: `${publics}/noticesPage/manager?page=${limit.page}&size=${limit.size}`,
//     method: 'post',
//     data: {}
//   })
// }

//xianqging
export function findNoticeId(id) {
  return request({
    url: `${publics}/notice/${id}`,
    method: 'get'
  })
}

//new 待办 获得列表页
// export function findOAList() {
//   return request({
//     url: `${myroot}/sysEventMessage/findOAList`,
//     method: 'post'
//   })
// }


/*
* 待办列表
* receiver 登录名
* */
export function todoList(data) {
  return request({
    url: `${todoApi}/backlog/pageList?pageSize=${data.pageSize}&pageNum=${data.pageNum}&itemName=${data.itemName}&submitter=${data.submitter}&receiver=${data.receiver}&orgCode=${data.orgCode}`,
    method: 'get',
  })
}

//
/*
* 已办列表
* handler 处理人
* */
export function haveDoneList(data) {
  return request({
    // url: `${todoApi}/haveDone/pageList?pageSize=${data.pageSize}&pageNum=${data.pageNum}&itemName=${data.itemName}&submitter=${data.submitter}&handler=${data.handler}`,
    url: `${todoApi}/haveDone/selectByPage?pageSize=${data.pageSize}&pageNum=${data.pageNum}&itemName=${data.itemName}&submitter=${data.submitter}&receiverId=${data.receiverId}&handlerId=${data.handlerId}`,
    method: 'get',
  })
}

// export function signTask(data) {
//   return request({
//     url: `${irpt}/sso/openItemUrl/`,
//     method: 'post',
//     data
//   })
// }

export function modificationFn(data) {
  return request({
    url: `${todoApi}/backlog/modification/`,
    method: 'post',
    data: data
  })
}

//首页转圈粮预警滚动列表
export function warnList(){
  return request({
    url: `${cblApiclient}/circlegrain/getUnReadWarning`,
    method: 'get',
  })
}
//首页转圈粮预警滚动列表已读
export function readList(data){
  return request({
    url: `${cblApiclient}/circlegrain/msgMarkAsRead`,
    method: 'post',
    data:data
  })
}