import request from '@/config/axios'

export interface MarsDeptVO {
  workstationId?: number
  workstationCode: string
  workstationName: string
  enableFlag?: string
  remark?: string
  createBy?: string
  createTime?: Date
  updateBy?: string
  updateTime?: Date
}

export interface PageParam {
  pageNo: number
  pageSize: number
  workstationCode?: string
  workstationName?: string
  enableFlag?: string
}

// 查询玛氏岗位列表
export const listMarsDept = async (params: PageParam) => {
  return await request.get({ url: '/iscs/workstation/getWorkstationPage', params })
}

// 查询玛氏岗位列表（排除节点）
export const listMarsDeptExcludeChild = async (deptId: number) => {
  return await request.get({ url: '/system/dept/list/exclude/' + deptId })
}

// 查询玛氏岗位详细
export const getMarsDept = async (id: number) => {
  return await request.get({
    url: '/iscs/workstation/selectWorkstationById',
    params: { id: id }
  })
}

// 新增玛氏岗位
export const addMarsDept = async (data: MarsDeptVO) => {
  return await request.post({ url: '/iscs/workstation/insertWorkstation', data })
}

// 修改玛氏岗位
export const updateMarsDept = async (data: MarsDeptVO) => {
  return await request.put({ url: '/iscs/workstation/updateWorkstation', data })
}

// 修改玛氏岗位 状态
export const updateMarsDeptStatus = async (data: MarsDeptVO) => {
  return await request.post({ url: '/iscs/workstation/updateIsWorkstationStatus', data })
}

// 删除玛氏岗位
export const delMarsDept = async (ids: number) => {
  return await request.delete({
    url: '/iscs/workstation/deleteWorkstationList?ids=' + ids,

  })
}
