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

export interface modeStationVO {
  stepCode: number,
  isPreset: boolean,
  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 getWorkflowStepTemplatePage = async (params: PageParam) => {
  return await request.get({ url: '/iscs/workflow-step-template/getWorkflowStepTemplatePage', params })
}

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


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

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

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