// 总工作台
import request from '../index'

// 审批提醒列表
export function getApprovalMessageList(data: { offset: number; limit: number }) {
  return request({
    url: `/workbench/approvalMessage/listPage?offset=${data.offset}&limit=${data.limit}`,
    method: 'post',
    data,
  })
}

// 审批提醒状态变更
export function changeWorkbenchApproveStatus(data: { id: string; status: number; businessId?: string; decisionItem?: number; formId?: string; processId?: string; taskId?: string }) {
  return request({
    url: '/workbench/approvalMessage/updateStatus',
    method: 'post',
    data,
  })
}

// 工作提醒列表
export function getWorkMessageList(data: { offset: number; limit: number }) {
  return request({
    url: `/workbench/remindMessage/listPage?offset=${data.offset}&limit=${data.limit}`,
    method: 'post',
    data,
  })
}

// 工作提醒状态变更
export function changeWorkbenchWorkListStatus(data: { id: string; status: number }) {
  return request({
    url: '/workbench/remindMessage/updateStatus',
    method: 'post',
    data,
  })
}

// 通知公告已读状态修改
export function changeWorkbenchNoticeStatus(data: { ids: any; userId: string }) {
  return request({
    url: '/system/notice/read',
    method: 'post',
    data,
  })
}

// 工作台顶部工作提醒和待办信息条数
export function getWorkbenchMessageCount(data: { remindDeptId: string; remindId: string }) {
  return request({
    url: '/workbench/approvalMessage/count',
    method: 'post',
    data,
  })
}

// -----------------------------------------日历------------------------------------------
// 新增日程
export function addSchedule(data: object) {
  return request({
    url: '/workbench/calendarSchedule/add',
    method: 'post',
    data,
  })
}
// 编辑日程
export function editSchedule(data: object) {
  return request({
    url: '/workbench/calendarSchedule/update',
    method: 'post',
    data,
  })
}
// 日历列表
export function getCalendarList(data: {	calendarMonth: string; userId: string }) {
  return request({
    url: '/workbench/calendarSchedule/list',
    method: 'post',
    data,
  })
}

// 删除日程
export function delSchedule(data: object) {
  return request({
    url: '/workbench/calendarSchedule/delete',
    method: 'post',
    data,
  })
}

