// src/api/mes/modeStation/modeStation.ts
import request from '@/config/axios'

export interface modeStationVO {
  modeId?: number
  createTime?: Date
  stepTemplateId: number,
  stepIndex: number,
  stepName: string,
  stepTitle: string,
  stepDescription: string,
  confirmType:number,
  confirmRoleCode: string,
  confirmUser:number,
  enableCancelJob: boolean,
  enableSetLocker: boolean,
  enableSetColocker: boolean,
  enableAddColocker: boolean,
  gotoStepAfterAddingColocker:number,
  enableReduceColocker: boolean,
  enableLock: boolean,
  enableColock: boolean,
  enableReleaseColock: boolean,
  enableUnlock: boolean,
  enableEndJob: boolean,

}

export interface PageParam {
  pageNo: number
  pageSize: number
  stepName?: string
  stepTitle?: string
}

// 查询工作步骤列表
export const getWorkflowStepPage = async (params: PageParam) => {
  return await request.get({ url: '/iscs/workflow-step/getWorkflowStepPage', params })
}

// 获取工作步骤详细信息
export const selectWorkflowStepById = async (id: number) => {
  return await request.get({ url: '/iscs/workflow-step/selectWorkflowStepById', params: { id: id } })
}


// 新增工作步骤
export const insertWorkflowStep = async (data: modeStationVO) => {
  return await request.post({ url: '/iscs/workflow-step/insertWorkflowStep', data })
}

// 修改工作步骤
export const updateWorkflowStep = async (data: modeStationVO) => {
  return await request.post({ url: '/iscs/workflow-step/updateWorkflowStep', data })
}

// 删除工作步骤
export const deleteWorkflowStepList = async (ids: number) => {
  return await request.delete({
    url: '/iscs/workflow-step/deleteWorkflowStepList?ids='+ids,
  })
}
