import http from 'libs/http' interface Craft { id?: number name?: string steps?: string oresId?: number } export const getCraftList = (params: { oresId: string }): Promise => http.get(`/crafts/list/${params.oresId}`) export const createCraft = (params: Craft): Promise => http.post('/crafts', params) export const updateCraft = (params: Craft): Promise => http.put(`/crafts`, params) export const delCraft = (ids: string): Promise => http.delete(`/crafts/${ids}`) // 开始执行预设 export const startCraft = (params: { heatId?: string, craftId?: number, columns?: number[] }): Promise => http.post(`/crafts/start`, params) export const pauseCraft = (params: { heatId: string }): Promise => http.post(`/crafts/pause`, params) export const resumeCraft = (params: { heatId: string }): Promise => http.post(`/crafts/resume`, params) export const stopCraft = (params: { heatId: string }): Promise => http.post(`/crafts/stop`, params) // 加热区配置预设 export const setCraft = (params: { heatId?: string | number, craftId?: string | number }): Promise => http.post(`/crafts/set`, params) export const craftstatus = (): Promise => http.get(`/monitor/crafts/status`) export const craftstatusByHeatId = (heatId: string): Promise => http.get(`/monitor/crafts/status/${heatId}`) export const craftList = (): Promise => http.get(`/crafts/monitor/list`) export const craftRestart = (monitorId: string): Promise => http.post(`/crafts/restart`, { monitorId }) export const craftRestore = (isRestore: boolean): Promise => http.get(`/crafts/restore${isRestore}`) export const craftRemove = (monitorId: string): Promise => http.delete(`/crafts/remove`, { params: { monitorId } })