| | |
| | | import { request } from '@/common/utils' |
| | | import type { TasksGroupByChannel } from './task' |
| | | import type { CraftParamsResponse, TasksGroupByChannel } from './task' |
| | | import type { PLCResponse } from './plc' |
| | | |
| | | export interface BaseResponse<T = any> { |
| | |
| | | procedureId: number |
| | | } |
| | | |
| | | /** |
| | | * 获取PLC运行数据 |
| | | * @param params |
| | | */ |
| | | export function getProductProgress(params: ProductProgressParams) { |
| | | return request<BaseResponse<PLCResponse>>({ |
| | | url: '/v1/plc/productProgress', |
| | |
| | | data: params |
| | | }) |
| | | } |
| | | export interface CraftParamsParams { |
| | | id: number |
| | | } |
| | | |
| | | /** |
| | | * 获取工艺参数 |
| | | * @param params |
| | | */ |
| | | export function getCraftParams(params: CraftParamsParams) { |
| | | return request<BaseResponse<CraftParamsResponse>>({ |
| | | url: `v1/task/start/${params.id}`, |
| | | method: 'get', |
| | | data: params |
| | | }) |
| | | } |
| | | |
| | | export interface SendProcessParamsParams { |
| | | procedureId: number |
| | | } |
| | | export function sendProcessParams(params: SendProcessParamsParams) { |
| | | return request<BaseResponse>({ |
| | | url: `v1/task/sendProcessParams`, |
| | | method: 'post', |
| | | data: params |
| | | }) |
| | | } |